From 30723831064ee64ab9f8801a0c64d421d1d2ce1e Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Thu, 30 Jun 2022 09:47:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20Linux-=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D1=81=D0=B8=D0=B8=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20DockContent,=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D0=BE=D1=80=20(=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=20=D0=B2?= =?UTF-8?q?=D1=81=D0=BF=D0=BB=D1=8B=D0=B2=D0=B0=D1=8E=D1=89=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BE=D0=BA=D0=BD=D0=B0)=20=D0=A1=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BA=D1=82=20VisualPABCLinux=20=D0=98=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D1=88=D0=BB=D0=BE=D1=81=D1=8C=20=D1=81=D0=BA=D0=BB?= =?UTF-8?q?=D0=BE=D0=BD=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20Plugin?= =?UTF-8?q?sSupport,=20=D0=BF=D0=BE=D1=81=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA?= =?UTF-8?q?=D1=83=20=D0=BE=D0=BD=20=D0=B2=D0=BD=D0=BE=D1=81=D0=B8=D1=82=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BF=D0=BE=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D1=83=20=D0=9A=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D1=8B=20WeifenLuo=20=D0=B4=D0=BB=D1=8F=20Linux=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B4=D0=BE=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB?= =?UTF-8?q?=D1=8F=D1=86=D0=B8=D0=B8=20=D1=81=D0=BA=D0=BE=D0=BF=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B2=20Libraries=20-=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D1=88=D0=B8=D1=82=D1=8C=20=D0=B8=D1=85=20?= =?UTF-8?q?=D0=BA=20=D0=BE=D1=81=D0=BD=D0=BE=D0=B2=D0=BD=D0=BE=D0=BC=D1=83?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D1=83=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=BE=20=D0=BD=D0=B5=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=83=D1=87=D0=B8=D0=BB=D0=BE=D1=81=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- .../Configuration/AssemblyInfo.cs | 19 + .../ICSharpCode.TextEditorLinux.csproj | 259 + .../Resources/ASPX.xshd | 17 + .../Resources/BAT-Mode.xshd | 32 + .../Resources/Boo.xshd | 314 + .../Resources/Breakpoint.png | Bin 0 -> 858 bytes .../Resources/Breakpoint24x24.png | Bin 0 -> 1241 bytes .../Resources/Breakpoint32x32.png | Bin 0 -> 2369 bytes .../Resources/CPP-Mode.xshd | 206 + .../Resources/CSharp-Mode.xshd | 338 + .../Resources/Coco-Mode.xshd | 97 + .../Resources/ConditionBreakpoint24x24.png | Bin 0 -> 1162 bytes .../Resources/HTML-Mode.xshd | 385 + .../Resources/ICSharpCode.TextEditor.snk | Bin 0 -> 596 bytes .../Resources/Java-Mode.xshd | 180 + .../Resources/JavaScript-Mode.xshd | 136 + .../Resources/Mode.xsd | 295 + .../Resources/PHP-Mode.xshd | 198 + .../Resources/Patch-Mode.xshd | 37 + .../Resources/RightArrow.cur | Bin 0 -> 326 bytes .../Resources/SyntaxModes.xml | 57 + .../Resources/Tex-Mode.xshd | 108 + .../Resources/TextEditorControl.bmp | Bin 0 -> 824 bytes .../Resources/VBNET-Mode.xshd | 265 + .../Resources/XML-Mode.xshd | 60 + .../Src/Actions/BookmarkActions.cs | 78 + .../Src/Actions/CaretActions.cs | 203 + .../Src/Actions/ClipBoardActions.cs | 42 + .../Src/Actions/FoldActions.cs | 54 + .../Src/Actions/FormatActions.cs | 213 + .../Src/Actions/HomeEndActions.cs | 114 + .../Src/Actions/IEditAction.cs | 58 + .../Src/Actions/MiscActions.cs | 926 ++ .../Src/Actions/SelectionActions.cs | 176 + .../Src/Document/AbstractSegment.cs | 52 + .../Src/Document/BookmarkManager/Bookmark.cs | 137 + .../BookmarkManager/BookmarkEventHandler.cs | 32 + .../BookmarkManager/BookmarkManager.cs | 254 + .../BookmarkManager/BookmarkManagerMemento.cs | 101 + .../CustomLineManager/CustomLineManager.cs | 217 + .../CustomLineManager/ICustomLineManager.cs | 72 + .../Src/Document/DefaultDocument.cs | 460 + .../Document/DefaultTextEditorProperties.cs | 316 + .../Src/Document/DocumentEventArgs.cs | 103 + .../Src/Document/DocumentFactory.cs | 58 + .../Document/FoldingStrategy/FoldMarker.cs | 179 + .../FoldingStrategy/FoldingManager.cs | 333 + .../FoldingStrategy/IFoldingStrategy.cs | 24 + .../FoldingStrategy/IndentFoldingStrategy.cs | 47 + .../DefaultFormattingStrategy.cs | 180 + .../FormattingStrategy/IFormattingStrategy.cs | 59 + .../DefaultHighlightingStrategy.cs | 949 ++ .../HighlightingStrategy/FontContainer.cs | 103 + .../HighlightBackground.cs | 51 + .../HighlightingStrategy/HighlightColor.cs | 280 + .../HighlightingStrategy/HighlightInfo.cs | 25 + .../HighlightingStrategy/HighlightRuleSet.cs | 190 + .../HighlightingColorNotFoundException.cs | 32 + .../HighlightingDefinitionInvalidException.cs | 37 + .../HighlightingDefinitionParser.cs | 110 + .../HighlightingManager.cs | 163 + .../HighlightingStrategyFactory.cs | 38 + .../IHighlightingStrategy.cs | 65 + .../HighlightingStrategy/NextMarker.cs | 63 + .../HighlightingStrategy/PrevMarker.cs | 63 + .../Src/Document/HighlightingStrategy/Span.cs | 157 + .../HighlightingStrategy/SpanStack.cs | 118 + .../SyntaxModes/FileSyntaxModeProvider.cs | 84 + .../SyntaxModes/ISyntaxModeFileProvider.cs | 23 + .../SyntaxModes/ResourceSyntaxModeProvider.cs | 48 + .../SyntaxModes/SyntaxMode.cs | 96 + .../Document/HighlightingStrategy/TextWord.cs | 236 + .../Src/Document/IDocument.cs | 322 + .../Src/Document/ISegment.cs | 32 + .../Src/Document/ITextEditorProperties.cs | 171 + .../Src/Document/LineManager/LineManager.cs | 364 + .../LineManager/LineManagerEventArgs.cs | 97 + .../Src/Document/LineManager/LineSegment.cs | 251 + .../Document/LineManager/LineSegmentTree.cs | 478 ++ .../Document/MarkerStrategy/MarkerStrategy.cs | 119 + .../Src/Document/MarkerStrategy/TextMarker.cs | 110 + .../Src/Document/Selection/ColumnRange.cs | 66 + .../Document/Selection/DefaultSelection.cs | 133 + .../Src/Document/Selection/ISelection.cs | 64 + .../Document/Selection/SelectionManager.cs | 456 + .../Src/Document/TextAnchor.cs | 88 + .../GapTextBufferStrategy.cs | 179 + .../TextBufferStrategy/ITextBufferStrategy.cs | 85 + .../StringTextBufferStrategy.cs | 85 + .../Src/Document/TextLocation.cs | 128 + .../Src/Document/TextUtilities.cs | 313 + .../Src/Gui/AbstractMargin.cs | 115 + .../Src/Gui/BracketHighlighter.cs | 86 + .../Src/Gui/BrushRegistry.cs | 61 + ICSharpCode.TextEditorLinux/Src/Gui/Caret.cs | 568 ++ .../AbstractCompletionWindow.cs | 228 + .../CodeCompletionListView.cs | 293 + .../CodeCompletionListView.resx | 120 + .../CompletionWindow/CodeCompletionWindow.cs | 295 + .../CompletionWindow/DeclarationViewWindow.cs | 101 + .../Gui/CompletionWindow/ICompletionData.cs | 112 + .../ICompletionDataProvider.cs | 62 + .../Src/Gui/DrawableLine.cs | 190 + .../Src/Gui/FoldMargin.cs | 275 + .../Src/Gui/GutterMargin.cs | 158 + ICSharpCode.TextEditorLinux/Src/Gui/HRuler.cs | 54 + .../Src/Gui/IconBarMargin.cs | 316 + ICSharpCode.TextEditorLinux/Src/Gui/Ime.cs | 175 + .../Gui/InsightWindow/IInsightDataProvider.cs | 53 + .../Src/Gui/InsightWindow/InsightWindow.cs | 203 + .../Src/Gui/TextArea.cs | 1019 +++ .../Src/Gui/TextAreaClipboardHandler.cs | 249 + .../Src/Gui/TextAreaControl.cs | 471 + .../Src/Gui/TextAreaDragDropHandler.cs | 127 + .../Src/Gui/TextAreaMouseHandler.cs | 485 ++ .../Src/Gui/TextAreaUpdate.cs | 85 + .../Src/Gui/TextEditorControl.cs | 393 + .../Src/Gui/TextEditorControlBase.cs | 757 ++ .../Src/Gui/TextView.cs | 1179 +++ .../Src/Gui/ToolTipRequestEventArgs.cs | 62 + .../Src/Undo/IUndoableOperation.cs | 26 + .../Src/Undo/UndoQueue.cs | 53 + .../Src/Undo/UndoStack.cs | 223 + .../Src/Undo/UndoableDelete.cs | 72 + .../Src/Undo/UndoableInsert.cs | 73 + .../Src/Undo/UndoableReplace.cs | 75 + .../Src/Util/AugmentableRedBlackTree.cs | 590 ++ .../Src/Util/FileReader.cs | 152 + .../Src/Util/LookupTable.cs | 140 + .../Src/Util/RedBlackTreeIterator.cs | 85 + .../Src/Util/RtfWriter.cs | 190 + .../Src/Util/TextUtility.cs | 81 + .../Src/Util/TipPainter.cs | 124 + .../Src/Util/TipPainterTools.cs | 168 + .../Src/Util/TipSection.cs | 84 + .../Src/Util/TipSpacer.cs | 36 + .../Src/Util/TipSplitter.cs | 99 + .../Src/Util/TipText.cs | 183 + .../Src/Util/WeakCollection.cs | 136 + ICSharpCode.TextEditorLinux/copyright.txt | 10 + ICSharpCode.TextEditorLinux/license.txt | 458 + ...uo.WinFormsUI.Docking.ThemeVS2005Linux.dll | Bin 0 -> 90112 bytes .../WeifenLuo.WinFormsUI.DockingLinux.dll | Bin 0 -> 244736 bytes PascalABCNET.sln | 49 +- PluginsSupportLinux/Classes.cs | 69 + PluginsSupportLinux/Interfaces.cs | 540 ++ .../PluginsSupportLinux.csproj | 123 + .../Properties/AssemblyInfo.cs | 37 + Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- VisualPascalABCNETLinux/ABCHealth.Designer.cs | 48 + VisualPascalABCNETLinux/ABCHealth.cs | 28 + VisualPascalABCNETLinux/ABCHealth.ico | Bin 0 -> 1150 bytes VisualPascalABCNETLinux/ABCHealth.resx | 145 + VisualPascalABCNETLinux/ABCNET32.ico | Bin 0 -> 766 bytes VisualPascalABCNETLinux/AboutBox.Designer.cs | 422 + VisualPascalABCNETLinux/AboutBox.cs | 239 + VisualPascalABCNETLinux/AboutBox.resx | 120 + .../AutoInsertCode/AutoInsertCode.cs | 289 + .../CodeFileDocumentTextEditorControl.cs | 11 + VisualPascalABCNETLinux/CompileOptionsSet.cs | 14 + .../CompilerForm.Designer.cs | 60 + VisualPascalABCNETLinux/CompilerForm.cs | 25 + VisualPascalABCNETLinux/CompilerForm.resx | 120 + .../Config/AssemblyInfo.cs | 8 + VisualPascalABCNETLinux/DS/Classes.cs | 37 + .../CodeCompletionListView.cs | 497 ++ .../CodeCompletionWindow.cs | 395 + .../CodeCompletionVisual/DeclarationWindow.cs | 57 + .../DS/CodeCompletionVisual/InsightWindow.cs | 259 + .../DS/CodeCompletionVisual/TipPainter.cs | 165 + .../CodeCompletionVisual/TipPainterTools.cs | 536 ++ .../DS/CodeCompletionVisual/TipSection.cs | 91 + .../DS/CodeCompletionVisual/TipSpacer.cs | 36 + .../DS/CodeCompletionVisual/TipSplitter.cs | 136 + .../DS/CodeCompletionVisual/TipText.cs | 400 + VisualPascalABCNETLinux/DS/Constants.cs | 70 + VisualPascalABCNETLinux/DS/FoldingStrategy.cs | 46 + .../DS/NavigationManager.cs | 96 + .../DS/ObjectLocalisator.cs | 27 + .../DS/PluginsController/PluginsController.cs | 199 + .../RunManager/EventedEventWaitHandleList.cs | 62 + .../DS/RunManager/RunManager.cs | 412 + .../DS/RuntimeException.cs | 51 + VisualPascalABCNETLinux/DS/SymbolsViwer.cs | 143 + VisualPascalABCNETLinux/DS/Tools.cs | 112 + .../DS/Utils/OutputReader.cs | 93 + .../DS/Utils/ProcessRunner.cs | 361 + .../DS/VisualEnvironmentCompiler.cs | 549 ++ .../CodeFileDocumentTextEditorControl.cs | 145 + .../BottomDockContentForm.Designer.cs | 51 + .../DockContent/BottomDockContentForm.cs | 40 + .../DockContent/BottomDockContentForm.resx | 120 + .../DockContent/CodeFileDocument.Designer.cs | 102 + .../DockContent/CodeFileDocument.cs | 822 ++ .../DockContent/CodeFileDocument.resx | 145 + .../CodeFileDocumentTextEditorControl.cs | 265 + .../CodeFileDocumentTextEditorControl.resx | 120 + .../CompilerConsoleWindowForm.Designer.cs | 71 + .../DockContent/CompilerConsoleWindowForm.cs | 47 + .../CompilerConsoleWindowForm.resx | 145 + .../DebugVariablesListWindowForm.Designer.cs | 69 + .../DebugVariablesListWindowForm.cs | 259 + .../DebugVariablesListWindowForm.resx | 145 + .../DebugWatchListWindowForm.Designer.cs | 122 + .../DockContent/DebugWatchListWindowForm.cs | 483 ++ .../DockContent/DebugWatchListWindowForm.resx | 148 + .../DockContent/DisassemblyWindow.Designer.cs | 66 + .../DockContent/DisassemblyWindow.cs | 50 + .../DockContent/DisassemblyWindow.resx | 120 + .../ErrorsListWindowForm.Designer.cs | 174 + .../DockContent/ErrorsListWindowForm.cs | 193 + .../DockContent/ErrorsListWindowForm.resx | 486 ++ .../FindSymbolsResultWindow.Designer.cs | 86 + .../DockContent/FindSymbolsResultWindow.cs | 89 + .../DockContent/FindSymbolsResultWindow.resx | 145 + .../DockContent/ImmediateWindow.Designer.cs | 73 + .../DockContent/ImmediateWindow.cs | 30 + .../DockContent/ImmediateWindow.resx | 149 + .../DockContent/OutputWindowForm.Designer.cs | 265 + .../DockContent/OutputWindowForm.cs | 196 + .../DockContent/OutputWindowForm.resx | 148 + .../DockContent/WebBrowserControl.Designer.cs | 116 + .../DockContent/WebBrowserControl.cs | 92 + .../DockContent/WebBrowserControl.resx | 120 + VisualPascalABCNETLinux/FSWatcherService.cs | 65 + VisualPascalABCNETLinux/FileMonitoring.cs | 133 + VisualPascalABCNETLinux/FontCombo.cs | 153 + VisualPascalABCNETLinux/Form1.Designer.cs | 2703 ++++++ VisualPascalABCNETLinux/Form1.Designer.cs1 | 2637 ++++++ VisualPascalABCNETLinux/Form1.cs | 2034 +++++ VisualPascalABCNETLinux/Form1.cs1 | 1969 +++++ VisualPascalABCNETLinux/Form1.resx | 1477 ++++ VisualPascalABCNETLinux/Form1OpenFromHelp.cs | 0 VisualPascalABCNETLinux/GotoLine.Designer.cs | 104 + VisualPascalABCNETLinux/GotoLine.cs | 47 + VisualPascalABCNETLinux/GotoLine.resx | 120 + .../CodeCompletion/CodeCompletionActions.cs | 724 ++ .../CodeCompletion/CodeCompletionHelpers.cs | 100 + .../CodeCompletionHighlighter.cs | 699 ++ .../CodeCompletionImagesProvider.cs | 205 + .../CodeCompletionKeyHandler.cs | 282 + .../CodeCompletionParserController.cs | 283 + .../CodeCompletion/CodeCompletionProvider.cs | 639 ++ .../IB/CodeCompletion/CodeTemplateManager.cs | 97 + .../DefinitionByMouseClickManager.cs | 136 + .../IB/CodeCompletion/FoldingStrategy.cs | 116 + .../IB/CodeCompletion/InsightProvider.cs | 182 + .../CodeCompletion/QuickClassBrowserPanel.cs | 896 ++ .../QuickClassBrowserPanel.resx | 120 + .../CodeCompletion/TooltipServiceManager.cs | 179 + .../IB/Debugger/Actions.cs | 47 + .../IB/Debugger/AddWatchForm.Designer.cs | 89 + .../IB/Debugger/AddWatchForm.cs | 40 + .../IB/Debugger/AddWatchForm.resx | 120 + .../IB/Debugger/Bookmarks.cs | 758 ++ .../Debugger/BreakpointCondition.Designer.cs | 130 + .../IB/Debugger/BreakpointCondition.cs | 92 + .../IB/Debugger/BreakpointCondition.resx | 120 + .../IB/Debugger/Debugger.cs | 1842 ++++ .../IB/Debugger/DynamicTreeView.cs | 2788 ++++++ .../IB/Debugger/ExpressionEvaluation.cs | 7603 +++++++++++++++++ .../IB/Debugger/Immediate.cs | 36 + .../IB/Debugger/LocalVars.cs | 1472 ++++ .../IB/Debugger/Utility.cs | 260 + VisualPascalABCNETLinux/IB/FormExtensions.cs | 583 ++ .../IB/Refactoring/Bookmarks.cs | 410 + .../IB/Refactoring/RenameForm.Designer.cs | 100 + .../IB/Refactoring/RenameForm.cs | 40 + .../IB/Refactoring/RenameForm.resx | 120 + .../IB/Samples/CodeSampleManager.cs | 85 + .../TreeGridView/Samples/CodeSampleManager.cs | 83 + .../IB/TreeGridView/TreeGridCell.cs | 411 + .../IB/TreeGridView/TreeGridEvents.cs | 82 + .../IB/TreeGridView/TreeGridNode.cs | 890 ++ .../IB/TreeGridView/TreeGridNodeCollection.cs | 252 + .../IB/TreeGridView/TreeGridView.cs | 633 ++ .../IB/VBComp/VBNETCompiler.cs | 49 + .../CompilerOptionsContent.Designer.cs | 188 + .../OptionsContent/CompilerOptionsContent.cs | 151 + .../CompilerOptionsContent.resx | 123 + .../EditorOptionsContent.Designer.cs | 209 + .../OptionsContent/EditorOptionsContent.cs | 155 + .../OptionsContent/EditorOptionsContent.resx | 120 + .../OptionsContent/IOptionsContent.cs | 26 + .../IntelliseseOptionsContent.Designer.cs | 198 + .../IntelliseseOptionsContent.cs | 98 + .../IntelliseseOptionsContent.resx | 120 + .../OptionsContent/OptionsContentEngine.cs | 60 + .../OptionsContent/OptionsForm.Designer.cs | 130 + .../OptionsContent/OptionsForm.cs | 87 + .../OptionsContent/OptionsForm.resx | 148 + .../ViewOptionsContent.Designer.cs | 164 + .../OptionsContent/ViewOptionsContent.cs | 152 + .../OptionsContent/ViewOptionsContent.resx | 120 + VisualPascalABCNETLinux/Program.cs | 120 + .../Projects/FusionNative.cs | 270 + .../Projects/GacInterop.cs | 202 + .../Projects/NewFileForm.Designer.cs | 147 + .../Projects/NewFileForm.cs | 129 + .../Projects/NewFileForm.resx | 188 + .../Projects/NewProject.Designer.cs | 185 + .../Projects/NewProject.cs | 167 + .../Projects/NewProject.resx | 329 + .../Projects/NuGetTasks.cs | 86 + .../Projects/ProjectExplorer.Designer.cs | 311 + .../Projects/ProjectExplorer.cs | 431 + .../Projects/ProjectExplorer.resx | 330 + .../Projects/ProjectHelper.cs | 256 + .../Projects/ProjectInfo.cs | 19 + .../Projects/ProjectProperties.Designer.cs | 478 ++ .../Projects/ProjectProperties.cs | 239 + .../Projects/ProjectProperties.resx | 126 + .../Projects/ProjectTasks.cs | 224 + .../Projects/ReferenceForm.Designer.cs | 260 + .../Projects/ReferenceForm.cs | 195 + .../Projects/ReferenceForm.resx | 123 + .../Projects/TypeLibrary.cs | 318 + .../Projects/UserOptionsManager.cs | 128 + .../Properties/Resources.Designer.cs | 473 + .../Properties/Resources.resx | 535 ++ .../Properties/Settings.Designer.cs | 26 + .../Properties/Settings.settings | 7 + .../ReplaceConfirmDialog.Designer.cs | 122 + .../ReplaceConfirmDialog.cs | 46 + .../ReplaceConfirmDialog.resx | 120 + .../ReplaceForm.Designer.cs | 241 + VisualPascalABCNETLinux/ReplaceForm.cs | 272 + VisualPascalABCNETLinux/ReplaceForm.resx | 120 + .../Resources/AlignObjectsBottomHS.png | Bin 0 -> 405 bytes .../AlignObjectsCenteredHorizontalHS.png | Bin 0 -> 353 bytes .../AlignObjectsCenteredVerticalHS.png | Bin 0 -> 365 bytes .../Resources/AlignObjectsLeftHS.png | Bin 0 -> 425 bytes .../Resources/AlignObjectsRightHS.png | Bin 0 -> 454 bytes .../Resources/AlignObjectsTopHS.png | Bin 0 -> 413 bytes .../Resources/AlignToGridHS.png | Bin 0 -> 530 bytes .../Resources/BringToFrontHS.png | Bin 0 -> 689 bytes VisualPascalABCNETLinux/Resources/Delete.bmp | Bin 0 -> 824 bytes VisualPascalABCNETLinux/Resources/Delete3.bmp | Bin 0 -> 822 bytes .../Resources/FormsDesignerPointerIcon.bmp | Bin 0 -> 1334 bytes .../Resources/FormsDesignerPointerIcon.png | Bin 0 -> 587 bytes .../Resources/Icons.16x16.Class.png | Bin 0 -> 1375 bytes .../Resources/Icons.16x16.Debug.Break.png | Bin 0 -> 368 bytes .../Resources/Icons.16x16.Debug.Continue.png | Bin 0 -> 367 bytes .../Resources/Icons.16x16.Debug.StepInto.png | Bin 0 -> 327 bytes .../Resources/Icons.16x16.Debug.StepOut.png | Bin 0 -> 317 bytes .../Resources/Icons.16x16.Debug.StepOver.png | Bin 0 -> 327 bytes .../Resources/Icons.16x16.Delegate.png | Bin 0 -> 1469 bytes .../Resources/Icons.16x16.Disassembly.png | Bin 0 -> 509 bytes .../Resources/Icons.16x16.Enum.png | Bin 0 -> 1352 bytes .../Resources/Icons.16x16.Error.png | Bin 0 -> 851 bytes .../Resources/Icons.16x16.ErrorInWatch.png | Bin 0 -> 805 bytes .../Resources/Icons.16x16.EvalError.png | Bin 0 -> 748 bytes .../Resources/Icons.16x16.Event.png | Bin 0 -> 1369 bytes .../Resources/Icons.16x16.ExtensionMethod.png | Bin 0 -> 647 bytes .../Resources/Icons.16x16.Field.png | Bin 0 -> 1342 bytes .../Resources/Icons.16x16.Form.png | Bin 0 -> 642 bytes .../Resources/Icons.16x16.GenerateMethod.png | Bin 0 -> 655 bytes .../Resources/Icons.16x16.GotoDefinition.png | Bin 0 -> 574 bytes .../Resources/Icons.16x16.GotoRealization.png | Bin 0 -> 507 bytes .../Resources/Icons.16x16.GotoText.png | Bin 0 -> 550 bytes .../Resources/Icons.16x16.Intellisense.ico | Bin 0 -> 1150 bytes .../Resources/Icons.16x16.Intellisense.png | Bin 0 -> 457 bytes .../Resources/Icons.16x16.Interface.png | Bin 0 -> 1345 bytes .../Resources/Icons.16x16.InternalClass.png | Bin 0 -> 1415 bytes .../Icons.16x16.InternalConstant.png | Bin 0 -> 682 bytes .../Icons.16x16.InternalDelegate.png | Bin 0 -> 882 bytes .../Resources/Icons.16x16.InternalEnum.png | Bin 0 -> 626 bytes .../Resources/Icons.16x16.InternalEvent.png | Bin 0 -> 621 bytes .../Resources/Icons.16x16.InternalField.png | Bin 0 -> 581 bytes .../Icons.16x16.InternalInterface.png | Bin 0 -> 604 bytes .../Resources/Icons.16x16.InternalMethod.png | Bin 0 -> 698 bytes .../Icons.16x16.InternalProperty.png | Bin 0 -> 830 bytes .../Resources/Icons.16x16.InternalStruct.png | Bin 0 -> 693 bytes .../Resources/Icons.16x16.Keyword.png | Bin 0 -> 294 bytes .../Resources/Icons.16x16.Literal.png | Bin 0 -> 557 bytes .../Resources/Icons.16x16.Local.png | Bin 0 -> 391 bytes .../Resources/Icons.16x16.Method.png | Bin 0 -> 542 bytes .../Resources/Icons.16x16.NameSpace.png | Bin 0 -> 356 bytes .../Resources/Icons.16x16.NewProjectIcon.png | Bin 0 -> 740 bytes .../Resources/Icons.16x16.Open.png | Bin 0 -> 575 bytes .../Resources/Icons.16x16.Options.ico | Bin 0 -> 1150 bytes .../Resources/Icons.16x16.Options.png | Bin 0 -> 516 bytes .../Resources/Icons.16x16.PrivateClass.png | Bin 0 -> 1437 bytes .../Resources/Icons.16x16.PrivateConstant.png | Bin 0 -> 701 bytes .../Resources/Icons.16x16.PrivateDelegate.png | Bin 0 -> 876 bytes .../Resources/Icons.16x16.PrivateEnum.png | Bin 0 -> 693 bytes .../Resources/Icons.16x16.PrivateEvent.png | Bin 0 -> 669 bytes .../Resources/Icons.16x16.PrivateField.png | Bin 0 -> 630 bytes .../Resources/Icons.16x16.PrivateIndexer.png | Bin 0 -> 649 bytes .../Icons.16x16.PrivateInterface.png | Bin 0 -> 643 bytes .../Resources/Icons.16x16.PrivateMethod.png | Bin 0 -> 721 bytes .../Resources/Icons.16x16.PrivateProperty.png | Bin 0 -> 855 bytes .../Resources/Icons.16x16.PrivateStruct.png | Bin 0 -> 729 bytes .../Resources/Icons.16x16.Project.png | Bin 0 -> 617 bytes .../Resources/Icons.16x16.Property.ico | Bin 0 -> 1406 bytes .../Resources/Icons.16x16.Property.png | Bin 0 -> 1433 bytes .../Resources/Icons.16x16.ProtectedClass.png | Bin 0 -> 619 bytes .../Icons.16x16.ProtectedConstant.png | Bin 0 -> 649 bytes .../Icons.16x16.ProtectedDelegate.png | Bin 0 -> 866 bytes .../Resources/Icons.16x16.ProtectedEnum.png | Bin 0 -> 693 bytes .../Resources/Icons.16x16.ProtectedEvent.png | Bin 0 -> 628 bytes .../Resources/Icons.16x16.ProtectedField.png | Bin 0 -> 591 bytes .../Icons.16x16.ProtectedInterface.png | Bin 0 -> 597 bytes .../Resources/Icons.16x16.ProtectedMethod.png | Bin 0 -> 678 bytes .../Icons.16x16.ProtectedProperty.png | Bin 0 -> 805 bytes .../Resources/Icons.16x16.ProtectedStruct.png | Bin 0 -> 692 bytes .../Resources/Icons.16x16.Reference.png | Bin 0 -> 409 bytes .../Resources/Icons.16x16.RuntimeError.png | Bin 0 -> 654 bytes .../Resources/Icons.16x16.Save.png | Bin 0 -> 535 bytes .../Resources/Icons.16x16.Struct.png | Bin 0 -> 1405 bytes .../Resources/Icons.16x16.TreeView.png | Bin 0 -> 334 bytes .../Resources/Icons.16x16.UnitNamespace.png | Bin 0 -> 469 bytes .../Resources/Icons.16x16.Warning.png | Bin 0 -> 776 bytes .../Resources/Icons.16x16.Window.CodePage.ico | Bin 0 -> 1150 bytes .../Resources/Icons.16x16.Window.CodePage.png | Bin 0 -> 280 bytes .../Icons.16x16.Window.CompilerConsole.ico | Bin 0 -> 1150 bytes .../Icons.16x16.Window.CompilerConsole.png | Bin 0 -> 391 bytes .../Icons.16x16.Window.DebugVariablesList.ico | Bin 0 -> 1150 bytes .../Icons.16x16.Window.DebugVariablesList.png | Bin 0 -> 739 bytes .../Icons.16x16.Window.DebugWatches.ico | Bin 0 -> 1150 bytes .../Icons.16x16.Window.DebugWatches.png | Bin 0 -> 861 bytes .../Icons.16x16.Window.ErrorList.ico | Bin 0 -> 1150 bytes .../Icons.16x16.Window.ErrorList.png | Bin 0 -> 890 bytes .../Icons.16x16.Window.FindSymbolResult.ico | Bin 0 -> 1150 bytes .../Icons.16x16.Window.FindSymbolResult.png | Bin 0 -> 659 bytes .../Icons.16x16.Window.Immediate.ico | Bin 0 -> 1406 bytes .../Icons.16x16.Window.Immediate.png | Bin 0 -> 393 bytes .../Resources/Icons.16x16.Window.Output.ico | Bin 0 -> 1150 bytes .../Resources/Icons.16x16.Window.Output.png | Bin 0 -> 382 bytes .../Resources/Icons.32x32.Form.png | Bin 0 -> 687 bytes .../Icons.32x32.PABCProject.Console.png | Bin 0 -> 973 bytes .../Icons.32x32.PABCProject.ConsoleSimple.png | Bin 0 -> 712 bytes .../Icons.32x32.PABCProject.Library.png | Bin 0 -> 1377 bytes .../Icons.32x32.PABCProject.WinForms.png | Bin 0 -> 987 bytes .../Resources/Icons.32x32.PABCProject.png | Bin 0 -> 1389 bytes .../Resources/Icons.32x32.Unit.png | Bin 0 -> 1345 bytes .../Resources/PadIcons.ProjectBrowser.ico | Bin 0 -> 1406 bytes .../Resources/PadIcons.ProjectBrowser.png | Bin 0 -> 813 bytes VisualPascalABCNETLinux/Resources/Pointer.bmp | Bin 0 -> 246 bytes VisualPascalABCNETLinux/Resources/PrintHS.bmp | Bin 0 -> 1078 bytes VisualPascalABCNETLinux/Resources/PrintHS.png | Bin 0 -> 766 bytes .../ProjectBrowser.ReferenceFolder.Closed.png | Bin 0 -> 655 bytes .../ProjectBrowser.ReferenceFolder.Open.png | Bin 0 -> 583 bytes .../Resources/SendToBackHS.png | Bin 0 -> 586 bytes .../Resources/browserNavigBack.Image.png | Bin 0 -> 3354 bytes VisualPascalABCNETLinux/Resources/copy.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/cut.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/format.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/format.png | Bin 0 -> 587 bytes VisualPascalABCNETLinux/Resources/format1.png | Bin 0 -> 587 bytes VisualPascalABCNETLinux/Resources/format2.png | Bin 0 -> 587 bytes .../Resources/new_file.bmp | Bin 0 -> 822 bytes .../Resources/new_file1.bmp | Bin 0 -> 822 bytes .../Resources/new_file_png.png | Bin 0 -> 574 bytes VisualPascalABCNETLinux/Resources/open.bmp | Bin 0 -> 822 bytes .../Resources/openclosed.png | Bin 0 -> 3205 bytes .../Resources/pabcfile.png | Bin 0 -> 556 bytes VisualPascalABCNETLinux/Resources/paste.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/redo.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/save.bmp | Bin 0 -> 822 bytes .../Resources/save_all.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/start.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/stop.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/Resources/undo.bmp | Bin 0 -> 822 bytes .../RunArguments.Designer.cs | 104 + VisualPascalABCNETLinux/RunArguments.cs | 32 + VisualPascalABCNETLinux/RunArguments.resx | 120 + VisualPascalABCNETLinux/RunProcessOptions.cs | 14 + VisualPascalABCNETLinux/SSYY/App.ico | Bin 0 -> 1078 bytes .../SSYY/DefaultMenuCommands.cs | 289 + .../SSYY/DesignerComponentCollection.cs | 73 + .../SSYY/DesignerHost.csproj | 180 + VisualPascalABCNETLinux/SSYY/DesignerHost.sln | 19 + VisualPascalABCNETLinux/SSYY/DesignerMain.cs | 181 + VisualPascalABCNETLinux/SSYY/EULA.txt | 3 + .../SSYY/KeystrokeMessageFilter.cs | 90 + VisualPascalABCNETLinux/SSYY/MainForm.cs | 1069 +++ VisualPascalABCNETLinux/SSYY/MainForm.resx | 42 + .../SSYY/PABCCodeProvider.cs | 575 ++ .../SSYY/PropertiesForm.Designer.cs | 108 + .../SSYY/PropertiesForm.cs | 138 + .../SSYY/PropertiesForm.resx | 120 + .../SSYY/PropertyGridSite.cs | 80 + .../SSYY/SampleDesignSite.cs | 152 + .../SSYY/SampleDesignerHost.cs | 1651 ++++ .../SSYY/SampleDesignerLoader.cs | 1537 ++++ .../SSYY/SampleDesignerNameAttribute.cs | 49 + .../SampleDesignerSerializationManager.cs | 569 ++ .../SampleDesignerSerializationService.cs | 49 + .../SSYY/SampleDesignerTransaction.cs | 79 + .../SSYY/SampleDocumentWindow.cs | 153 + .../SSYY/SampleDocumentWindow.resx | 42 + .../SSYY/SampleEventBindingService.cs | 771 ++ .../SSYY/SampleMenuCommandService.cs | 320 + .../SSYY/SampleNameExtenderProvider.cs | 133 + .../SSYY/SampleResourceService.cs | 52 + .../SSYY/SampleSelectionItem.cs | 70 + .../SSYY/SampleSelectionService.cs | 493 ++ .../SSYY/SampleToolboxService.cs | 264 + .../SSYY/SampleTypeDescriptorFilterService.cs | 192 + .../SSYY/SampleTypeResolutionService.cs | 143 + .../SSYY/ServiceRequests.cs | 189 + .../SSYY/ServiceRequests.resx | 42 + VisualPascalABCNETLinux/SSYY/StringStack.cs | 36 + .../SSYY/ToolBoxForm.Designer.cs | 65 + VisualPascalABCNETLinux/SSYY/ToolBoxForm.cs | 36 + VisualPascalABCNETLinux/SSYY/ToolBoxForm.resx | 120 + .../SSYY/ToolBoxPane2.Designer.cs | 100 + VisualPascalABCNETLinux/SSYY/ToolBoxPane2.cs | 406 + .../SSYY/ToolBoxPane2.resx | 120 + VisualPascalABCNETLinux/SSYY/ToolboxPane.cs | 617 ++ VisualPascalABCNETLinux/UserOptions.cs | 279 + .../VisualPascalABCNETLinux.csproj | 805 ++ VisualPascalABCNETLinux/VisualStates.cs | 13 + .../Workbench/BuildService.cs | 299 + .../Workbench/DebugService.cs | 110 + .../Workbench/DialogsService.cs | 56 + .../Workbench/EditorServices.cs | 260 + .../Workbench/FileOperations.cs | 604 ++ .../Workbench/HelpService.cs | 244 + .../Workbench/OptionsManager.cs | 379 + .../Workbench/ProjectService.cs | 276 + .../Workbench/RunService.cs | 343 + .../Workbench/RunnerManagerHandlers.cs | 247 + .../Workbench/UpdateService.cs | 89 + .../Workbench/VisibilityService.cs | 686 ++ .../Workbench/WindowOperations.cs | 698 ++ .../Workbench/WorkbenchServiceFactory.cs | 244 + VisualPascalABCNETLinux/_ABC13.ico | Bin 0 -> 42599 bytes VisualPascalABCNETLinux/app.config | 14 + VisualPascalABCNETLinux/app.manifest | 76 + VisualPascalABCNETLinux/bitmaps/ABCNET16.ico | Bin 0 -> 1406 bytes VisualPascalABCNETLinux/bitmaps/ABCNET2.ico | Bin 0 -> 3638 bytes VisualPascalABCNETLinux/bitmaps/ABCNET32.ico | Bin 0 -> 766 bytes .../bitmaps/ConsoleApplication.bmp | Bin 0 -> 822 bytes .../bitmaps/DynamicLib.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/bitmaps/Exit.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/bitmaps/Icon1.ico | Bin 0 -> 766 bytes .../bitmaps/Icons.16x16.Debug.Continue.png | Bin 0 -> 367 bytes .../bitmaps/WindowsApplication.bmp | Bin 0 -> 822 bytes .../bitmaps/abcneticon.bmp | Bin 0 -> 3126 bytes VisualPascalABCNETLinux/bitmaps/bookmark.png | Bin 0 -> 735 bytes .../bitmaps/compileroptions.bmp | Bin 0 -> 822 bytes .../bitmaps/compileroptions.ico | Bin 0 -> 2478 bytes .../bitmaps/delete_bookmark.png | Bin 0 -> 782 bytes VisualPascalABCNETLinux/bitmaps/find.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/bitmaps/findnext.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/bitmaps/internal.bmp | Bin 0 -> 306 bytes .../bitmaps/navig_back.bmp | Bin 0 -> 822 bytes .../bitmaps/navig_forw.bmp | Bin 0 -> 822 bytes .../bitmaps/next_bookmark.png | Bin 0 -> 708 bytes VisualPascalABCNETLinux/bitmaps/options.bmp | Bin 0 -> 822 bytes VisualPascalABCNETLinux/bitmaps/options.ico | Bin 0 -> 2478 bytes .../bitmaps/outputwindow.bmp | Bin 0 -> 822 bytes .../bitmaps/outputwindow1.bmp | Bin 0 -> 822 bytes .../bitmaps/prev_bookmark.png | Bin 0 -> 691 bytes VisualPascalABCNETLinux/bitmaps/replace.bmp | Bin 0 -> 822 bytes .../bitmaps/run_nodebug.bmp | Bin 0 -> 822 bytes WeifenLuoLinux/.gitignore | 31 + .../WinFormsUI/Docking/AutoHideStripBase.cs | 746 ++ .../Docking/Configuration/PatchSection.cs | 93 + .../WinFormsUI/Docking/DefaultTheme.cs | 261 + .../WinFormsUI/Docking/DockAreasEditor.cs | 142 + .../WinFormsUI/Docking/DockContent.cs | 358 + .../Docking/DockContentCollection.cs | 174 + .../Docking/DockContentEventArgs.cs | 19 + .../WinFormsUI/Docking/DockContentHandler.cs | 1260 +++ .../WinFormsUI/Docking/DockOutlineBase.cs | 160 + .../Docking/DockPane.SplitterControl.cs | 141 + WeifenLuoLinux/WinFormsUI/Docking/DockPane.cs | 1371 +++ .../WinFormsUI/Docking/DockPaneCaptionBase.cs | 109 + .../WinFormsUI/Docking/DockPaneCollection.cs | 56 + .../WinFormsUI/Docking/DockPaneStripBase.cs | 448 + .../Docking/DockPanel.Appearance.cs | 44 + .../Docking/DockPanel.AutoHideWindow.cs | 575 ++ .../Docking/DockPanel.DockDragHandler.cs | 551 ++ .../Docking/DockPanel.DragHandler.cs | 163 + .../Docking/DockPanel.FocusManager.cs | 632 ++ .../Docking/DockPanel.MdiClientController.cs | 441 + .../WinFormsUI/Docking/DockPanel.Persistor.cs | 816 ++ .../Docking/DockPanel.SplitterDragHandler.cs | 161 + .../WinFormsUI/Docking/DockPanel.bmp | Bin 0 -> 822 bytes .../WinFormsUI/Docking/DockPanel.cs | 1176 +++ .../Docking/DockPanelColorPalette.cs | 230 + .../WinFormsUI/Docking/DockPanelExtender.cs | 227 + .../WinFormsUI/Docking/DockPanelSkin.cs | 418 + .../WinFormsUI/Docking/DockWindow.cs | 240 + .../Docking/DockWindowCollection.cs | 38 + WeifenLuoLinux/WinFormsUI/Docking/DragForm.cs | 99 + .../WinFormsUI/Docking/DrawingRoutines.cs | 35 + .../WinFormsUI/Docking/DummyControl.cs | 21 + WeifenLuoLinux/WinFormsUI/Docking/Enums.cs | 59 + .../WinFormsUI/Docking/FloatWindow.cs | 485 ++ .../Docking/FloatWindowCollection.cs | 39 + .../WinFormsUI/Docking/Helpers/DockHelper.cs | 104 + .../WinFormsUI/Docking/Helpers/DrawHelper.cs | 101 + .../Docking/Helpers/ResourceHelper.cs | 25 + .../WinFormsUI/Docking/Helpers/Win32Helper.cs | 29 + .../WinFormsUI/Docking/IImageService.cs | 312 + .../WinFormsUI/Docking/IPaintingService.cs | 11 + .../WinFormsUI/Docking/InertButtonBase.cs | 165 + .../WinFormsUI/Docking/Interfaces.cs | 59 + .../WinFormsUI/Docking/LayoutUtils.cs | 12 + .../WinFormsUI/Docking/Localization.cs | 46 + WeifenLuoLinux/WinFormsUI/Docking/Measures.cs | 15 + .../WinFormsUI/Docking/NestedDockingStatus.cs | 107 + .../Docking/NestedPaneCollection.cs | 170 + .../WinFormsUI/Docking/PatchController.cs | 1039 +++ .../WinFormsUI/Docking/SplitterBase.cs | 69 + .../WinFormsUI/Docking/Strings.Designer.cs | 783 ++ .../WinFormsUI/Docking/Strings.resx | 360 + .../WinFormsUI/Docking/ThemeBase.cs | 189 + .../Docking/VisibleNestedPaneCollection.cs | 185 + .../Docking/VisualStudioColorTable.cs | 303 + .../VisualStudioToolStripExtender.Designer.cs | 36 + .../Docking/VisualStudioToolStripExtender.cs | 125 + .../Docking/VisualStudioToolStripRenderer.cs | 683 ++ .../WinFormsUI/Docking/Win32/Enums.cs | 371 + .../WinFormsUI/Docking/Win32/NativeMethods.cs | 61 + WeifenLuoLinux/WinFormsUI/ThemeVS2005.csproj | 158 + .../ThemeVS2005/Resources.Designer.cs | 303 + .../WinFormsUI/ThemeVS2005/Resources.resx | 193 + .../Resources/DockIndicator_PaneDiamond.png | Bin 0 -> 2011 bytes .../DockIndicator_PaneDiamond_Bottom.png | Bin 0 -> 2010 bytes .../DockIndicator_PaneDiamond_Hotspot.png | Bin 0 -> 484 bytes ...DockIndicator_PaneDiamond_HotspotIndex.png | Bin 0 -> 275 bytes ...icator_PaneDiamond_HotspotIndex_VS2012.png | Bin 0 -> 167 bytes .../DockIndicator_PaneDiamond_Left.png | Bin 0 -> 2012 bytes .../DockIndicator_PaneDiamond_Right.png | Bin 0 -> 2006 bytes .../DockIndicator_PaneDiamond_Top.png | Bin 0 -> 2011 bytes .../Resources/DockIndicator_PanelBottom.png | Bin 0 -> 882 bytes .../DockIndicator_PanelBottom_Active.png | Bin 0 -> 885 bytes .../Resources/DockIndicator_PanelFill.png | Bin 0 -> 642 bytes .../DockIndicator_PanelFill_Active.png | Bin 0 -> 645 bytes .../Resources/DockIndicator_PanelLeft.png | Bin 0 -> 871 bytes .../DockIndicator_PanelLeft_Active.png | Bin 0 -> 871 bytes .../Resources/DockIndicator_PanelRight.png | Bin 0 -> 882 bytes .../DockIndicator_PanelRight_Active.png | Bin 0 -> 885 bytes .../Resources/DockIndicator_PanelTop.png | Bin 0 -> 860 bytes .../DockIndicator_PanelTop_Active.png | Bin 0 -> 860 bytes .../Resources/DockPane_AutoHide.png | Bin 0 -> 259 bytes .../ThemeVS2005/Resources/DockPane_Close.png | Bin 0 -> 263 bytes .../ThemeVS2005/Resources/DockPane_Dock.png | Bin 0 -> 258 bytes .../ThemeVS2005/Resources/DockPane_Option.png | Bin 0 -> 256 bytes .../Resources/DockPane_OptionOverflow.png | Bin 0 -> 259 bytes .../Dockindicator_PaneDiamond_Fill.png | Bin 0 -> 2005 bytes .../ThemeVS2005/Strings.Designer.cs | 252 + .../WinFormsUI/ThemeVS2005/Strings.resx | 183 + .../ThemeVS2005/VS2005AutoHideStrip.cs | 542 ++ .../VS2005AutoHideWindowControl.cs | 10 + .../VS2005AutoHideWindowFactory.cs | 90 + .../ThemeVS2005/VS2005DockIndicatorFactory.cs | 14 + .../ThemeVS2005/VS2005DockOutlineFactory.cs | 166 + .../ThemeVS2005/VS2005DockPaneCaption.cs | 485 ++ .../VS2005DockPaneSplitterControlFactory.cs | 40 + .../ThemeVS2005/VS2005DockPaneStrip.cs | 1584 ++++ .../ThemeVS2005/VS2005DockWindowFactory.cs | 36 + .../ThemeVS2005/VS2005PaneIndicatorFactory.cs | 93 + .../VS2005PanelIndicatorFactory.cs | 116 + .../WinFormsUI/ThemeVS2005/VS2005Theme.cs | 103 + .../VS2005WindowSplitterControlFactory.cs | 36 + .../WeifenLuo.WinFormsUI.Docking.Linux.csproj | 170 + WeifenLuoLinux/WinFormsUI/dockpanelsuite.snk | Bin 0 -> 596 bytes WeifenLuoLinux/WinFormsUI/license.txt | 9 + 667 files changed, 122268 insertions(+), 7 deletions(-) create mode 100644 ICSharpCode.TextEditorLinux/Configuration/AssemblyInfo.cs create mode 100644 ICSharpCode.TextEditorLinux/ICSharpCode.TextEditorLinux.csproj create mode 100644 ICSharpCode.TextEditorLinux/Resources/ASPX.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/BAT-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/Boo.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/Breakpoint.png create mode 100644 ICSharpCode.TextEditorLinux/Resources/Breakpoint24x24.png create mode 100644 ICSharpCode.TextEditorLinux/Resources/Breakpoint32x32.png create mode 100644 ICSharpCode.TextEditorLinux/Resources/CPP-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/CSharp-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/Coco-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/ConditionBreakpoint24x24.png create mode 100644 ICSharpCode.TextEditorLinux/Resources/HTML-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/ICSharpCode.TextEditor.snk create mode 100644 ICSharpCode.TextEditorLinux/Resources/Java-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/JavaScript-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/Mode.xsd create mode 100644 ICSharpCode.TextEditorLinux/Resources/PHP-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/Patch-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/RightArrow.cur create mode 100644 ICSharpCode.TextEditorLinux/Resources/SyntaxModes.xml create mode 100644 ICSharpCode.TextEditorLinux/Resources/Tex-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/TextEditorControl.bmp create mode 100644 ICSharpCode.TextEditorLinux/Resources/VBNET-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Resources/XML-Mode.xshd create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/BookmarkActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/CaretActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/ClipBoardActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/FoldActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/FormatActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/HomeEndActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/IEditAction.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/MiscActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Actions/SelectionActions.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/AbstractSegment.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/Bookmark.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkEventHandler.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManagerMemento.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/CustomLineManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/ICustomLineManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/DefaultDocument.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/DefaultTextEditorProperties.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/DocumentEventArgs.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/DocumentFactory.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldMarker.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldingManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IFoldingStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/DefaultFormattingStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/IFormattingStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/FontContainer.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightBackground.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightColor.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightInfo.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightRuleSet.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingColorNotFoundException.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionInvalidException.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionParser.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingStrategyFactory.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/IHighlightingStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/NextMarker.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/PrevMarker.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/Span.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SpanStack.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/FileSyntaxModeProvider.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ISyntaxModeFileProvider.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ResourceSyntaxModeProvider.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/SyntaxMode.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/TextWord.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/IDocument.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/ISegment.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/ITextEditorProperties.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManagerEventArgs.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegment.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegmentTree.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/MarkerStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/TextMarker.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/Selection/ColumnRange.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/Selection/DefaultSelection.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/Selection/ISelection.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/Selection/SelectionManager.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/TextAnchor.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/GapTextBufferStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/ITextBufferStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/StringTextBufferStrategy.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/TextLocation.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Document/TextUtilities.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/AbstractMargin.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/BracketHighlighter.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/BrushRegistry.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/Caret.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.resx create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionWindow.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/DeclarationViewWindow.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionData.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionDataProvider.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/DrawableLine.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/FoldMargin.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/GutterMargin.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/HRuler.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/IconBarMargin.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/Ime.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/IInsightDataProvider.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/InsightWindow.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextArea.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextAreaClipboardHandler.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextAreaControl.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextAreaDragDropHandler.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextAreaMouseHandler.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextAreaUpdate.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControl.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControlBase.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Gui/ToolTipRequestEventArgs.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Undo/IUndoableOperation.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Undo/UndoQueue.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Undo/UndoStack.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Undo/UndoableDelete.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Undo/UndoableInsert.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Undo/UndoableReplace.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/AugmentableRedBlackTree.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/FileReader.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/LookupTable.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/RedBlackTreeIterator.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/RtfWriter.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TextUtility.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TipPainter.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TipPainterTools.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TipSection.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TipSpacer.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TipSplitter.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/TipText.cs create mode 100644 ICSharpCode.TextEditorLinux/Src/Util/WeakCollection.cs create mode 100644 ICSharpCode.TextEditorLinux/copyright.txt create mode 100644 ICSharpCode.TextEditorLinux/license.txt create mode 100644 Libraries/WeifenLuo.WinFormsUI.Docking.ThemeVS2005Linux.dll create mode 100644 Libraries/WeifenLuo.WinFormsUI.DockingLinux.dll create mode 100644 PluginsSupportLinux/Classes.cs create mode 100644 PluginsSupportLinux/Interfaces.cs create mode 100644 PluginsSupportLinux/PluginsSupportLinux.csproj create mode 100644 PluginsSupportLinux/Properties/AssemblyInfo.cs create mode 100644 VisualPascalABCNETLinux/ABCHealth.Designer.cs create mode 100644 VisualPascalABCNETLinux/ABCHealth.cs create mode 100644 VisualPascalABCNETLinux/ABCHealth.ico create mode 100644 VisualPascalABCNETLinux/ABCHealth.resx create mode 100644 VisualPascalABCNETLinux/ABCNET32.ico create mode 100644 VisualPascalABCNETLinux/AboutBox.Designer.cs create mode 100644 VisualPascalABCNETLinux/AboutBox.cs create mode 100644 VisualPascalABCNETLinux/AboutBox.resx create mode 100644 VisualPascalABCNETLinux/AutoInsertCode/AutoInsertCode.cs create mode 100644 VisualPascalABCNETLinux/CodeFileDocumentTextEditorControl.cs create mode 100644 VisualPascalABCNETLinux/CompileOptionsSet.cs create mode 100644 VisualPascalABCNETLinux/CompilerForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/CompilerForm.cs create mode 100644 VisualPascalABCNETLinux/CompilerForm.resx create mode 100644 VisualPascalABCNETLinux/Config/AssemblyInfo.cs create mode 100644 VisualPascalABCNETLinux/DS/Classes.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/CodeCompletionListView.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/CodeCompletionWindow.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/DeclarationWindow.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/InsightWindow.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainter.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainterTools.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSection.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSpacer.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSplitter.cs create mode 100644 VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipText.cs create mode 100644 VisualPascalABCNETLinux/DS/Constants.cs create mode 100644 VisualPascalABCNETLinux/DS/FoldingStrategy.cs create mode 100644 VisualPascalABCNETLinux/DS/NavigationManager.cs create mode 100644 VisualPascalABCNETLinux/DS/ObjectLocalisator.cs create mode 100644 VisualPascalABCNETLinux/DS/PluginsController/PluginsController.cs create mode 100644 VisualPascalABCNETLinux/DS/RunManager/EventedEventWaitHandleList.cs create mode 100644 VisualPascalABCNETLinux/DS/RunManager/RunManager.cs create mode 100644 VisualPascalABCNETLinux/DS/RuntimeException.cs create mode 100644 VisualPascalABCNETLinux/DS/SymbolsViwer.cs create mode 100644 VisualPascalABCNETLinux/DS/Tools.cs create mode 100644 VisualPascalABCNETLinux/DS/Utils/OutputReader.cs create mode 100644 VisualPascalABCNETLinux/DS/Utils/ProcessRunner.cs create mode 100644 VisualPascalABCNETLinux/DS/VisualEnvironmentCompiler.cs create mode 100644 VisualPascalABCNETLinux/DockContent/Avalon/CodeFileDocumentTextEditorControl.cs create mode 100644 VisualPascalABCNETLinux/DockContent/BottomDockContentForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/BottomDockContentForm.cs create mode 100644 VisualPascalABCNETLinux/DockContent/BottomDockContentForm.resx create mode 100644 VisualPascalABCNETLinux/DockContent/CodeFileDocument.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs create mode 100644 VisualPascalABCNETLinux/DockContent/CodeFileDocument.resx create mode 100644 VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.cs create mode 100644 VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.resx create mode 100644 VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.cs create mode 100644 VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.resx create mode 100644 VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs create mode 100644 VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.resx create mode 100644 VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs create mode 100644 VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.resx create mode 100644 VisualPascalABCNETLinux/DockContent/DisassemblyWindow.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/DisassemblyWindow.cs create mode 100644 VisualPascalABCNETLinux/DockContent/DisassemblyWindow.resx create mode 100644 VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.cs create mode 100644 VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.resx create mode 100644 VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.cs create mode 100644 VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.resx create mode 100644 VisualPascalABCNETLinux/DockContent/ImmediateWindow.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/ImmediateWindow.cs create mode 100644 VisualPascalABCNETLinux/DockContent/ImmediateWindow.resx create mode 100644 VisualPascalABCNETLinux/DockContent/OutputWindowForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/OutputWindowForm.cs create mode 100644 VisualPascalABCNETLinux/DockContent/OutputWindowForm.resx create mode 100644 VisualPascalABCNETLinux/DockContent/WebBrowserControl.Designer.cs create mode 100644 VisualPascalABCNETLinux/DockContent/WebBrowserControl.cs create mode 100644 VisualPascalABCNETLinux/DockContent/WebBrowserControl.resx create mode 100644 VisualPascalABCNETLinux/FSWatcherService.cs create mode 100644 VisualPascalABCNETLinux/FileMonitoring.cs create mode 100644 VisualPascalABCNETLinux/FontCombo.cs create mode 100644 VisualPascalABCNETLinux/Form1.Designer.cs create mode 100644 VisualPascalABCNETLinux/Form1.Designer.cs1 create mode 100644 VisualPascalABCNETLinux/Form1.cs create mode 100644 VisualPascalABCNETLinux/Form1.cs1 create mode 100644 VisualPascalABCNETLinux/Form1.resx create mode 100644 VisualPascalABCNETLinux/Form1OpenFromHelp.cs create mode 100644 VisualPascalABCNETLinux/GotoLine.Designer.cs create mode 100644 VisualPascalABCNETLinux/GotoLine.cs create mode 100644 VisualPascalABCNETLinux/GotoLine.resx create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionActions.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHelpers.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHighlighter.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionImagesProvider.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionKeyHandler.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionParserController.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionProvider.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/CodeTemplateManager.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/DefinitionByMouseClickManager.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/FoldingStrategy.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/InsightProvider.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.cs create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.resx create mode 100644 VisualPascalABCNETLinux/IB/CodeCompletion/TooltipServiceManager.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/Actions.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.resx create mode 100644 VisualPascalABCNETLinux/IB/Debugger/Bookmarks.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.Designer.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.resx create mode 100644 VisualPascalABCNETLinux/IB/Debugger/Debugger.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/Immediate.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs create mode 100644 VisualPascalABCNETLinux/IB/Debugger/Utility.cs create mode 100644 VisualPascalABCNETLinux/IB/FormExtensions.cs create mode 100644 VisualPascalABCNETLinux/IB/Refactoring/Bookmarks.cs create mode 100644 VisualPascalABCNETLinux/IB/Refactoring/RenameForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/IB/Refactoring/RenameForm.cs create mode 100644 VisualPascalABCNETLinux/IB/Refactoring/RenameForm.resx create mode 100644 VisualPascalABCNETLinux/IB/Samples/CodeSampleManager.cs create mode 100644 VisualPascalABCNETLinux/IB/TreeGridView/Samples/CodeSampleManager.cs create mode 100644 VisualPascalABCNETLinux/IB/TreeGridView/TreeGridCell.cs create mode 100644 VisualPascalABCNETLinux/IB/TreeGridView/TreeGridEvents.cs create mode 100644 VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs create mode 100644 VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNodeCollection.cs create mode 100644 VisualPascalABCNETLinux/IB/TreeGridView/TreeGridView.cs create mode 100644 VisualPascalABCNETLinux/IB/VBComp/VBNETCompiler.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.Designer.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.resx create mode 100644 VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.Designer.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.resx create mode 100644 VisualPascalABCNETLinux/OptionsContent/IOptionsContent.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.Designer.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.resx create mode 100644 VisualPascalABCNETLinux/OptionsContent/OptionsContentEngine.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/OptionsForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/OptionsForm.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/OptionsForm.resx create mode 100644 VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.Designer.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.cs create mode 100644 VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.resx create mode 100644 VisualPascalABCNETLinux/Program.cs create mode 100644 VisualPascalABCNETLinux/Projects/FusionNative.cs create mode 100644 VisualPascalABCNETLinux/Projects/GacInterop.cs create mode 100644 VisualPascalABCNETLinux/Projects/NewFileForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/Projects/NewFileForm.cs create mode 100644 VisualPascalABCNETLinux/Projects/NewFileForm.resx create mode 100644 VisualPascalABCNETLinux/Projects/NewProject.Designer.cs create mode 100644 VisualPascalABCNETLinux/Projects/NewProject.cs create mode 100644 VisualPascalABCNETLinux/Projects/NewProject.resx create mode 100644 VisualPascalABCNETLinux/Projects/NuGetTasks.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectExplorer.Designer.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectExplorer.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectExplorer.resx create mode 100644 VisualPascalABCNETLinux/Projects/ProjectHelper.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectInfo.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectProperties.Designer.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectProperties.cs create mode 100644 VisualPascalABCNETLinux/Projects/ProjectProperties.resx create mode 100644 VisualPascalABCNETLinux/Projects/ProjectTasks.cs create mode 100644 VisualPascalABCNETLinux/Projects/ReferenceForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/Projects/ReferenceForm.cs create mode 100644 VisualPascalABCNETLinux/Projects/ReferenceForm.resx create mode 100644 VisualPascalABCNETLinux/Projects/TypeLibrary.cs create mode 100644 VisualPascalABCNETLinux/Projects/UserOptionsManager.cs create mode 100644 VisualPascalABCNETLinux/Properties/Resources.Designer.cs create mode 100644 VisualPascalABCNETLinux/Properties/Resources.resx create mode 100644 VisualPascalABCNETLinux/Properties/Settings.Designer.cs create mode 100644 VisualPascalABCNETLinux/Properties/Settings.settings create mode 100644 VisualPascalABCNETLinux/ReplaceConfirmDialog.Designer.cs create mode 100644 VisualPascalABCNETLinux/ReplaceConfirmDialog.cs create mode 100644 VisualPascalABCNETLinux/ReplaceConfirmDialog.resx create mode 100644 VisualPascalABCNETLinux/ReplaceForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/ReplaceForm.cs create mode 100644 VisualPascalABCNETLinux/ReplaceForm.resx create mode 100644 VisualPascalABCNETLinux/Resources/AlignObjectsBottomHS.png create mode 100644 VisualPascalABCNETLinux/Resources/AlignObjectsCenteredHorizontalHS.png create mode 100644 VisualPascalABCNETLinux/Resources/AlignObjectsCenteredVerticalHS.png create mode 100644 VisualPascalABCNETLinux/Resources/AlignObjectsLeftHS.png create mode 100644 VisualPascalABCNETLinux/Resources/AlignObjectsRightHS.png create mode 100644 VisualPascalABCNETLinux/Resources/AlignObjectsTopHS.png create mode 100644 VisualPascalABCNETLinux/Resources/AlignToGridHS.png create mode 100644 VisualPascalABCNETLinux/Resources/BringToFrontHS.png create mode 100644 VisualPascalABCNETLinux/Resources/Delete.bmp create mode 100644 VisualPascalABCNETLinux/Resources/Delete3.bmp create mode 100644 VisualPascalABCNETLinux/Resources/FormsDesignerPointerIcon.bmp create mode 100644 VisualPascalABCNETLinux/Resources/FormsDesignerPointerIcon.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Class.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.Break.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.Continue.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepInto.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepOut.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepOver.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Delegate.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Disassembly.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Enum.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Error.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ErrorInWatch.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.EvalError.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Event.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ExtensionMethod.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Field.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Form.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.GenerateMethod.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.GotoDefinition.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.GotoRealization.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.GotoText.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Intellisense.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Intellisense.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Interface.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalClass.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalConstant.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalDelegate.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalEnum.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalEvent.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalField.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalInterface.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalMethod.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalProperty.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.InternalStruct.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Keyword.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Literal.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Local.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Method.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.NameSpace.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.NewProjectIcon.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Open.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Options.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Options.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateClass.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateConstant.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateDelegate.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateEnum.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateEvent.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateField.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateIndexer.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateInterface.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateMethod.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateProperty.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateStruct.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Project.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Property.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Property.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedClass.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedConstant.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedDelegate.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedEnum.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedEvent.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedField.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedInterface.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedMethod.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedProperty.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedStruct.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Reference.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.RuntimeError.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Save.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Struct.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.TreeView.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.UnitNamespace.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Warning.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CodePage.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CodePage.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CompilerConsole.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CompilerConsole.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugVariablesList.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugVariablesList.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugWatches.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugWatches.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.ErrorList.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.ErrorList.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.FindSymbolResult.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.FindSymbolResult.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.Immediate.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.Immediate.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.Output.ico create mode 100644 VisualPascalABCNETLinux/Resources/Icons.16x16.Window.Output.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.Form.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.Console.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.ConsoleSimple.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.Library.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.WinForms.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.png create mode 100644 VisualPascalABCNETLinux/Resources/Icons.32x32.Unit.png create mode 100644 VisualPascalABCNETLinux/Resources/PadIcons.ProjectBrowser.ico create mode 100644 VisualPascalABCNETLinux/Resources/PadIcons.ProjectBrowser.png create mode 100644 VisualPascalABCNETLinux/Resources/Pointer.bmp create mode 100644 VisualPascalABCNETLinux/Resources/PrintHS.bmp create mode 100644 VisualPascalABCNETLinux/Resources/PrintHS.png create mode 100644 VisualPascalABCNETLinux/Resources/ProjectBrowser.ReferenceFolder.Closed.png create mode 100644 VisualPascalABCNETLinux/Resources/ProjectBrowser.ReferenceFolder.Open.png create mode 100644 VisualPascalABCNETLinux/Resources/SendToBackHS.png create mode 100644 VisualPascalABCNETLinux/Resources/browserNavigBack.Image.png create mode 100644 VisualPascalABCNETLinux/Resources/copy.bmp create mode 100644 VisualPascalABCNETLinux/Resources/cut.bmp create mode 100644 VisualPascalABCNETLinux/Resources/format.bmp create mode 100644 VisualPascalABCNETLinux/Resources/format.png create mode 100644 VisualPascalABCNETLinux/Resources/format1.png create mode 100644 VisualPascalABCNETLinux/Resources/format2.png create mode 100644 VisualPascalABCNETLinux/Resources/new_file.bmp create mode 100644 VisualPascalABCNETLinux/Resources/new_file1.bmp create mode 100644 VisualPascalABCNETLinux/Resources/new_file_png.png create mode 100644 VisualPascalABCNETLinux/Resources/open.bmp create mode 100644 VisualPascalABCNETLinux/Resources/openclosed.png create mode 100644 VisualPascalABCNETLinux/Resources/pabcfile.png create mode 100644 VisualPascalABCNETLinux/Resources/paste.bmp create mode 100644 VisualPascalABCNETLinux/Resources/redo.bmp create mode 100644 VisualPascalABCNETLinux/Resources/save.bmp create mode 100644 VisualPascalABCNETLinux/Resources/save_all.bmp create mode 100644 VisualPascalABCNETLinux/Resources/start.bmp create mode 100644 VisualPascalABCNETLinux/Resources/stop.bmp create mode 100644 VisualPascalABCNETLinux/Resources/undo.bmp create mode 100644 VisualPascalABCNETLinux/RunArguments.Designer.cs create mode 100644 VisualPascalABCNETLinux/RunArguments.cs create mode 100644 VisualPascalABCNETLinux/RunArguments.resx create mode 100644 VisualPascalABCNETLinux/RunProcessOptions.cs create mode 100644 VisualPascalABCNETLinux/SSYY/App.ico create mode 100644 VisualPascalABCNETLinux/SSYY/DefaultMenuCommands.cs create mode 100644 VisualPascalABCNETLinux/SSYY/DesignerComponentCollection.cs create mode 100644 VisualPascalABCNETLinux/SSYY/DesignerHost.csproj create mode 100644 VisualPascalABCNETLinux/SSYY/DesignerHost.sln create mode 100644 VisualPascalABCNETLinux/SSYY/DesignerMain.cs create mode 100644 VisualPascalABCNETLinux/SSYY/EULA.txt create mode 100644 VisualPascalABCNETLinux/SSYY/KeystrokeMessageFilter.cs create mode 100644 VisualPascalABCNETLinux/SSYY/MainForm.cs create mode 100644 VisualPascalABCNETLinux/SSYY/MainForm.resx create mode 100644 VisualPascalABCNETLinux/SSYY/PABCCodeProvider.cs create mode 100644 VisualPascalABCNETLinux/SSYY/PropertiesForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/SSYY/PropertiesForm.cs create mode 100644 VisualPascalABCNETLinux/SSYY/PropertiesForm.resx create mode 100644 VisualPascalABCNETLinux/SSYY/PropertyGridSite.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignSite.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignerHost.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignerLoader.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignerNameAttribute.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationManager.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDesignerTransaction.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.resx create mode 100644 VisualPascalABCNETLinux/SSYY/SampleEventBindingService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleMenuCommandService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleNameExtenderProvider.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleResourceService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleSelectionItem.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleSelectionService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleToolboxService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleTypeDescriptorFilterService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/SampleTypeResolutionService.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ServiceRequests.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ServiceRequests.resx create mode 100644 VisualPascalABCNETLinux/SSYY/StringStack.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ToolBoxForm.Designer.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ToolBoxForm.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ToolBoxForm.resx create mode 100644 VisualPascalABCNETLinux/SSYY/ToolBoxPane2.Designer.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ToolBoxPane2.cs create mode 100644 VisualPascalABCNETLinux/SSYY/ToolBoxPane2.resx create mode 100644 VisualPascalABCNETLinux/SSYY/ToolboxPane.cs create mode 100644 VisualPascalABCNETLinux/UserOptions.cs create mode 100644 VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj create mode 100644 VisualPascalABCNETLinux/VisualStates.cs create mode 100644 VisualPascalABCNETLinux/Workbench/BuildService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/DebugService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/DialogsService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/EditorServices.cs create mode 100644 VisualPascalABCNETLinux/Workbench/FileOperations.cs create mode 100644 VisualPascalABCNETLinux/Workbench/HelpService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/OptionsManager.cs create mode 100644 VisualPascalABCNETLinux/Workbench/ProjectService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/RunService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/RunnerManagerHandlers.cs create mode 100644 VisualPascalABCNETLinux/Workbench/UpdateService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/VisibilityService.cs create mode 100644 VisualPascalABCNETLinux/Workbench/WindowOperations.cs create mode 100644 VisualPascalABCNETLinux/Workbench/WorkbenchServiceFactory.cs create mode 100644 VisualPascalABCNETLinux/_ABC13.ico create mode 100644 VisualPascalABCNETLinux/app.config create mode 100644 VisualPascalABCNETLinux/app.manifest create mode 100644 VisualPascalABCNETLinux/bitmaps/ABCNET16.ico create mode 100644 VisualPascalABCNETLinux/bitmaps/ABCNET2.ico create mode 100644 VisualPascalABCNETLinux/bitmaps/ABCNET32.ico create mode 100644 VisualPascalABCNETLinux/bitmaps/ConsoleApplication.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/DynamicLib.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/Exit.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/Icon1.ico create mode 100644 VisualPascalABCNETLinux/bitmaps/Icons.16x16.Debug.Continue.png create mode 100644 VisualPascalABCNETLinux/bitmaps/WindowsApplication.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/abcneticon.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/bookmark.png create mode 100644 VisualPascalABCNETLinux/bitmaps/compileroptions.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/compileroptions.ico create mode 100644 VisualPascalABCNETLinux/bitmaps/delete_bookmark.png create mode 100644 VisualPascalABCNETLinux/bitmaps/find.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/findnext.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/internal.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/navig_back.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/navig_forw.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/next_bookmark.png create mode 100644 VisualPascalABCNETLinux/bitmaps/options.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/options.ico create mode 100644 VisualPascalABCNETLinux/bitmaps/outputwindow.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/outputwindow1.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/prev_bookmark.png create mode 100644 VisualPascalABCNETLinux/bitmaps/replace.bmp create mode 100644 VisualPascalABCNETLinux/bitmaps/run_nodebug.bmp create mode 100644 WeifenLuoLinux/.gitignore create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/AutoHideStripBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Configuration/PatchSection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DefaultTheme.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockAreasEditor.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockContent.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockContentCollection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockContentEventArgs.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockContentHandler.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockOutlineBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPane.SplitterControl.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPane.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPaneCaptionBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPaneCollection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPaneStripBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Appearance.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DockDragHandler.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DragHandler.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.FocusManager.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.MdiClientController.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Persistor.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.bmp create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanel.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanelColorPalette.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanelExtender.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockPanelSkin.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockWindow.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DockWindowCollection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DragForm.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DrawingRoutines.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/DummyControl.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Enums.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/FloatWindow.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/FloatWindowCollection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Helpers/DockHelper.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Helpers/DrawHelper.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Helpers/ResourceHelper.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Helpers/Win32Helper.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/IImageService.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/IPaintingService.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/InertButtonBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Interfaces.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/LayoutUtils.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Localization.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Measures.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/NestedDockingStatus.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/NestedPaneCollection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/PatchController.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/SplitterBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Strings.Designer.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Strings.resx create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/ThemeBase.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/VisibleNestedPaneCollection.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/VisualStudioColorTable.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripExtender.Designer.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripExtender.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripRenderer.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Win32/Enums.cs create mode 100644 WeifenLuoLinux/WinFormsUI/Docking/Win32/NativeMethods.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005.csproj create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.Designer.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.resx create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Bottom.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Hotspot.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_HotspotIndex.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_HotspotIndex_VS2012.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Left.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Right.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Top.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelBottom.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelBottom_Active.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelFill.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelFill_Active.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelLeft.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelLeft_Active.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelRight.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelRight_Active.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelTop.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelTop_Active.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_AutoHide.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Close.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Dock.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Option.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_OptionOverflow.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/Dockindicator_PaneDiamond_Fill.png create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Strings.Designer.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/Strings.resx create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideStrip.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowControl.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockIndicatorFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockOutlineFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneCaption.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneSplitterControlFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneStrip.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockWindowFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PaneIndicatorFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PanelIndicatorFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005Theme.cs create mode 100644 WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005WindowSplitterControlFactory.cs create mode 100644 WeifenLuoLinux/WinFormsUI/WeifenLuo.WinFormsUI.Docking.Linux.csproj create mode 100644 WeifenLuoLinux/WinFormsUI/dockpanelsuite.snk create mode 100644 WeifenLuoLinux/WinFormsUI/license.txt diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 64ffff7ee..777519197 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "3"; - public const string Revision = "3129"; + public const string Revision = "3134"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 31a9efd92..4884b82ff 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=8 -%REVISION%=3129 %COREVERSION%=3 +%REVISION%=3134 +%MINOR%=8 %MAJOR%=3 diff --git a/ICSharpCode.TextEditorLinux/Configuration/AssemblyInfo.cs b/ICSharpCode.TextEditorLinux/Configuration/AssemblyInfo.cs new file mode 100644 index 000000000..c09fc40ce --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Configuration/AssemblyInfo.cs @@ -0,0 +1,19 @@ +// +// +// +// +// $Revision: 1618 $ +// + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: CLSCompliant(true)] +[assembly: StringFreezing()] + +[assembly: AssemblyTitle("ICSharpCode.TextEditor")] +[assembly: AssemblyDescription("A .NET text editor control")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] diff --git a/ICSharpCode.TextEditorLinux/ICSharpCode.TextEditorLinux.csproj b/ICSharpCode.TextEditorLinux/ICSharpCode.TextEditorLinux.csproj new file mode 100644 index 000000000..0adee59ad --- /dev/null +++ b/ICSharpCode.TextEditorLinux/ICSharpCode.TextEditorLinux.csproj @@ -0,0 +1,259 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} + ICSharpCode.TextEditorLinux + Library + 4 + False + False + OnSuccessfulBuild + Library + true + Resources\ICSharpCode.TextEditor.snk + ICSharpCode.TextEditor + False + Auto + 98041856 + AnyCPU + 4096 + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + False + False + True + ..\bin\ + DEBUG + false + -Microsoft.Design#CA1012;-Microsoft.Design#CA2210;-Microsoft.Design#CA1040;-Microsoft.Design#CA1005;-Microsoft.Design#CA1020;-Microsoft.Design#CA1021;-Microsoft.Design#CA1010;-Microsoft.Design#CA1011;-Microsoft.Design#CA1009;-Microsoft.Design#CA1050;-Microsoft.Design#CA1026;-Microsoft.Design#CA1019;-Microsoft.Design#CA1031;-Microsoft.Design#CA1047;-Microsoft.Design#CA1000;-Microsoft.Design#CA1048;-Microsoft.Design#CA1051;-Microsoft.Design#CA1002;-Microsoft.Design#CA1061;-Microsoft.Design#CA1006;-Microsoft.Design#CA1046;-Microsoft.Design#CA1045;-Microsoft.Design#CA1038;-Microsoft.Design#CA1008;-Microsoft.Design#CA1028;-Microsoft.Design#CA1004;-Microsoft.Design#CA1035;-Microsoft.Design#CA1063;-Microsoft.Design#CA1032;-Microsoft.Design#CA1023;-Microsoft.Design#CA1033;-Microsoft.Design#CA1039;-Microsoft.Design#CA1016;-Microsoft.Design#CA1014;-Microsoft.Design#CA1017;-Microsoft.Design#CA1018;-Microsoft.Design#CA1027;-Microsoft.Design#CA1059;-Microsoft.Design#CA1060;-Microsoft.Design#CA1034;-Microsoft.Design#CA1013;-Microsoft.Design#CA1036;-Microsoft.Design#CA1044;-Microsoft.Design#CA1041;-Microsoft.Design#CA1025;-Microsoft.Design#CA1052;-Microsoft.Design#CA1053;-Microsoft.Design#CA1057;-Microsoft.Design#CA1058;-Microsoft.Design#CA1001;-Microsoft.Design#CA1049;-Microsoft.Design#CA1054;-Microsoft.Design#CA1056;-Microsoft.Design#CA1055;-Microsoft.Design#CA1030;-Microsoft.Design#CA1003;-Microsoft.Design#CA1007;-Microsoft.Design#CA1043;-Microsoft.Design#CA1024;-Microsoft.Design#CA1062;-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302;-Microsoft.Globalization#CA1303;-Microsoft.Globalization#CA1306;-Microsoft.Globalization#CA1304;-Microsoft.Globalization#CA1305;-Microsoft.Globalization#CA1300;-Microsoft.Mobility#CA1600;-Microsoft.Mobility#CA1601;-Microsoft.Naming#CA1718;-Microsoft.Naming#CA1720;-Microsoft.Naming#CA1700;-Microsoft.Naming#CA1712;-Microsoft.Naming#CA1713;-Microsoft.Naming#CA1709;-Microsoft.Naming#CA1708;-Microsoft.Naming#CA1715;-Microsoft.Naming#CA1710;-Microsoft.Naming#CA1707;-Microsoft.Naming#CA1722;-Microsoft.Naming#CA1711;-Microsoft.Naming#CA1716;-Microsoft.Naming#CA1705;-Microsoft.Naming#CA1725;-Microsoft.Naming#CA1719;-Microsoft.Naming#CA1721;-Microsoft.Naming#CA1706;-Microsoft.Naming#CA1724;-Microsoft.Naming#CA1726;-Microsoft.Performance#CA1809;-Microsoft.Performance#CA1811;-Microsoft.Performance#CA1812;-Microsoft.Performance#CA1807;-Microsoft.Performance#CA1813;-Microsoft.Performance#CA1823;-Microsoft.Performance#CA1816;-Microsoft.Performance#CA1817;-Microsoft.Performance#CA1800;-Microsoft.Performance#CA1818;-Microsoft.Performance#CA1805;-Microsoft.Performance#CA1810;-Microsoft.Performance#CA1822;-Microsoft.Performance#CA1815;-Microsoft.Performance#CA1814;-Microsoft.Performance#CA1819;-Microsoft.Performance#CA1804;-Microsoft.Performance#CA1820;-Microsoft.Performance#CA1802;-Microsoft.Security#CA2116;-Microsoft.Security#CA2117;-Microsoft.Security#CA2105;-Microsoft.Security#CA2115;-Microsoft.Security#CA2104;-Microsoft.Security#CA2122;-Microsoft.Security#CA2114;-Microsoft.Security#CA2123;-Microsoft.Security#CA2111;-Microsoft.Security#CA2108;-Microsoft.Security#CA2107;-Microsoft.Security#CA2103;-Microsoft.Security#CA2100;-Microsoft.Security#CA2118;-Microsoft.Security#CA2109;-Microsoft.Security#CA2119;-Microsoft.Security#CA2106;-Microsoft.Security#CA2112;-Microsoft.Security#CA2110;-Microsoft.Security#CA2120;-Microsoft.Security#CA2101;-Microsoft.Security#CA2121;-Microsoft.Security#CA2126;-Microsoft.Security#CA2124;-Microsoft.Usage#CA2209;-Microsoft.Usage#CA2236;-Microsoft.Usage#CA2227;-Microsoft.Usage#CA2213;-Microsoft.Usage#CA2216;-Microsoft.Usage#CA2215;-Microsoft.Usage#CA2214;-Microsoft.Usage#CA2222;-Microsoft.Usage#CA2202;-Microsoft.Usage#CA1806;-Microsoft.Usage#CA2217;-Microsoft.Usage#CA2212;-Microsoft.Usage#CA2219;-Microsoft.Usage#CA2201;-Microsoft.Usage#CA2228;-Microsoft.Usage#CA2221;-Microsoft.Usage#CA2220;-Microsoft.Usage#CA2240;-Microsoft.Usage#CA2229;-Microsoft.Usage#CA2238;-Microsoft.Usage#CA2207;-Microsoft.Usage#CA2208;-Microsoft.Usage#CA2235;-Microsoft.Usage#CA2237;-Microsoft.Usage#CA2232;-Microsoft.Usage#CA2223;-Microsoft.Usage#CA2211;-Microsoft.Usage#CA2233;-Microsoft.Usage#CA2225;-Microsoft.Usage#CA2226;-Microsoft.Usage#CA2231;-Microsoft.Usage#CA2224;-Microsoft.Usage#CA2218;-Microsoft.Usage#CA2234;-Microsoft.Usage#CA2241;-Microsoft.Usage#CA2239;-Microsoft.Usage#CA2200;-Microsoft.Usage#CA1801;-Microsoft.Usage#CA2205;-Microsoft.Usage#CA2230 + + + True + False + False + ..\bin\ + False + + + Full + true + + + None + False + + + + + 3.5 + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form + + + + Form + + + + + + + + + + + + + + + Component + + + UserControl + + + UserControl + + + + + + + + + + Component + + + + + + + + + + + + + + + + + + + Form + + + UserControl + + + + Component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + + + + \ No newline at end of file diff --git a/ICSharpCode.TextEditorLinux/Resources/ASPX.xshd b/ICSharpCode.TextEditorLinux/Resources/ASPX.xshd new file mode 100644 index 000000000..c691f4b9c --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/ASPX.xshd @@ -0,0 +1,17 @@ + + + + + + <% + %> + + + + + + // + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/BAT-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/BAT-Mode.xshd new file mode 100644 index 000000000..16b97f564 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/BAT-Mode.xshd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/Boo.xshd b/ICSharpCode.TextEditorLinux/Resources/Boo.xshd new file mode 100644 index 000000000..eb2688b61 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/Boo.xshd @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + &<>~!@$%^*()-+=|\#/{}[]:;"' , .? + + + """ + """ + + + + # + + + + // + + + + /* + */ + + + + " + " + + + + """ + """ + + + + ' + ' + + + + @@/ + / + + + + /@! @@!/@ + / + + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &<>~!@%^*()-+=|\#/{}[]:;"' , .? + + + /* + */ + + + + + + &<>~!@%^*()-+=|\#/{}[]:;"' , .? + + + /* + */ + + + + + + &<>~!@%^*()-+=|\#/{}[]:;"' , .? + + + ${ + } + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/Breakpoint.png b/ICSharpCode.TextEditorLinux/Resources/Breakpoint.png new file mode 100644 index 0000000000000000000000000000000000000000..ed2b08fbbdc66901e777d83f25910581dac03682 GIT binary patch literal 858 zcmV-g1Eu_lP)Px#1ZP1_K>z@;j|==^1poj5A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`oWHW5baKMO^GGGiXS5dA?5jQJ+ciP1dEX0$XJb6xXe&@W;|Ga-J zW{aVhUBFu2ehaq&fF|ah4f89^hS~h`)!+X-H@|rCJg8g)TkYGlHYh8?>5COUdZkP} zBrnnqNyWPRB7v@l&(n5gW=M2guJ0XA>b5t62GvUYVYN~?UZyh4Xw;@h<;CXNQiWwo zT3{JJpKaEsve)h=B^bU*O5(S&Saw^&21+gxMlPwe(^t#ZmujovY2$TRss93&Yp%e; zWfjcHB`}ef34_cyxXU=X)XHE~ei2?dOb#{R1Rx|RouvA?E^JPkSBo)C#b}Ialcp82QI|6ldy1w*iD6Pal0E_7si?;Vk zM3Tu8xoNoufxfB*)6HgB`?lStPi-I#0$oHPAx!3^!RXmD&>Il~ZN4;<+Ap9$_Q7Es z=4W9(pO0Lw$A!x7Bt1MjLKL+VXvU9tZMc1mz6N5D1;ed4j9wfFdBafdX621 z4(dKj$?mVz+KWCm1@oj-VMyEek7TI*}a}ikA zr}$hjrm|ox;S>x+hCx^0L1@^s^JSrnYkm4IPdiLoLc;c&pT`sb@q%k47gG+AEabfJhQnwX3~XKWCqB1N zMjG^S(J;o2hliZAVB~%V#xxc@Oi6-qRve7QMh9M9ihW-p&vqT_(#x#v>W*@x*v3Ud)jVN?C7|Z zi6>St39eiBoBUuPK}GY+tMJ;d*Lr%GTD{!OZTt3Gn%yXtdJ5Tm)tP7#;~fXn?1=nC zJZWpl>*hO8^?z63=|dImau;22AvZ~hBwe8cQI~J;q)o>=7qIXoZ}tx2n|~v(VLUe) zHk0Cs%W!oka9rGoY$pnl?La252qYYHhx32I{%`yXf~H}-zVvgK00000NkvXXu0mjf Dq~bBf literal 0 HcmV?d00001 diff --git a/ICSharpCode.TextEditorLinux/Resources/Breakpoint32x32.png b/ICSharpCode.TextEditorLinux/Resources/Breakpoint32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..cbbe4468f79d1e6a737b84dd30b92d292b7239c1 GIT binary patch literal 2369 zcmV-H3BLA;P)Px#1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r>hC5e>>~PK z2Kk|N+h#m;cfl=3J6vA409D5NNVHz63*e{N*g;je5Zx(zIWrlej7F#>S#22**5@o+ zHfxG0a8WKaWWU3b3@-S<{zUZe6H)dN=#C0S=dJ)e7xO=sI{7hGGiX% zEf?vQ;7UYf!-LSB=!%QvR6LlO%+-{!F~W2~Eyntsc|KdS{h@j>&tC$Vg4M*jg1jI*ZLQo64VMq%Wekv<0Y9#54~u8#01M~ zhykGtS$}Isns!ZUA4pF^KiO_y(jN5erOYXKS9l=Q!8`EW->~iRfAUJRJb%1p>h(fdH*!9L&MGMG@$yi&;xCMp%~2VEV=M&DONf)Xw_7M-)c1 z3%ShIAv^HGe+yLf5-Q!-;4V4f^<_4=$e)L5QzInJFh|5U^Ec@LsPXZc_PxJAd2`EV zv_jscV8mRAY+S_ui_rtu|IALUfB%UdDnaqv(@2>Z3h8TvtS`KvvuHhya@2Y^Bvx3^WB6Nuk}#6 zt_BX*XcTe~7HLer2tDVs3=0Yy!hGw5l zP?4hB{Jc10X`@WrsJ~ljzm;m;Okf%1P4w>HTeX6MFG0NxALm){8HUK2u7^;g*}sPH zX04mjPcyme#^56k&Xect?Qok!)UbXv9*~(lq#%zxTz?<*&Gy!>LL)si_vzfP4ogXJ z3sFagbIx)$s%P*Znf^6)^URw<3}yvSDfq`jQpdHSh0E+GPT1Jss_jB3$VhHE5g=!K z+@UP*IIqBMTHkV5#?gI!*&@_0;-i*7mut7<=E~jr zGsWT4O+GKUFQFxV!IHo1wY1qBKbv1Bn#FI3Hs=pUe6wIO%+zu+%*0|a%xG3a7|*Os nXkg|g)SLO&FS+}F`|Q5}LD7>dqY#@z00000NkvXXu0mjfIyh*O literal 0 HcmV?d00001 diff --git a/ICSharpCode.TextEditorLinux/Resources/CPP-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/CPP-Mode.xshd new file mode 100644 index 000000000..1504df1d4 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/CPP-Mode.xshd @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + ~!%^*()-+=|\#/{}[]:;"'<> , .? + + + # + + + + // + + + + /* + */ + + + + " + " + + + + ' + ' + + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/CSharp-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/CSharp-Mode.xshd new file mode 100644 index 000000000..3d44b3c41 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/CSharp-Mode.xshd @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + &<>~!%^*()-+=|\#/{}[]:;"' , .? + + + # + + + + ///@!/@ + + + + //@!/@ + + + //// + + + + /* + */ + + + + " + " + + + + @@" + " + + + + ' + ' + + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <>~!@%^*()-+=|\#/{}[]:;"' , .? + + + + + + + + + + + + <>~!@%^*()-+=|\#/{}[]:;"' , .? + + + < + > + + + + + + + + + + + + + + + &<>~!%^*()-+=|\#/{}[]:;"' , .? + + + + + + + + + + + + + + + + + + + <>~!@%^*()-+=|\#/{}[]:;"' , .? + + + " + " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/Coco-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/Coco-Mode.xshd new file mode 100644 index 000000000..0eb3b9393 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/Coco-Mode.xshd @@ -0,0 +1,97 @@ + + + + + + + + + &<>~!@%^*()-+=|\#/{}[]:;"' , .? + + + // + + + + /* + */ + + + + + COMPILER + TOKENNAMES + + + + " + " + + + + ' + ' + + + + < + > + + + + (. + .) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/ConditionBreakpoint24x24.png b/ICSharpCode.TextEditorLinux/Resources/ConditionBreakpoint24x24.png new file mode 100644 index 0000000000000000000000000000000000000000..1128635995b42a4b92c4410bb5724d67c471048f GIT binary patch literal 1162 zcmV;51aV=JXD5E z0m~3%&P~=On_*jq14g8j0b`7}59A@EP#L$qXO|L;EX0$X{O-NKoKL>zdw=IgBy17- z!V5&~%{NFE06YnASx_^;X@S!gv4B7+y;FjASOzFH+m*&cHAbfrH z9OXwoPdku&7M+r2SPgxu%!j9{0^DrVdTV%_li4B|#UVp6C!r@S7~1>}Lj9hdtNBjO zb;-LJHiYJwnC*8yiIV*ud)hdf5)TuZDKI5TgDGh`n3s%JMdpPC7{mAe;zfdi6ABOf z4?(M^J6xqY8PgG(MEI@?iJ;|hh_&30J@1|fGw7qZFeHeE5#bpaP5Kl@6ZtT5E)ItI zQ7{zE#UaPx0p60%iwRn~Gsx_ao_GiPffQRR(R!Ay2L_R@haAuOE;zu{6@Cm1r^2Bh zhYsM`ANdjVaYNzZhk>{fHhk~RgofQTtjPYInPgk4DBg~?dG5*sLMT;-4&S`Z_BH)< zgblw1y$_usA3z7bw&U+@Y;S1wU|5wD+1t;hl937?#d+&_Qylc8s9D}w74G}>T85jk z$=wxg-nSQPbfIH)bQ*fa5i#bG?Ryh#kc?O|b!*7R@MSZ7-WD@FnbKXZ(hE+s20232 z<=Y{;99su%GTAYgPo{bZb|A06MmAs~7Zx#<&LE{YyHbQsE{MQ^jtJ~%6h4JY;_Yx; cH}-$=A7Ai*JDncoZU6uP07*qoM6N<$f?<;yBLDyZ literal 0 HcmV?d00001 diff --git a/ICSharpCode.TextEditorLinux/Resources/HTML-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/HTML-Mode.xshd new file mode 100644 index 000000000..5ca4ec47a --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/HTML-Mode.xshd @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + <!-- + --> + + + <script> + </script> + + + <script lang="JavaScript"> + </script> + + + <script lang="JScript"> + </script> + + + <script lang="VBScript"> + </script> + + + <script@C + </script> + + + < + > + + + + & + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /= + + + " + " + + + + ' + ' + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/ICSharpCode.TextEditor.snk b/ICSharpCode.TextEditorLinux/Resources/ICSharpCode.TextEditor.snk new file mode 100644 index 0000000000000000000000000000000000000000..a49f400e767a63cff1b0f7febf0c10343d230b6d GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096WpVmUMQ4OSI%Q$c1gpaNbGB%y_t?hRK zTGzB+bsR&MM+0P7$%9j8`-o^O=-7rH*@Sf@Ur6#3A!6mi81mAfK`>yrOQLx5@eOkz$?z+Ch_8NMWO3D1 zSuXQo_?#bjgAv|SMMz4``&37VBkE;Zp?M52q_V#YF5wa`67>U@GG$ z%k#&`vXbY0L-Yt|KKahW-5ufQvw_uBR%86?f9&;$eM`b7O|dLHx%fn~JRAkwGkVj8 zQdxCM3*G~?xsx3-)zPtgQXTElzZ9Q`N#EJfe&ahCx}>)!%<@{VET6E+Jc<>@JCh=< z2T{TZN0tlA;&fCIfWW15zsu8$GH$`HhzJAmgf~Ta#qbxt#v!~x(%8F|NeW@+<}kys zq^2`^kHDWlrqFV3pTH{Di(d*7)ao+U6;7ub|g_AhHeUz=u(TZ=T&YeH4F$DCo!&DnT6wqW(l zFvsBrH-lYCG3TE`w+SMB;?IBxe6|LUu0bjTJ@0`0xa502dM1UEv7q)+6NP3UJ(~t= izMc*^c*r(Tg^PXu&cFM>4=-sg+K7J$BNGRc(Q*?32P9np literal 0 HcmV?d00001 diff --git a/ICSharpCode.TextEditorLinux/Resources/Java-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/Java-Mode.xshd new file mode 100644 index 000000000..913d16e95 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/Java-Mode.xshd @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + ~!%^*()-+=|\#/{}[]:;"'<> , .? + + + // + + + + /* + */ + + + + " + " + + + + ' + ' + + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ~!%^*()-+=|\#/{}[]:;"'<> , .? + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/JavaScript-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/JavaScript-Mode.xshd new file mode 100644 index 000000000..23a470802 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/JavaScript-Mode.xshd @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + =!><+-/*%&|^~.}{,;][?: + + + // + + + + /* + */ + + + + " + " + + + + ' + ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/Mode.xsd b/ICSharpCode.TextEditorLinux/Resources/Mode.xsd new file mode 100644 index 000000000..81a79dc62 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/Mode.xsd @@ -0,0 +1,295 @@ + + + + + This schema defines the syntax for mode definitions in SharpDevelop. + The schema can be simplified quite a bit but it does the job as is. + + + If you are using this file as a reference it is probably easiest to scroll to + the botton to find the definition of the root element called SyntaxDefinition and + then unwind the different type definitions and refernces. + + Note on coloring: + Many tags define how some symbol should be colored. If a specific symbol + can not be matched onto either a Span definition, Keyword, or a Digit/Number it + will be rendered in the current default color. Which is the default color of the + current span or the default color of the mode as a whole if no span has been entered. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/PHP-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/PHP-Mode.xshd new file mode 100644 index 000000000..39d5fa3ec --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/PHP-Mode.xshd @@ -0,0 +1,198 @@ + + + + + + + + + + ~!%^*()-+=|\#/{}[]:;"'<> , .? + + + # + + + + /// + + + + //@!/@ + + + + /* + */ + + + + " + " + + + + @@" + " + + + + ' + ' + + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ~!@%^*()-+=|\#/{}[]:;"'<> , .? + + + + + + + ~!@%^*()-+=|\#/{}[]:;"'<> , .? + + + < + > + + + + + + + + + ~!@%^*()-+=|\#/{}[]:;"'<> , .? + + + " + " + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/Patch-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/Patch-Mode.xshd new file mode 100644 index 000000000..1f7100e28 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/Patch-Mode.xshd @@ -0,0 +1,37 @@ + + + + + + + + ~!%^*()-+=|\#/{}[]:;"'<> , .? + + + Index: + + + == + + + --- + + + +++ + + + @@ + + + - + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/RightArrow.cur b/ICSharpCode.TextEditorLinux/Resources/RightArrow.cur new file mode 100644 index 0000000000000000000000000000000000000000..5691efbaf8997b9957eff92ce6b842edf232689a GIT binary patch literal 326 zcmb8pF%H5o5Jb^2NTfj`6`~_0rH_z~>*NS@TnmYUYmh3fJ17vtUlJ*G)_NZA%91Uu zl+-lRR#HyVo;-n(S|rxLrWl)fw>>utP6zIWcsFc9Ev+*;6zPZ^Dny^4&>^D+#UB>c h!0r2_C;OLO7?!jBu0|K~h9}B2`;cEaT=BqQ{{a3le&zrG literal 0 HcmV?d00001 diff --git a/ICSharpCode.TextEditorLinux/Resources/SyntaxModes.xml b/ICSharpCode.TextEditorLinux/Resources/SyntaxModes.xml new file mode 100644 index 000000000..e5cc72273 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/SyntaxModes.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/Tex-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/Tex-Mode.xshd new file mode 100644 index 000000000..91083b0ab --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/Tex-Mode.xshd @@ -0,0 +1,108 @@ + + + + + + + + + + &~!@%^*()-+=|\#/{}[]:;"'<> , .? + + + % + + + + $$ + $$ + + + \[ + \] + + + + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &~!@%^*()-+=|\#/{}[]:;"'<> , .? + + + + % + + + + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/TextEditorControl.bmp b/ICSharpCode.TextEditorLinux/Resources/TextEditorControl.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4bd828012d3d1d6ae8eb3b8e620b0e019a362950 GIT binary patch literal 824 zcmZ?rwP0od12Z700mK4O%*Y@C76%bR+z<>C_|Nd4rfB`D^~58fOMr_169+&lVd@ze z8i1N0egZO{w1hwqNU#AY3G^h`WSDv&mmokfA8ZK399YPK%tW>bSv^6+feMh-!_9#^ z8_oc^9_%}0^}l}oB4`D&dWf5WS|Fi;<`JMQntKQuj;tPN5s?TOUuZtX&m}`WPzy + + + + + + + + + + + + + + + + ~!@%^*()-+=|\#/{}[]:;"'<>,.? + + + " + " + + + + # + + + + # + # + + + + ' + + + + REM@C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ~!@%^*()-+=|\#/{}[]:;"'<>,.? + + + + + + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Resources/XML-Mode.xshd b/ICSharpCode.TextEditorLinux/Resources/XML-Mode.xshd new file mode 100644 index 000000000..56780483b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Resources/XML-Mode.xshd @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + <!-- + --> + + + <![CDATA[ + ]]> + + + <!DOCTYPE + > + + + <? + ?> + + + < + > + + + & + ; + + + + + /= + + " + " + + + ' + ' + + = + + + + + + + + + diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/BookmarkActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/BookmarkActions.cs new file mode 100644 index 000000000..e137d6a65 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/BookmarkActions.cs @@ -0,0 +1,78 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public class ToggleBookmark : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + textArea.Document.BookmarkManager.ToggleMarkAt(textArea.Caret.Line); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, textArea.Caret.Line)); + textArea.Document.CommitUpdate(); + + } + } + + public class GotoPrevBookmark : AbstractEditAction + { + Predicate predicate = null; + + public GotoPrevBookmark(Predicate predicate) + { + this.predicate = predicate; + } + + public override void Execute(TextArea textArea) + { + Bookmark mark = textArea.Document.BookmarkManager.GetPrevMark(textArea.Caret.Line, predicate); + if (mark != null) { + textArea.Caret.Line = mark.LineNumber; + textArea.SelectionManager.ClearSelection(); + } + } + } + + public class GotoNextBookmark : AbstractEditAction + { + Predicate predicate = null; + + public GotoNextBookmark(Predicate predicate) + { + this.predicate = predicate; + } + + public override void Execute(TextArea textArea) + { + Bookmark mark = textArea.Document.BookmarkManager.GetNextMark(textArea.Caret.Line, predicate); + if (mark != null) { + textArea.Caret.Line = mark.LineNumber; + textArea.SelectionManager.ClearSelection(); + } + } + } + + public class ClearAllBookmarks : AbstractEditAction + { + Predicate predicate = null; + + public ClearAllBookmarks(Predicate predicate) + { + this.predicate = predicate; + } + + public override void Execute(TextArea textArea) + { + textArea.Document.BookmarkManager.RemoveMarks(predicate); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + textArea.Document.CommitUpdate(); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/CaretActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/CaretActions.cs new file mode 100644 index 000000000..e7df851b0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/CaretActions.cs @@ -0,0 +1,203 @@ +// +// +// +// +// $Revision: 2681 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public class CaretLeft : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + TextLocation position = textArea.Caret.Position; + List foldings = textArea.Document.FoldingManager.GetFoldedFoldingsWithEnd(position.Y); + FoldMarker justBeforeCaret = null; + foreach (FoldMarker fm in foldings) { + if (fm.EndColumn == position.X) { + justBeforeCaret = fm; + break; // the first folding found is the folding with the smallest Startposition + } + } + + if (justBeforeCaret != null) { + position.Y = justBeforeCaret.StartLine; + position.X = justBeforeCaret.StartColumn; + } else { + if (position.X > 0) { + --position.X; + } else if (position.Y > 0) { + LineSegment lineAbove = textArea.Document.GetLineSegment(position.Y - 1); + position = new TextLocation(lineAbove.Length, position.Y - 1); + } + } + + textArea.Caret.Position = position; + textArea.SetDesiredColumn(); + } + } + + public class CaretRight : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + LineSegment curLine = textArea.Document.GetLineSegment(textArea.Caret.Line); + TextLocation position = textArea.Caret.Position; + List foldings = textArea.Document.FoldingManager.GetFoldedFoldingsWithStart(position.Y); + FoldMarker justBehindCaret = null; + foreach (FoldMarker fm in foldings) { + if (fm.StartColumn == position.X) { + justBehindCaret = fm; + break; + } + } + if (justBehindCaret != null) { + position.Y = justBehindCaret.EndLine; + position.X = justBehindCaret.EndColumn; + } else { // no folding is interesting + if (position.X < curLine.Length || textArea.TextEditorProperties.AllowCaretBeyondEOL) { + ++position.X; + } else if (position.Y + 1 < textArea.Document.TotalNumberOfLines) { + ++position.Y; + position.X = 0; + } + } + textArea.Caret.Position = position; + textArea.SetDesiredColumn(); + } + } + + public class CaretUp : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + TextLocation position = textArea.Caret.Position; + int lineNr = position.Y; + int visualLine = textArea.Document.GetVisibleLine(lineNr); + if (visualLine > 0) { + Point pos = new Point(textArea.TextView.GetDrawingXPos(lineNr, position.X), + textArea.TextView.DrawingPosition.Y + (visualLine - 1) * textArea.TextView.FontHeight - textArea.TextView.TextArea.VirtualTop.Y); + textArea.Caret.Position = textArea.TextView.GetLogicalPosition(pos); + textArea.SetCaretToDesiredColumn(); + } +// if (textArea.Caret.Line > 0) { +// textArea.SetCaretToDesiredColumn(textArea.Caret.Line - 1); +// } + } + } + + public class CaretDown : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + TextLocation position = textArea.Caret.Position; + int lineNr = position.Y; + int visualLine = textArea.Document.GetVisibleLine(lineNr); + if (visualLine < textArea.Document.GetVisibleLine(textArea.Document.TotalNumberOfLines)) { + Point pos = new Point(textArea.TextView.GetDrawingXPos(lineNr, position.X), + textArea.TextView.DrawingPosition.Y + + (visualLine + 1) * textArea.TextView.FontHeight + - textArea.TextView.TextArea.VirtualTop.Y); + textArea.Caret.Position = textArea.TextView.GetLogicalPosition(pos); + textArea.SetCaretToDesiredColumn(); + } +// if (textArea.Caret.Line + 1 < textArea.Document.TotalNumberOfLines) { +// textArea.SetCaretToDesiredColumn(textArea.Caret.Line + 1); +// } + } + } + + public class WordRight : CaretRight + { + public override void Execute(TextArea textArea) + { + LineSegment line = textArea.Document.GetLineSegment(textArea.Caret.Position.Y); + TextLocation oldPos = textArea.Caret.Position; + TextLocation newPos; + if (textArea.Caret.Column >= line.Length) { + newPos = new TextLocation(0, textArea.Caret.Line + 1); + } else { + int nextWordStart = TextUtilities.FindNextWordStart(textArea.Document, textArea.Caret.Offset); + newPos = textArea.Document.OffsetToPosition(nextWordStart); + } + + // handle fold markers + List foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(newPos.Y, newPos.X); + foreach (FoldMarker marker in foldings) { + if (marker.IsFolded) { + if (oldPos.X == marker.StartColumn && oldPos.Y == marker.StartLine) { + newPos = new TextLocation(marker.EndColumn, marker.EndLine); + } else { + newPos = new TextLocation(marker.StartColumn, marker.StartLine); + } + break; + } + } + + textArea.Caret.Position = newPos; + textArea.SetDesiredColumn(); + } + } + + public class WordLeft : CaretLeft + { + public override void Execute(TextArea textArea) + { + TextLocation oldPos = textArea.Caret.Position; + if (textArea.Caret.Column == 0) { + base.Execute(textArea); + } else { + LineSegment line = textArea.Document.GetLineSegment(textArea.Caret.Position.Y); + + int prevWordStart = TextUtilities.FindPrevWordStart(textArea.Document, textArea.Caret.Offset); + + TextLocation newPos = textArea.Document.OffsetToPosition(prevWordStart); + + // handle fold markers + List foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(newPos.Y, newPos.X); + foreach (FoldMarker marker in foldings) { + if (marker.IsFolded) { + if (oldPos.X == marker.EndColumn && oldPos.Y == marker.EndLine) { + newPos = new TextLocation(marker.StartColumn, marker.StartLine); + } else { + newPos = new TextLocation(marker.EndColumn, marker.EndLine); + } + break; + } + } + textArea.Caret.Position = newPos; + textArea.SetDesiredColumn(); + } + + + } + } + + public class ScrollLineUp : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + textArea.AutoClearSelection = false; + + textArea.MotherTextAreaControl.VScrollBar.Value = Math.Max(textArea.MotherTextAreaControl.VScrollBar.Minimum, + textArea.VirtualTop.Y - textArea.TextView.FontHeight); + } + } + + public class ScrollLineDown : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + textArea.AutoClearSelection = false; + textArea.MotherTextAreaControl.VScrollBar.Value = Math.Min(textArea.MotherTextAreaControl.VScrollBar.Maximum, + textArea.VirtualTop.Y + textArea.TextView.FontHeight); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/ClipBoardActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/ClipBoardActions.cs new file mode 100644 index 000000000..4e6f50eb0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/ClipBoardActions.cs @@ -0,0 +1,42 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Actions +{ + public class Cut : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + textArea.ClipboardHandler.Cut(null, null); + } + } + + public class Copy : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + textArea.AutoClearSelection = false; + textArea.ClipboardHandler.Copy(null, null); + } + } + + public class Paste : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + textArea.ClipboardHandler.Paste(null, null); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/FoldActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/FoldActions.cs new file mode 100644 index 000000000..8211ece1e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/FoldActions.cs @@ -0,0 +1,54 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Collections.Generic; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public class ToggleFolding : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + List foldMarkers = textArea.Document.FoldingManager.GetFoldingsWithStart(textArea.Caret.Line); + foreach (FoldMarker fm in foldMarkers) { + fm.IsFolded = !fm.IsFolded; + } + textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty); + } + } + + public class ToggleAllFoldings : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + bool doFold = true; + foreach (FoldMarker fm in textArea.Document.FoldingManager.FoldMarker) { + if (fm.IsFolded) { + doFold = false; + break; + } + } + foreach (FoldMarker fm in textArea.Document.FoldingManager.FoldMarker) { + fm.IsFolded = doFold; + } + textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty); + } + } + + public class ShowDefinitionsOnly : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + foreach (FoldMarker fm in textArea.Document.FoldingManager.FoldMarker) { + fm.IsFolded = fm.FoldType == FoldType.MemberBody || fm.FoldType == FoldType.Region; + } + textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/FormatActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/FormatActions.cs new file mode 100644 index 000000000..20eef6d2b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/FormatActions.cs @@ -0,0 +1,213 @@ +// +// +// +// +// $Revision: 2640 $ +// + +using System; +using System.Text; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public abstract class AbstractLineFormatAction : AbstractEditAction + { + protected TextArea textArea; + abstract protected void Convert(IDocument document, int startLine, int endLine); + + public override void Execute(TextArea textArea) + { + this.textArea = textArea; + textArea.BeginUpdate(); + textArea.Document.UndoStack.StartUndoGroup(); + if (textArea.SelectionManager.HasSomethingSelected) { + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + Convert(textArea.Document, selection.StartPosition.Y, selection.EndPosition.Y); + } + } else { + Convert(textArea.Document, 0, textArea.Document.TotalNumberOfLines - 1); + } + textArea.Document.UndoStack.EndUndoGroup(); + textArea.Caret.ValidateCaretPos(); + textArea.EndUpdate(); + textArea.Refresh(); + } + } + + public abstract class AbstractSelectionFormatAction : AbstractEditAction + { + protected TextArea textArea; + abstract protected void Convert(IDocument document, int offset, int length); + + public override void Execute(TextArea textArea) + { + this.textArea = textArea; + textArea.BeginUpdate(); + if (textArea.SelectionManager.HasSomethingSelected) { + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + Convert(textArea.Document, selection.Offset, selection.Length); + } + } else { + Convert(textArea.Document, 0, textArea.Document.TextLength); + } + textArea.Caret.ValidateCaretPos(); + textArea.EndUpdate(); + textArea.Refresh(); + } + } + + public class RemoveLeadingWS : AbstractLineFormatAction + { + protected override void Convert(IDocument document, int y1, int y2) + { + for (int i = y1; i < y2; ++i) { + LineSegment line = document.GetLineSegment(i); + int removeNumber = 0; + for (int x = line.Offset; x < line.Offset + line.Length && Char.IsWhiteSpace(document.GetCharAt(x)); ++x) { + ++removeNumber; + } + if (removeNumber > 0) { + document.Remove(line.Offset, removeNumber); + } + } + } + } + + public class RemoveTrailingWS : AbstractLineFormatAction + { + protected override void Convert(IDocument document, int y1, int y2) + { + for (int i = y2 - 1; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + int removeNumber = 0; + for (int x = line.Offset + line.Length - 1; x >= line.Offset && Char.IsWhiteSpace(document.GetCharAt(x)); --x) { + ++removeNumber; + } + if (removeNumber > 0) { + document.Remove(line.Offset + line.Length - removeNumber, removeNumber); + } + } + } + } + + + public class ToUpperCase : AbstractSelectionFormatAction + { + protected override void Convert(IDocument document, int startOffset, int length) + { + string what = document.GetText(startOffset, length).ToUpper(); + document.Replace(startOffset, length, what); + } + } + + public class ToLowerCase : AbstractSelectionFormatAction + { + protected override void Convert(IDocument document, int startOffset, int length) + { + string what = document.GetText(startOffset, length).ToLower(); + document.Replace(startOffset, length, what); + } + } + + public class InvertCaseAction : AbstractSelectionFormatAction + { + protected override void Convert(IDocument document, int startOffset, int length) + { + StringBuilder what = new StringBuilder(document.GetText(startOffset, length)); + + for (int i = 0; i < what.Length; ++i) { + what[i] = Char.IsUpper(what[i]) ? Char.ToLower(what[i]) : Char.ToUpper(what[i]); + } + + document.Replace(startOffset, length, what.ToString()); + } + } + + public class CapitalizeAction : AbstractSelectionFormatAction + { + protected override void Convert(IDocument document, int startOffset, int length) + { + StringBuilder what = new StringBuilder(document.GetText(startOffset, length)); + + for (int i = 0; i < what.Length; ++i) { + if (!Char.IsLetter(what[i]) && i < what.Length - 1) { + what[i + 1] = Char.ToUpper(what[i + 1]); + } + } + document.Replace(startOffset, length, what.ToString()); + } + + } + + public class ConvertTabsToSpaces : AbstractSelectionFormatAction + { + protected override void Convert(IDocument document, int startOffset, int length) + { + string what = document.GetText(startOffset, length); + string spaces = new string(' ', document.TextEditorProperties.TabIndent); + document.Replace(startOffset, length, what.Replace("\t", spaces)); + } + } + + public class ConvertSpacesToTabs : AbstractSelectionFormatAction + { + protected override void Convert(IDocument document, int startOffset, int length) + { + string what = document.GetText(startOffset, length); + string spaces = new string(' ', document.TextEditorProperties.TabIndent); + document.Replace(startOffset, length, what.Replace(spaces, "\t")); + } + } + + public class ConvertLeadingTabsToSpaces : AbstractLineFormatAction + { + protected override void Convert(IDocument document, int y1, int y2) + { + for (int i = y2; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + + if(line.Length > 0) { + // count how many whitespace characters there are at the start + int whiteSpace = 0; + for(whiteSpace = 0; whiteSpace < line.Length && Char.IsWhiteSpace(document.GetCharAt(line.Offset + whiteSpace)); whiteSpace++) { + // deliberately empty + } + if(whiteSpace > 0) { + string newLine = document.GetText(line.Offset,whiteSpace); + string newPrefix = newLine.Replace("\t",new string(' ', document.TextEditorProperties.TabIndent)); + document.Replace(line.Offset,whiteSpace,newPrefix); + } + } + } + } + } + + public class ConvertLeadingSpacesToTabs : AbstractLineFormatAction + { + protected override void Convert(IDocument document, int y1, int y2) + { + for (int i = y2; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + if(line.Length > 0) { + // note: some users may prefer a more radical ConvertLeadingSpacesToTabs that + // means there can be no spaces before the first character even if the spaces + // didn't add up to a whole number of tabs + string newLine = TextUtilities.LeadingWhiteSpaceToTabs(document.GetText(line.Offset,line.Length), document.TextEditorProperties.TabIndent); + document.Replace(line.Offset,line.Length,newLine); + } + } + } + } + + /// + /// This is a sample editaction plugin, it indents the selected area. + /// + public class FormatBuffer : AbstractLineFormatAction + { + protected override void Convert(IDocument document, int startLine, int endLine) + { + document.FormattingStrategy.IndentLines(textArea, startLine, endLine); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/HomeEndActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/HomeEndActions.cs new file mode 100644 index 000000000..87e72bb78 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/HomeEndActions.cs @@ -0,0 +1,114 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public class Home : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + LineSegment curLine; + TextLocation newPos = textArea.Caret.Position; + bool jumpedIntoFolding = false; + do { + curLine = textArea.Document.GetLineSegment(newPos.Y); + + if (TextUtilities.IsEmptyLine(textArea.Document, newPos.Y)) { + if (newPos.X != 0) { + newPos.X = 0; + } else { + newPos.X = curLine.Length; + } + } else { + int firstCharOffset = TextUtilities.GetFirstNonWSChar(textArea.Document, curLine.Offset); + int firstCharColumn = firstCharOffset - curLine.Offset; + + if (newPos.X == firstCharColumn) { + newPos.X = 0; + } else { + newPos.X = firstCharColumn; + } + } + List foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(newPos.Y, newPos.X); + jumpedIntoFolding = false; + foreach (FoldMarker foldMarker in foldings) { + if (foldMarker.IsFolded) { + newPos = new TextLocation(foldMarker.StartColumn, foldMarker.StartLine); + jumpedIntoFolding = true; + break; + } + } + + } while (jumpedIntoFolding); + + if (newPos != textArea.Caret.Position) { + textArea.Caret.Position = newPos; + textArea.SetDesiredColumn(); + } + } + } + + public class End : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + LineSegment curLine; + TextLocation newPos = textArea.Caret.Position; + bool jumpedIntoFolding = false; + do { + curLine = textArea.Document.GetLineSegment(newPos.Y); + newPos.X = curLine.Length; + + List foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(newPos.Y, newPos.X); + jumpedIntoFolding = false; + foreach (FoldMarker foldMarker in foldings) { + if (foldMarker.IsFolded) { + newPos = new TextLocation(foldMarker.EndColumn, foldMarker.EndLine); + jumpedIntoFolding = true; + break; + } + } + } while (jumpedIntoFolding); + + if (newPos != textArea.Caret.Position) { + textArea.Caret.Position = newPos; + textArea.SetDesiredColumn(); + } + } + } + + + public class MoveToStart : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + if (textArea.Caret.Line != 0 || textArea.Caret.Column != 0) { + textArea.Caret.Position = new TextLocation(0, 0); + textArea.SetDesiredColumn(); + } + } + } + + + public class MoveToEnd : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + TextLocation endPos = textArea.Document.OffsetToPosition(textArea.Document.TextLength); + if (textArea.Caret.Position != endPos) { + textArea.Caret.Position = endPos; + textArea.SetDesiredColumn(); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/IEditAction.cs b/ICSharpCode.TextEditorLinux/Src/Actions/IEditAction.cs new file mode 100644 index 000000000..d7a75afee --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/IEditAction.cs @@ -0,0 +1,58 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Actions +{ + /// + /// To define a new key for the textarea, you must write a class which + /// implements this interface. + /// + public interface IEditAction + { + /// + /// An array of keys on which this edit action occurs. + /// + Keys[] Keys { + get; + set; + } + + /// + /// When the key which is defined per XML is pressed, this method will be launched. + /// + void Execute(TextArea textArea); + } + + /// + /// To define a new key for the textarea, you must write a class which + /// implements this interface. + /// + public abstract class AbstractEditAction : IEditAction + { + Keys[] keys = null; + + /// + /// An array of keys on which this edit action occurs. + /// + public Keys[] Keys { + get { + return keys; + } + set { + keys = value; + } + } + + /// + /// When the key which is defined per XML is pressed, this method will be launched. + /// + public abstract void Execute(TextArea textArea); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/MiscActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/MiscActions.cs new file mode 100644 index 000000000..0cbc226de --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/MiscActions.cs @@ -0,0 +1,926 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; +using System.Text; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public class Tab : AbstractEditAction + { + public static string GetIndentationString(IDocument document) + { + return GetIndentationString(document, null); + } + + public static string GetIndentationString(IDocument document, TextArea textArea) + { + StringBuilder indent = new StringBuilder(); + + if (document.TextEditorProperties.ConvertTabsToSpaces) { + int tabIndent = document.TextEditorProperties.IndentationSize; + if (textArea != null) { + int column = textArea.TextView.GetVisualColumn(textArea.Caret.Line, textArea.Caret.Column); + indent.Append(new String(' ', tabIndent - column % tabIndent)); + } else { + indent.Append(new String(' ', tabIndent)); + } + } else { + indent.Append('\t'); + } + return indent.ToString(); + } + + void InsertTabs(IDocument document, ISelection selection, int y1, int y2) + { + string indentationString = GetIndentationString(document); + for (int i = y2; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + if (i == y2 && i == selection.EndPosition.Y && selection.EndPosition.X == 0) { + continue; + } + + // this bit is optional - but useful if you are using block tabbing to sort out + // a source file with a mixture of tabs and spaces +// string newLine = document.GetText(line.Offset,line.Length); +// document.Replace(line.Offset,line.Length,newLine); + + document.Insert(line.Offset, indentationString); + } + } + + void InsertTabAtCaretPosition(TextArea textArea) + { + switch (textArea.Caret.CaretMode) { + case CaretMode.InsertMode: + textArea.InsertString(GetIndentationString(textArea.Document, textArea)); + break; + case CaretMode.OverwriteMode: + string indentStr = GetIndentationString(textArea.Document, textArea); + textArea.ReplaceChar(indentStr[0]); + if (indentStr.Length > 1) { + textArea.InsertString(indentStr.Substring(1)); + } + break; + } + textArea.SetDesiredColumn(); + } + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + textArea.Document.UndoStack.StartUndoGroup(); + if (textArea.SelectionManager.HasSomethingSelected) { + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + int startLine = selection.StartPosition.Y; + int endLine = selection.EndPosition.Y; + if (startLine != endLine) { + textArea.BeginUpdate(); + InsertTabs(textArea.Document, selection, startLine, endLine); + textArea.Document.UpdateQueue.Clear(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine, endLine)); + textArea.EndUpdate(); + } else { + InsertTabAtCaretPosition(textArea); + break; + } + } + textArea.Document.CommitUpdate(); + textArea.AutoClearSelection = false; + } else { + InsertTabAtCaretPosition(textArea); + } + textArea.Document.UndoStack.EndUndoGroup(); + } + } + + public class ShiftTab : AbstractEditAction + { + void RemoveTabs(IDocument document, ISelection selection, int y1, int y2) + { + document.UndoStack.StartUndoGroup(); + for (int i = y2; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + if (i == y2 && line.Offset == selection.EndOffset) { + continue; + } + if (line.Length > 0) { + /**** TextPad Strategy: + /// first convert leading whitespace to tabs (controversial! - not all editors work like this) + string newLine = TextUtilities.LeadingWhiteSpaceToTabs(document.GetText(line.Offset,line.Length),document.Properties.Get("TabIndent", 4)); + if(newLine.Length > 0 && newLine[0] == '\t') { + document.Replace(line.Offset,line.Length,newLine.Substring(1)); + ++redocounter; + } + else if(newLine.Length > 0 && newLine[0] == ' ') { + /// there were just some leading spaces but less than TabIndent of them + int leadingSpaces = 1; + for(leadingSpaces = 1; leadingSpaces < newLine.Length && newLine[leadingSpaces] == ' '; leadingSpaces++) { + /// deliberately empty + } + document.Replace(line.Offset,line.Length,newLine.Substring(leadingSpaces)); + ++redocounter; + } + /// else + /// there were no leading tabs or spaces on this line so do nothing + /// MS Visual Studio 6 strategy: + ****/ +// string temp = document.GetText(line.Offset,line.Length); + if (line.Length > 0) { + int charactersToRemove = 0; + if(document.GetCharAt(line.Offset) == '\t') { // first character is a tab - just remove it + charactersToRemove = 1; + } else if(document.GetCharAt(line.Offset) == ' ') { + int leadingSpaces = 1; + int tabIndent = document.TextEditorProperties.IndentationSize; + for (leadingSpaces = 1; leadingSpaces < line.Length && document.GetCharAt(line.Offset + leadingSpaces) == ' '; leadingSpaces++) { + // deliberately empty + } + + if(leadingSpaces >= tabIndent) { + // just remove tabIndent + charactersToRemove = tabIndent; + + } + else if(line.Length > leadingSpaces && document.GetCharAt(line.Offset + leadingSpaces) == '\t') { + // remove the leading spaces and the following tab as they add up + // to just one tab stop + charactersToRemove = leadingSpaces+1; + } + else { + // just remove the leading spaces + charactersToRemove = leadingSpaces; + } + } + if (charactersToRemove > 0) { + document.Remove(line.Offset,charactersToRemove); + } + } + } + } + document.UndoStack.EndUndoGroup(); + } + + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.SelectionManager.HasSomethingSelected) { + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + int startLine = selection.StartPosition.Y; + int endLine = selection.EndPosition.Y; + textArea.BeginUpdate(); + RemoveTabs(textArea.Document, selection, startLine, endLine); + textArea.Document.UpdateQueue.Clear(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine, endLine)); + textArea.EndUpdate(); + + } + textArea.AutoClearSelection = false; + } else { + // Pressing Shift-Tab with nothing selected the cursor will move back to the + // previous tab stop. It will stop at the beginning of the line. Also, the desired + // column is updated to that column. + LineSegment line = textArea.Document.GetLineSegmentForOffset(textArea.Caret.Offset); + string startOfLine = textArea.Document.GetText(line.Offset,textArea.Caret.Offset - line.Offset); + int tabIndent = textArea.Document.TextEditorProperties.IndentationSize; + int currentColumn = textArea.Caret.Column; + int remainder = currentColumn % tabIndent; + if (remainder == 0) { + textArea.Caret.DesiredColumn = Math.Max(0, currentColumn - tabIndent); + } else { + textArea.Caret.DesiredColumn = Math.Max(0, currentColumn - remainder); + } + textArea.SetCaretToDesiredColumn(); + } + } + } + + public class ToggleComment : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + + if (textArea.Document.HighlightingStrategy.Properties.ContainsKey("LineComment")) { + new ToggleLineComment().Execute(textArea); + } else if (textArea.Document.HighlightingStrategy.Properties.ContainsKey("BlockCommentBegin") && + textArea.Document.HighlightingStrategy.Properties.ContainsKey("BlockCommentBegin")) { + new ToggleBlockComment().Execute(textArea); + } + } + } + + public class ToggleLineComment : AbstractEditAction + { + int firstLine; + int lastLine; + + void RemoveCommentAt(IDocument document, string comment, ISelection selection, int y1, int y2) + { + firstLine = y1; + lastLine = y2; + + for (int i = y2; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + if (selection != null && i == y2 && line.Offset == selection.Offset + selection.Length) { + --lastLine; + continue; + } + + string lineText = document.GetText(line.Offset, line.Length); + if (lineText.Trim().StartsWith(comment)) { + document.Remove(line.Offset + lineText.IndexOf(comment), comment.Length); + } + } + } + + void SetCommentAt(IDocument document, string comment, ISelection selection, int y1, int y2) + { + firstLine = y1; + lastLine = y2; + + for (int i = y2; i >= y1; --i) { + LineSegment line = document.GetLineSegment(i); + if (selection != null && i == y2 && line.Offset == selection.Offset + selection.Length) { + --lastLine; + continue; + } + + string lineText = document.GetText(line.Offset, line.Length); + document.Insert(line.Offset, comment); + } + } + + bool ShouldComment(IDocument document, string comment, ISelection selection, int startLine, int endLine) + { + for (int i = endLine; i >= startLine; --i) { + LineSegment line = document.GetLineSegment(i); + if (selection != null && i == endLine && line.Offset == selection.Offset + selection.Length) { + --lastLine; + continue; + } + string lineText = document.GetText(line.Offset, line.Length); + if (!lineText.Trim().StartsWith(comment)) { + return true; + } + } + return false; + } + + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + + string comment = null; + if (textArea.Document.HighlightingStrategy.Properties.ContainsKey("LineComment")) { + comment = textArea.Document.HighlightingStrategy.Properties["LineComment"].ToString(); + } + + if (comment == null || comment.Length == 0) { + return; + } + + textArea.Document.UndoStack.StartUndoGroup(); + if (textArea.SelectionManager.HasSomethingSelected) { + bool shouldComment = true; + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + if (!ShouldComment(textArea.Document, comment, selection, selection.StartPosition.Y, selection.EndPosition.Y)) { + shouldComment = false; + break; + } + } + + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + textArea.BeginUpdate(); + if (shouldComment) { + SetCommentAt(textArea.Document, comment, selection, selection.StartPosition.Y, selection.EndPosition.Y); + } else { + RemoveCommentAt(textArea.Document, comment, selection, selection.StartPosition.Y, selection.EndPosition.Y); + } + textArea.Document.UpdateQueue.Clear(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, firstLine, lastLine)); + textArea.EndUpdate(); + } + textArea.Document.CommitUpdate(); + textArea.AutoClearSelection = false; + } else { + textArea.BeginUpdate(); + int caretLine = textArea.Caret.Line; + if (ShouldComment(textArea.Document, comment, null, caretLine, caretLine)) { + SetCommentAt(textArea.Document, comment, null, caretLine, caretLine); + } else { + RemoveCommentAt(textArea.Document, comment, null, caretLine, caretLine); + } + textArea.Document.UpdateQueue.Clear(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, caretLine)); + textArea.EndUpdate(); + } + textArea.Document.UndoStack.EndUndoGroup(); + } + } + + public class ToggleBlockComment : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + + string commentStart = null; + if (textArea.Document.HighlightingStrategy.Properties.ContainsKey("BlockCommentBegin")) { + commentStart = textArea.Document.HighlightingStrategy.Properties["BlockCommentBegin"].ToString(); + } + + string commentEnd = null; + if (textArea.Document.HighlightingStrategy.Properties.ContainsKey("BlockCommentEnd")) { + commentEnd = textArea.Document.HighlightingStrategy.Properties["BlockCommentEnd"].ToString(); + } + + if (commentStart == null || commentStart.Length == 0 || commentEnd == null || commentEnd.Length == 0) { + return; + } + + int selectionStartOffset; + int selectionEndOffset; + + if (textArea.SelectionManager.HasSomethingSelected) { + selectionStartOffset = textArea.SelectionManager.SelectionCollection[0].Offset; + selectionEndOffset = textArea.SelectionManager.SelectionCollection[textArea.SelectionManager.SelectionCollection.Count - 1].EndOffset; + } else { + selectionStartOffset = textArea.Caret.Offset; + selectionEndOffset = selectionStartOffset; + } + + BlockCommentRegion commentRegion = FindSelectedCommentRegion(textArea.Document, commentStart, commentEnd, selectionStartOffset, selectionEndOffset); + + textArea.Document.UndoStack.StartUndoGroup(); + if (commentRegion != null) { + RemoveComment(textArea.Document, commentRegion); + } else if (textArea.SelectionManager.HasSomethingSelected) { + SetCommentAt(textArea.Document, selectionStartOffset, selectionEndOffset, commentStart, commentEnd); + } + textArea.Document.UndoStack.EndUndoGroup(); + + textArea.Document.CommitUpdate(); + textArea.AutoClearSelection = false; + } + + public static BlockCommentRegion FindSelectedCommentRegion(IDocument document, string commentStart, string commentEnd, int selectionStartOffset, int selectionEndOffset) + { + if (document.TextLength == 0) { + return null; + } + + // Find start of comment in selected text. + + int commentEndOffset = -1; + string selectedText = document.GetText(selectionStartOffset, selectionEndOffset - selectionStartOffset); + + int commentStartOffset = selectedText.IndexOf(commentStart); + if (commentStartOffset >= 0) { + commentStartOffset += selectionStartOffset; + } + + // Find end of comment in selected text. + + if (commentStartOffset >= 0) { + commentEndOffset = selectedText.IndexOf(commentEnd, commentStartOffset + commentStart.Length - selectionStartOffset); + } else { + commentEndOffset = selectedText.IndexOf(commentEnd); + } + + if (commentEndOffset >= 0) { + commentEndOffset += selectionStartOffset; + } + + // Find start of comment before or partially inside the + // selected text. + + int commentEndBeforeStartOffset = -1; + if (commentStartOffset == -1) { + int offset = selectionEndOffset + commentStart.Length - 1; + if (offset > document.TextLength) { + offset = document.TextLength; + } + string text = document.GetText(0, offset); + commentStartOffset = text.LastIndexOf(commentStart); + if (commentStartOffset >= 0) { + // Find end of comment before comment start. + commentEndBeforeStartOffset = text.IndexOf(commentEnd, commentStartOffset, selectionStartOffset - commentStartOffset); + if (commentEndBeforeStartOffset > commentStartOffset) { + commentStartOffset = -1; + } + } + } + + // Find end of comment after or partially after the + // selected text. + + if (commentEndOffset == -1) { + int offset = selectionStartOffset + 1 - commentEnd.Length; + if (offset < 0) { + offset = selectionStartOffset; + } + string text = document.GetText(offset, document.TextLength - offset); + commentEndOffset = text.IndexOf(commentEnd); + if (commentEndOffset >= 0) { + commentEndOffset += offset; + } + } + + if (commentStartOffset != -1 && commentEndOffset != -1) { + return new BlockCommentRegion(commentStart, commentEnd, commentStartOffset, commentEndOffset); + } + + return null; + } + + + void SetCommentAt(IDocument document, int offsetStart, int offsetEnd, string commentStart, string commentEnd) + { + document.Insert(offsetEnd, commentEnd); + document.Insert(offsetStart, commentStart); + } + + void RemoveComment(IDocument document, BlockCommentRegion commentRegion) + { + document.Remove(commentRegion.EndOffset, commentRegion.CommentEnd.Length); + document.Remove(commentRegion.StartOffset, commentRegion.CommentStart.Length); + } + } + + public class BlockCommentRegion + { + string commentStart = String.Empty; + string commentEnd = String.Empty; + int startOffset = -1; + int endOffset = -1; + + /// + /// The end offset is the offset where the comment end string starts from. + /// + public BlockCommentRegion(string commentStart, string commentEnd, int startOffset, int endOffset) + { + this.commentStart = commentStart; + this.commentEnd = commentEnd; + this.startOffset = startOffset; + this.endOffset = endOffset; + } + + public string CommentStart { + get { + return commentStart; + } + } + + public string CommentEnd { + get { + return commentEnd; + } + } + + public int StartOffset { + get { + return startOffset; + } + } + + public int EndOffset { + get { + return endOffset; + } + } + + public override bool Equals(object obj) + { + BlockCommentRegion commentRegion = obj as BlockCommentRegion; + if (commentRegion != null) { + if (commentRegion.commentStart == commentStart && + commentRegion.commentEnd == commentEnd && + commentRegion.startOffset == startOffset && + commentRegion.endOffset == endOffset) { + return true; + } + } + + return false; + } + + public override int GetHashCode() + { + return commentStart.GetHashCode() & commentEnd.GetHashCode() & startOffset.GetHashCode() & endOffset.GetHashCode(); + } + } + + public class IndentSelection : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + textArea.BeginUpdate(); + if (textArea.SelectionManager.HasSomethingSelected) { + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + textArea.Document.FormattingStrategy.IndentLines(textArea, selection.StartPosition.Y, selection.EndPosition.Y); + } + } else { + textArea.Document.FormattingStrategy.IndentLines(textArea, 0, textArea.Document.TotalNumberOfLines - 1); + } + textArea.EndUpdate(); + textArea.Refresh(); + } + } + + public class Backspace : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + if (textArea.SelectionManager.HasSomethingSelected) { + textArea.BeginUpdate(); + textArea.Caret.Position = textArea.SelectionManager.SelectionCollection[0].StartPosition; + textArea.SelectionManager.RemoveSelectedText(); + textArea.ScrollToCaret(); + textArea.EndUpdate(); + } else { + if (textArea.Caret.Offset > 0) { + textArea.BeginUpdate(); + int curLineNr = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); + int curLineOffset = textArea.Document.GetLineSegment(curLineNr).Offset; + + if (curLineOffset == textArea.Caret.Offset) { + LineSegment line = textArea.Document.GetLineSegment(curLineNr - 1); + bool lastLine = curLineNr == textArea.Document.TotalNumberOfLines; + int lineEndOffset = line.Offset + line.Length; + int lineLength = line.Length; + textArea.Document.Remove(lineEndOffset, curLineOffset - lineEndOffset); + textArea.Caret.Position = new TextLocation(lineLength, curLineNr - 1); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, curLineNr - 1))); + textArea.EndUpdate(); + } else { + int caretOffset = textArea.Caret.Offset - 1; + textArea.Caret.Position = textArea.Document.OffsetToPosition(caretOffset); + textArea.Document.Remove(caretOffset, 1); + + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToLineEnd, new TextLocation(textArea.Caret.Offset - textArea.Document.GetLineSegment(curLineNr).Offset, curLineNr))); + textArea.EndUpdate(); + } + } + } + } + } + + public class Delete : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + if (textArea.SelectionManager.HasSomethingSelected) { + textArea.BeginUpdate(); + textArea.Caret.Position = textArea.SelectionManager.SelectionCollection[0].StartPosition; + textArea.SelectionManager.RemoveSelectedText(); + textArea.ScrollToCaret(); + textArea.EndUpdate(); + } else { + + if (textArea.Caret.Offset < textArea.Document.TextLength) { + textArea.BeginUpdate(); + int curLineNr = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); + LineSegment curLine = textArea.Document.GetLineSegment(curLineNr); + + if (curLine.Offset + curLine.Length == textArea.Caret.Offset) { + if (curLineNr + 1 < textArea.Document.TotalNumberOfLines) { + LineSegment nextLine = textArea.Document.GetLineSegment(curLineNr + 1); + + textArea.Document.Remove(textArea.Caret.Offset, nextLine.Offset - textArea.Caret.Offset); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, curLineNr))); + } + } else { + textArea.Document.Remove(textArea.Caret.Offset, 1); +// textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToLineEnd, new TextLocation(textArea.Caret.Offset - textArea.Document.GetLineSegment(curLineNr).Offset, curLineNr))); + } + textArea.UpdateMatchingBracket(); + textArea.EndUpdate(); + } + } + } + } + + public class MovePageDown : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + int curLineNr = textArea.Caret.Line; + int requestedLineNumber = Math.Min(textArea.Document.GetNextVisibleLineAbove(curLineNr, textArea.TextView.VisibleLineCount), textArea.Document.TotalNumberOfLines - 1); + + if (curLineNr != requestedLineNumber) { + textArea.Caret.Position = new TextLocation(textArea.Caret.DesiredColumn, requestedLineNumber); + } + } + } + + public class MovePageUp : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + int curLineNr = textArea.Caret.Line; + int requestedLineNumber = Math.Max(textArea.Document.GetNextVisibleLineBelow(curLineNr, textArea.TextView.VisibleLineCount), 0); + + if (curLineNr != requestedLineNumber) { + textArea.Caret.Position = new TextLocation(textArea.Caret.DesiredColumn, requestedLineNumber); + } + } + } + public class Return : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + textArea.BeginUpdate(); + textArea.Document.UndoStack.StartUndoGroup(); + try { + if (textArea.HandleKeyPress('\n')) + { + textArea.Document.UndoStack.EndUndoGroup(); + return; + } + textArea.InsertString(Environment.NewLine); + + int curLineNr = textArea.Caret.Line; + textArea.Document.FormattingStrategy.FormatLine(textArea, curLineNr, textArea.Caret.Offset, '\n'); + textArea.SetDesiredColumn(); + + textArea.Document.UpdateQueue.Clear(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, curLineNr - 1))); + } finally { + textArea.Document.UndoStack.EndUndoGroup(); + textArea.EndUpdate(); + } + } + } + + public class ToggleEditMode : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + if (textArea.Document.ReadOnly) { + return; + } + switch (textArea.Caret.CaretMode) { + case CaretMode.InsertMode: + textArea.Caret.CaretMode = CaretMode.OverwriteMode; + break; + case CaretMode.OverwriteMode: + textArea.Caret.CaretMode = CaretMode.InsertMode; + break; + } + } + } + + public class Undo : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + textArea.MotherTextEditorControl.Undo(); + } + } + + public class Redo : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + textArea.MotherTextEditorControl.Redo(); + } + } + + /// + /// handles the ctrl-backspace key + /// functionality attempts to roughly mimic MS Developer studio + /// I will implement this as deleting back to the point that ctrl-leftarrow would + /// take you to + /// + public class WordBackspace : AbstractEditAction + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + // if anything is selected we will just delete it first + textArea.BeginUpdate(); + if (textArea.SelectionManager.HasSomethingSelected) { + textArea.SelectionManager.RemoveSelectedText(); + textArea.ScrollToCaret(); + } + // now delete from the caret to the beginning of the word + LineSegment line = + textArea.Document.GetLineSegmentForOffset(textArea.Caret.Offset); + // if we are not at the beginning of a line + if(textArea.Caret.Offset > line.Offset) { + int prevWordStart = TextUtilities.FindPrevWordStart(textArea.Document, + textArea.Caret.Offset); + if(prevWordStart < textArea.Caret.Offset) { + textArea.Document.Remove(prevWordStart,textArea.Caret.Offset - + prevWordStart); + textArea.Caret.Position = textArea.Document.OffsetToPosition(prevWordStart); + } + } + // if we are now at the beginning of a line + if(textArea.Caret.Offset == line.Offset) { + // if we are not on the first line + int curLineNr = + textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); + if(curLineNr > 0) { + // move to the end of the line above + LineSegment lineAbove = textArea.Document.GetLineSegment(curLineNr - + 1); + int endOfLineAbove = lineAbove.Offset + lineAbove.Length; + int charsToDelete = textArea.Caret.Offset - endOfLineAbove; + textArea.Document.Remove(endOfLineAbove,charsToDelete); + textArea.Caret.Position = textArea.Document.OffsetToPosition(endOfLineAbove); + } + } + textArea.SetDesiredColumn(); + textArea.EndUpdate(); + // if there are now less lines, we need this or there are redraw problems + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset)))); + textArea.Document.CommitUpdate(); + } + } + + /// + /// handles the ctrl-delete key + /// functionality attempts to mimic MS Developer studio + /// I will implement this as deleting forwardto the point that + /// ctrl-leftarrow would take you to + /// + public class DeleteWord : Delete + { + /// + /// Executes this edit action + /// + /// The which is used for callback purposes + public override void Execute(TextArea textArea) + { + // if anything is selected we will just delete it first + textArea.BeginUpdate(); + if (textArea.SelectionManager.HasSomethingSelected) { + textArea.SelectionManager.RemoveSelectedText(); + textArea.ScrollToCaret(); + } + // now delete from the caret to the beginning of the word + LineSegment line = + textArea.Document.GetLineSegmentForOffset(textArea.Caret.Offset); + if(textArea.Caret.Offset == line.Offset + line.Length) { + // if we are at the end of a line + base.Execute(textArea); + } else { + int nextWordStart = TextUtilities.FindNextWordStart(textArea.Document, + textArea.Caret.Offset); + if(nextWordStart > textArea.Caret.Offset) { + textArea.Document.Remove(textArea.Caret.Offset,nextWordStart - + textArea.Caret.Offset); + // cursor never moves with this command + } + } + textArea.UpdateMatchingBracket(); + textArea.EndUpdate(); + // if there are now less lines, we need this or there are redraw problems + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset)))); + textArea.Document.CommitUpdate(); + } + } + + public class DeleteLine : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + int lineNr = textArea.Caret.Line; + LineSegment line = textArea.Document.GetLineSegment(lineNr); + textArea.Document.Remove(line.Offset, line.TotalLength); + textArea.Caret.Position = textArea.Document.OffsetToPosition(line.Offset); + + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, lineNr))); + textArea.UpdateMatchingBracket(); + textArea.Document.CommitUpdate(); + } + } + + public class DeleteToLineEnd : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + int lineNr = textArea.Caret.Line; + LineSegment line = textArea.Document.GetLineSegment(lineNr); + + int numRemove = (line.Offset + line.Length) - textArea.Caret.Offset; + if (numRemove > 0) { + textArea.Document.Remove(textArea.Caret.Offset, numRemove); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, new TextLocation(0, lineNr))); + textArea.Document.CommitUpdate(); + } + } + } + + public class GotoMatchingBrace : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + Highlight highlight = textArea.FindMatchingBracketHighlight(); + if (highlight != null) { + TextLocation p1 = new TextLocation(highlight.CloseBrace.X + 1, highlight.CloseBrace.Y); + TextLocation p2 = new TextLocation(highlight.OpenBrace.X + 1, highlight.OpenBrace.Y); + if (p1 == textArea.Caret.Position) { + if (textArea.Document.TextEditorProperties.BracketMatchingStyle == BracketMatchingStyle.After) { + textArea.Caret.Position = p2; + } else { + textArea.Caret.Position = new TextLocation(p2.X - 1, p2.Y); + } + } else { + if (textArea.Document.TextEditorProperties.BracketMatchingStyle == BracketMatchingStyle.After) { + textArea.Caret.Position = p1; + } else { + textArea.Caret.Position = new TextLocation(p1.X - 1, p1.Y); + } + } + textArea.SetDesiredColumn(); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Actions/SelectionActions.cs b/ICSharpCode.TextEditorLinux/Src/Actions/SelectionActions.cs new file mode 100644 index 000000000..9a0565b19 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Actions/SelectionActions.cs @@ -0,0 +1,176 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Actions +{ + public class ShiftCaretRight : CaretRight + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftCaretLeft : CaretLeft + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftCaretUp : CaretUp + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftCaretDown : CaretDown + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftWordRight : WordRight + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftWordLeft : WordLeft + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftHome : Home + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftEnd : End + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftMoveToStart : MoveToStart + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftMoveToEnd : MoveToEnd + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftMovePageUp : MovePageUp + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class ShiftMovePageDown : MovePageDown + { + public override void Execute(TextArea textArea) + { + TextLocation oldCaretPos = textArea.Caret.Position; + base.Execute(textArea); + textArea.AutoClearSelection = false; + textArea.SelectionManager.ExtendSelection(oldCaretPos, textArea.Caret.Position); + } + } + + public class SelectWholeDocument : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + textArea.AutoClearSelection = false; + TextLocation startPoint = new TextLocation(0, 0); + TextLocation endPoint = textArea.Document.OffsetToPosition(textArea.Document.TextLength); + if (textArea.SelectionManager.HasSomethingSelected) { + if (textArea.SelectionManager.SelectionCollection[0].StartPosition == startPoint && + textArea.SelectionManager.SelectionCollection[0].EndPosition == endPoint) { + return; + } + } + textArea.Caret.Position = textArea.SelectionManager.NextValidPosition(endPoint.Y); + textArea.SelectionManager.ExtendSelection(startPoint, endPoint); + // after a SelectWholeDocument selection, the caret is placed correctly, + // but it is not positioned internally. The effect is when the cursor + // is moved up or down a line, the caret will take on the column that + // it was in before the SelectWholeDocument + textArea.SetDesiredColumn(); + } + } + + public class ClearAllSelections : AbstractEditAction + { + public override void Execute(TextArea textArea) + { + textArea.SelectionManager.ClearSelection(); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/AbstractSegment.cs b/ICSharpCode.TextEditorLinux/Src/Document/AbstractSegment.cs new file mode 100644 index 000000000..ec04ca073 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/AbstractSegment.cs @@ -0,0 +1,52 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This interface is used to describe a span inside a text sequence + /// + public class AbstractSegment : ISegment + { + [CLSCompliant(false)] + protected int offset = -1; + [CLSCompliant(false)] + protected int length = -1; + + #region ICSharpCode.TextEditor.Document.ISegment interface implementation + public virtual int Offset { + get { + return offset; + } + set { + offset = value; + } + } + + public virtual int Length { + get { + return length; + } + set { + length = value; + } + } + + #endregion + + public override string ToString() + { + return String.Format("[AbstractSegment: Offset = {0}, Length = {1}]", + Offset, + Length); + } + + + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/Bookmark.cs b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/Bookmark.cs new file mode 100644 index 000000000..994da2484 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/Bookmark.cs @@ -0,0 +1,137 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Drawing; +using SWF = System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Description of Bookmark. + /// + public class Bookmark + { + IDocument document; + LineSegment line; + int lineNumber; + bool isEnabled = true; + + public IDocument Document { + get { + return document; + } + set { + if (document != value) { + if (line != null) { + lineNumber = line.LineNumber; + line = null; + } + document = value; + if (document != null) { + line = document.GetLineSegment(Math.Min(lineNumber, document.TotalNumberOfLines-1)); + } + OnDocumentChanged(EventArgs.Empty); + } + } + } + + public event EventHandler DocumentChanged; + + protected virtual void OnDocumentChanged(EventArgs e) + { + if (DocumentChanged != null) { + DocumentChanged(this, e); + } + } + + public bool IsEnabled { + get { + return isEnabled; + } + set { + if (isEnabled != value) { + isEnabled = value; + if (document != null) { + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, lineNumber)); + document.CommitUpdate(); + } + OnIsEnabledChanged(EventArgs.Empty); + } + } + } + + public event EventHandler IsEnabledChanged; + + protected virtual void OnIsEnabledChanged(EventArgs e) + { + if (IsEnabledChanged != null) { + IsEnabledChanged(this, e); + } + } + + /// + /// Gets the line the bookmark belongs to. + /// Is null if the bookmark is not connected to a document. + /// + public LineSegment Line { + get { return line; } + } + + public int LineNumber { + get { + if (line != null) + return line.LineNumber; + else + return lineNumber; + } + set { + if (value < 0) + throw new ArgumentOutOfRangeException("value", value, "line number must be >= 0"); + if (document == null) { + lineNumber = value; + } else { + line = document.GetLineSegment(value); + } + } + } + + /// + /// Gets if the bookmark can be toggled off using the 'set/unset bookmark' command. + /// + public virtual bool CanToggle { + get { + return true; + } + } + + public Bookmark(IDocument document, int lineNumber) : this(document, lineNumber, true) + { + } + + public Bookmark(IDocument document, int lineNumber, bool isEnabled) + { + this.document = document; + this.isEnabled = isEnabled; + this.LineNumber = lineNumber; + } + + public virtual bool Click(SWF.Control parent, SWF.MouseEventArgs e) + { + if (e.Button == SWF.MouseButtons.Left && CanToggle) { + document.BookmarkManager.RemoveMark(this); + return true; + } + return false; + } + + public virtual void Draw(IconBarMargin margin, Graphics g, Point p) + { + margin.DrawBookmark(g, p.Y, isEnabled); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkEventHandler.cs b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkEventHandler.cs new file mode 100644 index 000000000..ae43efa2e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkEventHandler.cs @@ -0,0 +1,32 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + public delegate void BookmarkEventHandler(object sender, BookmarkEventArgs e); + + /// + /// Description of BookmarkEventHandler. + /// + public class BookmarkEventArgs : EventArgs + { + Bookmark bookmark; + + public Bookmark Bookmark { + get { + return bookmark; + } + } + + public BookmarkEventArgs(Bookmark bookmark) + { + this.bookmark = bookmark; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManager.cs new file mode 100644 index 000000000..63a9117e0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManager.cs @@ -0,0 +1,254 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Document +{ + public interface IBookmarkFactory + { + Bookmark CreateBookmark(IDocument document, int lineNumber); + } + + /// + /// This class handles the bookmarks for a buffer + /// + public class BookmarkManager + { + IDocument document; + List bookmark = new List(); + + /// + /// Contains all bookmarks + /// + public List Marks { + get { + return bookmark; + } + } + + public IDocument Document { + get { + return document; + } + } + + /// + /// Creates a new instance of + /// + internal BookmarkManager(IDocument document, LineManager lineTracker) + { + this.document = document; + lineTracker.LineDeleted += delegate(object sender, LineEventArgs e) { + for (int i = 0; i < bookmark.Count; i++) { + Bookmark b = bookmark[i]; + if (b.Line == e.LineSegment) { + bookmark.RemoveAt(i--); + OnRemoved(new BookmarkEventArgs(b)); + } + } + }; + } + + IBookmarkFactory factory; + + public IBookmarkFactory Factory { + get { + return factory; + } + set { + factory = value; + } + } + + /// + /// Sets the mark at the line lineNr if it is not set, if the + /// line is already marked the mark is cleared. + /// + public void ToggleMarkAt(int lineNr) + { + Bookmark newMark; + if (factory != null) + newMark = factory.CreateBookmark(document, lineNr); + else + newMark = new Bookmark(document, lineNr); + + Type newMarkType = newMark.GetType(); + + for (int i = 0; i < bookmark.Count; ++i) { + Bookmark mark = bookmark[i]; + + if (mark.LineNumber == lineNr && mark.CanToggle && mark.GetType() == newMarkType) { + bookmark.RemoveAt(i); + OnRemoved(new BookmarkEventArgs(mark)); + return; + } + } + + bookmark.Add(newMark); + OnAdded(new BookmarkEventArgs(newMark)); + } + + public void AddMark(Bookmark mark) + { + bookmark.Add(mark); + OnAdded(new BookmarkEventArgs(mark)); + } + + public void RemoveMark(Bookmark mark) + { + bookmark.Remove(mark); + OnRemoved(new BookmarkEventArgs(mark)); + } + + public void RemoveMarks(Predicate predicate) + { + for (int i = 0; i < bookmark.Count; ++i) { + Bookmark bm = bookmark[i]; + if (predicate(bm)) { + bookmark.RemoveAt(i--); + OnRemoved(new BookmarkEventArgs(bm)); + } + } + } + + /// + /// true, if a mark at mark exists, otherwise false + /// + public bool IsMarked(int lineNr) + { + for (int i = 0; i < bookmark.Count; ++i) { + if (bookmark[i].LineNumber == lineNr) { + return true; + } + } + return false; + } + + /// + /// Clears all bookmark + /// + public void Clear() + { + foreach (Bookmark mark in bookmark) { + OnRemoved(new BookmarkEventArgs(mark)); + } + bookmark.Clear(); + } + + /// + /// The lowest mark, if no marks exists it returns -1 + /// + public Bookmark GetFirstMark(Predicate predicate) + { + if (bookmark.Count < 1) { + return null; + } + Bookmark first = null; + for (int i = 0; i < bookmark.Count; ++i) { + if (predicate(bookmark[i]) && bookmark[i].IsEnabled && (first == null || bookmark[i].LineNumber < first.LineNumber)) { + first = bookmark[i]; + } + } + return first; + } + + /// + /// The highest mark, if no marks exists it returns -1 + /// + public Bookmark GetLastMark(Predicate predicate) + { + if (bookmark.Count < 1) { + return null; + } + Bookmark last = null; + for (int i = 0; i < bookmark.Count; ++i) { + if (predicate(bookmark[i]) && bookmark[i].IsEnabled && (last == null || bookmark[i].LineNumber > last.LineNumber)) { + last = bookmark[i]; + } + } + return last; + } + bool AcceptAnyMarkPredicate(Bookmark mark) + { + return true; + } + public Bookmark GetNextMark(int curLineNr) + { + return GetNextMark(curLineNr, AcceptAnyMarkPredicate); + } + + /// + /// returns first mark higher than lineNr + /// + /// + /// returns the next mark > cur, if it not exists it returns FirstMark() + /// + public Bookmark GetNextMark(int curLineNr, Predicate predicate) + { + if (bookmark.Count == 0) { + return null; + } + + Bookmark next = GetFirstMark(predicate); + foreach (Bookmark mark in bookmark) { + if (predicate(mark) && mark.IsEnabled && mark.LineNumber > curLineNr) { + if (mark.LineNumber < next.LineNumber || next.LineNumber <= curLineNr) { + next = mark; + } + } + } + return next; + } + + public Bookmark GetPrevMark(int curLineNr) + { + return GetPrevMark(curLineNr, AcceptAnyMarkPredicate); + } + /// + /// returns first mark lower than lineNr + /// + /// + /// returns the next mark lower than cur, if it not exists it returns LastMark() + /// + public Bookmark GetPrevMark(int curLineNr, Predicate predicate) + { + if (bookmark.Count == 0) { + return null; + } + + Bookmark prev = GetLastMark(predicate); + + foreach (Bookmark mark in bookmark) { + if (predicate(mark) && mark.IsEnabled && mark.LineNumber < curLineNr) { + if (mark.LineNumber > prev.LineNumber || prev.LineNumber >= curLineNr) { + prev = mark; + } + } + } + return prev; + } + + protected virtual void OnRemoved(BookmarkEventArgs e) + { + if (Removed != null) { + Removed(this, e); + } + } + + protected virtual void OnAdded(BookmarkEventArgs e) + { + if (Added != null) { + Added(this, e); + } + } + + public event BookmarkEventHandler Removed; + public event BookmarkEventHandler Added; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManagerMemento.cs b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManagerMemento.cs new file mode 100644 index 000000000..7849dca57 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/BookmarkManager/BookmarkManagerMemento.cs @@ -0,0 +1,101 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Collections.Generic; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This class is used for storing the state of a bookmark manager + /// + public class BookmarkManagerMemento + { + List bookmarks = new List(); + + /// + /// Contains all bookmarks as int values + /// + public List Bookmarks { + get { + return bookmarks; + } + set { + bookmarks = value; + } + } + + /// + /// Validates all bookmarks if they're in range of the document. + /// (removing all bookmarks < 0 and bookmarks > max. line number + /// + public void CheckMemento(IDocument document) + { + for (int i = 0; i < bookmarks.Count; ++i) { + int mark = (int)bookmarks[i]; + if (mark < 0 || mark >= document.TotalNumberOfLines) { + bookmarks.RemoveAt(i); + --i; + } + } + } + + /// + /// Creates a new instance of + /// + public BookmarkManagerMemento() + { + } + + /// + /// Creates a new instance of + /// + public BookmarkManagerMemento(XmlElement element) + { + foreach (XmlElement el in element.ChildNodes) { + bookmarks.Add(Int32.Parse(el.Attributes["line"].InnerText)); + } + } + + /// + /// Creates a new instance of + /// + public BookmarkManagerMemento(List bookmarks) + { + this.bookmarks = bookmarks; + } + + /// + /// Converts a xml element to a object + /// + public object FromXmlElement(XmlElement element) + { + return new BookmarkManagerMemento(element); + } + + /// + /// Converts this to a xml element + /// + public XmlElement ToXmlElement(XmlDocument doc) + { + XmlElement bookmarknode = doc.CreateElement("Bookmarks"); + + foreach (int line in bookmarks) { + XmlElement markNode = doc.CreateElement("Mark"); + + XmlAttribute lineAttr = doc.CreateAttribute("line"); + lineAttr.InnerText = line.ToString(); + markNode.Attributes.Append(lineAttr); + + bookmarknode.AppendChild(markNode); + } + + return bookmarknode; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/CustomLineManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/CustomLineManager.cs new file mode 100644 index 000000000..75d9c5421 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/CustomLineManager.cs @@ -0,0 +1,217 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This class is used to store a pair of lineNr and its color + /// + public class CustomLine + { + public int StartLineNr; + public int EndLineNr; + public Color Color; + public bool ReadOnly; + + public CustomLine(int lineNr, Color customColor, bool readOnly) + { + this.StartLineNr = this.EndLineNr = lineNr; + this.Color = customColor; + this.ReadOnly = readOnly; + } + + public CustomLine(int startLineNr, int endLineNr, Color customColor, bool readOnly) + { + this.StartLineNr = startLineNr; + this.EndLineNr = endLineNr; + this.Color = customColor; + this.ReadOnly = readOnly; + } + } + + /// + /// This class handles the bookmarks for a buffer + /// + public class CustomLineManager : ICustomLineManager + { + List lines = new List(); + + /// + /// Creates a new instance of + /// + internal CustomLineManager(LineManager lineTracker) + { + lineTracker.LineCountChanged += MoveIndices; + } + + /// + /// Contains all custom lines + /// + public List CustomLines { + get { + return lines; + } + } + + /// + /// Returns the Color if the line lineNr has custom bg color + /// otherwise returns defaultColor + /// + public Color GetCustomColor(int lineNr, Color defaultColor) + { + foreach(CustomLine line in lines) + if (line.StartLineNr <= lineNr && line.EndLineNr >= lineNr) + return line.Color; + return defaultColor; + } + + /// + /// Returns the ReadOnly if the line lineNr is custom + /// otherwise returns default + /// + public bool IsReadOnly(int lineNr, bool defaultReadOnly) + { + foreach(CustomLine line in lines) + if (line.StartLineNr <= lineNr && line.EndLineNr >= lineNr) + return line.ReadOnly; + return defaultReadOnly; + } + + /// + /// Returns true if selection is read only + /// + public bool IsReadOnly(ISelection selection, bool defaultReadOnly) + { + int startLine = selection.StartPosition.Y; + int endLine = selection.EndPosition.Y; + foreach (CustomLine customLine in lines) { + if (customLine.ReadOnly == false) + continue; + if (startLine < customLine.StartLineNr && endLine < customLine.StartLineNr) + continue; + if (startLine > customLine.EndLineNr && endLine > customLine.EndLineNr) + continue; + return true; + } + return defaultReadOnly; + } + + /// + /// Clears all custom lines + /// + public void Clear() + { + OnBeforeChanged(); + lines.Clear(); + OnChanged(); + } + + /// + /// Is fired before the change + /// + public event EventHandler BeforeChanged; + + /// + /// Is fired after the change + /// + public event EventHandler Changed; + + + + void OnChanged() + { + if (Changed != null) { + Changed(this, null); + } + } + void OnBeforeChanged() + { + if (BeforeChanged != null) { + BeforeChanged(this, null); + } + } + + /// + /// Set Custom Line at the line lineNr + /// + public void AddCustomLine(int lineNr, Color customColor, bool readOnly) + { + OnBeforeChanged(); + lines.Add(new CustomLine(lineNr, customColor, readOnly)); + OnChanged(); + } + + /// + /// Add Custom Lines from the line startLineNr to the line endLineNr + /// + public void AddCustomLine(int startLineNr, int endLineNr, Color customColor, bool readOnly) + { + OnBeforeChanged(); + lines.Add(new CustomLine(startLineNr, endLineNr, customColor, readOnly)); + OnChanged(); + } + + /// + /// Remove Custom Line at the line lineNr + /// + public void RemoveCustomLine(int lineNr) + { + for (int i = 0; i < lines.Count; ++i) { + if (((CustomLine)lines[i]).StartLineNr <= lineNr && ((CustomLine)lines[i]).EndLineNr >= lineNr) { + OnBeforeChanged(); + lines.RemoveAt(i); + OnChanged(); + return; + } + } + } + + /// + /// This method moves all indices from index upward count lines + /// (useful for deletion/insertion of text) + /// + void MoveIndices(object sender, LineCountChangeEventArgs e) + { + bool changed = false; + OnBeforeChanged(); + for (int i = 0; i < lines.Count; ++i) { + int startLineNr = ((CustomLine)lines[i]).StartLineNr; + int endLineNr = ((CustomLine)lines[i]).EndLineNr; + if (e.LineStart >= startLineNr && e.LineStart < endLineNr) { + changed = true; + ((CustomLine)lines[i]).EndLineNr += e.LinesMoved; + } + else if (e.LineStart < startLineNr) { + ((CustomLine)lines[i]).StartLineNr += e.LinesMoved; + ((CustomLine)lines[i]).EndLineNr += e.LinesMoved; + } + else { + } +/* + if (e.LinesMoved < 0 && lineNr == e.LineStart) { + lines.RemoveAt(i); + --i; + changed = true; + } else if (lineNr > e.LineStart + 1 || (e.LinesMoved < 0 && lineNr > e.LineStart)) { + changed = true; + ((CustomLine)lines[i]).StartLineNr += e.LinesMoved; + ((CustomLine)lines[i]).EndLineNr += e.LinesMoved; + } +*/ + } + + if (changed) { + OnChanged(); + } + } + + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/ICustomLineManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/ICustomLineManager.cs new file mode 100644 index 000000000..161aeba18 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/CustomLineManager/ICustomLineManager.cs @@ -0,0 +1,72 @@ +// +// +// +// +// $Revision: 1959 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This class handles the custom lines for a buffer + /// + public interface ICustomLineManager + { + /// + /// Contains all custom lines + /// + List CustomLines { + get; + } + + /// + /// Returns the Color if the line lineNr has custom bg color + /// otherwise returns defaultColor + /// + Color GetCustomColor(int lineNr, Color defaultColor); + + /// + /// Returns true if the line lineNr is read only + /// + bool IsReadOnly(int lineNr, bool defaultReadOnly); + + /// + /// Returns true if selection is read only + /// + bool IsReadOnly(ISelection selection, bool defaultReadOnly); + + /// + /// Add Custom Line at the line lineNr + /// + void AddCustomLine(int lineNr, Color customColor, bool readOnly); + + /// + /// Add Custom Lines from the line startLineNr to the line endLineNr + /// + void AddCustomLine(int startLineNr, int endLineNr, Color customColor, bool readOnly); + + /// + /// Remove Custom Line at the line lineNr + /// + void RemoveCustomLine(int lineNr); + + /// + /// Clears all custom color lines + /// + void Clear(); + + /// + /// Is fired before the change + /// + event EventHandler BeforeChanged; + + /// + /// Is fired after the change + /// + event EventHandler Changed; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/DefaultDocument.cs b/ICSharpCode.TextEditorLinux/Src/Document/DefaultDocument.cs new file mode 100644 index 000000000..bdf8ce959 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/DefaultDocument.cs @@ -0,0 +1,460 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; + +using ICSharpCode.TextEditor.Undo; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Describes the caret marker + /// + public enum LineViewerStyle { + /// + /// No line viewer will be displayed + /// + None, + + /// + /// The row in which the caret is will be marked + /// + FullRow + } + + /// + /// Describes the indent style + /// + public enum IndentStyle { + /// + /// No indentation occurs + /// + None, + + /// + /// The indentation from the line above will be + /// taken to indent the curent line + /// + Auto, + + /// + /// Inteligent, context sensitive indentation will occur + /// + Smart + } + + /// + /// Describes the bracket highlighting style + /// + public enum BracketHighlightingStyle { + + /// + /// Brackets won't be highlighted + /// + None, + + /// + /// Brackets will be highlighted if the caret is on the bracket + /// + OnBracket, + + /// + /// Brackets will be highlighted if the caret is after the bracket + /// + AfterBracket + } + + /// + /// Describes the selection mode of the text area + /// + public enum DocumentSelectionMode { + /// + /// The 'normal' selection mode. + /// + Normal, + + /// + /// Selections will be added to the current selection or new + /// ones will be created (multi-select mode) + /// + Additive + } + + /// + /// The default implementation. + /// + internal sealed class DefaultDocument : IDocument + { + bool readOnly = false; + + LineManager lineTrackingStrategy; + ICustomLineManager customLineManager; + BookmarkManager bookmarkManager; + ITextBufferStrategy textBufferStrategy; + IFormattingStrategy formattingStrategy; + FoldingManager foldingManager; + UndoStack undoStack = new UndoStack(); + ITextEditorProperties textEditorProperties = new DefaultTextEditorProperties(); + MarkerStrategy markerStrategy; + + public LineManager LineManager { + get { return lineTrackingStrategy; } + set { lineTrackingStrategy = value; } + } + + public event EventHandler LineLengthChanged { + add { lineTrackingStrategy.LineLengthChanged += value; } + remove { lineTrackingStrategy.LineLengthChanged -= value; } + } + public event EventHandler LineCountChanged { + add { lineTrackingStrategy.LineCountChanged += value; } + remove { lineTrackingStrategy.LineCountChanged -= value; } + } + public event EventHandler LineDeleted { + add { lineTrackingStrategy.LineDeleted += value; } + remove { lineTrackingStrategy.LineDeleted -= value; } + } + + public MarkerStrategy MarkerStrategy { + get { return markerStrategy; } + set { markerStrategy = value; } + } + + public ITextEditorProperties TextEditorProperties { + get { + return textEditorProperties; + } + set { + textEditorProperties = value; + } + } + + public UndoStack UndoStack { + get { + return undoStack; + } + } + + public IList LineSegmentCollection { + get { + return lineTrackingStrategy.LineSegmentCollection; + } + } + + public bool ReadOnly { + get { + return readOnly; + } + set { + readOnly = value; + } + } + + public ITextBufferStrategy TextBufferStrategy { + get { + return textBufferStrategy; + } + set { + textBufferStrategy = value; + } + } + + public IFormattingStrategy FormattingStrategy { + get { + return formattingStrategy; + } + set { + formattingStrategy = value; + } + } + + public FoldingManager FoldingManager { + get { + return foldingManager; + } + set { + foldingManager = value; + } + } + + public IHighlightingStrategy HighlightingStrategy { + get { + return lineTrackingStrategy.HighlightingStrategy; + } + set { + lineTrackingStrategy.HighlightingStrategy = value; + } + } + + public int TextLength { + get { + return textBufferStrategy.Length; + } + } + + public BookmarkManager BookmarkManager { + get { + return bookmarkManager; + } + set { + bookmarkManager = value; + } + } + + + public ICustomLineManager CustomLineManager { + get { + return customLineManager; + } + set { + customLineManager = value; + } + } + + public string TextContent { + get { + return GetText(0, textBufferStrategy.Length); + } + set { + Debug.Assert(textBufferStrategy != null); + Debug.Assert(lineTrackingStrategy != null); + OnDocumentAboutToBeChanged(new DocumentEventArgs(this, 0, 0, value)); + textBufferStrategy.SetContent(value); + lineTrackingStrategy.SetContent(value); + undoStack.ClearAll(); + + OnDocumentChanged(new DocumentEventArgs(this, 0, 0, value)); + OnTextContentChanged(EventArgs.Empty); + } + } + + public void Insert(int offset, string text) + { + if (readOnly) { + return; + } + OnDocumentAboutToBeChanged(new DocumentEventArgs(this, offset, -1, text)); + + textBufferStrategy.Insert(offset, text); + lineTrackingStrategy.Insert(offset, text); + + undoStack.Push(new UndoableInsert(this, offset, text)); + + OnDocumentChanged(new DocumentEventArgs(this, offset, -1, text)); + } + + public void Remove(int offset, int length) + { + if (readOnly) { + return; + } + OnDocumentAboutToBeChanged(new DocumentEventArgs(this, offset, length)); + undoStack.Push(new UndoableDelete(this, offset, GetText(offset, length))); + + textBufferStrategy.Remove(offset, length); + lineTrackingStrategy.Remove(offset, length); + + OnDocumentChanged(new DocumentEventArgs(this, offset, length)); + } + + public void Replace(int offset, int length, string text) + { + if (readOnly) { + return; + } + OnDocumentAboutToBeChanged(new DocumentEventArgs(this, offset, length, text)); + undoStack.Push(new UndoableReplace(this, offset, GetText(offset, length), text)); + + textBufferStrategy.Replace(offset, length, text); + lineTrackingStrategy.Replace(offset, length, text); + + OnDocumentChanged(new DocumentEventArgs(this, offset, length, text)); + } + + public char GetCharAt(int offset) + { + return textBufferStrategy.GetCharAt(offset); + } + + public string GetText(int offset, int length) + { + #if DEBUG + if (length < 0) throw new ArgumentOutOfRangeException("length", length, "length < 0"); + #endif + return textBufferStrategy.GetText(offset, length); + } + public string GetText(ISegment segment) + { + return GetText(segment.Offset, segment.Length); + } + + public int TotalNumberOfLines { + get { + return lineTrackingStrategy.TotalNumberOfLines; + } + } + + public int GetLineNumberForOffset(int offset) + { + return lineTrackingStrategy.GetLineNumberForOffset(offset); + } + + public LineSegment GetLineSegmentForOffset(int offset) + { + return lineTrackingStrategy.GetLineSegmentForOffset(offset); + } + + public LineSegment GetLineSegment(int line) + { + return lineTrackingStrategy.GetLineSegment(line); + } + + public int GetFirstLogicalLine(int lineNumber) + { + return lineTrackingStrategy.GetFirstLogicalLine(lineNumber); + } + + public int GetLastLogicalLine(int lineNumber) + { + return lineTrackingStrategy.GetLastLogicalLine(lineNumber); + } + + public int GetVisibleLine(int lineNumber) + { + return lineTrackingStrategy.GetVisibleLine(lineNumber); + } + +// public int GetVisibleColumn(int logicalLine, int logicalColumn) +// { +// return lineTrackingStrategy.GetVisibleColumn(logicalLine, logicalColumn); +// } +// + public int GetNextVisibleLineAbove(int lineNumber, int lineCount) + { + return lineTrackingStrategy.GetNextVisibleLineAbove(lineNumber, lineCount); + } + + public int GetNextVisibleLineBelow(int lineNumber, int lineCount) + { + return lineTrackingStrategy.GetNextVisibleLineBelow(lineNumber, lineCount); + } + + public TextLocation OffsetToPosition(int offset) + { + int lineNr = GetLineNumberForOffset(offset); + LineSegment line = GetLineSegment(lineNr); + return new TextLocation(offset - line.Offset, lineNr); + } + + public int PositionToOffset(TextLocation p) + { + if (p.Y >= this.TotalNumberOfLines) { + return 0; + } + LineSegment line = GetLineSegment(p.Y); + return Math.Min(this.TextLength, line.Offset + Math.Min(line.Length, p.X)); + } + + public void UpdateSegmentListOnDocumentChange(List list, DocumentEventArgs e) where T : ISegment + { + for (int i = 0; i < list.Count; ++i) { + ISegment fm = list[i]; + + if (e.Offset <= fm.Offset && fm.Offset <= e.Offset + e.Length || + e.Offset <= fm.Offset + fm.Length && fm.Offset + fm.Length <= e.Offset + e.Length) { + list.RemoveAt(i); + --i; + continue; + } + + if (fm.Offset <= e.Offset && e.Offset <= fm.Offset + fm.Length) { + if (e.Text != null) { + fm.Length += e.Text.Length; + } + if (e.Length > 0) { + fm.Length -= e.Length; + } + continue; + } + + if (fm.Offset >= e.Offset) { + if (e.Text != null) { + fm.Offset += e.Text.Length; + } + if (e.Length > 0) { + fm.Offset -= e.Length; + } + } + } + } + + void OnDocumentAboutToBeChanged(DocumentEventArgs e) + { + if (DocumentAboutToBeChanged != null) { + DocumentAboutToBeChanged(this, e); + } + } + + void OnDocumentChanged(DocumentEventArgs e) + { + if (DocumentChanged != null) { + DocumentChanged(this, e); + } + } + + public event DocumentEventHandler DocumentAboutToBeChanged; + public event DocumentEventHandler DocumentChanged; + + // UPDATE STUFF + List updateQueue = new List(); + + public List UpdateQueue { + get { + return updateQueue; + } + } + + public void RequestUpdate(TextAreaUpdate update) + { + if (updateQueue.Count == 1 && updateQueue[0].TextAreaUpdateType == TextAreaUpdateType.WholeTextArea) { + // if we're going to update the whole text area, we don't need to store detail updates + return; + } + if (update.TextAreaUpdateType == TextAreaUpdateType.WholeTextArea) { + // if we're going to update the whole text area, we don't need to store detail updates + updateQueue.Clear(); + } + updateQueue.Add(update); + } + + public void CommitUpdate() + { + if (UpdateCommited != null) { + UpdateCommited(this, EventArgs.Empty); + } + } + + void OnTextContentChanged(EventArgs e) + { + if (TextContentChanged != null) { + TextContentChanged(this, e); + } + } + + public event EventHandler UpdateCommited; + public event EventHandler TextContentChanged; + + [Conditional("DEBUG")] + internal static void ValidatePosition(IDocument document, TextLocation position) + { + document.GetLineSegment(position.Line); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/DefaultTextEditorProperties.cs b/ICSharpCode.TextEditorLinux/Src/Document/DefaultTextEditorProperties.cs new file mode 100644 index 000000000..006013897 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/DefaultTextEditorProperties.cs @@ -0,0 +1,316 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Drawing; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + public enum BracketMatchingStyle { + Before, + After + } + + public class DefaultTextEditorProperties : ITextEditorProperties + { + int tabIndent = 4; + int indentationSize = 4; + IndentStyle indentStyle = IndentStyle.Smart; + DocumentSelectionMode documentSelectionMode = DocumentSelectionMode.Normal; + Encoding encoding = System.Text.Encoding.UTF8; + BracketMatchingStyle bracketMatchingStyle = BracketMatchingStyle.After; + FontContainer fontContainer; + static Font DefaultFont; + + public DefaultTextEditorProperties() + { + if (DefaultFont == null) { + DefaultFont = new Font("Courier New", 10); + } + this.fontContainer = new FontContainer(DefaultFont); + } + + bool allowCaretBeyondEOL = false; + + bool showMatchingBracket = true; + bool showLineNumbers = true; + + bool showSpaces = false; + bool showTabs = false; + bool showEOLMarker = false; + + bool showInvalidLines = false; + + bool isIconBarVisible = false; + bool enableFolding = true; + bool showHorizontalRuler = false; + bool showVerticalRuler = true; + bool convertTabsToSpaces = false; + System.Drawing.Text.TextRenderingHint textRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault; + bool createBackupCopy = false; + bool mouseWheelScrollDown = true; + bool mouseWheelTextZoom = true; + + bool hideMouseCursor = false; + bool cutCopyWholeLine = true; + + int verticalRulerRow = 80; + LineViewerStyle lineViewerStyle = LineViewerStyle.None; + string lineTerminator = "\r\n"; + bool autoInsertCurlyBracket = true; + bool useCustomLine = false; + + public int TabIndent { + get { + return tabIndent; + } + set { + tabIndent = value; + } + } + + public int IndentationSize { + get { return indentationSize; } + set { indentationSize = value; } + } + + public IndentStyle IndentStyle { + get { + return indentStyle; + } + set { + indentStyle = value; + } + } + public DocumentSelectionMode DocumentSelectionMode { + get { + return documentSelectionMode; + } + set { + documentSelectionMode = value; + } + } + public bool AllowCaretBeyondEOL { + get { + return allowCaretBeyondEOL; + } + set { + allowCaretBeyondEOL = value; + } + } + public bool ShowMatchingBracket { + get { + return showMatchingBracket; + } + set { + showMatchingBracket = value; + } + } + public bool ShowLineNumbers { + get { + return showLineNumbers; + } + set { + showLineNumbers = value; + } + } + public bool ShowSpaces { + get { + return showSpaces; + } + set { + showSpaces = value; + } + } + public bool ShowTabs { + get { + return showTabs; + } + set { + showTabs = value; + } + } + public bool ShowEOLMarker { + get { + return showEOLMarker; + } + set { + showEOLMarker = value; + } + } + public bool ShowInvalidLines { + get { + return showInvalidLines; + } + set { + showInvalidLines = value; + } + } + public bool IsIconBarVisible { + get { + return isIconBarVisible; + } + set { + isIconBarVisible = value; + } + } + public bool EnableFolding { + get { + return enableFolding; + } + set { + enableFolding = value; + } + } + public bool ShowHorizontalRuler { + get { + return showHorizontalRuler; + } + set { + showHorizontalRuler = value; + } + } + public bool ShowVerticalRuler { + get { + return showVerticalRuler; + } + set { + showVerticalRuler = value; + } + } + public bool ConvertTabsToSpaces { + get { + return convertTabsToSpaces; + } + set { + convertTabsToSpaces = value; + } + } + public System.Drawing.Text.TextRenderingHint TextRenderingHint { + get { return textRenderingHint; } + set { textRenderingHint = value; } + } + + public bool CreateBackupCopy { + get { + return createBackupCopy; + } + set { + createBackupCopy = value; + } + } + public bool MouseWheelScrollDown { + get { + return mouseWheelScrollDown; + } + set { + mouseWheelScrollDown = value; + } + } + public bool MouseWheelTextZoom { + get { + return mouseWheelTextZoom; + } + set { + mouseWheelTextZoom = value; + } + } + + public bool HideMouseCursor { + get { + return hideMouseCursor; + } + set { + hideMouseCursor = value; + } + } + + public bool CutCopyWholeLine { + get { + return cutCopyWholeLine; + } + set { + cutCopyWholeLine = value; + } + } + + public Encoding Encoding { + get { + return encoding; + } + set { + encoding = value; + } + } + public int VerticalRulerRow { + get { + return verticalRulerRow; + } + set { + verticalRulerRow = value; + } + } + public LineViewerStyle LineViewerStyle { + get { + return lineViewerStyle; + } + set { + lineViewerStyle = value; + } + } + public string LineTerminator { + get { + return lineTerminator; + } + set { + lineTerminator = value; + } + } + public bool AutoInsertCurlyBracket { + get { + return autoInsertCurlyBracket; + } + set { + autoInsertCurlyBracket = value; + } + } + + public Font Font { + get { + return fontContainer.DefaultFont; + } + set { + fontContainer.DefaultFont = value; + } + } + + public FontContainer FontContainer { + get { + return fontContainer; + } + } + + public BracketMatchingStyle BracketMatchingStyle { + get { + return bracketMatchingStyle; + } + set { + bracketMatchingStyle = value; + } + } + + public bool UseCustomLine { + get { + return useCustomLine; + } + set { + useCustomLine = value; + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/DocumentEventArgs.cs b/ICSharpCode.TextEditorLinux/Src/Document/DocumentEventArgs.cs new file mode 100644 index 000000000..53d38dcdb --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/DocumentEventArgs.cs @@ -0,0 +1,103 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This delegate is used for document events. + /// + public delegate void DocumentEventHandler(object sender, DocumentEventArgs e); + + /// + /// This class contains more information on a document event + /// + public class DocumentEventArgs : EventArgs + { + IDocument document; + int offset; + int length; + string text; + + /// + /// always a valid Document which is related to the Event. + /// + public IDocument Document { + get { + return document; + } + } + + /// + /// -1 if no offset was specified for this event + /// + public int Offset { + get { + return offset; + } + } + + /// + /// null if no text was specified for this event + /// + public string Text { + get { + return text; + } + } + + /// + /// -1 if no length was specified for this event + /// + public int Length { + get { + return length; + } + } + + /// + /// Creates a new instance off + /// + public DocumentEventArgs(IDocument document) : this(document, -1, -1, null) + { + } + + /// + /// Creates a new instance off + /// + public DocumentEventArgs(IDocument document, int offset) : this(document, offset, -1, null) + { + } + + /// + /// Creates a new instance off + /// + public DocumentEventArgs(IDocument document, int offset, int length) : this(document, offset, length, null) + { + } + + /// + /// Creates a new instance off + /// + public DocumentEventArgs(IDocument document, int offset, int length, string text) + { + this.document = document; + this.offset = offset; + this.length = length; + this.text = text; + } + public override string ToString() + { + return String.Format("[DocumentEventArgs: Document = {0}, Offset = {1}, Text = {2}, Length = {3}]", + Document, + Offset, + Text, + Length); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/DocumentFactory.cs b/ICSharpCode.TextEditorLinux/Src/Document/DocumentFactory.cs new file mode 100644 index 000000000..297756cef --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/DocumentFactory.cs @@ -0,0 +1,58 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This interface represents a container which holds a text sequence and + /// all necessary information about it. It is used as the base for a text editor. + /// + public class DocumentFactory + { + /// + /// Creates a new object. Only create + /// with this method. + /// + public IDocument CreateDocument() + { + DefaultDocument doc = new DefaultDocument(); + doc.TextBufferStrategy = new GapTextBufferStrategy(); + doc.FormattingStrategy = new DefaultFormattingStrategy(); + doc.LineManager = new LineManager(doc, null); + doc.FoldingManager = new FoldingManager(doc, doc.LineManager); + doc.FoldingManager.FoldingStrategy = null; //new ParserFoldingStrategy(); + doc.MarkerStrategy = new MarkerStrategy(doc); + doc.BookmarkManager = new BookmarkManager(doc, doc.LineManager); + doc.CustomLineManager = new CustomLineManager(doc.LineManager); + return doc; + } + + /// + /// Creates a new document and loads the given file + /// + public IDocument CreateFromTextBuffer(ITextBufferStrategy textBuffer) + { + DefaultDocument doc = (DefaultDocument)CreateDocument(); + doc.TextContent = textBuffer.GetText(0, textBuffer.Length); + doc.TextBufferStrategy = textBuffer; + return doc; + } + + /// + /// Creates a new document and loads the given file + /// + public IDocument CreateFromFile(string fileName) + { + IDocument document = CreateDocument(); + document.TextContent = Util.FileReader.ReadFileContent(fileName, Encoding.Default); + return document; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldMarker.cs b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldMarker.cs new file mode 100644 index 000000000..f2fa3fbad --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldMarker.cs @@ -0,0 +1,179 @@ +// +// +// +// +// $Revision: 2063 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + public enum FoldType { + Unspecified, + MemberBody, + Region, + TypeBody + } + + public class FoldMarker : AbstractSegment, IComparable + { + bool isFolded = false; + string foldText = "..."; + FoldType foldType = FoldType.Unspecified; + IDocument document = null; + int startLine = -1, startColumn, endLine = -1, endColumn; + + static void GetPointForOffset(IDocument document, int offset, out int line, out int column) + { + if (offset > document.TextLength) { + line = document.TotalNumberOfLines + 1; + column = 1; + } else if (offset < 0) { + line = -1; + column = -1; + } else { + line = document.GetLineNumberForOffset(offset); + column = offset - document.GetLineSegment(line).Offset; + } + } + + public FoldType FoldType { + get { return foldType; } + set { foldType = value; } + } + + public int StartLine { + get { + if (startLine < 0) { + GetPointForOffset(document, offset, out startLine, out startColumn); + } + return startLine; + } + } + + public int StartColumn { + get { + if (startLine < 0) { + GetPointForOffset(document, offset, out startLine, out startColumn); + } + return startColumn; + } + } + + public int EndLine { + get { + if (endLine < 0) { + GetPointForOffset(document, offset + length, out endLine, out endColumn); + } + return endLine; + } + } + + public int EndColumn { + get { + if (endLine < 0) { + GetPointForOffset(document, offset + length, out endLine, out endColumn); + } + return endColumn; + } + } + + public override int Offset { + get { return base.Offset; } + set { + base.Offset = value; + startLine = -1; endLine = -1; + } + } + public override int Length { + get { return base.Length; } + set { + base.Length = value; + endLine = -1; + } + } + + public bool IsFolded { + get { + return isFolded; + } + set { + isFolded = value; + } + } + + public string FoldText { + get { + return foldText; + } + } + + public void SetFoldText(string text) + { + foldText = text; + } + + public string InnerText { + get { + return document.GetText(offset, length); + } + } + + public FoldMarker(IDocument document, int offset, int length, string foldText, bool isFolded) + { + this.document = document; + this.offset = offset; + this.length = length; + this.foldText = foldText; + this.isFolded = isFolded; + } + + public FoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn) : this(document, startLine, startColumn, endLine, endColumn, FoldType.Unspecified) + { + } + + public FoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn, FoldType foldType) : this(document, startLine, startColumn, endLine, endColumn, foldType, "...") + { + } + + public FoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn, FoldType foldType, string foldText) : this(document, startLine, startColumn, endLine, endColumn, foldType, foldText, false) + { + } + + public FoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn, FoldType foldType, string foldText, bool isFolded) + { + this.document = document; + + startLine = Math.Min(document.TotalNumberOfLines - 1, Math.Max(startLine, 0)); + ISegment startLineSegment = document.GetLineSegment(startLine); + + endLine = Math.Min(document.TotalNumberOfLines - 1, Math.Max(endLine, 0)); + ISegment endLineSegment = document.GetLineSegment(endLine); + + // Prevent the region from completely disappearing + if (string.IsNullOrEmpty(foldText)) { + foldText = "..."; + } + + this.FoldType = foldType; + this.foldText = foldText; + this.offset = startLineSegment.Offset + Math.Min(startColumn, startLineSegment.Length); + this.length = (endLineSegment.Offset + Math.Min(endColumn, endLineSegment.Length)) - this.offset; + this.isFolded = isFolded; + } + + public int CompareTo(object o) + { + if (!(o is FoldMarker)) { + throw new ArgumentException(); + } + FoldMarker f = (FoldMarker)o; + if (offset != f.offset) { + return offset.CompareTo(f.offset); + } + + return length.CompareTo(f.length); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldingManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldingManager.cs new file mode 100644 index 000000000..a0f2129f9 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/FoldingManager.cs @@ -0,0 +1,333 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + public class FoldingManager + { + List foldMarker = new List(); + List foldMarkerByEnd = new List(); + IFoldingStrategy foldingStrategy = null; + IDocument document; + + public IList FoldMarker { + get { + return foldMarker.AsReadOnly(); + } + } + + public IFoldingStrategy FoldingStrategy { + get { + return foldingStrategy; + } + set { + foldingStrategy = value; + } + } + + internal FoldingManager(IDocument document, LineManager lineTracker) + { + this.document = document; + document.DocumentChanged += new DocumentEventHandler(DocumentChanged); + +// lineTracker.LineCountChanged += new LineManagerEventHandler(LineManagerLineCountChanged); +// lineTracker.LineLengthChanged += new LineLengthEventHandler(LineManagerLineLengthChanged); +// foldMarker.Add(new FoldMarker(0, 5, 3, 5)); +// +// foldMarker.Add(new FoldMarker(5, 5, 10, 3)); +// foldMarker.Add(new FoldMarker(6, 0, 8, 2)); +// +// FoldMarker fm1 = new FoldMarker(10, 4, 10, 7); +// FoldMarker fm2 = new FoldMarker(10, 10, 10, 14); +// +// fm1.IsFolded = true; +// fm2.IsFolded = true; +// +// foldMarker.Add(fm1); +// foldMarker.Add(fm2); +// foldMarker.Sort(); + } + + void DocumentChanged(object sender, DocumentEventArgs e) + { + int oldCount = foldMarker.Count; + document.UpdateSegmentListOnDocumentChange(foldMarker, e); + if (oldCount != foldMarker.Count) { + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + } + } + + public List GetFoldingsFromPosition(int line, int column) + { + List foldings = new List(); + if (foldMarker != null) { + for (int i = 0; i < foldMarker.Count; ++i) { + FoldMarker fm = foldMarker[i]; + if ((fm.StartLine == line && column > fm.StartColumn && !(fm.EndLine == line && column >= fm.EndColumn)) || + (fm.EndLine == line && column < fm.EndColumn && !(fm.StartLine == line && column <= fm.StartColumn)) || + (line > fm.StartLine && line < fm.EndLine)) { + foldings.Add(fm); + } + } + } + return foldings; + } + + class StartComparer : IComparer + { + public readonly static StartComparer Instance = new StartComparer(); + + public int Compare(FoldMarker x, FoldMarker y) + { + if (x.StartLine < y.StartLine) + return -1; + else if (x.StartLine == y.StartLine) + return x.StartColumn.CompareTo(y.StartColumn); + else + return 1; + } + } + + class EndComparer : IComparer + { + public readonly static EndComparer Instance = new EndComparer(); + + public int Compare(FoldMarker x, FoldMarker y) + { + if (x.EndLine < y.EndLine) + return -1; + else if (x.EndLine == y.EndLine) + return x.EndColumn.CompareTo(y.EndColumn); + else + return 1; + } + } + + List GetFoldingsByStartAfterColumn(int lineNumber, int column, bool forceFolded) + { + List foldings = new List(); + + if (foldMarker != null) { + int index = foldMarker.BinarySearch( + new FoldMarker(document, lineNumber, column, lineNumber, column), + StartComparer.Instance); + if (index < 0) index = ~index; + + for (; index < foldMarker.Count; index++) { + FoldMarker fm = foldMarker[index]; + if (fm.StartLine > lineNumber) + break; + if (fm.StartColumn <= column) + continue; + if (!forceFolded || fm.IsFolded) + foldings.Add(fm); + } + } + return foldings; + } + + public List GetFoldingsWithStart(int lineNumber) + { + return GetFoldingsByStartAfterColumn(lineNumber, -1, false); + } + + public List GetFoldedFoldingsWithStart(int lineNumber) + { + return GetFoldingsByStartAfterColumn(lineNumber, -1, true); + } + + public List GetFoldedFoldingsWithStartAfterColumn(int lineNumber, int column) + { + return GetFoldingsByStartAfterColumn(lineNumber, column, true); + } + + List GetFoldingsByEndAfterColumn(int lineNumber, int column, bool forceFolded) + { + List foldings = new List(); + + if (foldMarker != null) { + int index = foldMarkerByEnd.BinarySearch( + new FoldMarker(document, lineNumber, column, lineNumber, column), + EndComparer.Instance); + if (index < 0) index = ~index; + + for (; index < foldMarkerByEnd.Count; index++) { + FoldMarker fm = foldMarkerByEnd[index]; + if (fm.EndLine > lineNumber) + break; + if (fm.EndColumn <= column) + continue; + if (!forceFolded || fm.IsFolded) + foldings.Add(fm); + } + } + return foldings; + } + + public List GetFoldingsWithEnd(int lineNumber) + { + return GetFoldingsByEndAfterColumn(lineNumber, -1, false); + } + + public List GetFoldedFoldingsWithEnd(int lineNumber) + { + return GetFoldingsByEndAfterColumn(lineNumber, -1, true); + } + + public bool IsFoldStart(int lineNumber) + { + return GetFoldingsWithStart(lineNumber).Count > 0; + } + + public bool IsFoldEnd(int lineNumber) + { + return GetFoldingsWithEnd(lineNumber).Count > 0; + } + + public List GetFoldingsContainsLineNumber(int lineNumber) + { + List foldings = new List(); + if (foldMarker != null) { + foreach (FoldMarker fm in foldMarker) { + if (fm.StartLine < lineNumber && lineNumber < fm.EndLine) { + foldings.Add(fm); + } + } + } + return foldings; + } + + public bool IsBetweenFolding(int lineNumber) + { + return GetFoldingsContainsLineNumber(lineNumber).Count > 0; + } + + public bool IsLineVisible(int lineNumber) + { + foreach (FoldMarker fm in GetFoldingsContainsLineNumber(lineNumber)) { + if (fm.IsFolded) + return false; + } + return true; + } + + public List GetTopLevelFoldedFoldings() + { + List foldings = new List(); + if (foldMarker != null) { + Point end = new Point(0, 0); + foreach (FoldMarker fm in foldMarker) { + if (fm.IsFolded && (fm.StartLine > end.Y || fm.StartLine == end.Y && fm.StartColumn >= end.X)) { + foldings.Add(fm); + end = new Point(fm.EndColumn, fm.EndLine); + } + } + } + return foldings; + } + + public void UpdateFoldings(string fileName, object parseInfo) + { + UpdateFoldings(foldingStrategy.GenerateFoldMarkers(document, fileName, parseInfo)); + } + + public void UpdateFoldings(List newFoldings) + { + int oldFoldingsCount = foldMarker.Count; + lock (this) { + if (newFoldings != null && newFoldings.Count != 0) { + newFoldings.Sort(); + if (foldMarker.Count == newFoldings.Count) { + for (int i = 0; i < foldMarker.Count; ++i) { + newFoldings[i].IsFolded = foldMarker[i].IsFolded; + } + foldMarker = newFoldings; + } else { + for (int i = 0, j = 0; i < foldMarker.Count && j < newFoldings.Count;) { + int n = newFoldings[j].CompareTo(foldMarker[i]); + if (n > 0) { + ++i; + } else { + if (n == 0) { + newFoldings[j].IsFolded = foldMarker[i].IsFolded; + } + ++j; + } + } + } + } + if (newFoldings != null) { + foldMarker = newFoldings; + foldMarkerByEnd = new List(newFoldings); + foldMarkerByEnd.Sort(EndComparer.Instance); + } else { + foldMarker.Clear(); + foldMarkerByEnd.Clear(); + } + } + if (oldFoldingsCount != foldMarker.Count) { + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + document.CommitUpdate(); + } + } + + public string SerializeToString() + { + StringBuilder sb = new StringBuilder(); + foreach (FoldMarker marker in this.foldMarker) { + sb.Append(marker.Offset);sb.Append("\n"); + sb.Append(marker.Length);sb.Append("\n"); + sb.Append(marker.FoldText);sb.Append("\n"); + sb.Append(marker.IsFolded);sb.Append("\n"); + } + return sb.ToString(); + } + + public void DeserializeFromString(string str) + { + try { + string[] lines = str.Split('\n'); + for (int i = 0; i < lines.Length && lines[i].Length > 0; i += 4) { + int offset = Int32.Parse(lines[i]); + int length = Int32.Parse(lines[i + 1]); + string text = lines[i + 2]; + bool isFolded = Boolean.Parse(lines[i + 3]); + bool found = false; + foreach (FoldMarker marker in foldMarker) { + if (marker.Offset == offset && marker.Length == length) { + marker.IsFolded = isFolded; + found = true; + break; + } + } + if (!found) { + foldMarker.Add(new FoldMarker(document, offset, length, text, isFolded)); + } + } + if (lines.Length > 0) { + NotifyFoldingsChanged(EventArgs.Empty); + } + } catch (Exception) { + } + } + + public void NotifyFoldingsChanged(EventArgs e) + { + if (FoldingsChanged != null) { + FoldingsChanged(this, e); + } + } + + + public event EventHandler FoldingsChanged; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IFoldingStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IFoldingStrategy.cs new file mode 100644 index 000000000..a5e28e507 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IFoldingStrategy.cs @@ -0,0 +1,24 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This interface is used for the folding capabilities + /// of the textarea. + /// + public interface IFoldingStrategy + { + /// + /// Calculates the fold level of a specific line. + /// + List GenerateFoldMarkers(IDocument document, string fileName, object parseInformation); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs new file mode 100644 index 000000000..33587cab6 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs @@ -0,0 +1,47 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// A simple folding strategy which calculates the folding level + /// using the indent level of the line. + /// + public class IndentFoldingStrategy : IFoldingStrategy + { + public List GenerateFoldMarkers(IDocument document, string fileName, object parseInformation) + { + List l = new List(); + Stack offsetStack = new Stack(); + Stack textStack = new Stack(); + //int level = 0; + //foreach (LineSegment segment in document.LineSegmentCollection) { + // + //} + return l; + } + + int GetLevel(IDocument document, int offset) + { + int level = 0; + int spaces = 0; + for (int i = offset; i < document.TextLength; ++i) { + char c = document.GetCharAt(i); + if (c == '\t' || (c == ' ' && ++spaces == 4)) { + spaces = 0; + ++level; + } else { + break; + } + } + return level; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/DefaultFormattingStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/DefaultFormattingStrategy.cs new file mode 100644 index 000000000..eee662518 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/DefaultFormattingStrategy.cs @@ -0,0 +1,180 @@ +// +// +// +// +// $Revision: 2643 $ +// + +using System; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This class handles the auto and smart indenting in the textbuffer while + /// you type. + /// + public class DefaultFormattingStrategy : IFormattingStrategy + { + /// + /// Creates a new instance off + /// + public DefaultFormattingStrategy() + { + } + + /// + /// returns the whitespaces which are before a non white space character in the line line + /// as a string. + /// + protected string GetIndentation(TextArea textArea, int lineNumber) + { + if (lineNumber < 0 || lineNumber > textArea.Document.TotalNumberOfLines) { + throw new ArgumentOutOfRangeException("lineNumber"); + } + + string lineText = TextUtilities.GetLineAsString(textArea.Document, lineNumber); + StringBuilder whitespaces = new StringBuilder(); + + foreach (char ch in lineText) { + if (Char.IsWhiteSpace(ch)) { + whitespaces.Append(ch); + } else { + break; + } + } + return whitespaces.ToString(); + } + + /// + /// Could be overwritten to define more complex indenting. + /// + protected virtual int AutoIndentLine(TextArea textArea, int lineNumber) + { + string indentation = lineNumber != 0 ? GetIndentation(textArea, lineNumber - 1) : ""; + if(indentation.Length > 0) { + string newLineText = indentation + TextUtilities.GetLineAsString(textArea.Document, lineNumber).Trim(); + LineSegment oldLine = textArea.Document.GetLineSegment(lineNumber); + textArea.Document.Replace(oldLine.Offset, oldLine.Length, newLineText); + } + return indentation.Length; + } + + /// + /// Could be overwritten to define more complex indenting. + /// + protected virtual int SmartIndentLine(TextArea textArea, int line) + { + return AutoIndentLine(textArea, line); // smart = autoindent in normal texts + } + + /// + /// This function formats a specific line after ch is pressed. + /// + /// + /// the caret delta position the caret will be moved this number + /// of bytes (e.g. the number of bytes inserted before the caret, or + /// removed, if this number is negative) + /// + public virtual void FormatLine(TextArea textArea, int line, int cursorOffset, char ch) + { + if (ch == '\n') { + textArea.Caret.Column = IndentLine(textArea, line); + } + } + + /// + /// This function sets the indentation level in a specific line + /// + /// + /// the number of inserted characters. + /// + public int IndentLine(TextArea textArea, int line) + { + textArea.Document.UndoStack.StartUndoGroup(); + int result; + switch (textArea.Document.TextEditorProperties.IndentStyle) { + case IndentStyle.None: + result = 0; + break; + case IndentStyle.Auto: + result = AutoIndentLine(textArea, line); + break; + case IndentStyle.Smart: + result = SmartIndentLine(textArea, line); + break; + default: + throw new NotSupportedException("Unsupported value for IndentStyle: " + textArea.Document.TextEditorProperties.IndentStyle); + } + textArea.Document.UndoStack.EndUndoGroup(); + return result; + } + + /// + /// This function sets the indentlevel in a range of lines. + /// + public virtual void IndentLines(TextArea textArea, int begin, int end) + { + textArea.Document.UndoStack.StartUndoGroup(); + for (int i = begin; i <= end; ++i) { + IndentLine(textArea, i); + } + textArea.Document.UndoStack.EndUndoGroup(); + } + + public virtual int SearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket) + { + int brackets = -1; + // first try "quick find" - find the matching bracket if there is no string/comment in the way + bool kavs = false; + for (int i = offset; i >= 0; --i) { + char ch = document.GetCharAt(i); + if (ch == openBracket) { + if (!kavs || ch == '{') + ++brackets; + if (brackets == 0) return i; + } else if (ch == closingBracket) { + if (!kavs || ch == '}') + --brackets; + } + else if (ch == '"') + { + break; + } else if (ch == '\'') { + kavs = !kavs; + } else if (ch == '/' && i > 0) { + if (document.GetCharAt(i - 1) == '/') break; + if (document.GetCharAt(i - 1) == '*') break; + } + } + return -1; + } + + public virtual int SearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket) + { + int brackets = 1; + bool kavs = false; + // try "quick find" - find the matching bracket if there is no string/comment in the way + for (int i = offset; i < document.TextLength; ++i) { + char ch = document.GetCharAt(i); + if (ch == openBracket) { + if (!kavs || ch == '{') + ++brackets; + } else if (ch == closingBracket) { + if (!kavs || ch == '}') + --brackets; + if (brackets == 0) return i; + } else if (ch == '"') { + break; + } else if (ch == '\'') { + kavs = !kavs; + } else if (ch == '/' && i > 0) { + if (document.GetCharAt(i - 1) == '/') break; + } else if (ch == '*' && i > 0) { + if (document.GetCharAt(i - 1) == '/') break; + } + } + return -1; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/IFormattingStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/IFormattingStrategy.cs new file mode 100644 index 000000000..2735e99e3 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/FormattingStrategy/IFormattingStrategy.cs @@ -0,0 +1,59 @@ +// +// +// +// +// $Revision: 2640 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This interface handles the auto and smart indenting and formating + /// in the document while you type. Language bindings could overwrite this + /// interface and define their own indentation/formating. + /// + public interface IFormattingStrategy + { + /// + /// This function formats a specific line after ch is pressed. + /// + void FormatLine(TextArea textArea, int line, int caretOffset, char charTyped); + + /// + /// This function sets the indentation level in a specific line + /// + /// + /// The target caret position (length of new indentation). + /// + int IndentLine(TextArea textArea, int line); + + /// + /// This function sets the indentlevel in a range of lines. + /// + void IndentLines(TextArea textArea, int begin, int end); + + /// + /// Finds the offset of the opening bracket in the block defined by offset skipping + /// brackets in strings and comments. + /// + /// The document to search in. + /// The offset of an position in the block or the offset of the closing bracket. + /// The character for the opening bracket. + /// The character for the closing bracket. + /// Returns the offset of the opening bracket or -1 if no matching bracket was found. + int SearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket); + + /// + /// Finds the offset of the closing bracket in the block defined by offset skipping + /// brackets in strings and comments. + /// + /// The document to search in. + /// The offset of an position in the block or the offset of the opening bracket. + /// The character for the opening bracket. + /// The character for the closing bracket. + /// Returns the offset of the closing bracket or -1 if no matching bracket was found. + int SearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs new file mode 100644 index 000000000..7e4a9cb97 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/DefaultHighlightingStrategy.cs @@ -0,0 +1,949 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Document +{ + public class DefaultHighlightingStrategy : IHighlightingStrategy + { + string name; + List rules = new List(); + + Dictionary environmentColors = new Dictionary(); + Dictionary properties = new Dictionary(); + string[] extensions; + + HighlightColor digitColor; + HighlightRuleSet defaultRuleSet = null; + + public HighlightColor DigitColor { + get { + return digitColor; + } + set { + digitColor = value; + } + } + + public IEnumerable> EnvironmentColors { + get { + return environmentColors; + } + } + + protected void ImportSettingsFrom(DefaultHighlightingStrategy source) + { + if (source == null) + throw new ArgumentNullException("source"); + properties = source.properties; + extensions = source.extensions; + digitColor = source.digitColor; + defaultRuleSet = source.defaultRuleSet; + name = source.name; + rules = source.rules; + environmentColors = source.environmentColors; + defaultTextColor = source.defaultTextColor; + } + + public DefaultHighlightingStrategy() : this("Default") + { + } + + public DefaultHighlightingStrategy(string name) + { + this.name = name; + + digitColor = new HighlightColor(SystemColors.WindowText, false, false); + defaultTextColor = new HighlightColor(SystemColors.WindowText, false, false); + + // set small 'default color environment' + environmentColors["Default"] = new HighlightBackground("WindowText", "Window", false, false); + environmentColors["Selection"] = new HighlightColor("HighlightText", "Highlight", false, false); + environmentColors["VRuler"] = new HighlightColor("ControlLight", "Window", false, false); + environmentColors["InvalidLines"] = new HighlightColor(Color.Red, false, false); + environmentColors["CaretMarker"] = new HighlightColor(Color.Yellow, false, false); + environmentColors["LineNumbers"] = new HighlightBackground("ControlDark", "Window", false, false); + + environmentColors["FoldLine"] = new HighlightColor(Color.FromArgb(0x80, 0x80, 0x80), Color.Black, false, false); + environmentColors["FoldMarker"] = new HighlightColor(Color.FromArgb(0x80, 0x80, 0x80), Color.White, false, false); + environmentColors["SelectedFoldLine"] = new HighlightColor(Color.Black, false, false); + environmentColors["EOLMarkers"] = new HighlightColor("ControlLight", "Window", false, false); + environmentColors["SpaceMarkers"] = new HighlightColor("ControlLight", "Window", false, false); + environmentColors["TabMarkers"] = new HighlightColor("ControlLight", "Window", false, false); + + } + + public Dictionary Properties { + get { + return properties; + } + } + + public string Name + { + get { + return name; + } + } + + public string[] Extensions + { + set { + extensions = value; + } + get { + return extensions; + } + } + + public List Rules { + get { + return rules; + } + } + + public HighlightRuleSet FindHighlightRuleSet(string name) + { + foreach(HighlightRuleSet ruleSet in rules) { + if (ruleSet.Name == name) { + return ruleSet; + } + } + return null; + } + + public void AddRuleSet(HighlightRuleSet aRuleSet) + { + HighlightRuleSet existing = FindHighlightRuleSet(aRuleSet.Name); + if (existing != null) { + existing.MergeFrom(aRuleSet); + } else { + rules.Add(aRuleSet); + } + } + + public void ResolveReferences() + { + // Resolve references from Span definitions to RuleSets + ResolveRuleSetReferences(); + // Resolve references from RuleSet defintitions to Highlighters defined in an external mode file + ResolveExternalReferences(); + } + + void ResolveRuleSetReferences() + { + foreach (HighlightRuleSet ruleSet in Rules) { + if (ruleSet.Name == null) { + defaultRuleSet = ruleSet; + } + + foreach (Span aSpan in ruleSet.Spans) { + if (aSpan.Rule != null) { + bool found = false; + foreach (HighlightRuleSet refSet in Rules) { + if (refSet.Name == aSpan.Rule) { + found = true; + aSpan.RuleSet = refSet; + break; + } + } + if (!found) { + aSpan.RuleSet = null; + throw new HighlightingDefinitionInvalidException("The RuleSet " + aSpan.Rule + " could not be found in mode definition " + this.Name); + } + } else { + aSpan.RuleSet = null; + } + } + } + + if (defaultRuleSet == null) { + throw new HighlightingDefinitionInvalidException("No default RuleSet is defined for mode definition " + this.Name); + } + } + + void ResolveExternalReferences() + { + foreach (HighlightRuleSet ruleSet in Rules) { + if (ruleSet.Reference != null) { + IHighlightingStrategy highlighter = HighlightingManager.Manager.FindHighlighter (ruleSet.Reference); + + if (highlighter != null) { + ruleSet.Highlighter = highlighter; + } else { + ruleSet.Highlighter = this; + throw new HighlightingDefinitionInvalidException("The mode defintion " + ruleSet.Reference + " which is refered from the " + this.Name + " mode definition could not be found"); + } + } else { + ruleSet.Highlighter = this; + } + } + } + +// internal void SetDefaultColor(HighlightBackground color) +// { +// return (HighlightColor)environmentColors[name]; +// defaultColor = color; +// } + + HighlightColor defaultTextColor; + + public HighlightColor DefaultTextColor { + get { + return defaultTextColor; + } + } + + public void SetColorFor(string name, HighlightColor color) + { + if (name == "Default") + defaultTextColor = new HighlightColor(color.Color, color.Bold, color.Italic); + environmentColors[name] = color; + } + + public HighlightColor GetColorFor(string name) + { + HighlightColor color; + if (environmentColors.TryGetValue(name, out color)) + return color; + else + return defaultTextColor; + } + + public HighlightColor GetColor(IDocument document, LineSegment currentSegment, int currentOffset, int currentLength) + { + return GetColor(defaultRuleSet, document, currentSegment, currentOffset, currentLength); + } + + protected virtual HighlightColor GetColor(HighlightRuleSet ruleSet, IDocument document, LineSegment currentSegment, int currentOffset, int currentLength) + { + if (ruleSet != null) { + if (ruleSet.Reference != null) { + return ruleSet.Highlighter.GetColor(document, currentSegment, currentOffset, currentLength); + } else { + return (HighlightColor)ruleSet.KeyWords[document, currentSegment, currentOffset, currentLength]; + } + } + return null; + } + + public HighlightRuleSet GetRuleSet(Span aSpan) + { + if (aSpan == null) { + return this.defaultRuleSet; + } else { + if (aSpan.RuleSet != null) + { + if (aSpan.RuleSet.Reference != null) { + return aSpan.RuleSet.Highlighter.GetRuleSet(null); + } else { + return aSpan.RuleSet; + } + } else { + return null; + } + } + } + + // Line state variable + protected LineSegment currentLine; + protected int currentLineNumber; + + // Span stack state variable + protected SpanStack currentSpanStack; + + public virtual void MarkTokens(IDocument document) + { + if (Rules.Count == 0) { + return; + } + + int lineNumber = 0; + + while (lineNumber < document.TotalNumberOfLines) { + LineSegment previousLine = (lineNumber > 0 ? document.GetLineSegment(lineNumber - 1) : null); + if (lineNumber >= document.LineSegmentCollection.Count) { // may be, if the last line ends with a delimiter + break; // then the last line is not in the collection :) + } + + currentSpanStack = ((previousLine != null && previousLine.HighlightSpanStack != null) ? previousLine.HighlightSpanStack.Clone() : null); + + if (currentSpanStack != null) { + while (!currentSpanStack.IsEmpty && currentSpanStack.Peek().StopEOL) + { + currentSpanStack.Pop(); + } + if (currentSpanStack.IsEmpty) currentSpanStack = null; + } + + currentLine = (LineSegment)document.LineSegmentCollection[lineNumber]; + + if (currentLine.Length == -1) { // happens when buffer is empty ! + return; + } + + currentLineNumber = lineNumber; + List words = ParseLine(document); + // Alex: clear old words + if (currentLine.Words != null) { + currentLine.Words.Clear(); + } + currentLine.Words = words; + currentLine.HighlightSpanStack = (currentSpanStack==null || currentSpanStack.IsEmpty) ? null : currentSpanStack; + + ++lineNumber; + } + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + document.CommitUpdate(); + currentLine = null; + } + + bool MarkTokensInLine(IDocument document, int lineNumber, ref bool spanChanged) + { + currentLineNumber = lineNumber; + bool processNextLine = false; + LineSegment previousLine = (lineNumber > 0 ? document.GetLineSegment(lineNumber - 1) : null); + + currentSpanStack = ((previousLine != null && previousLine.HighlightSpanStack != null) ? previousLine.HighlightSpanStack.Clone() : null); + if (currentSpanStack != null) { + while (!currentSpanStack.IsEmpty && currentSpanStack.Peek().StopEOL) { + currentSpanStack.Pop(); + } + if (currentSpanStack.IsEmpty) { + currentSpanStack = null; + } + } + + currentLine = (LineSegment)document.LineSegmentCollection[lineNumber]; + + if (currentLine.Length == -1) { // happens when buffer is empty ! + return false; + } + + List words = ParseLine(document); + // SSM 21/02/2022 - пробую исправить step + var fi = words.FindIndex(tw => string.Compare(tw.Word,"for",true)==0); + if (fi >= 0) + { + var toi = words.FindIndex(fi,tw => string.Compare(tw.Word, "to", true) == 0); + if (toi >= 0) + { + var stepi = words.FindIndex(toi,tw => string.Compare(tw.Word, "step", true) == 0); + if (stepi >= 0) + { + var doi = words.FindIndex(stepi, tw => string.Compare(tw.Word, "do", true) == 0); + if (doi >= 0) + { + var f = words[fi]; + var w = words[stepi]; + w.SyntaxColor = f.SyntaxColor; + } + } + } + } + var fe = words.FindIndex(tw => string.Compare(tw.Word, "foreach", true) == 0); + if (fe >= 0) + { + var index = words.FindIndex(tw => string.Compare(tw.Word, "index", true) == 0); + if (index >= 0) + { + var f = words[fe]; + var ind = words[index]; + ind.SyntaxColor = f.SyntaxColor; + } + + } + + + if (currentSpanStack != null && currentSpanStack.IsEmpty) { + currentSpanStack = null; + } + + // Check if the span state has changed, if so we must re-render the next line + // This check may seem utterly complicated but I didn't want to introduce any function calls + // or allocations here for perf reasons. + if(currentLine.HighlightSpanStack != currentSpanStack) { + if (currentLine.HighlightSpanStack == null) { + processNextLine = false; + foreach (Span sp in currentSpanStack) { + if (!sp.StopEOL) { + spanChanged = true; + processNextLine = true; + break; + } + } + } else if (currentSpanStack == null) { + processNextLine = false; + foreach (Span sp in currentLine.HighlightSpanStack) { + if (!sp.StopEOL) { + spanChanged = true; + processNextLine = true; + break; + } + } + } else { + SpanStack.Enumerator e1 = currentSpanStack.GetEnumerator(); + SpanStack.Enumerator e2 = currentLine.HighlightSpanStack.GetEnumerator(); + bool done = false; + while (!done) { + bool blockSpanIn1 = false; + while (e1.MoveNext()) { + if (!((Span)e1.Current).StopEOL) { + blockSpanIn1 = true; + break; + } + } + bool blockSpanIn2 = false; + while (e2.MoveNext()) { + if (!((Span)e2.Current).StopEOL) { + blockSpanIn2 = true; + break; + } + } + if (blockSpanIn1 || blockSpanIn2) { + if (blockSpanIn1 && blockSpanIn2) { + if (e1.Current != e2.Current) { + done = true; + processNextLine = true; + spanChanged = true; + } + } else { + spanChanged = true; + done = true; + processNextLine = true; + } + } else { + done = true; + processNextLine = false; + } + } + } + } else { + processNextLine = false; + } + + //// Alex: remove old words + if (currentLine.Words!=null) currentLine.Words.Clear(); + currentLine.Words = words; + currentLine.HighlightSpanStack = (currentSpanStack != null && !currentSpanStack.IsEmpty) ? currentSpanStack : null; + + return processNextLine; + } + + public virtual void MarkTokens(IDocument document, List inputLines) + { + if (Rules.Count == 0) { + return; + } + + Dictionary processedLines = new Dictionary(); + + bool spanChanged = false; + int documentLineSegmentCount = document.LineSegmentCollection.Count; + + foreach (LineSegment lineToProcess in inputLines) { + if (!processedLines.ContainsKey(lineToProcess)) { + int lineNumber = lineToProcess.LineNumber; + bool processNextLine = true; + + if (lineNumber != -1) { + while (processNextLine && lineNumber < documentLineSegmentCount) { + processNextLine = MarkTokensInLine(document, lineNumber, ref spanChanged); + processedLines[currentLine] = true; + //processedLines[lineToProcess] = true; + ++lineNumber; + } + } + } + } + + if (spanChanged || inputLines.Count > 20) { + // if the span was changed (more than inputLines lines had to be reevaluated) + // or if there are many lines in inputLines, it's faster to update the whole + // text area instead of many small segments + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + } else { +// document.Caret.ValidateCaretPos(); +// document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, document.GetLineNumberForOffset(document.Caret.Offset))); +// + foreach (LineSegment lineToProcess in inputLines) { + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, lineToProcess.LineNumber)); + } + + } + document.CommitUpdate(); + currentLine = null; + } + + // Span state variables + protected bool inSpan; + protected Span activeSpan; + protected HighlightRuleSet activeRuleSet; + + // Line scanning state variables + protected int currentOffset; + protected int currentLength; + + void UpdateSpanStateVariables() + { + inSpan = (currentSpanStack != null && !currentSpanStack.IsEmpty); + activeSpan = inSpan ? currentSpanStack.Peek() : null; + activeRuleSet = GetRuleSet(activeSpan); + } + + List ParseLine(IDocument document) + { + List words = new List(); + HighlightColor markNext = null; + + currentOffset = 0; + currentLength = 0; + UpdateSpanStateVariables(); + + int currentLineLength = currentLine.Length; + int currentLineOffset = currentLine.Offset; + + for (int i = 0; i < currentLine.Length; ++i) { + char ch = document.GetCharAt(currentLineOffset + i); + switch (ch) { + case '\n': + case '\r': + PushCurWord(document, ref markNext, words); + ++currentOffset; + break; + case ' ': + PushCurWord(document, ref markNext, words); + if (activeSpan != null && activeSpan.Color.HasBackground) { + words.Add(new TextWord.SpaceTextWord(activeSpan.Color)); + } else { + words.Add(TextWord.Space); + } + ++currentOffset; + break; + case '\t': + PushCurWord(document, ref markNext, words); + if (activeSpan != null && activeSpan.Color.HasBackground) { + words.Add(new TextWord.TabTextWord(activeSpan.Color)); + } else { + words.Add(TextWord.Tab); + } + ++currentOffset; + break; + default: + { + // handle escape characters + char escapeCharacter = '\0'; + if (activeSpan != null && activeSpan.EscapeCharacter != '\0') { + escapeCharacter = activeSpan.EscapeCharacter; + } else if (activeRuleSet != null) { + escapeCharacter = activeRuleSet.EscapeCharacter; + } + if (escapeCharacter != '\0' && escapeCharacter == ch) { + // we found the escape character + if (activeSpan != null && activeSpan.End != null && activeSpan.End.Length == 1 + && escapeCharacter == activeSpan.End[0]) + { + // the escape character is a end-doubling escape character + // it may count as escape only when the next character is the escape, too + if (i + 1 < currentLineLength) { + if (document.GetCharAt(currentLineOffset + i + 1) == escapeCharacter) { + currentLength += 2; + PushCurWord(document, ref markNext, words); + ++i; + continue; + } + } + } else { + // this is a normal \-style escape + ++currentLength; + if (i + 1 < currentLineLength) { + ++currentLength; + } + PushCurWord(document, ref markNext, words); + ++i; + continue; + } + } + + // highlight digits + if (!inSpan && (Char.IsDigit(ch) || (ch == '.' && i + 1 < currentLineLength && Char.IsDigit(document.GetCharAt(currentLineOffset + i + 1)))) && currentLength == 0) { + bool ishex = false; + bool isfloatingpoint = false; + + if (ch == '0' && i + 1 < currentLineLength && Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1)) == 'X') { // hex digits + const string hex = "0123456789ABCDEF"; + ++currentLength; + ++i; // skip 'x' + ++currentLength; + ishex = true; + while (i + 1 < currentLineLength && hex.IndexOf(Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1))) != -1) { + ++i; + ++currentLength; + } + } else { + ++currentLength; + while (i + 1 < currentLineLength && Char.IsDigit(document.GetCharAt(currentLineOffset + i + 1))) { + ++i; + ++currentLength; + } + } + if (!ishex && i + 1 < currentLineLength && document.GetCharAt(currentLineOffset + i + 1) == '.') { + isfloatingpoint = true; + ++i; + ++currentLength; + while (i + 1 < currentLineLength && Char.IsDigit(document.GetCharAt(currentLineOffset + i + 1))) { + ++i; + ++currentLength; + } + } + + if (i + 1 < currentLineLength && Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1)) == 'E') { + isfloatingpoint = true; + ++i; + ++currentLength; + if (i + 1 < currentLineLength && (document.GetCharAt(currentLineOffset + i + 1) == '+' || document.GetCharAt(currentLine.Offset + i + 1) == '-')) { + ++i; + ++currentLength; + } + while (i + 1 < currentLine.Length && Char.IsDigit(document.GetCharAt(currentLineOffset + i + 1))) { + ++i; + ++currentLength; + } + } + + if (i + 1 < currentLine.Length) { + char nextch = Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1)); + if (nextch == 'F' || nextch == 'M' || nextch == 'D') { + isfloatingpoint = true; + ++i; + ++currentLength; + } + } + + if (!isfloatingpoint) { + bool isunsigned = false; + if (i + 1 < currentLineLength && Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1)) == 'U') { + ++i; + ++currentLength; + isunsigned = true; + } + if (i + 1 < currentLineLength && Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1)) == 'L') { + ++i; + ++currentLength; + if (!isunsigned && i + 1 < currentLineLength && Char.ToUpper(document.GetCharAt(currentLineOffset + i + 1)) == 'U') { + ++i; + ++currentLength; + } + } + } + + words.Add(new TextWord(document, currentLine, currentOffset, currentLength, DigitColor, false)); + currentOffset += currentLength; + currentLength = 0; + continue; + } + + // Check for SPAN ENDs + if (inSpan) { + if (activeSpan.End != null && activeSpan.End.Length > 0) { + if (MatchExpr(currentLine, activeSpan.End, i, document, activeSpan.IgnoreCase, currentLineOffset)) + { + PushCurWord(document, ref markNext, words); + string regex = GetRegString(currentLine, activeSpan.End, i, document, currentLineOffset); + currentLength += regex.Length; + words.Add(new TextWord(document, currentLine, currentOffset, currentLength, activeSpan.EndColor, false)); + currentOffset += currentLength; + currentLength = 0; + i += regex.Length - 1; + currentSpanStack.Pop(); + UpdateSpanStateVariables(); + continue; + } + } + } + + // check for SPAN BEGIN + if (activeRuleSet != null) { + foreach (Span span in activeRuleSet.Spans) { + + if ((!span.IsBeginSingleWord || currentLength == 0) + && (!span.IsBeginStartOfLine.HasValue || span.IsBeginStartOfLine.Value == (currentLength == 0 && words.TrueForAll(delegate(TextWord textWord) { return textWord.Type != TextWordType.Word; }))) + && MatchExpr(currentLine, span.Begin, i, document, activeRuleSet.IgnoreCase, currentLineOffset)) + { + + PushCurWord(document, ref markNext, words); + + string regex = GetRegString(currentLine, span.Begin, i, document, currentLineOffset); + + if (!OverrideSpan(regex, document, words, span, ref i)) { + currentLength += regex.Length; + words.Add(new TextWord(document, currentLine, currentOffset, currentLength, span.BeginColor, false)); + currentOffset += currentLength; + currentLength = 0; + + i += regex.Length - 1; + if (currentSpanStack == null) { + currentSpanStack = new SpanStack(); + } + currentSpanStack.Push(span); + span.IgnoreCase = activeRuleSet.IgnoreCase; + + UpdateSpanStateVariables(); + } + + goto skip; + } + } + } + + // check if the char is a delimiter + if (activeRuleSet != null && (int)ch < 256 && activeRuleSet.Delimiters[(int)ch]) { + PushCurWord(document, ref markNext, words); + if (currentOffset + currentLength +1 < currentLine.Length) { + ++currentLength; + PushCurWord(document, ref markNext, words); + goto skip; + } + } + + ++currentLength; + skip: continue; + } + } + } + + PushCurWord(document, ref markNext, words); + + OnParsedLine(document, currentLine, words); + + return words; + } + + protected virtual void OnParsedLine(IDocument document, LineSegment currentLine, List words) + { + } + + protected virtual bool OverrideSpan(string spanBegin, IDocument document, List words, Span span, ref int lineOffset) + { + return false; + } + + /// + /// pushes the curWord string on the word list, with the + /// correct color. + /// + void PushCurWord(IDocument document, ref HighlightColor markNext, List words) + { + // Svante Lidman : Need to look through the next prev logic. + if (currentLength > 0) { + if (words.Count > 0 && activeRuleSet != null) { + TextWord prevWord = null; + int pInd = words.Count - 1; + while (pInd >= 0) { + if (!((TextWord)words[pInd]).IsWhiteSpace) { + prevWord = (TextWord)words[pInd]; + if (prevWord.HasDefaultColor) { + PrevMarker marker = (PrevMarker)activeRuleSet.PrevMarkers[document, currentLine, currentOffset, currentLength]; + if (marker != null) { + prevWord.SyntaxColor = marker.Color; +// document.Caret.ValidateCaretPos(); +// document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, document.GetLineNumberForOffset(document.Caret.Offset))); + } + } + break; + } + pInd--; + } + } + + if (inSpan) { + HighlightColor c = null; + bool hasDefaultColor = true; + if (activeSpan.Rule == null) { + c = activeSpan.Color; + } else { + c = GetColor(activeRuleSet, document, currentLine, currentOffset, currentLength); + hasDefaultColor = false; + } + + if (c == null) { + c = activeSpan.Color; + if (c.Color == Color.Transparent) { + c = this.DefaultTextColor; + } + hasDefaultColor = true; + } + words.Add(new TextWord(document, currentLine, currentOffset, currentLength, markNext != null ? markNext : c, hasDefaultColor)); + } else { + HighlightColor c = markNext != null ? markNext : GetColor(activeRuleSet, document, currentLine, currentOffset, currentLength); + if (c == null) { + words.Add(new TextWord(document, currentLine, currentOffset, currentLength, this.DefaultTextColor, true)); + } else { + words.Add(new TextWord(document, currentLine, currentOffset, currentLength, c, false)); + } + } + + if (activeRuleSet != null) { + NextMarker nextMarker = (NextMarker)activeRuleSet.NextMarkers[document, currentLine, currentOffset, currentLength]; + if (nextMarker != null) { + if (nextMarker.MarkMarker && words.Count > 0) { + TextWord prevword = ((TextWord)words[words.Count - 1]); + prevword.SyntaxColor = nextMarker.Color; + } + markNext = nextMarker.Color; + } else { + markNext = null; + } + } + currentOffset += currentLength; + currentLength = 0; + } + } + + #region Matching + /// + /// get the string, which matches the regular expression expr, + /// in string s2 at index + /// + static string GetRegString(LineSegment lineSegment, char[] expr, int index, IDocument document, int currentLineOffset) + { + int j = 0; + StringBuilder regexpr = new StringBuilder(); + int offset = currentLineOffset; + int length = lineSegment.Length; + for (int i = 0; i < expr.Length; ++i, ++j) { + if (index + j >= length) + break; + + switch (expr[i]) { + case '@': // "special" meaning + ++i; + switch (expr[i]) { + case '!': // don't match the following expression + StringBuilder whatmatch = new StringBuilder(); + ++i; + while (i < expr.Length && expr[i] != '@') { + whatmatch.Append(expr[i++]); + } + break; + case '@': // matches @ + regexpr.Append(document.GetCharAt(offset + index + j)); + break; + } + break; + default: + if (expr[i] != document.GetCharAt(offset + index + j)) { + return regexpr.ToString(); + } + regexpr.Append(document.GetCharAt(offset + index + j)); + break; + } + } + return regexpr.ToString(); + } + + /// + /// returns true, if the get the string s2 at index matches the expression expr + /// + static bool MatchExpr(LineSegment lineSegment, char[] expr, int index, IDocument document, bool ignoreCase, int currentLineOffset) + { + int offset = currentLineOffset; + int length = lineSegment.Length; + for (int i = 0, j = 0; i < expr.Length; ++i, ++j) { + + switch (expr[i]) { + case '@': // "special" meaning + ++i; + if (i < expr.Length) { + switch (expr[i]) { + case 'C': // match whitespace or punctuation + if (index + j == offset || index + j >= offset + length) { + // nothing (EOL or SOL) + } else { + char ch = document.GetCharAt(offset + index + j); + if (!Char.IsWhiteSpace(ch) && !Char.IsPunctuation(ch)) { + return false; + } + } + break; + case '!': // don't match the following expression + { + StringBuilder whatmatch = new StringBuilder(); + ++i; + while (i < expr.Length && expr[i] != '@') { + whatmatch.Append(expr[i++]); + } + if (offset + index + j + whatmatch.Length < document.TextLength) { + int k = 0; + for (; k < whatmatch.Length; ++k) { + char docChar = ignoreCase ? Char.ToUpperInvariant(document.GetCharAt(offset + index + j + k)) : document.GetCharAt(offset + index + j + k); + char spanChar = ignoreCase ? Char.ToUpperInvariant(whatmatch[k]) : whatmatch[k]; + if (docChar != spanChar) { + break; + } + } + if (k >= whatmatch.Length) { + return false; + } + } +// --j; + break; + } + case '-': // don't match the expression before + { + StringBuilder whatmatch = new StringBuilder(); + ++i; + while (i < expr.Length && expr[i] != '@') { + whatmatch.Append(expr[i++]); + } + if (index - whatmatch.Length >= 0) { + int k = 0; + for (; k < whatmatch.Length; ++k) { + char docChar = ignoreCase ? Char.ToUpperInvariant(document.GetCharAt(offset + index - whatmatch.Length + k)) : document.GetCharAt(offset + index - whatmatch.Length + k); + char spanChar = ignoreCase ? Char.ToUpperInvariant(whatmatch[k]) : whatmatch[k]; + if (docChar != spanChar) + break; + } + if (k >= whatmatch.Length) { + return false; + } + } +// --j; + break; + } + case '@': // matches @ + if (index + j >= length || '@' != document.GetCharAt(offset + index + j)) { + return false; + } + break; + } + } + break; + default: + { + if (index + j >= length) { + return false; + } + char docChar = ignoreCase ? Char.ToUpperInvariant(document.GetCharAt(offset + index + j)) : document.GetCharAt(offset + index + j); + char spanChar = ignoreCase ? Char.ToUpperInvariant(expr[i]) : expr[i]; + if (docChar != spanChar) { + return false; + } + break; + } + } + } + return true; + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/FontContainer.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/FontContainer.cs new file mode 100644 index 000000000..791a25f71 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/FontContainer.cs @@ -0,0 +1,103 @@ +// +// +// +// +// $Revision: 2313 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This class is used to generate bold, italic and bold/italic fonts out + /// of a base font. + /// + public class FontContainer + { + Font defaultFont; + Font regularfont, boldfont, italicfont, bolditalicfont; + + /// + /// The scaled, regular version of the base font + /// + public Font RegularFont { + get { + return regularfont; + } + } + + /// + /// The scaled, bold version of the base font + /// + public Font BoldFont { + get { + return boldfont; + } + } + + /// + /// The scaled, italic version of the base font + /// + public Font ItalicFont { + get { + return italicfont; + } + } + + /// + /// The scaled, bold/italic version of the base font + /// + public Font BoldItalicFont { + get { + return bolditalicfont; + } + } + + static float twipsPerPixelY; + + public static float TwipsPerPixelY { + get { + if (twipsPerPixelY == 0) { + using (Bitmap bmp = new Bitmap(1,1)) { + using (Graphics g = Graphics.FromImage(bmp)) { + twipsPerPixelY = 1440 / g.DpiY; + } + } + } + return twipsPerPixelY; + } + } + + /// + /// The base font + /// + public Font DefaultFont { + get { + return defaultFont; + } + set { + // 1440 twips is one inch + int pixelSize = (int)(value.SizeInPoints * 20 / TwipsPerPixelY); + + defaultFont = value; + regularfont = new Font(value.FontFamily, pixelSize * TwipsPerPixelY / 20f, FontStyle.Regular); + boldfont = new Font(regularfont, FontStyle.Bold); + italicfont = new Font(regularfont, FontStyle.Italic); + bolditalicfont = new Font(regularfont, FontStyle.Bold | FontStyle.Italic); + } + } + + public static Font ParseFont(string font) + { + string[] descr = font.Split(new char[]{',', '='}); + return new Font(descr[1], Single.Parse(descr[3])); + } + + public FontContainer(Font defaultFont) + { + this.DefaultFont = defaultFont; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightBackground.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightBackground.cs new file mode 100644 index 000000000..9dd105396 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightBackground.cs @@ -0,0 +1,51 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Drawing; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Extens the highlighting color with a background image. + /// + public class HighlightBackground : HighlightColor + { + Image backgroundImage; + + /// + /// The image used as background + /// + public Image BackgroundImage { + get { + return backgroundImage; + } + } + + /// + /// Creates a new instance of + /// + public HighlightBackground(XmlElement el) : base(el) + { + if (el.Attributes["image"] != null) { + backgroundImage = new Bitmap(el.Attributes["image"].InnerText); + } + } + + /// + /// Creates a new instance of + /// + public HighlightBackground(Color color, Color backgroundcolor, bool bold, bool italic) : base(color, backgroundcolor, bold, italic) + { + } + + public HighlightBackground(string systemColor, string systemBackgroundColor, bool bold, bool italic) : base(systemColor, systemBackgroundColor, bold, italic) + { + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightColor.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightColor.cs new file mode 100644 index 000000000..30bf5814e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightColor.cs @@ -0,0 +1,280 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; +using System.Globalization; +using System.Reflection; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// A color used for highlighting + /// + public class HighlightColor + { + bool systemColor = false; + string systemColorName = null; + + bool systemBgColor = false; + string systemBgColorName = null; + + Color color; + Color backgroundcolor = System.Drawing.Color.WhiteSmoke; + + bool bold = false; + bool italic = false; + bool hasForeground = false; + bool hasBackground = false; + + public bool HasForeground { + get { + return hasForeground; + } + } + + public bool HasBackground { + get { + return hasBackground; + } + } + + + /// + /// If true the font will be displayed bold style + /// + public bool Bold { + get { + return bold; + } + } + + /// + /// If true the font will be displayed italic style + /// + public bool Italic { + get { + return italic; + } + } + + /// + /// The background color used + /// + public Color BackgroundColor { + get { + if (!systemBgColor) { + return backgroundcolor; + } + return ParseColorString(systemBgColorName); + } + } + + /// + /// The foreground color used + /// + public Color Color { + get { + if (!systemColor) { + return color; + } + return ParseColorString(systemColorName); + } + } + + /// + /// The font used + /// + public Font GetFont(FontContainer fontContainer) + { + if (Bold) { + return Italic ? fontContainer.BoldItalicFont : fontContainer.BoldFont; + } + return Italic ? fontContainer.ItalicFont : fontContainer.RegularFont; + } + + Color ParseColorString(string colorName) + { + string[] cNames = colorName.Split('*'); + PropertyInfo myPropInfo = typeof(System.Drawing.SystemColors).GetProperty(cNames[0], BindingFlags.Public | + BindingFlags.Instance | + BindingFlags.Static); + Color c = (Color)myPropInfo.GetValue(null, null); + + if (cNames.Length == 2) { + // hack : can't figure out how to parse doubles with '.' (culture info might set the '.' to ',') + double factor = Double.Parse(cNames[1]) / 100; + c = Color.FromArgb((int)((double)c.R * factor), (int)((double)c.G * factor), (int)((double)c.B * factor)); + } + + return c; + } + + /// + /// Creates a new instance of + /// + public HighlightColor(XmlElement el) + { + Debug.Assert(el != null, "ICSharpCode.TextEditor.Document.SyntaxColor(XmlElement el) : el == null"); + if (el.Attributes["bold"] != null) { + bold = Boolean.Parse(el.Attributes["bold"].InnerText); + } + + if (el.Attributes["italic"] != null) { + italic = Boolean.Parse(el.Attributes["italic"].InnerText); + } + + if (el.Attributes["color"] != null) { + string c = el.Attributes["color"].InnerText; + if (c[0] == '#') { + color = ParseColor(c); + } else if (c.StartsWith("SystemColors.")) { + systemColor = true; + systemColorName = c.Substring("SystemColors.".Length); + } else { + color = (Color)(Color.GetType()).InvokeMember(c, BindingFlags.GetProperty, null, Color, new object[0]); + } + hasForeground = true; + } else { + color = Color.Transparent; // to set it to the default value. + } + + if (el.Attributes["bgcolor"] != null) { + string c = el.Attributes["bgcolor"].InnerText; + if (c[0] == '#') { + backgroundcolor = ParseColor(c); + } else if (c.StartsWith("SystemColors.")) { + systemBgColor = true; + systemBgColorName = c.Substring("SystemColors.".Length); + } else { + backgroundcolor = (Color)(Color.GetType()).InvokeMember(c, BindingFlags.GetProperty, null, Color, new object[0]); + } + hasBackground = true; + } + } + + /// + /// Creates a new instance of + /// + public HighlightColor(XmlElement el, HighlightColor defaultColor) + { + Debug.Assert(el != null, "ICSharpCode.TextEditor.Document.SyntaxColor(XmlElement el) : el == null"); + if (el.Attributes["bold"] != null) { + bold = Boolean.Parse(el.Attributes["bold"].InnerText); + } else { + bold = defaultColor.Bold; + } + + if (el.Attributes["italic"] != null) { + italic = Boolean.Parse(el.Attributes["italic"].InnerText); + } else { + italic = defaultColor.Italic; + } + + if (el.Attributes["color"] != null) { + string c = el.Attributes["color"].InnerText; + if (c[0] == '#') { + color = ParseColor(c); + } else if (c.StartsWith("SystemColors.")) { + systemColor = true; + systemColorName = c.Substring("SystemColors.".Length); + } else { + color = (Color)(Color.GetType()).InvokeMember(c, BindingFlags.GetProperty, null, Color, new object[0]); + } + hasForeground = true; + } else { + color = defaultColor.color; + } + + if (el.Attributes["bgcolor"] != null) { + string c = el.Attributes["bgcolor"].InnerText; + if (c[0] == '#') { + backgroundcolor = ParseColor(c); + } else if (c.StartsWith("SystemColors.")) { + systemBgColor = true; + systemBgColorName = c.Substring("SystemColors.".Length); + } else { + backgroundcolor = (Color)(Color.GetType()).InvokeMember(c, BindingFlags.GetProperty, null, Color, new object[0]); + } + hasBackground = true; + } else { + backgroundcolor = defaultColor.BackgroundColor; + } + } + + /// + /// Creates a new instance of + /// + public HighlightColor(Color color, bool bold, bool italic) + { + hasForeground = true; + this.color = color; + this.bold = bold; + this.italic = italic; + } + + /// + /// Creates a new instance of + /// + public HighlightColor(Color color, Color backgroundcolor, bool bold, bool italic) + { + hasForeground = true; + hasBackground = true; + this.color = color; + this.backgroundcolor = backgroundcolor; + this.bold = bold; + this.italic = italic; + } + + + /// + /// Creates a new instance of + /// + public HighlightColor(string systemColor, string systemBackgroundColor, bool bold, bool italic) + { + hasForeground = true; + hasBackground = true; + + this.systemColor = true; + systemColorName = systemColor; + + systemBgColor = true; + systemBgColorName = systemBackgroundColor; + + this.bold = bold; + this.italic = italic; + } + + static Color ParseColor(string c) + { + int a = 255; + int offset = 0; + if (c.Length > 7) { + offset = 2; + a = Int32.Parse(c.Substring(1,2), NumberStyles.HexNumber); + } + + int r = Int32.Parse(c.Substring(1 + offset,2), NumberStyles.HexNumber); + int g = Int32.Parse(c.Substring(3 + offset,2), NumberStyles.HexNumber); + int b = Int32.Parse(c.Substring(5 + offset,2), NumberStyles.HexNumber); + return Color.FromArgb(a, r, g, b); + } + + /// + /// Converts a instance to string (for debug purposes) + /// + public override string ToString() + { + return "[HighlightColor: Bold = " + Bold + + ", Italic = " + Italic + + ", Color = " + Color + + ", BackgroundColor = " + BackgroundColor + "]"; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightInfo.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightInfo.cs new file mode 100644 index 000000000..1cb28bdcd --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightInfo.cs @@ -0,0 +1,25 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + public class HighlightInfo + { + public bool BlockSpanOn = false; + public bool Span = false; + public Span CurSpan = null; + + public HighlightInfo(Span curSpan, bool span, bool blockSpanOn) + { + this.CurSpan = curSpan; + this.Span = span; + this.BlockSpanOn = blockSpanOn; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightRuleSet.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightRuleSet.cs new file mode 100644 index 000000000..740c07087 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightRuleSet.cs @@ -0,0 +1,190 @@ +// +// +// +// +// $Revision: 2115 $ +// + +using System; +using System.Collections; +using System.Xml; + +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.TextEditor.Document +{ + public class HighlightRuleSet + { + LookupTable keyWords; + ArrayList spans = new ArrayList(); + LookupTable prevMarkers; + LookupTable nextMarkers; + IHighlightingStrategy highlighter = null; + char escapeCharacter; + + bool ignoreCase = false; + string name = null; + + bool[] delimiters = new bool[256]; + + string reference = null; + + public ArrayList Spans { + get { + return spans; + } + } + + internal IHighlightingStrategy Highlighter { + get { + return highlighter; + } + set { + highlighter = value; + } + } + + public LookupTable KeyWords { + get { + return keyWords; + } + } + + public LookupTable PrevMarkers { + get { + return prevMarkers; + } + } + + public LookupTable NextMarkers { + get { + return nextMarkers; + } + } + + public bool[] Delimiters { + get { + return delimiters; + } + } + + public char EscapeCharacter { + get { + return escapeCharacter; + } + } + + public bool IgnoreCase { + get { + return ignoreCase; + } + } + + public string Name { + get { + return name; + } + set { + name = value; + } + } + + public string Reference { + get { + return reference; + } + } + + public HighlightRuleSet() + { + keyWords = new LookupTable(false); + prevMarkers = new LookupTable(false); + nextMarkers = new LookupTable(false); + } + + public HighlightRuleSet(XmlElement el) + { + XmlNodeList nodes; + + if (el.Attributes["name"] != null) { + Name = el.Attributes["name"].InnerText; + } + + if (el.HasAttribute("escapecharacter")) { + escapeCharacter = el.GetAttribute("escapecharacter")[0]; + } + + if (el.Attributes["reference"] != null) { + reference = el.Attributes["reference"].InnerText; + } + + if (el.Attributes["ignorecase"] != null) { + ignoreCase = Boolean.Parse(el.Attributes["ignorecase"].InnerText); + } + + for (int i = 0; i < Delimiters.Length; ++i) { + delimiters[i] = false; + } + + if (el["Delimiters"] != null) { + string delimiterString = el["Delimiters"].InnerText; + foreach (char ch in delimiterString) { + delimiters[(int)ch] = true; + } + } + +// Spans = new LookupTable(!IgnoreCase); + + keyWords = new LookupTable(!IgnoreCase); + prevMarkers = new LookupTable(!IgnoreCase); + nextMarkers = new LookupTable(!IgnoreCase); + + nodes = el.GetElementsByTagName("KeyWords"); + foreach (XmlElement el2 in nodes) { + HighlightColor color = new HighlightColor(el2); + + XmlNodeList keys = el2.GetElementsByTagName("Key"); + foreach (XmlElement node in keys) { + keyWords[node.Attributes["word"].InnerText] = color; + } + } + + nodes = el.GetElementsByTagName("Span"); + foreach (XmlElement el2 in nodes) { + Spans.Add(new Span(el2)); + /* + Span span = new Span(el2); + Spans[span.Begin] = span;*/ + } + + nodes = el.GetElementsByTagName("MarkPrevious"); + foreach (XmlElement el2 in nodes) { + PrevMarker prev = new PrevMarker(el2); + prevMarkers[prev.What] = prev; + } + + nodes = el.GetElementsByTagName("MarkFollowing"); + foreach (XmlElement el2 in nodes) { + NextMarker next = new NextMarker(el2); + nextMarkers[next.What] = next; + } + } + + /// + /// Merges spans etc. from the other rule set into this rule set. + /// + public void MergeFrom(HighlightRuleSet ruleSet) + { + for (int i = 0; i < delimiters.Length; i++) { + delimiters[i] |= ruleSet.delimiters[i]; + } + // insert merged spans in front of old spans + ArrayList oldSpans = spans; + spans = (ArrayList)ruleSet.spans.Clone(); + spans.AddRange(oldSpans); + //keyWords.MergeFrom(ruleSet.keyWords); + //prevMarkers.MergeFrom(ruleSet.prevMarkers); + //nextMarkers.MergeFrom(ruleSet.nextMarkers); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingColorNotFoundException.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingColorNotFoundException.cs new file mode 100644 index 000000000..c439be498 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingColorNotFoundException.cs @@ -0,0 +1,32 @@ +// +// +// +// +// $Revision: 1624 $ +// + +using System; +using System.Runtime.Serialization; + +namespace ICSharpCode.TextEditor.Document +{ + [Serializable()] + public class HighlightingColorNotFoundException : Exception + { + public HighlightingColorNotFoundException() : base() + { + } + + public HighlightingColorNotFoundException(string message) : base(message) + { + } + + public HighlightingColorNotFoundException(string message, Exception innerException) : base(message, innerException) + { + } + + protected HighlightingColorNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionInvalidException.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionInvalidException.cs new file mode 100644 index 000000000..229bdc7d5 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionInvalidException.cs @@ -0,0 +1,37 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Runtime.Serialization; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Indicates that the highlighting definition that was tried to load was invalid. + /// You get this exception only once per highlighting definition, after that the definition + /// is replaced with the default highlighter. + /// + [Serializable()] + public class HighlightingDefinitionInvalidException : Exception + { + public HighlightingDefinitionInvalidException() : base() + { + } + + public HighlightingDefinitionInvalidException(string message) : base(message) + { + } + + public HighlightingDefinitionInvalidException(string message, Exception innerException) : base(message, innerException) + { + } + + protected HighlightingDefinitionInvalidException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionParser.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionParser.cs new file mode 100644 index 000000000..1c08cb6b1 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingDefinitionParser.cs @@ -0,0 +1,110 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Schema; + +namespace ICSharpCode.TextEditor.Document +{ + public static class HighlightingDefinitionParser + { + public static DefaultHighlightingStrategy Parse(SyntaxMode syntaxMode, XmlReader xmlReader) + { + return Parse(null, syntaxMode, xmlReader); + } + + public static DefaultHighlightingStrategy Parse(DefaultHighlightingStrategy highlighter, SyntaxMode syntaxMode, XmlReader xmlReader) + { + if (syntaxMode == null) + throw new ArgumentNullException("syntaxMode"); + if (xmlReader == null) + throw new ArgumentNullException("xmlTextReader"); + try { + List errors = null; + XmlReaderSettings settings = new XmlReaderSettings(); + Stream shemaStream = typeof(HighlightingDefinitionParser).Assembly.GetManifestResourceStream("ICSharpCode.TextEditor.Resources.Mode.xsd"); + settings.Schemas.Add("", new XmlTextReader(shemaStream)); + settings.Schemas.ValidationEventHandler += delegate(object sender, ValidationEventArgs args) { + if (errors == null) { + errors = new List(); + } + errors.Add(args); + }; + settings.ValidationType = ValidationType.Schema; + XmlReader validatingReader = XmlReader.Create(xmlReader, settings); + + XmlDocument doc = new XmlDocument(); + doc.Load(validatingReader); + + if (highlighter == null) + highlighter = new DefaultHighlightingStrategy(doc.DocumentElement.Attributes["name"].InnerText); + + if (doc.DocumentElement.HasAttribute("extends")) { + KeyValuePair entry = HighlightingManager.Manager.FindHighlighterEntry(doc.DocumentElement.GetAttribute("extends")); + if (entry.Key == null) { + throw new HighlightingDefinitionInvalidException("Cannot find referenced highlighting source " + doc.DocumentElement.GetAttribute("extends")); + } else { + highlighter = Parse(highlighter, entry.Key, entry.Value.GetSyntaxModeFile(entry.Key)); + if (highlighter == null) return null; + } + } + if (doc.DocumentElement.HasAttribute("extensions")) { + highlighter.Extensions = doc.DocumentElement.GetAttribute("extensions").Split(new char[] { ';', '|' }); + } + + XmlElement environment = doc.DocumentElement["Environment"]; + if (environment != null) { + foreach (XmlNode node in environment.ChildNodes) { + if (node is XmlElement) { + XmlElement el = (XmlElement)node; + if (el.Name == "Custom") { + highlighter.SetColorFor(el.GetAttribute("name"), el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el)); + } else { + highlighter.SetColorFor(el.Name, el.HasAttribute("bgcolor") ? new HighlightBackground(el) : new HighlightColor(el)); + } + } + } + } + + // parse properties + if (doc.DocumentElement["Properties"]!= null) { + foreach (XmlElement propertyElement in doc.DocumentElement["Properties"].ChildNodes) { + highlighter.Properties[propertyElement.Attributes["name"].InnerText] = propertyElement.Attributes["value"].InnerText; + } + } + + if (doc.DocumentElement["Digits"]!= null) { + highlighter.DigitColor = new HighlightColor(doc.DocumentElement["Digits"]); + } + + XmlNodeList nodes = doc.DocumentElement.GetElementsByTagName("RuleSet"); + foreach (XmlElement element in nodes) { + highlighter.AddRuleSet(new HighlightRuleSet(element)); + } + + xmlReader.Close(); + + if (errors != null) { + StringBuilder msg = new StringBuilder(); + foreach (ValidationEventArgs args in errors) { + msg.AppendLine(args.Message); + } + throw new HighlightingDefinitionInvalidException(msg.ToString()); + } else { + return highlighter; + } + } catch (Exception e) { + throw new HighlightingDefinitionInvalidException("Could not load mode definition file '" + syntaxMode.FileName + "'.\n", e); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingManager.cs new file mode 100644 index 000000000..a2ad8bfe5 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingManager.cs @@ -0,0 +1,163 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Diagnostics; + +namespace ICSharpCode.TextEditor.Document +{ + public class HighlightingManager + { + ArrayList syntaxModeFileProviders = new ArrayList(); + static HighlightingManager highlightingManager; + + // hash table from extension name to highlighting definition, + // OR from extension name to Pair SyntaxMode,ISyntaxModeFileProvider + Hashtable highlightingDefs = new Hashtable(); + + Hashtable extensionsToName = new Hashtable(); + + public Hashtable HighlightingDefinitions { + get { + return highlightingDefs; + } + } + + public static HighlightingManager Manager { + get { + return highlightingManager; + } + } + + static HighlightingManager() + { + highlightingManager = new HighlightingManager(); + highlightingManager.AddSyntaxModeFileProvider(new ResourceSyntaxModeProvider()); + } + + public HighlightingManager() + { + CreateDefaultHighlightingStrategy(); + } + + public void AddSyntaxModeFileProvider(ISyntaxModeFileProvider syntaxModeFileProvider) + { + foreach (SyntaxMode syntaxMode in syntaxModeFileProvider.SyntaxModes) { + highlightingDefs[syntaxMode.Name] = new DictionaryEntry(syntaxMode, syntaxModeFileProvider); + foreach (string extension in syntaxMode.Extensions) { + extensionsToName[extension.ToUpperInvariant()] = syntaxMode.Name; + } + } + if (!syntaxModeFileProviders.Contains(syntaxModeFileProvider)) { + syntaxModeFileProviders.Add(syntaxModeFileProvider); + } + } + + public void AddHighlightingStrategy(IHighlightingStrategy highlightingStrategy) + { + highlightingDefs[highlightingStrategy.Name] = highlightingStrategy; + foreach (string extension in highlightingStrategy.Extensions) + { + extensionsToName[extension.ToUpperInvariant()] = highlightingStrategy.Name; + } + } + + public void ReloadSyntaxModes() + { + highlightingDefs.Clear(); + extensionsToName.Clear(); + CreateDefaultHighlightingStrategy(); + foreach (ISyntaxModeFileProvider provider in syntaxModeFileProviders) { + provider.UpdateSyntaxModeList(); + AddSyntaxModeFileProvider(provider); + } + OnReloadSyntaxHighlighting(EventArgs.Empty); + } + + void CreateDefaultHighlightingStrategy() + { + DefaultHighlightingStrategy defaultHighlightingStrategy = new DefaultHighlightingStrategy(); + defaultHighlightingStrategy.Extensions = new string[] {}; + defaultHighlightingStrategy.Rules.Add(new HighlightRuleSet()); + highlightingDefs["Default"] = defaultHighlightingStrategy; + } + + IHighlightingStrategy LoadDefinition(DictionaryEntry entry) + { + SyntaxMode syntaxMode = (SyntaxMode)entry.Key; + ISyntaxModeFileProvider syntaxModeFileProvider = (ISyntaxModeFileProvider)entry.Value; + + DefaultHighlightingStrategy highlightingStrategy = null; + try { + highlightingStrategy = HighlightingDefinitionParser.Parse(syntaxMode, syntaxModeFileProvider.GetSyntaxModeFile(syntaxMode)); + if (highlightingStrategy.Name != syntaxMode.Name) { + throw new HighlightingDefinitionInvalidException("The name specified in the .xshd '" + highlightingStrategy.Name + "' must be equal the syntax mode name '" + syntaxMode.Name + "'"); + } + } finally { + if (highlightingStrategy == null) { + highlightingStrategy = DefaultHighlighting; + } + highlightingDefs[syntaxMode.Name] = highlightingStrategy; + highlightingStrategy.ResolveReferences(); + } + return highlightingStrategy; + } + + public DefaultHighlightingStrategy DefaultHighlighting { + get { + return (DefaultHighlightingStrategy)highlightingDefs["Default"]; + } + } + + internal KeyValuePair FindHighlighterEntry(string name) + { + foreach (ISyntaxModeFileProvider provider in syntaxModeFileProviders) { + foreach (SyntaxMode mode in provider.SyntaxModes) { + if (mode.Name == name) { + return new KeyValuePair(mode, provider); + } + } + } + return new KeyValuePair(null, null); + } + + public IHighlightingStrategy FindHighlighter(string name) + { + object def = highlightingDefs[name]; + if (def is DictionaryEntry) { + return LoadDefinition((DictionaryEntry)def); + } + return def == null ? DefaultHighlighting : (IHighlightingStrategy)def; + } + + public IHighlightingStrategy FindHighlighterForFile(string fileName) + { + string highlighterName = (string)extensionsToName[Path.GetExtension(fileName).ToUpperInvariant()]; + if (highlighterName != null) { + object def = highlightingDefs[highlighterName]; + if (def is DictionaryEntry) { + return LoadDefinition((DictionaryEntry)def); + } + return def == null ? DefaultHighlighting : (IHighlightingStrategy)def; + } else { + return DefaultHighlighting; + } + } + + protected virtual void OnReloadSyntaxHighlighting(EventArgs e) + { + if (ReloadSyntaxHighlighting != null) { + ReloadSyntaxHighlighting(this, e); + } + } + + public event EventHandler ReloadSyntaxHighlighting; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingStrategyFactory.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingStrategyFactory.cs new file mode 100644 index 000000000..100cf941e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/HighlightingStrategyFactory.cs @@ -0,0 +1,38 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + public class HighlightingStrategyFactory + { + public static IHighlightingStrategy CreateHighlightingStrategy() + { + return (IHighlightingStrategy)HighlightingManager.Manager.HighlightingDefinitions["Default"]; + } + + public static IHighlightingStrategy CreateHighlightingStrategy(string name) + { + IHighlightingStrategy highlightingStrategy = HighlightingManager.Manager.FindHighlighter(name); + + if (highlightingStrategy == null) { + return CreateHighlightingStrategy(); + } + return highlightingStrategy; + } + + public static IHighlightingStrategy CreateHighlightingStrategyForFile(string fileName) + { + IHighlightingStrategy highlightingStrategy = HighlightingManager.Manager.FindHighlighterForFile(fileName); + if (highlightingStrategy == null) { + return CreateHighlightingStrategy(); + } + return highlightingStrategy; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/IHighlightingStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/IHighlightingStrategy.cs new file mode 100644 index 000000000..6706cd616 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/IHighlightingStrategy.cs @@ -0,0 +1,65 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// A highlighting strategy for a buffer. + /// + public interface IHighlightingStrategy + { + /// + /// The name of the highlighting strategy, must be unique + /// + string Name { + get; + } + + /// + /// The file extenstions on which this highlighting strategy gets + /// used + /// + string[] Extensions { + set; + get; + } + + Dictionary Properties { + get; + } + + // returns special color. (BackGround Color, Cursor Color and so on) + + /// + /// Gets the color of an Environment element. + /// + HighlightColor GetColorFor(string name); + + /// + /// Used internally, do not call + /// + HighlightRuleSet GetRuleSet(Span span); + + /// + /// Used internally, do not call + /// + HighlightColor GetColor(IDocument document, LineSegment keyWord, int index, int length); + + /// + /// Used internally, do not call + /// + void MarkTokens(IDocument document, List lines); + + /// + /// Used internally, do not call + /// + void MarkTokens(IDocument document); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/NextMarker.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/NextMarker.cs new file mode 100644 index 000000000..4a2e236de --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/NextMarker.cs @@ -0,0 +1,63 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Used for mark next token + /// + public class NextMarker + { + string what; + HighlightColor color; + bool markMarker = false; + + /// + /// String value to indicate to mark next token + /// + public string What { + get { + return what; + } + } + + /// + /// Color for marking next token + /// + public HighlightColor Color { + get { + return color; + } + } + + /// + /// If true the indication text will be marked with the same color + /// too + /// + public bool MarkMarker { + get { + return markMarker; + } + } + + /// + /// Creates a new instance of + /// + public NextMarker(XmlElement mark) + { + color = new HighlightColor(mark); + what = mark.InnerText; + if (mark.Attributes["markmarker"] != null) { + markMarker = Boolean.Parse(mark.Attributes["markmarker"].InnerText); + } + } + } + +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/PrevMarker.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/PrevMarker.cs new file mode 100644 index 000000000..05a518867 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/PrevMarker.cs @@ -0,0 +1,63 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Used for mark previous token + /// + public class PrevMarker + { + string what; + HighlightColor color; + bool markMarker = false; + + /// + /// String value to indicate to mark previous token + /// + public string What { + get { + return what; + } + } + + /// + /// Color for marking previous token + /// + public HighlightColor Color { + get { + return color; + } + } + + /// + /// If true the indication text will be marked with the same color + /// too + /// + public bool MarkMarker { + get { + return markMarker; + } + } + + /// + /// Creates a new instance of + /// + public PrevMarker(XmlElement mark) + { + color = new HighlightColor(mark); + what = mark.InnerText; + if (mark.Attributes["markmarker"] != null) { + markMarker = Boolean.Parse(mark.Attributes["markmarker"].InnerText); + } + } + } + +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/Span.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/Span.cs new file mode 100644 index 000000000..31047b69a --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/Span.cs @@ -0,0 +1,157 @@ +// +// +// +// +// $Revision: 2115 $ +// + +using System; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + public sealed class Span + { + bool stopEOL; + HighlightColor color; + HighlightColor beginColor; + HighlightColor endColor; + char[] begin; + char[] end; + string name; + string rule; + HighlightRuleSet ruleSet; + char escapeCharacter; + bool ignoreCase; + bool isBeginSingleWord; + bool? isBeginStartOfLine; + bool isEndSingleWord; + + internal HighlightRuleSet RuleSet { + get { + return ruleSet; + } + set { + ruleSet = value; + } + } + + public bool IgnoreCase { + get { + return ignoreCase; + } + set { + ignoreCase = value; + } + } + + public bool StopEOL { + get { + return stopEOL; + } + } + + public bool? IsBeginStartOfLine { + get { + return isBeginStartOfLine; + } + } + + public bool IsBeginSingleWord { + get { + return isBeginSingleWord; + } + } + + public bool IsEndSingleWord { + get { + return isEndSingleWord; + } + } + + public HighlightColor Color { + get { + return color; + } + } + + public HighlightColor BeginColor { + get { + if(beginColor != null) { + return beginColor; + } else { + return color; + } + } + } + + public HighlightColor EndColor { + get { + return endColor!=null ? endColor : color; + } + } + + public char[] Begin { + get { return begin; } + } + + public char[] End { + get { return end; } + } + + public string Name { + get { return name; } + } + + public string Rule { + get { return rule; } + } + + /// + /// Gets the escape character of the span. The escape character is a character that can be used in front + /// of the span end to make it not end the span. The escape character followed by another escape character + /// means the escape character was escaped like in @"a "" b" literals in C#. + /// The default value '\0' means no escape character is allowed. + /// + public char EscapeCharacter { + get { return escapeCharacter; } + } + + public Span(XmlElement span) + { + color = new HighlightColor(span); + + if (span.HasAttribute("rule")) { + rule = span.GetAttribute("rule"); + } + + if (span.HasAttribute("escapecharacter")) { + escapeCharacter = span.GetAttribute("escapecharacter")[0]; + } + + name = span.GetAttribute("name"); + if (span.HasAttribute("stopateol")) { + stopEOL = Boolean.Parse(span.GetAttribute("stopateol")); + } + + begin = span["Begin"].InnerText.ToCharArray(); + beginColor = new HighlightColor(span["Begin"], color); + + if (span["Begin"].HasAttribute("singleword")) { + this.isBeginSingleWord = Boolean.Parse(span["Begin"].GetAttribute("singleword")); + } + if (span["Begin"].HasAttribute("startofline")) { + this.isBeginStartOfLine = Boolean.Parse(span["Begin"].GetAttribute("startofline")); + } + + if (span["End"] != null) { + end = span["End"].InnerText.ToCharArray(); + endColor = new HighlightColor(span["End"], color); + if (span["End"].HasAttribute("singleword")) { + this.isEndSingleWord = Boolean.Parse(span["End"].GetAttribute("singleword")); + } + + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SpanStack.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SpanStack.cs new file mode 100644 index 000000000..30db3cb04 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SpanStack.cs @@ -0,0 +1,118 @@ +// +// +// +// +// $Revision: 1471 $ +// + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// A stack of Span instances. Works like Stack<Span>, but can be cloned quickly + /// because it is implemented as linked list. + /// + public sealed class SpanStack : ICloneable, IEnumerable + { + internal sealed class StackNode + { + public readonly StackNode Previous; + public readonly Span Data; + + public StackNode(StackNode previous, Span data) + { + this.Previous = previous; + this.Data = data; + } + } + + StackNode top = null; + + public Span Pop() + { + Span s = top.Data; + top = top.Previous; + return s; + } + + public Span Peek() + { + return top.Data; + } + + public void Push(Span s) + { + top = new StackNode(top, s); + } + + public bool IsEmpty { + get { + return top == null; + } + } + + public SpanStack Clone() + { + SpanStack n = new SpanStack(); + n.top = this.top; + return n; + } + object ICloneable.Clone() + { + return this.Clone(); + } + + public Enumerator GetEnumerator() + { + return new Enumerator(new StackNode(top, null)); + } + IEnumerator IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + public struct Enumerator : IEnumerator + { + StackNode c; + + internal Enumerator(StackNode node) + { + c = node; + } + + public Span Current { + get { + return c.Data; + } + } + + object System.Collections.IEnumerator.Current { + get { + return c.Data; + } + } + + public void Dispose() + { + c = null; + } + + public bool MoveNext() + { + c = c.Previous; + return c != null; + } + + public void Reset() + { + throw new NotSupportedException(); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/FileSyntaxModeProvider.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/FileSyntaxModeProvider.cs new file mode 100644 index 000000000..7443a8f8f --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/FileSyntaxModeProvider.cs @@ -0,0 +1,84 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Collections.Generic; +using System.IO; +using System.Windows.Forms; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + public class FileSyntaxModeProvider : ISyntaxModeFileProvider + { + string directory; + List syntaxModes = null; + + public ICollection SyntaxModes { + get { + return syntaxModes; + } + } + + public FileSyntaxModeProvider(string directory) + { + this.directory = directory; + UpdateSyntaxModeList(); + } + + public void UpdateSyntaxModeList() + { + string syntaxModeFile = Path.Combine(directory, "SyntaxModes.xml"); + if (File.Exists(syntaxModeFile)) { + Stream s = File.OpenRead(syntaxModeFile); + syntaxModes = SyntaxMode.GetSyntaxModes(s); + s.Close(); + } else { + syntaxModes = ScanDirectory(directory); + } + } + + public XmlTextReader GetSyntaxModeFile(SyntaxMode syntaxMode) + { + string syntaxModeFile = Path.Combine(directory, syntaxMode.FileName); + if (!File.Exists(syntaxModeFile)) { + throw new HighlightingDefinitionInvalidException("Can't load highlighting definition " + syntaxModeFile + " (file not found)!"); + } + return new XmlTextReader(File.OpenRead(syntaxModeFile)); + } + + List ScanDirectory(string directory) + { + string[] files = Directory.GetFiles(directory); + List modes = new List(); + foreach (string file in files) { + if (Path.GetExtension(file).Equals(".XSHD", StringComparison.OrdinalIgnoreCase)) { + XmlTextReader reader = new XmlTextReader(file); + while (reader.Read()) { + if (reader.NodeType == XmlNodeType.Element) { + switch (reader.Name) { + case "SyntaxDefinition": + string name = reader.GetAttribute("name"); + string extensions = reader.GetAttribute("extensions"); + modes.Add(new SyntaxMode(Path.GetFileName(file), + name, + extensions)); + goto bailout; + default: + throw new HighlightingDefinitionInvalidException("Unknown root node in syntax highlighting file :" + reader.Name); + } + } + } + bailout: + reader.Close(); + + } + } + return modes; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ISyntaxModeFileProvider.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ISyntaxModeFileProvider.cs new file mode 100644 index 000000000..8e117bc66 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ISyntaxModeFileProvider.cs @@ -0,0 +1,23 @@ +// +// +// +// +// $Revision: 1301 $ +// + +using System; +using System.Collections.Generic; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + public interface ISyntaxModeFileProvider + { + ICollection SyntaxModes { + get; + } + + XmlTextReader GetSyntaxModeFile(SyntaxMode syntaxMode); + void UpdateSyntaxModeList(); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ResourceSyntaxModeProvider.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ResourceSyntaxModeProvider.cs new file mode 100644 index 000000000..d2644d4fc --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/ResourceSyntaxModeProvider.cs @@ -0,0 +1,48 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + public class ResourceSyntaxModeProvider : ISyntaxModeFileProvider + { + List syntaxModes = null; + + public ICollection SyntaxModes { + get { + return syntaxModes; + } + } + + public ResourceSyntaxModeProvider() + { + Assembly assembly = typeof(SyntaxMode).Assembly; + Stream syntaxModeStream = assembly.GetManifestResourceStream("ICSharpCode.TextEditor.Resources.SyntaxModes.xml"); + if (syntaxModeStream != null) { + syntaxModes = SyntaxMode.GetSyntaxModes(syntaxModeStream); + } else { + syntaxModes = new List(); + } + } + + public XmlTextReader GetSyntaxModeFile(SyntaxMode syntaxMode) + { + Assembly assembly = typeof(SyntaxMode).Assembly; + return new XmlTextReader(assembly.GetManifestResourceStream("ICSharpCode.TextEditor.Resources." + syntaxMode.FileName)); + } + + public void UpdateSyntaxModeList() + { + // resources don't change during runtime + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/SyntaxMode.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/SyntaxMode.cs new file mode 100644 index 000000000..68259d9b5 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/SyntaxModes/SyntaxMode.cs @@ -0,0 +1,96 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Collections.Generic; +using System.IO; +using System.Windows.Forms; +using System.Xml; + +namespace ICSharpCode.TextEditor.Document +{ + public class SyntaxMode + { + string fileName; + string name; + string[] extensions; + + public string FileName { + get { + return fileName; + } + set { + fileName = value; + } + } + + public string Name { + get { + return name; + } + set { + name = value; + } + } + + public string[] Extensions { + get { + return extensions; + } + set { + extensions = value; + } + } + + public SyntaxMode(string fileName, string name, string extensions) + { + this.fileName = fileName; + this.name = name; + this.extensions = extensions.Split(';', '|', ','); + } + + public SyntaxMode(string fileName, string name, string[] extensions) + { + this.fileName = fileName; + this.name = name; + this.extensions = extensions; + } + + public static List GetSyntaxModes(Stream xmlSyntaxModeStream) + { + XmlTextReader reader = new XmlTextReader(xmlSyntaxModeStream); + List syntaxModes = new List(); + while (reader.Read()) { + switch (reader.NodeType) { + case XmlNodeType.Element: + switch (reader.Name) { + case "SyntaxModes": + string version = reader.GetAttribute("version"); + if (version != "1.0") { + throw new HighlightingDefinitionInvalidException("Unknown syntax mode file defininition with version " + version); + } + break; + case "Mode": + syntaxModes.Add(new SyntaxMode(reader.GetAttribute("file"), + reader.GetAttribute("name"), + reader.GetAttribute("extensions"))); + break; + default: + throw new HighlightingDefinitionInvalidException("Unknown node in syntax mode file :" + reader.Name); + } + break; + } + } + reader.Close(); + return syntaxModes; + } + public override string ToString() + { + return String.Format("[SyntaxMode: FileName={0}, Name={1}, Extensions=({2})]", fileName, name, String.Join(",", extensions)); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/TextWord.cs b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/TextWord.cs new file mode 100644 index 000000000..a19a5fa64 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/HighlightingStrategy/TextWord.cs @@ -0,0 +1,236 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + public enum TextWordType { + Word, + Space, + Tab + } + + /// + /// This class represents single words with color information, two special versions of a word are + /// spaces and tabs. + /// + public class TextWord + { + HighlightColor color; + LineSegment line; + IDocument document; + + int offset; + int length; + + public sealed class SpaceTextWord : TextWord + { + public SpaceTextWord() + { + length = 1; + } + + public SpaceTextWord(HighlightColor color) + { + length = 1; + base.SyntaxColor = color; + } + + public override Font GetFont(FontContainer fontContainer) + { + return null; + } + + public override TextWordType Type { + get { + return TextWordType.Space; + } + } + public override bool IsWhiteSpace { + get { + return true; + } + } + } + + public sealed class TabTextWord : TextWord + { + public TabTextWord() + { + length = 1; + } + public TabTextWord(HighlightColor color) + { + length = 1; + base.SyntaxColor = color; + } + + public override Font GetFont(FontContainer fontContainer) + { + return null; + } + + public override TextWordType Type { + get { + return TextWordType.Tab; + } + } + public override bool IsWhiteSpace { + get { + return true; + } + } + } + + static TextWord spaceWord = new SpaceTextWord(); + static TextWord tabWord = new TabTextWord(); + + bool hasDefaultColor; + + public static TextWord Space { + get { + return spaceWord; + } + } + + public static TextWord Tab { + get { + return tabWord; + } + } + + public int Offset { + get { + return offset; + } + } + + public int Length { + get { + return length; + } + } + + /// + /// Splits the into two parts: the part before is assigned to + /// the reference parameter , the part after is returned. + /// + public static TextWord Split(ref TextWord word, int pos) + { + #if DEBUG + if (word.Type != TextWordType.Word) + throw new ArgumentException("word.Type must be Word"); + if (pos <= 0) + throw new ArgumentOutOfRangeException("pos", pos, "pos must be > 0"); + if (pos >= word.Length) + throw new ArgumentOutOfRangeException("pos", pos, "pos must be < word.Length"); + #endif + TextWord after = new TextWord(word.document, word.line, word.offset + pos, word.length - pos, word.color, word.hasDefaultColor); + word = new TextWord(word.document, word.line, word.offset, pos, word.color, word.hasDefaultColor); + return after; + } + + public bool HasDefaultColor { + get { + return hasDefaultColor; + } + } + + public virtual TextWordType Type { + get { + return TextWordType.Word; + } + } + + public string Word { + get { + if (document == null) { + return String.Empty; + } + return document.GetText(line.Offset + offset, length); + } + } + + public virtual Font GetFont(FontContainer fontContainer) + { + return color.GetFont(fontContainer); + } + + public Color Color { + get { + if (color == null) + return Color.Black; + else + return color.Color; + } + } + + public bool Bold { + get { + if (color == null) + return false; + else + return color.Bold; + } + } + + public bool Italic { + get { + if (color == null) + return false; + else + return color.Italic; + } + } + + public HighlightColor SyntaxColor { + get { + return color; + } + set { + Debug.Assert(value != null); + color = value; + } + } + + public virtual bool IsWhiteSpace { + get { + return false; + } + } + + protected TextWord() + { + } + + // TAB + public TextWord(IDocument document, LineSegment line, int offset, int length, HighlightColor color, bool hasDefaultColor) + { + Debug.Assert(document != null); + Debug.Assert(line != null); + Debug.Assert(color != null); + + this.document = document; + this.line = line; + this.offset = offset; + this.length = length; + this.color = color; + this.hasDefaultColor = hasDefaultColor; + } + + /// + /// Converts a instance to string (for debug purposes) + /// + public override string ToString() + { + return "[TextWord: Word = " + Word + ", Color = " + Color + "]"; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/IDocument.cs b/ICSharpCode.TextEditorLinux/Src/Document/IDocument.cs new file mode 100644 index 000000000..47fb6c3b1 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/IDocument.cs @@ -0,0 +1,322 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +using ICSharpCode.TextEditor.Undo; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This interface represents a container which holds a text sequence and + /// all necessary information about it. It is used as the base for a text editor. + /// + public interface IDocument + { + ITextEditorProperties TextEditorProperties { + get; + set; + } + + UndoStack UndoStack { + get; + } + /// + /// If true the document can't be altered + /// + bool ReadOnly { + get; + set; + } + + /// + /// The attached to the instance + /// + IFormattingStrategy FormattingStrategy { + get; + set; + } + + /// + /// The attached to the instance + /// + ITextBufferStrategy TextBufferStrategy { + get; + } + + /// + /// The attached to the instance + /// + FoldingManager FoldingManager { + get; + } + + /// + /// The attached to the instance + /// + IHighlightingStrategy HighlightingStrategy { + get; + set; + } + + /// + /// The attached to the instance + /// + BookmarkManager BookmarkManager { + get; + } + + /// + /// The attached to the instance + /// + ICustomLineManager CustomLineManager { + get; + } + + MarkerStrategy MarkerStrategy { + get; + } + +// /// +// /// The attached to the instance +// /// +// SelectionManager SelectionManager { +// get; +// } + + #region ILineManager interface + /// + /// A collection of all line segments + /// + /// + /// The collection should only be used if you're aware + /// of the 'last line ends with a delimiter problem'. Otherwise + /// the method should be used. + /// + IList LineSegmentCollection { + get; + } + + /// + /// The total number of lines in the document. + /// + int TotalNumberOfLines { + get; + } + + /// + /// Returns a valid line number for the given offset. + /// + /// + /// A offset which points to a character in the line which + /// line number is returned. + /// + /// + /// An int which value is the line number. + /// + /// If offset points not to a valid position + int GetLineNumberForOffset(int offset); + + /// + /// Returns a for the given offset. + /// + /// + /// A offset which points to a character in the line which + /// is returned. + /// + /// + /// A object. + /// + /// If offset points not to a valid position + LineSegment GetLineSegmentForOffset(int offset); + + /// + /// Returns a for the given line number. + /// This function should be used to get a line instead of getting the + /// line using the . + /// + /// + /// The line number which is requested. + /// + /// + /// A object. + /// + /// If offset points not to a valid position + LineSegment GetLineSegment(int lineNumber); + + /// + /// Get the first logical line for a given visible line. + /// example : lineNumber == 100 foldings are in the linetracker + /// between 0..1 (2 folded, invisible lines) this method returns 102 + /// the 'logical' line number + /// + int GetFirstLogicalLine(int lineNumber); + + /// + /// Get the last logical line for a given visible line. + /// example : lineNumber == 100 foldings are in the linetracker + /// between 0..1 (2 folded, invisible lines) this method returns 102 + /// the 'logical' line number + /// + int GetLastLogicalLine(int lineNumber); + + /// + /// Get the visible line for a given logical line. + /// example : lineNumber == 100 foldings are in the linetracker + /// between 0..1 (2 folded, invisible lines) this method returns 98 + /// the 'visible' line number + /// + int GetVisibleLine(int lineNumber); + +// /// +// /// Get the visible column for a given logical line and logical column. +// /// +// int GetVisibleColumn(int logicalLine, int logicalColumn); + + /// + /// Get the next visible line after lineNumber + /// + int GetNextVisibleLineAbove(int lineNumber, int lineCount); + + /// + /// Get the next visible line below lineNumber + /// + int GetNextVisibleLineBelow(int lineNumber, int lineCount); + + event EventHandler LineLengthChanged; + event EventHandler LineCountChanged; + event EventHandler LineDeleted; + #endregion + + #region ITextBufferStrategy interface + /// + /// Get the whole text as string. + /// When setting the text using the TextContent property, the undo stack is cleared. + /// Set TextContent only for actions such as loading a file; if you want to change the current document + /// use the Replace method instead. + /// + string TextContent { + get; + set; + } + + /// + /// The current length of the sequence of characters that can be edited. + /// + int TextLength { + get; + } + + /// + /// Inserts a string of characters into the sequence. + /// + /// + /// offset where to insert the string. + /// + /// + /// text to be inserted. + /// + void Insert(int offset, string text); + + /// + /// Removes some portion of the sequence. + /// + /// + /// offset of the remove. + /// + /// + /// number of characters to remove. + /// + void Remove(int offset, int length); + + /// + /// Replace some portion of the sequence. + /// + /// + /// offset. + /// + /// + /// number of characters to replace. + /// + /// + /// text to be replaced with. + /// + void Replace(int offset, int length, string text); + + /// + /// Returns a specific char of the sequence. + /// + /// + /// Offset of the char to get. + /// + char GetCharAt(int offset); + + /// + /// Fetches a string of characters contained in the sequence. + /// + /// + /// Offset into the sequence to fetch + /// + /// + /// number of characters to copy. + /// + string GetText(int offset, int length); + #endregion + string GetText(ISegment segment); + + #region ITextModel interface + /// + /// returns the logical line/column position from an offset + /// + TextLocation OffsetToPosition(int offset); + + /// + /// returns the offset from a logical line/column position + /// + int PositionToOffset(TextLocation p); + #endregion + /// + /// A container where all TextAreaUpdate objects get stored + /// + List UpdateQueue { + get; + } + + /// + /// Requests an update of the textarea + /// + void RequestUpdate(TextAreaUpdate update); + + /// + /// Commits all updates in the queue to the textarea (the + /// textarea will be painted) + /// + void CommitUpdate(); + + /// + /// Moves, Resizes, Removes a list of segments on insert/remove/replace events. + /// + void UpdateSegmentListOnDocumentChange(List list, DocumentEventArgs e) where T : ISegment; + + /// + /// Is fired when CommitUpdate is called + /// + event EventHandler UpdateCommited; + + /// + /// + event DocumentEventHandler DocumentAboutToBeChanged; + + /// + /// + event DocumentEventHandler DocumentChanged; + + event EventHandler TextContentChanged; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/ISegment.cs b/ICSharpCode.TextEditorLinux/Src/Document/ISegment.cs new file mode 100644 index 000000000..63f07b614 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/ISegment.cs @@ -0,0 +1,32 @@ +// +// +// +// +// $Revision: 1966 $ +// + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This interface is used to describe a span inside a text sequence + /// + public interface ISegment + { + /// + /// The offset where the span begins + /// + int Offset { + get; + set; + } + + /// + /// The length of the span + /// + int Length { + get; + set; + } + } + +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/ITextEditorProperties.cs b/ICSharpCode.TextEditorLinux/Src/Document/ITextEditorProperties.cs new file mode 100644 index 000000000..227fd96b0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/ITextEditorProperties.cs @@ -0,0 +1,171 @@ +// +// +// +// +// $Revision: 2644 $ +// + +using System; +using System.Drawing; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + public interface ITextEditorProperties + { + bool AutoInsertCurlyBracket { // is wrapped in text editor control + get; + set; + } + + bool HideMouseCursor { // is wrapped in text editor control + get; + set; + } + + bool IsIconBarVisible { // is wrapped in text editor control + get; + set; + } + + bool AllowCaretBeyondEOL { + get; + set; + } + + bool ShowMatchingBracket { // is wrapped in text editor control + get; + set; + } + + bool CutCopyWholeLine { + get; + set; + } + + System.Drawing.Text.TextRenderingHint TextRenderingHint { // is wrapped in text editor control + get; + set; + } + + bool MouseWheelScrollDown { + get; + set; + } + + bool MouseWheelTextZoom { + get; + set; + } + + string LineTerminator { + get; + set; + } + + LineViewerStyle LineViewerStyle { // is wrapped in text editor control + get; + set; + } + + bool ShowInvalidLines { // is wrapped in text editor control + get; + set; + } + + int VerticalRulerRow { // is wrapped in text editor control + get; + set; + } + + bool ShowSpaces { // is wrapped in text editor control + get; + set; + } + + bool ShowTabs { // is wrapped in text editor control + get; + set; + } + + bool ShowEOLMarker { // is wrapped in text editor control + get; + set; + } + + bool ConvertTabsToSpaces { // is wrapped in text editor control + get; + set; + } + + bool ShowHorizontalRuler { // is wrapped in text editor control + get; + set; + } + + bool ShowVerticalRuler { // is wrapped in text editor control + get; + set; + } + + Encoding Encoding { + get; + set; + } + + bool EnableFolding { // is wrapped in text editor control + get; + set; + } + + bool ShowLineNumbers { // is wrapped in text editor control + get; + set; + } + + /// + /// The width of a tab. + /// + int TabIndent { // is wrapped in text editor control + get; + set; + } + + /// + /// The amount of spaces a tab is converted to if ConvertTabsToSpaces is true. + /// + int IndentationSize { + get; + set; + } + + IndentStyle IndentStyle { // is wrapped in text editor control + get; + set; + } + + DocumentSelectionMode DocumentSelectionMode { + get; + set; + } + + Font Font { // is wrapped in text editor control + get; + set; + } + + FontContainer FontContainer { + get; + } + + BracketMatchingStyle BracketMatchingStyle { // is wrapped in text editor control + get; + set; + } + + bool UseCustomLine { + get; + set; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManager.cs new file mode 100644 index 000000000..92ffe8745 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManager.cs @@ -0,0 +1,364 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace ICSharpCode.TextEditor.Document +{ + internal sealed class LineManager + { + LineSegmentTree lineCollection = new LineSegmentTree(); + + IDocument document; + IHighlightingStrategy highlightingStrategy; + + public IList LineSegmentCollection { + get { + return lineCollection; + } + } + + public int TotalNumberOfLines { + get { + return lineCollection.Count; + } + } + + public IHighlightingStrategy HighlightingStrategy { + get { + return highlightingStrategy; + } + set { + if (highlightingStrategy != value) { + highlightingStrategy = value; + if (highlightingStrategy != null) { + highlightingStrategy.MarkTokens(document); + } + } + } + } + + public LineManager(IDocument document, IHighlightingStrategy highlightingStrategy) + { + this.document = document; + this.highlightingStrategy = highlightingStrategy; + } + + public int GetLineNumberForOffset(int offset) + { + return GetLineSegmentForOffset(offset).LineNumber; + } + + public LineSegment GetLineSegmentForOffset(int offset) + { + return lineCollection.GetByOffset(offset); + } + + public LineSegment GetLineSegment(int lineNr) + { + return lineCollection[lineNr]; + } + + public void Insert(int offset, string text) + { + Replace(offset, 0, text); + } + + public void Remove(int offset, int length) + { + Replace(offset, length, String.Empty); + } + + public void Replace(int offset, int length, string text) + { +// Console.WriteLine("Replace offset="+offset+" length="+length+" text.Length="+text.Length); + int lineStart = GetLineNumberForOffset(offset); + int oldNumberOfLines = this.TotalNumberOfLines; + List removedLines = RemoveInternal(offset, length); + int numberOfLinesAfterRemoving = this.TotalNumberOfLines; + if (!string.IsNullOrEmpty(text)) { + InsertInternal(offset, text); + } +// #if DEBUG +// Console.WriteLine("New line collection:"); +// Console.WriteLine(lineCollection.GetTreeAsString()); +// Console.WriteLine("New text:"); +// Console.WriteLine("'" + document.TextContent + "'"); +// #endif + RunHighlighter(lineStart, 1 + Math.Max(0, this.TotalNumberOfLines - numberOfLinesAfterRemoving)); + if (removedLines != null) { + foreach (LineSegment ls in removedLines) + OnLineDeleted(new LineEventArgs(document, ls)); + } + if (this.TotalNumberOfLines != oldNumberOfLines) { + OnLineCountChanged(new LineCountChangeEventArgs(document, lineStart, this.TotalNumberOfLines - oldNumberOfLines)); + } + } + + List RemoveInternal(int offset, int length) + { + Debug.Assert(length >= 0); + if (length == 0) return null; + LineSegmentTree.Enumerator it = lineCollection.GetEnumeratorForOffset(offset); + LineSegment startSegment = it.Current; + int startSegmentOffset = startSegment.Offset; + if (offset + length < startSegmentOffset + startSegment.TotalLength) { + // just removing a part of this line segment + startSegment.RemovedLinePart(offset - startSegmentOffset, length); + SetSegmentLength(startSegment, startSegment.TotalLength - length); + return null; + } + // merge startSegment with another line segment because startSegment's delimiter was deleted + // possibly remove lines in between if multiple delimiters were deleted + int charactersRemovedInStartLine = startSegmentOffset + startSegment.TotalLength - offset; + Debug.Assert(charactersRemovedInStartLine > 0); + startSegment.RemovedLinePart(offset - startSegmentOffset, charactersRemovedInStartLine); + + + LineSegment endSegment = lineCollection.GetByOffset(offset + length); + if (endSegment == startSegment) { + // special case: we are removing a part of the last line up to the + // end of the document + SetSegmentLength(startSegment, startSegment.TotalLength - length); + return null; + } + int endSegmentOffset = endSegment.Offset; + int charactersLeftInEndLine = endSegmentOffset + endSegment.TotalLength - (offset + length); + endSegment.RemovedLinePart(0, endSegment.TotalLength - charactersLeftInEndLine); + startSegment.MergedWith(endSegment, offset - startSegmentOffset); + SetSegmentLength(startSegment, startSegment.TotalLength - charactersRemovedInStartLine + charactersLeftInEndLine); + startSegment.DelimiterLength = endSegment.DelimiterLength; + // remove all segments between startSegment (excl.) and endSegment (incl.) + it.MoveNext(); + List removedLines = new List(); + LineSegment segmentToRemove; + do { + segmentToRemove = it.Current; + it.MoveNext(); + lineCollection.RemoveSegment(segmentToRemove); + removedLines.Add(segmentToRemove); + segmentToRemove.Deleted(); + } while (segmentToRemove != endSegment); + return removedLines; + } + + void InsertInternal(int offset, string text) + { + LineSegment segment = lineCollection.GetByOffset(offset); + DelimiterSegment ds = NextDelimiter(text, 0); + if (ds == null) { + // no newline is being inserted, all text is inserted in a single line + segment.InsertedLinePart(offset - segment.Offset, text.Length); + SetSegmentLength(segment, segment.TotalLength + text.Length); + return; + } + LineSegment firstLine = segment; + firstLine.InsertedLinePart(offset - firstLine.Offset, ds.Offset); + int lastDelimiterEnd = 0; + while (ds != null) { + // split line segment at line delimiter + int lineBreakOffset = offset + ds.Offset + ds.Length; + int segmentOffset = segment.Offset; + int lengthAfterInsertionPos = segmentOffset + segment.TotalLength - (offset + lastDelimiterEnd); + lineCollection.SetSegmentLength(segment, lineBreakOffset - segmentOffset); + LineSegment newSegment = lineCollection.InsertSegmentAfter(segment, lengthAfterInsertionPos); + segment.DelimiterLength = ds.Length; + + segment = newSegment; + lastDelimiterEnd = ds.Offset + ds.Length; + + ds = NextDelimiter(text, lastDelimiterEnd); + } + firstLine.SplitTo(segment); + // insert rest after last delimiter + if (lastDelimiterEnd != text.Length) { + segment.InsertedLinePart(0, text.Length - lastDelimiterEnd); + SetSegmentLength(segment, segment.TotalLength + text.Length - lastDelimiterEnd); + } + } + + void SetSegmentLength(LineSegment segment, int newTotalLength) + { + int delta = newTotalLength - segment.TotalLength; + if (delta != 0) { + lineCollection.SetSegmentLength(segment, newTotalLength); + OnLineLengthChanged(new LineLengthChangeEventArgs(document, segment, delta)); + } + } + + void RunHighlighter(int firstLine, int lineCount) + { + if (highlightingStrategy != null) { + List markLines = new List(lineCount); + LineSegmentTree.Enumerator it = lineCollection.GetEnumeratorForIndex(firstLine); + for (int i = 0; i < lineCount && it.IsValid; i++) { + markLines.Add(it.Current); + it.MoveNext(); + } + highlightingStrategy.MarkTokens(document, markLines); + } + } + + public void SetContent(string text) + { + lineCollection.Clear(); + if (text != null) { + Replace(0, 0, text); + } + } + + public int GetVisibleLine(int logicalLineNumber) + { + if (!document.TextEditorProperties.EnableFolding) { + return logicalLineNumber; + } + + int visibleLine = 0; + int foldEnd = 0; + List foldings = document.FoldingManager.GetTopLevelFoldedFoldings(); + foreach (FoldMarker fm in foldings) { + if (fm.StartLine >= logicalLineNumber) { + break; + } + if (fm.StartLine >= foldEnd) { + visibleLine += fm.StartLine - foldEnd; + if (fm.EndLine > logicalLineNumber) { + return visibleLine; + } + foldEnd = fm.EndLine; + } + } +// Debug.Assert(logicalLineNumber >= foldEnd); + visibleLine += logicalLineNumber - foldEnd; + return visibleLine; + } + + public int GetFirstLogicalLine(int visibleLineNumber) + { + if (!document.TextEditorProperties.EnableFolding) { + return visibleLineNumber; + } + int v = 0; + int foldEnd = 0; + List foldings = document.FoldingManager.GetTopLevelFoldedFoldings(); + foreach (FoldMarker fm in foldings) { + if (fm.StartLine >= foldEnd) { + if (v + fm.StartLine - foldEnd >= visibleLineNumber) { + break; + } + v += fm.StartLine - foldEnd; + foldEnd = fm.EndLine; + } + } + // help GC + foldings.Clear(); + foldings = null; + return foldEnd + visibleLineNumber - v; + } + + public int GetLastLogicalLine(int visibleLineNumber) + { + if (!document.TextEditorProperties.EnableFolding) { + return visibleLineNumber; + } + return GetFirstLogicalLine(visibleLineNumber + 1) - 1; + } + + // TODO : speedup the next/prev visible line search + // HOW? : save the foldings in a sorted list and lookup the + // line numbers in this list + public int GetNextVisibleLineAbove(int lineNumber, int lineCount) + { + int curLineNumber = lineNumber; + if (document.TextEditorProperties.EnableFolding) { + for (int i = 0; i < lineCount && curLineNumber < TotalNumberOfLines; ++i) { + ++curLineNumber; + while (curLineNumber < TotalNumberOfLines && (curLineNumber >= lineCollection.Count || !document.FoldingManager.IsLineVisible(curLineNumber))) { + ++curLineNumber; + } + } + } else { + curLineNumber += lineCount; + } + return Math.Min(TotalNumberOfLines - 1, curLineNumber); + } + + public int GetNextVisibleLineBelow(int lineNumber, int lineCount) + { + int curLineNumber = lineNumber; + if (document.TextEditorProperties.EnableFolding) { + for (int i = 0; i < lineCount; ++i) { + --curLineNumber; + while (curLineNumber >= 0 && !document.FoldingManager.IsLineVisible(curLineNumber)) { + --curLineNumber; + } + } + } else { + curLineNumber -= lineCount; + } + return Math.Max(0, curLineNumber); + } + + // use always the same DelimiterSegment object for the NextDelimiter + DelimiterSegment delimiterSegment = new DelimiterSegment(); + + DelimiterSegment NextDelimiter(string text, int offset) + { + for (int i = offset; i < text.Length; i++) { + switch (text[i]) { + case '\r': + if (i + 1 < text.Length) { + if (text[i + 1] == '\n') { + delimiterSegment.Offset = i; + delimiterSegment.Length = 2; + return delimiterSegment; + } + } + goto case '\n'; + case '\n': + delimiterSegment.Offset = i; + delimiterSegment.Length = 1; + return delimiterSegment; + } + } + return null; + } + + void OnLineCountChanged(LineCountChangeEventArgs e) + { + if (LineCountChanged != null) { + LineCountChanged(this, e); + } + } + + void OnLineLengthChanged(LineLengthChangeEventArgs e) + { + if (LineLengthChanged != null) { + LineLengthChanged(this, e); + } + } + + void OnLineDeleted(LineEventArgs e) + { + if (LineDeleted != null) { + LineDeleted(this, e); + } + } + + public event EventHandler LineLengthChanged; + public event EventHandler LineCountChanged; + public event EventHandler LineDeleted; + + sealed class DelimiterSegment + { + internal int Offset; + internal int Length; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManagerEventArgs.cs b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManagerEventArgs.cs new file mode 100644 index 000000000..e4dd98646 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineManagerEventArgs.cs @@ -0,0 +1,97 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + public class LineCountChangeEventArgs : EventArgs + { + IDocument document; + int start; + int moved; + + /// + /// always a valid Document which is related to the Event. + /// + public IDocument Document { + get { + return document; + } + } + + /// + /// -1 if no offset was specified for this event + /// + public int LineStart { + get { + return start; + } + } + + /// + /// -1 if no length was specified for this event + /// + public int LinesMoved { + get { + return moved; + } + } + + public LineCountChangeEventArgs(IDocument document, int lineStart, int linesMoved) + { + this.document = document; + this.start = lineStart; + this.moved = linesMoved; + } + } + + public class LineEventArgs : EventArgs + { + IDocument document; + LineSegment lineSegment; + + public IDocument Document { + get { return document; } + } + + public LineSegment LineSegment { + get { return lineSegment; } + } + + public LineEventArgs(IDocument document, LineSegment lineSegment) + { + this.document = document; + this.lineSegment = lineSegment; + } + + public override string ToString() + { + return string.Format("[LineEventArgs Document={0} LineSegment={1}]", this.document, this.lineSegment); + } + } + + public class LineLengthChangeEventArgs : LineEventArgs + { + int lengthDelta; + + public int LengthDelta { + get { return lengthDelta; } + } + + public LineLengthChangeEventArgs(IDocument document, LineSegment lineSegment, int moved) + : base(document, lineSegment) + { + this.lengthDelta = moved; + } + + public override string ToString() + { + return string.Format("[LineLengthEventArgs Document={0} LineSegment={1} LengthDelta={2}]", this.Document, this.LineSegment, this.lengthDelta); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegment.cs b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegment.cs new file mode 100644 index 000000000..82e23dc6a --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegment.cs @@ -0,0 +1,251 @@ +// +// +// +// +// $Revision: 2691 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Diagnostics; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + public sealed class LineSegment : ISegment + { + internal LineSegmentTree.Enumerator treeEntry; + int totalLength, delimiterLength; + + List words; + SpanStack highlightSpanStack; + + public TextWord GetWord(int column) + { + int curColumn = 0; + foreach (TextWord word in words) { + if (column < curColumn + word.Length) { + return word; + } + curColumn += word.Length; + } + return null; + } + + public bool IsDeleted { + get { return !treeEntry.IsValid; } + } + + public int LineNumber { + get { return treeEntry.CurrentIndex; } + } + + public int Offset { + get { return treeEntry.CurrentOffset; } + } + + public int Length { + get { return totalLength - delimiterLength; } + } + + int ISegment.Offset { + get { return this.Offset; } + set { throw new NotSupportedException(); } + } + int ISegment.Length { + get { return this.Length; } + set { throw new NotSupportedException(); } + } + + public int TotalLength { + get { return totalLength; } + internal set { totalLength = value; } + } + + public int DelimiterLength { + get { return delimiterLength; } + internal set { delimiterLength = value; } + } + + // highlighting information + public List Words { + get { + return words; + } + set { + words = value; + } + } + + public HighlightColor GetColorForPosition(int x) + { + if (Words != null) { + int xPos = 0; + foreach (TextWord word in Words) { + if (x < xPos + word.Length) { + return word.SyntaxColor; + } + xPos += word.Length; + } + } + return new HighlightColor(Color.Black, false, false); + } + + public SpanStack HighlightSpanStack { + get { + return highlightSpanStack; + } + set { + highlightSpanStack = value; + } + } + + /// + /// Converts a instance to string (for debug purposes) + /// + public override string ToString() + { + if (IsDeleted) + return "[LineSegment: (deleted) Length = " + Length + ", TotalLength = " + TotalLength + ", DelimiterLength = " + delimiterLength + "]"; + else + return "[LineSegment: LineNumber=" + LineNumber + ", Offset = "+ Offset +", Length = " + Length + ", TotalLength = " + TotalLength + ", DelimiterLength = " + delimiterLength + "]"; + } + + #region Anchor management + Util.WeakCollection anchors; + + public TextAnchor CreateAnchor(int column) + { + TextAnchor anchor = new TextAnchor(this, column); + AddAnchor(anchor); + return anchor; + } + + void AddAnchor(TextAnchor anchor) + { + Debug.Assert(anchor.Line == this); + + if (anchors == null) + anchors = new Util.WeakCollection(); + + anchors.Add(anchor); + } + + /// + /// Is called when the LineSegment is deleted. + /// + internal void Deleted() + { + //Console.WriteLine("Deleted"); + treeEntry = LineSegmentTree.Enumerator.Invalid; + if (anchors != null) { + foreach (TextAnchor a in anchors) { + a.Deleted(); + } + anchors = null; + } + } + + /// + /// Is called when a part of the line is removed. + /// + internal void RemovedLinePart(int startColumn, int length) + { + if (length == 0) + return; + Debug.Assert(length > 0); + + //Console.WriteLine("RemovedLinePart " + startColumn + ", " + length); + if (anchors != null) { + List deletedAnchors = null; + foreach (TextAnchor a in anchors) { + if (a.ColumnNumber > startColumn) { + if (a.ColumnNumber >= startColumn + length) { + a.ColumnNumber -= length; + } else { + if (deletedAnchors == null) + deletedAnchors = new List(); + a.Deleted(); + deletedAnchors.Add(a); + } + } + } + if (deletedAnchors != null) { + foreach (TextAnchor a in deletedAnchors) { + anchors.Remove(a); + } + } + } + } + + /// + /// Is called when a part of the line is inserted. + /// + internal void InsertedLinePart(int startColumn, int length) + { + if (length == 0) + return; + Debug.Assert(length > 0); + + //Console.WriteLine("InsertedLinePart " + startColumn + ", " + length); + if (anchors != null) { + foreach (TextAnchor a in anchors) { + if (a.ColumnNumber >= startColumn) { + a.ColumnNumber += length; + } + } + } + } + + /// + /// Is called after another line's content is appended to this line because the newline in between + /// was deleted. + /// The DefaultLineManager will call Deleted() on the deletedLine after the MergedWith call. + /// + /// firstLineLength: the length of the line before the merge. + /// + internal void MergedWith(LineSegment deletedLine, int firstLineLength) + { + //Console.WriteLine("MergedWith"); + + if (deletedLine.anchors != null) { + foreach (TextAnchor a in deletedLine.anchors) { + a.Line = this; + AddAnchor(a); + a.ColumnNumber += firstLineLength; + } + deletedLine.anchors = null; + } + } + + /// + /// Is called after a newline was inserted into this line, splitting it into this and followingLine. + /// + internal void SplitTo(LineSegment followingLine) + { + //Console.WriteLine("SplitTo"); + + if (anchors != null) { + List movedAnchors = null; + foreach (TextAnchor a in anchors) { + if (a.ColumnNumber > this.Length) { + a.Line = followingLine; + followingLine.AddAnchor(a); + a.ColumnNumber -= this.Length; + + if (movedAnchors == null) + movedAnchors = new List(); + movedAnchors.Add(a); + } + } + if (movedAnchors != null) { + foreach (TextAnchor a in movedAnchors) { + anchors.Remove(a); + } + } + } + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegmentTree.cs b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegmentTree.cs new file mode 100644 index 000000000..122bf6e69 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/LineManager/LineSegmentTree.cs @@ -0,0 +1,478 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Data structure for efficient management of the line segments (most operations are O(lg n)). + /// This implements an augmented red-black tree where each node has fields for the number of + /// nodes in its subtree (like an order statistics tree) for access by index(=line number). + /// Additionally, each node knows the total length of all segments in its subtree. + /// This means we can find nodes by offset in O(lg n) time. Since the offset itself is not stored in + /// the line segment but computed from the lengths stored in the tree, we adjusting the offsets when + /// text is inserted in one line means we just have to increment the totalLength of the affected line and + /// its parent nodes - an O(lg n) operation. + /// However this means getting the line number or offset from a LineSegment is not a constant time + /// operation, but takes O(lg n). + /// + /// NOTE: The tree is never empty, Clear() causes it to contain an empty segment. + /// + sealed class LineSegmentTree : IList + { + internal struct RBNode + { + internal LineSegment lineSegment; + internal int count; + internal int totalLength; + + public RBNode(LineSegment lineSegment) + { + this.lineSegment = lineSegment; + this.count = 1; + this.totalLength = lineSegment.TotalLength; + } + + public override string ToString() + { + return "[RBNode count=" + count + " totalLength="+totalLength + + " lineSegment.LineNumber=" + lineSegment.LineNumber + + " lineSegment.Offset=" + lineSegment.Offset + + " lineSegment.TotalLength=" + lineSegment.TotalLength + + " lineSegment.DelimiterLength=" + lineSegment.DelimiterLength + "]"; + } + } + + struct MyHost : IRedBlackTreeHost + { + public int Compare(RBNode x, RBNode y) + { + throw new NotImplementedException(); + } + + public bool Equals(RBNode a, RBNode b) + { + throw new NotImplementedException(); + } + + public void UpdateAfterChildrenChange(RedBlackTreeNode node) + { + int count = 1; + int totalLength = node.val.lineSegment.TotalLength; + if (node.left != null) { + count += node.left.val.count; + totalLength += node.left.val.totalLength; + } + if (node.right != null) { + count += node.right.val.count; + totalLength += node.right.val.totalLength; + } + if (count != node.val.count || totalLength != node.val.totalLength) { + node.val.count = count; + node.val.totalLength = totalLength; + if (node.parent != null) UpdateAfterChildrenChange(node.parent); + } + } + + public void UpdateAfterRotateLeft(RedBlackTreeNode node) + { + UpdateAfterChildrenChange(node); + UpdateAfterChildrenChange(node.parent); + } + + public void UpdateAfterRotateRight(RedBlackTreeNode node) + { + UpdateAfterChildrenChange(node); + UpdateAfterChildrenChange(node.parent); + } + } + + readonly AugmentableRedBlackTree tree = new AugmentableRedBlackTree(new MyHost()); + + RedBlackTreeNode GetNode(int index) + { + if (index < 0 || index >= tree.Count) + return tree.root; + //throw new ArgumentOutOfRangeException("index", index, "index should be between 0 and " + (tree.Count-1)); + RedBlackTreeNode node = tree.root; + while (true) { + if (node.left != null && index < node.left.val.count) { + node = node.left; + } else { + if (node.left != null) { + index -= node.left.val.count; + } + if (index == 0) + return node; + index--; + node = node.right; + } + } + } + + static int GetIndexFromNode(RedBlackTreeNode node) + { + int index = (node.left != null) ? node.left.val.count : 0; + while (node.parent != null) { + if (node == node.parent.right) { + if (node.parent.left != null) + index += node.parent.left.val.count; + index++; + } + node = node.parent; + } + return index; + } + + RedBlackTreeNode GetNodeByOffset(int offset) + { + if (offset < 0 || offset > this.TotalLength) + throw new ArgumentOutOfRangeException("offset", offset, "offset should be between 0 and " + this.TotalLength); + if (offset == this.TotalLength) { + if (tree.root == null) + throw new InvalidOperationException("Cannot call GetNodeByOffset while tree is empty."); + return tree.root.RightMost; + } + RedBlackTreeNode node = tree.root; + while (true) { + if (node.left != null && offset < node.left.val.totalLength) { + node = node.left; + } else { + if (node.left != null) { + offset -= node.left.val.totalLength; + } + offset -= node.val.lineSegment.TotalLength; + if (offset < 0) + return node; + node = node.right; + } + } + } + + static int GetOffsetFromNode(RedBlackTreeNode node) + { + int offset = (node.left != null) ? node.left.val.totalLength : 0; + while (node.parent != null) { + if (node == node.parent.right) { + if (node.parent.left != null) + offset += node.parent.left.val.totalLength; + offset += node.parent.val.lineSegment.TotalLength; + } + node = node.parent; + } + return offset; + } + + public LineSegment GetByOffset(int offset) + { + return GetNodeByOffset(offset).val.lineSegment; + } + + /// + /// Gets the total length of all line segments. Runs in O(1). + /// + public int TotalLength { + get { + if (tree.root == null) + return 0; + else + return tree.root.val.totalLength; + } + } + + /// + /// Updates the length of a line segment. Runs in O(lg n). + /// + public void SetSegmentLength(LineSegment segment, int newTotalLength) + { + if (segment == null) + throw new ArgumentNullException("segment"); + RedBlackTreeNode node = segment.treeEntry.it.node; + segment.TotalLength = newTotalLength; + default(MyHost).UpdateAfterChildrenChange(node); + #if DEBUG + CheckProperties(); + #endif + } + + public void RemoveSegment(LineSegment segment) + { + tree.RemoveAt(segment.treeEntry.it); + #if DEBUG + CheckProperties(); + #endif + } + + public LineSegment InsertSegmentAfter(LineSegment segment, int length) + { + LineSegment newSegment = new LineSegment(); + newSegment.TotalLength = length; + newSegment.DelimiterLength = segment.DelimiterLength; + + newSegment.treeEntry = InsertAfter(segment.treeEntry.it.node, newSegment); + return newSegment; + } + + Enumerator InsertAfter(RedBlackTreeNode node, LineSegment newSegment) + { + RedBlackTreeNode newNode = new RedBlackTreeNode(new RBNode(newSegment)); + if (node.right == null) { + tree.InsertAsRight(node, newNode); + } else { + tree.InsertAsLeft(node.right.LeftMost, newNode); + } + #if DEBUG + CheckProperties(); + #endif + return new Enumerator(new RedBlackTreeIterator(newNode)); + } + + /// + /// Gets the number of items in the collections. Runs in O(1). + /// + public int Count { + get { return tree.Count; } + } + + /// + /// Gets or sets an item by index. Runs in O(lg n). + /// + public LineSegment this[int index] { + get { + return GetNode(index).val.lineSegment; + } + set { + throw new NotSupportedException(); + } + } + + bool ICollection.IsReadOnly { + get { return true; } + } + + /// + /// Gets the index of an item. Runs in O(lg n). + /// + public int IndexOf(LineSegment item) + { + int index = item.LineNumber; + if (index < 0 || index >= this.Count) + return -1; + if (item != this[index]) + return -1; + return index; + } + + void IList.RemoveAt(int index) + { + throw new NotSupportedException(); + } + + #if DEBUG + [Conditional("DATACONSISTENCYTEST")] + void CheckProperties() + { + if (tree.root == null) { + Debug.Assert(this.Count == 0); + } else { + Debug.Assert(tree.root.val.count == this.Count); + CheckProperties(tree.root); + } + } + + void CheckProperties(RedBlackTreeNode node) + { + int count = 1; + int totalLength = node.val.lineSegment.TotalLength; + if (node.left != null) { + CheckProperties(node.left); + count += node.left.val.count; + totalLength += node.left.val.totalLength; + } + if (node.right != null) { + CheckProperties(node.right); + count += node.right.val.count; + totalLength += node.right.val.totalLength; + } + Debug.Assert(node.val.count == count); + Debug.Assert(node.val.totalLength == totalLength); + } + + public string GetTreeAsString() + { + return tree.GetTreeAsString(); + } + #endif + + public LineSegmentTree() + { + Clear(); + } + + /// + /// Clears the list. Runs in O(1). + /// + public void Clear() + { + tree.Clear(); + LineSegment emptySegment = new LineSegment(); + emptySegment.TotalLength = 0; + emptySegment.DelimiterLength = 0; + tree.Add(new RBNode(emptySegment)); + emptySegment.treeEntry = GetEnumeratorForIndex(0); + #if DEBUG + CheckProperties(); + #endif + } + + /// + /// Tests whether an item is in the list. Runs in O(n). + /// + public bool Contains(LineSegment item) + { + return IndexOf(item) >= 0; + } + + /// + /// Copies all elements from the list to the array. + /// + public void CopyTo(LineSegment[] array, int arrayIndex) + { + if (array == null) throw new ArgumentNullException("array"); + foreach (LineSegment val in this) + array[arrayIndex++] = val; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + public Enumerator GetEnumerator() + { + return new Enumerator(tree.GetEnumerator()); + } + + public Enumerator GetEnumeratorForIndex(int index) + { + return new Enumerator(new RedBlackTreeIterator(GetNode(index))); + } + + public Enumerator GetEnumeratorForOffset(int offset) + { + return new Enumerator(new RedBlackTreeIterator(GetNodeByOffset(offset))); + } + + public struct Enumerator : IEnumerator + { + /// + /// An invalid enumerator value. Calling MoveNext on the invalid enumerator + /// will always return false, accessing Current will throw an exception. + /// + public static readonly Enumerator Invalid = default(Enumerator); + + internal RedBlackTreeIterator it; + + internal Enumerator(RedBlackTreeIterator it) + { + this.it = it; + } + + /// + /// Gets the current value. Runs in O(1). + /// + public LineSegment Current { + get { + return it.Current.lineSegment; + } + } + + public bool IsValid { + get { + return it.IsValid; + } + } + + /// + /// Gets the index of the current value. Runs in O(lg n). + /// + public int CurrentIndex { + get { + if (it.node == null) + throw new InvalidOperationException(); + return GetIndexFromNode(it.node); + } + } + + /// + /// Gets the offset of the current value. Runs in O(lg n). + /// + public int CurrentOffset { + get { + if (it.node == null) + throw new InvalidOperationException(); + return GetOffsetFromNode(it.node); + } + } + + object System.Collections.IEnumerator.Current { + get { + return it.Current.lineSegment; + } + } + + public void Dispose() + { + } + + /// + /// Moves to the next index. Runs in O(lg n), but for k calls, the combined time is only O(k+lg n). + /// + public bool MoveNext() + { + return it.MoveNext(); + } + + /// + /// Moves to the previous index. Runs in O(lg n), but for k calls, the combined time is only O(k+lg n). + /// + public bool MoveBack() + { + return it.MoveBack(); + } + + void System.Collections.IEnumerator.Reset() + { + throw new NotSupportedException(); + } + } + + void IList.Insert(int index, LineSegment item) + { + throw new NotSupportedException(); + } + + void ICollection.Add(LineSegment item) + { + throw new NotSupportedException(); + } + + bool ICollection.Remove(LineSegment item) + { + throw new NotSupportedException(); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/MarkerStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/MarkerStrategy.cs new file mode 100644 index 000000000..ee413e7c9 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/MarkerStrategy.cs @@ -0,0 +1,119 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Manages the list of markers and provides ways to retrieve markers for specific positions. + /// + public sealed class MarkerStrategy + { + List textMarker = new List(); + IDocument document; + + public IDocument Document { + get { + return document; + } + } + + public IEnumerable TextMarker { + get { + return textMarker.AsReadOnly(); + } + } + + public void AddMarker(TextMarker item) + { + markersTable.Clear(); + textMarker.Add(item); + } + + public void InsertMarker(int index, TextMarker item) + { + markersTable.Clear(); + textMarker.Insert(index, item); + } + + public void RemoveMarker(TextMarker item) + { + markersTable.Clear(); + textMarker.Remove(item); + } + + public void RemoveAll(Predicate match) + { + markersTable.Clear(); + textMarker.RemoveAll(match); + } + + public MarkerStrategy(IDocument document) + { + this.document = document; + document.DocumentChanged += new DocumentEventHandler(DocumentChanged); + } + + Dictionary> markersTable = new Dictionary>(); + + public List GetMarkers(int offset) + { + if (!markersTable.ContainsKey(offset)) { + List markers = new List(); + for (int i = 0; i < textMarker.Count; ++i) { + TextMarker marker = (TextMarker)textMarker[i]; + if (marker.Offset <= offset && offset <= marker.EndOffset) { + markers.Add(marker); + } + } + markersTable[offset] = markers; + } + return markersTable[offset]; + } + + public List GetMarkers(int offset, int length) + { + int endOffset = offset + length - 1; + List markers = new List(); + for (int i = 0; i < textMarker.Count; ++i) { + TextMarker marker = (TextMarker)textMarker[i]; + if (// start in marker region + marker.Offset <= offset && offset <= marker.EndOffset || + // end in marker region + marker.Offset <= endOffset && endOffset <= marker.EndOffset || + // marker start in region + offset <= marker.Offset && marker.Offset <= endOffset || + // marker end in region + offset <= marker.EndOffset && marker.EndOffset <= endOffset + ) + { + markers.Add(marker); + } + } + return markers; + } + + public List GetMarkers(TextLocation position) + { + if (position.Y >= document.TotalNumberOfLines || position.Y < 0) { + return new List(); + } + LineSegment segment = document.GetLineSegment(position.Y); + return GetMarkers(segment.Offset + position.X); + } + + void DocumentChanged(object sender, DocumentEventArgs e) + { + // reset markers table + markersTable.Clear(); + document.UpdateSegmentListOnDocumentChange(textMarker, e); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/TextMarker.cs b/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/TextMarker.cs new file mode 100644 index 000000000..8f7305b65 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/TextMarker.cs @@ -0,0 +1,110 @@ +// +// +// +// +// $Revision: 2140 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + public enum TextMarkerType + { + SolidBlock, + Underlined, + WaveLine, + Cant + } + + /// + /// Marks a part of a document. + /// + public class TextMarker : AbstractSegment + { + TextMarkerType textMarkerType; + Color color; + Color foreColor; + string toolTip = null; + bool overrideForeColor = false; + bool wholeLine = false; + public TextMarkerType TextMarkerType { + get { + return textMarkerType; + } + } + + public bool WholeLine + { + get + { + return WholeLine; + } + set + { + wholeLine = value; + } + } + + public Color Color { + get { + return color; + } + } + + public Color ForeColor { + get { + return foreColor; + } + } + + public bool OverrideForeColor { + get { + return overrideForeColor; + } + } + + public string ToolTip { + get { + return toolTip; + } + set { + toolTip = value; + } + } + + /// + /// Gets the last offset that is inside the marker region. + /// + public int EndOffset { + get { + return Offset + Length - 1; + } + } + + public TextMarker(int offset, int length, TextMarkerType textMarkerType) : this(offset, length, textMarkerType, Color.Red) + { + } + + public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color) + { + if (length < 1) length = 1; + this.offset = offset; + this.length = length; + this.textMarkerType = textMarkerType; + this.color = color; + } + + public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color, Color foreColor) + { + if (length < 1) length = 1; + this.offset = offset; + this.length = length; + this.textMarkerType = textMarkerType; + this.color = color; + this.foreColor = foreColor; + this.overrideForeColor = true; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/Selection/ColumnRange.cs b/ICSharpCode.TextEditorLinux/Src/Document/Selection/ColumnRange.cs new file mode 100644 index 000000000..891e44690 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/Selection/ColumnRange.cs @@ -0,0 +1,66 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + public class ColumnRange + { + public static readonly ColumnRange NoColumn = new ColumnRange(-2, -2); + public static readonly ColumnRange WholeColumn = new ColumnRange(-1, -1); + + int startColumn; + int endColumn; + + public int StartColumn { + get { + return startColumn; + } + set { + startColumn = value; + } + } + + public int EndColumn { + get { + return endColumn; + } + set { + endColumn = value; + } + } + + public ColumnRange(int startColumn, int endColumn) + { + this.startColumn = startColumn; + this.endColumn = endColumn; + + } + + public override int GetHashCode() + { + return startColumn + (endColumn << 16); + } + + public override bool Equals(object obj) + { + if (obj is ColumnRange) { + return ((ColumnRange)obj).startColumn == startColumn && + ((ColumnRange)obj).endColumn == endColumn; + + } + return false; + } + + public override string ToString() + { + return String.Format("[ColumnRange: StartColumn={0}, EndColumn={1}]", startColumn, endColumn); + } + + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/Selection/DefaultSelection.cs b/ICSharpCode.TextEditorLinux/Src/Document/Selection/DefaultSelection.cs new file mode 100644 index 000000000..ff78c1b4a --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/Selection/DefaultSelection.cs @@ -0,0 +1,133 @@ +// +// +// +// +// $Revision: 2679 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Default implementation of the interface. + /// + public class DefaultSelection : ISelection + { + IDocument document; + bool isRectangularSelection; + TextLocation startPosition; + TextLocation endPosition; + + public TextLocation StartPosition { + get { + return startPosition; + } + set { + DefaultDocument.ValidatePosition(document, value); + startPosition = value; + } + } + + public TextLocation EndPosition { + get { + return endPosition; + } + set { + DefaultDocument.ValidatePosition(document, value); + endPosition = value; + } + } + + public int Offset { + get { + return document.PositionToOffset(startPosition); + } + } + + public int EndOffset { + get { + return document.PositionToOffset(endPosition); + } + } + + public int Length { + get { + return EndOffset - Offset; + } + } + + /// + /// Returns true, if the selection is empty + /// + public bool IsEmpty { + get { + return startPosition == endPosition; + } + } + + /// + /// Returns true, if the selection is rectangular + /// + // TODO : make this unused property used. + public bool IsRectangularSelection { + get { + return isRectangularSelection; + } + set { + isRectangularSelection = value; + } + } + + /// + /// The text which is selected by this selection. + /// + public string SelectedText { + get { + if (document != null) { + if (Length < 0) { + return null; + } + return document.GetText(Offset, Length); + } + return null; + } + } + + /// + /// Creates a new instance of + /// + public DefaultSelection(IDocument document, TextLocation startPosition, TextLocation endPosition) + { + DefaultDocument.ValidatePosition(document, startPosition); + DefaultDocument.ValidatePosition(document, endPosition); + Debug.Assert(startPosition <= endPosition); + this.document = document; + this.startPosition = startPosition; + this.endPosition = endPosition; + } + + /// + /// Converts a instance to string (for debug purposes) + /// + public override string ToString() + { + return String.Format("[DefaultSelection : StartPosition={0}, EndPosition={1}]", startPosition, endPosition); + } + public bool ContainsPosition(TextLocation position) + { + if (this.IsEmpty) + return false; + return startPosition.Y < position.Y && position.Y < endPosition.Y || + startPosition.Y == position.Y && startPosition.X <= position.X && (startPosition.Y != endPosition.Y || position.X <= endPosition.X) || + endPosition.Y == position.Y && startPosition.Y != endPosition.Y && position.X <= endPosition.X; + } + + public bool ContainsOffset(int offset) + { + return Offset <= offset && offset <= EndOffset; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/Selection/ISelection.cs b/ICSharpCode.TextEditorLinux/Src/Document/Selection/ISelection.cs new file mode 100644 index 000000000..c4567b593 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/Selection/ISelection.cs @@ -0,0 +1,64 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System.Drawing; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// An interface representing a portion of the current selection. + /// + public interface ISelection + { + TextLocation StartPosition { + get; + set; + } + + TextLocation EndPosition { + get; + set; + } + + int Offset { + get; + } + + int EndOffset { + get; + } + + int Length { + get; + } + + /// + /// Returns true, if the selection is rectangular + /// + bool IsRectangularSelection { + get; + } + + /// + /// Returns true, if the selection is empty + /// + bool IsEmpty { + get; + } + + /// + /// The text which is selected by this selection. + /// + string SelectedText { + get; + } + + bool ContainsOffset(int offset); + + bool ContainsPosition(TextLocation position); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/Selection/SelectionManager.cs b/ICSharpCode.TextEditorLinux/Src/Document/Selection/SelectionManager.cs new file mode 100644 index 000000000..499211513 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/Selection/SelectionManager.cs @@ -0,0 +1,456 @@ +// +// +// +// +// $Revision: 2679 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// This class manages the selections in a document. + /// + public class SelectionManager : IDisposable + { + TextLocation selectionStart; + + internal TextLocation SelectionStart { + get { return selectionStart; } + set { + DefaultDocument.ValidatePosition(document, value); + selectionStart = value; + } + } + IDocument document; + TextArea textArea; + internal SelectFrom selectFrom = new SelectFrom(); + + internal List selectionCollection = new List(); + + /// + /// A collection containing all selections. + /// + public List SelectionCollection { + get { + return selectionCollection; + } + } + + /// + /// true if the is not empty, false otherwise. + /// + public bool HasSomethingSelected { + get { + return selectionCollection.Count > 0; + } + } + + public bool SelectionIsReadonly { + get { + if (document.ReadOnly) + return true; + if (document.TextEditorProperties.UseCustomLine) { + foreach (ISelection sel in selectionCollection) { + if (document.CustomLineManager.IsReadOnly(sel, false)) + return true; + } + } + return false; + } + } + + /// + /// The text that is currently selected. + /// + public string SelectedText { + get { + StringBuilder builder = new StringBuilder(); + +// PriorityQueue queue = new PriorityQueue(); + + foreach (ISelection s in selectionCollection) { + builder.Append(s.SelectedText); +// queue.Insert(-s.Offset, s); + } + +// while (queue.Count > 0) { +// ISelection s = ((ISelection)queue.Remove()); +// builder.Append(s.SelectedText); +// } + + return builder.ToString(); + } + } + + /// + /// Creates a new instance of + /// + public SelectionManager(IDocument document) + { + this.document = document; + document.DocumentChanged += new DocumentEventHandler(DocumentChanged); + } + + /// + /// Creates a new instance of + /// + public SelectionManager(IDocument document, TextArea textArea) + { + this.document = document; + this.textArea = textArea; + document.DocumentChanged += new DocumentEventHandler(DocumentChanged); + } + + public void Dispose() + { + if (this.document != null) { + document.DocumentChanged -= new DocumentEventHandler(DocumentChanged); + this.document = null; + } + } + + void DocumentChanged(object sender, DocumentEventArgs e) + { + if (e.Text == null) { + Remove(e.Offset, e.Length); + } else { + if (e.Length < 0) { + Insert(e.Offset, e.Text); + } else { + Replace(e.Offset, e.Length, e.Text); + } + } + } + + /// + /// Clears the selection and sets a new selection + /// using the given object. + /// + public void SetSelection(ISelection selection) + { +// autoClearSelection = false; + if (selection != null) { + if (SelectionCollection.Count == 1 && + selection.StartPosition == SelectionCollection[0].StartPosition && + selection.EndPosition == SelectionCollection[0].EndPosition ) { + return; + } + ClearWithoutUpdate(); + selectionCollection.Add(selection); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, selection.StartPosition.Y, selection.EndPosition.Y)); + document.CommitUpdate(); + OnSelectionChanged(EventArgs.Empty); + } else { + ClearSelection(); + } + } + + public void SetSelection(TextLocation startPosition, TextLocation endPosition) + { + SetSelection(new DefaultSelection(document, startPosition, endPosition)); + } + + public bool GreaterEqPos(TextLocation p1, TextLocation p2) + { + return p1.Y > p2.Y || p1.Y == p2.Y && p1.X >= p2.X; + } + + public void ExtendSelection(TextLocation oldPosition, TextLocation newPosition) + { + // where oldposition is where the cursor was, + // and newposition is where it has ended up from a click (both zero based) + + if (oldPosition == newPosition) + { + return; + } + + TextLocation min; + TextLocation max; + int oldnewX = newPosition.X; + bool oldIsGreater = GreaterEqPos(oldPosition, newPosition); + if (oldIsGreater) { + min = newPosition; + max = oldPosition; + } else { + min = oldPosition; + max = newPosition; + } + + if (min == max) { + return; + } + + if (!HasSomethingSelected) + { + SetSelection(new DefaultSelection(document, min, max)); + // initialise selectFrom for a cursor selection + if (selectFrom.where == WhereFrom.None) + SelectionStart = oldPosition; //textArea.Caret.Position; + return; + } + + ISelection selection = this.selectionCollection[0]; + + if (min == max) { + //selection.StartPosition = newPosition; + return; + } else { + // changed selection via gutter + if (selectFrom.where == WhereFrom.Gutter) + { + // selection new position is always at the left edge for gutter selections + newPosition.X = 0; + } + + if (GreaterEqPos(newPosition, SelectionStart)) // selecting forward + { + selection.StartPosition = SelectionStart; + // this handles last line selection + if (selectFrom.where == WhereFrom.Gutter ) //&& newPosition.Y != oldPosition.Y) + selection.EndPosition = new TextLocation(textArea.Caret.Column, textArea.Caret.Line); + else { + newPosition.X = oldnewX; + selection.EndPosition = newPosition; + } + } else { // selecting back + if (selectFrom.where == WhereFrom.Gutter && selectFrom.first == WhereFrom.Gutter) + { // gutter selection + selection.EndPosition = NextValidPosition(SelectionStart.Y); + } else { // internal text selection + selection.EndPosition = SelectionStart; //selection.StartPosition; + } + selection.StartPosition = newPosition; + } + } + + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, min.Y, max.Y)); + document.CommitUpdate(); + OnSelectionChanged(EventArgs.Empty); + } + + // retrieve the next available line + // - checks that there are more lines available after the current one + // - if there are then the next line is returned + // - if there are NOT then the last position on the given line is returned + public TextLocation NextValidPosition(int line) + { + if (line < document.TotalNumberOfLines - 1) + return new TextLocation(0, line + 1); + else + return new TextLocation(document.GetLineSegment(document.TotalNumberOfLines - 1).Length + 1, line); + } + + void ClearWithoutUpdate() + { + while (selectionCollection.Count > 0) { + ISelection selection = selectionCollection[selectionCollection.Count - 1]; + selectionCollection.RemoveAt(selectionCollection.Count - 1); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, selection.StartPosition.Y, selection.EndPosition.Y)); + OnSelectionChanged(EventArgs.Empty); + } + } + /// + /// Clears the selection. + /// + public void ClearSelection() + { + Point mousepos; + mousepos = textArea.mousepos; + // this is the most logical place to reset selection starting + // positions because it is always called before a new selection + selectFrom.first = selectFrom.where; + TextLocation newSelectionStart = textArea.TextView.GetLogicalPosition(mousepos.X - textArea.TextView.DrawingPosition.X, mousepos.Y - textArea.TextView.DrawingPosition.Y); + if (selectFrom.where == WhereFrom.Gutter) { + newSelectionStart.X = 0; +// selectionStart.Y = -1; + } + if (newSelectionStart.Line >= document.TotalNumberOfLines) { + newSelectionStart.Line = document.TotalNumberOfLines-1; + newSelectionStart.Column = document.GetLineSegment(document.TotalNumberOfLines-1).Length; + } + this.SelectionStart = newSelectionStart; + + ClearWithoutUpdate(); + document.CommitUpdate(); + } + + /// + /// Removes the selected text from the buffer and clears + /// the selection. + /// + public void RemoveSelectedText() + { + List lines = new List(); + int offset = -1; + bool oneLine = true; +// PriorityQueue queue = new PriorityQueue(); + foreach (ISelection s in selectionCollection) { +// ISelection s = ((ISelection)queue.Remove()); + if (oneLine) { + int lineBegin = s.StartPosition.Y; + if (lineBegin != s.EndPosition.Y) { + oneLine = false; + } else { + lines.Add(lineBegin); + } + } + offset = s.Offset; + document.Remove(s.Offset, s.Length); + +// queue.Insert(-s.Offset, s); + } + ClearSelection(); + if (offset >= 0) { + // TODO: +// document.Caret.Offset = offset; + } + if (offset != -1) { + if (oneLine) { + foreach (int i in lines) { + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, i)); + } + } else { + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + } + document.CommitUpdate(); + } + } + + + bool SelectionsOverlap(ISelection s1, ISelection s2) + { + return (s1.Offset <= s2.Offset && s2.Offset <= s1.Offset + s1.Length) || + (s1.Offset <= s2.Offset + s2.Length && s2.Offset + s2.Length <= s1.Offset + s1.Length) || + (s1.Offset >= s2.Offset && s1.Offset + s1.Length <= s2.Offset + s2.Length); + } + + /// + /// Returns true if the given offset points to a section which is + /// selected. + /// + public bool IsSelected(int offset) + { + return GetSelectionAt(offset) != null; + } + + /// + /// Returns a object giving the selection in which + /// the offset points to. + /// + /// + /// null if the offset doesn't point to a selection + /// + public ISelection GetSelectionAt(int offset) + { + foreach (ISelection s in selectionCollection) { + if (s.ContainsOffset(offset)) { + return s; + } + } + return null; + } + + /// + /// Used internally, do not call. + /// + internal void Insert(int offset, string text) + { +// foreach (ISelection selection in SelectionCollection) { +// if (selection.Offset > offset) { +// selection.Offset += text.Length; +// } else if (selection.Offset + selection.Length > offset) { +// selection.Length += text.Length; +// } +// } + } + + /// + /// Used internally, do not call. + /// + internal void Remove(int offset, int length) + { +// foreach (ISelection selection in selectionCollection) { +// if (selection.Offset > offset) { +// selection.Offset -= length; +// } else if (selection.Offset + selection.Length > offset) { +// selection.Length -= length; +// } +// } + } + + /// + /// Used internally, do not call. + /// + internal void Replace(int offset, int length, string text) + { +// foreach (ISelection selection in selectionCollection) { +// if (selection.Offset > offset) { +// selection.Offset = selection.Offset - length + text.Length; +// } else if (selection.Offset + selection.Length > offset) { +// selection.Length = selection.Length - length + text.Length; +// } +// } + } + + public ColumnRange GetSelectionAtLine(int lineNumber) + { + foreach (ISelection selection in selectionCollection) { + int startLine = selection.StartPosition.Y; + int endLine = selection.EndPosition.Y; + if (startLine < lineNumber && lineNumber < endLine) { + return ColumnRange.WholeColumn; + } + + if (startLine == lineNumber) { + LineSegment line = document.GetLineSegment(startLine); + int startColumn = selection.StartPosition.X; + int endColumn = endLine == lineNumber ? selection.EndPosition.X : line.Length + 1; + return new ColumnRange(startColumn, endColumn); + } + + if (endLine == lineNumber) { + int endColumn = selection.EndPosition.X; + return new ColumnRange(0, endColumn); + } + } + + return ColumnRange.NoColumn; + } + + public void FireSelectionChanged() + { + OnSelectionChanged(EventArgs.Empty); + } + protected virtual void OnSelectionChanged(EventArgs e) + { + if (SelectionChanged != null) { + SelectionChanged(this, e); + } + } + + public event EventHandler SelectionChanged; + } + + // selection initiated from... + internal class SelectFrom { + public int where = WhereFrom.None; // last selection initiator + public int first = WhereFrom.None; // first selection initiator + + public SelectFrom() + { + } + } + + // selection initiated from type... + internal class WhereFrom { + public const int None = 0; + public const int Gutter = 1; + public const int TArea = 2; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/TextAnchor.cs b/ICSharpCode.TextEditorLinux/Src/Document/TextAnchor.cs new file mode 100644 index 000000000..39ab5ea74 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/TextAnchor.cs @@ -0,0 +1,88 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Description of TextAnchor. + /// + public sealed class TextAnchor + { + static Exception AnchorDeletedError() + { + return new InvalidOperationException("The text containing the anchor was deleted"); + } + + LineSegment lineSegment; + int columnNumber; + + public LineSegment Line { + get { + if (lineSegment == null) throw AnchorDeletedError(); + return lineSegment; + } + internal set { + lineSegment = value; + } + } + + public bool IsDeleted { + get { + return lineSegment == null; + } + } + + public int LineNumber { + get { + return this.Line.LineNumber; + } + } + + public int ColumnNumber { + get { + if (lineSegment == null) throw AnchorDeletedError(); + return columnNumber; + } + internal set { + columnNumber = value; + } + } + + public TextLocation Location { + get { + return new TextLocation(this.ColumnNumber, this.LineNumber); + } + } + + public int Offset { + get { + return this.Line.Offset + columnNumber; + } + } + + internal void Deleted() + { + lineSegment = null; + } + + internal TextAnchor(LineSegment lineSegment, int columnNumber) + { + this.lineSegment = lineSegment; + this.columnNumber = columnNumber; + } + + public override string ToString() + { + if (this.IsDeleted) + return "[TextAnchor (deleted)]"; + else + return "[TextAnchor " + this.Location.ToString() + "]"; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/GapTextBufferStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/GapTextBufferStrategy.cs new file mode 100644 index 000000000..a82d41479 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/GapTextBufferStrategy.cs @@ -0,0 +1,179 @@ +// +// +// +// +// $Revision: 2667 $ +// + +using System; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + public class GapTextBufferStrategy : ITextBufferStrategy + { + #if DEBUG + int creatorThread = System.Threading.Thread.CurrentThread.ManagedThreadId; + + void CheckThread() + { + //if (System.Threading.Thread.CurrentThread.ManagedThreadId != creatorThread) + // throw new InvalidOperationException("GapTextBufferStategy is not thread-safe!"); + } + #endif + + char[] buffer = new char[0]; + + int gapBeginOffset = 0; + int gapEndOffset = 0; + int gapLength = 0; // gapLength == gapEndOffset - gapBeginOffset + + const int minGapLength = 128; + const int maxGapLength = 2048; + + public int Length { + get { + return buffer.Length - gapLength; + } + } + + public void SetContent(string text) + { + if (text == null) { + text = String.Empty; + } + buffer = text.ToCharArray(); + gapBeginOffset = gapEndOffset = gapLength = 0; + } + + public char GetCharAt(int offset) + { + #if DEBUG + CheckThread(); + #endif + + if (offset < 0 || offset >= Length) { + throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset < " + Length.ToString()); + } + + return offset < gapBeginOffset ? buffer[offset] : buffer[offset + gapLength]; + } + + public string GetText(int offset, int length) + { + #if DEBUG + CheckThread(); + #endif + + if (offset < 0 || offset > Length) { + throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset <= " + Length.ToString()); + } + if (length < 0 || offset + length > Length) { + throw new ArgumentOutOfRangeException("length", length, "0 <= length, offset(" + offset + ")+length <= " + Length.ToString()); + } + + int end = offset + length; + + if (end < gapBeginOffset) { + return new string(buffer, offset, length); + } + + if (offset > gapBeginOffset) { + return new string(buffer, offset + gapLength, length); + } + + int block1Size = gapBeginOffset - offset; + int block2Size = end - gapBeginOffset; + + StringBuilder buf = new StringBuilder(block1Size + block2Size); + buf.Append(buffer, offset, block1Size); + buf.Append(buffer, gapEndOffset, block2Size); + return buf.ToString(); + } + + public void Insert(int offset, string text) + { + Replace(offset, 0, text); + } + + public void Remove(int offset, int length) + { + Replace(offset, length, String.Empty); + } + + public void Replace(int offset, int length, string text) + { + if (text == null) { + text = String.Empty; + } + + #if DEBUG + CheckThread(); + #endif + + if (offset < 0 || offset > Length) { + throw new ArgumentOutOfRangeException("offset", offset, "0 <= offset <= " + Length.ToString()); + } + if (length < 0 || offset + length > Length) { + throw new ArgumentOutOfRangeException("length", length, "0 <= length, offset+length <= " + Length.ToString()); + } + + // Math.Max is used so that if we need to resize the array + // the new array has enough space for all old chars + PlaceGap(offset, text.Length - length); + gapEndOffset += length; // delete removed text + text.CopyTo(0, buffer, gapBeginOffset, text.Length); + gapBeginOffset += text.Length; + gapLength = gapEndOffset - gapBeginOffset; + if (gapLength > maxGapLength) { + MakeNewBuffer(gapBeginOffset, minGapLength); + } + } + + void PlaceGap(int newGapOffset, int minRequiredGapLength) + { + if (gapLength < minRequiredGapLength) { + // enlarge gap + MakeNewBuffer(newGapOffset, minRequiredGapLength); + } else { + while (newGapOffset < gapBeginOffset) { + buffer[--gapEndOffset] = buffer[--gapBeginOffset]; + } + while (newGapOffset > gapBeginOffset) { + buffer[gapBeginOffset++] = buffer[gapEndOffset++]; + } + } + } + + void MakeNewBuffer(int newGapOffset, int newGapLength) + { + if (newGapLength < minGapLength) newGapLength = minGapLength; + + char[] newBuffer = new char[Length + newGapLength]; + if (newGapOffset < gapBeginOffset) { + // gap is moving backwards + + // first part: + Array.Copy(buffer, 0, newBuffer, 0, newGapOffset); + // moving middle part: + Array.Copy(buffer, newGapOffset, newBuffer, newGapOffset + newGapLength, gapBeginOffset - newGapOffset); + // last part: + Array.Copy(buffer, gapEndOffset, newBuffer, newBuffer.Length - (buffer.Length - gapEndOffset), buffer.Length - gapEndOffset); + } else { + // gap is moving forwards + // first part: + Array.Copy(buffer, 0, newBuffer, 0, gapBeginOffset); + // moving middle part: + Array.Copy(buffer, gapEndOffset, newBuffer, gapBeginOffset, newGapOffset - gapBeginOffset); + // last part: + int lastPartLength = newBuffer.Length - (newGapOffset + newGapLength); + Array.Copy(buffer, buffer.Length - lastPartLength, newBuffer, newGapOffset + newGapLength, lastPartLength); + } + + gapBeginOffset = newGapOffset; + gapEndOffset = newGapOffset + newGapLength; + gapLength = newGapLength; + buffer = newBuffer; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/ITextBufferStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/ITextBufferStrategy.cs new file mode 100644 index 000000000..62c13bda2 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/ITextBufferStrategy.cs @@ -0,0 +1,85 @@ +// +// +// +// +// $Revision: 1966 $ +// + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Interface to describe a sequence of characters that can be edited. + /// + public interface ITextBufferStrategy + { + /// + /// The current length of the sequence of characters that can be edited. + /// + int Length { + get; + } + + /// + /// Inserts a string of characters into the sequence. + /// + /// + /// offset where to insert the string. + /// + /// + /// text to be inserted. + /// + void Insert(int offset, string text); + + /// + /// Removes some portion of the sequence. + /// + /// + /// offset of the remove. + /// + /// + /// number of characters to remove. + /// + void Remove(int offset, int length); + + /// + /// Replace some portion of the sequence. + /// + /// + /// offset. + /// + /// + /// number of characters to replace. + /// + /// + /// text to be replaced with. + /// + void Replace(int offset, int length, string text); + + /// + /// Fetches a string of characters contained in the sequence. + /// + /// + /// Offset into the sequence to fetch + /// + /// + /// number of characters to copy. + /// + string GetText(int offset, int length); + + /// + /// Returns a specific char of the sequence. + /// + /// + /// Offset of the char to get. + /// + char GetCharAt(int offset); + + /// + /// This method sets the stored content. + /// + /// + /// The string that represents the character sequence. + /// + void SetContent(string text); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/StringTextBufferStrategy.cs b/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/StringTextBufferStrategy.cs new file mode 100644 index 000000000..cfa16cc92 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/TextBufferStrategy/StringTextBufferStrategy.cs @@ -0,0 +1,85 @@ +// +// +// +// +// $Revision: 2682 $ +// + +using System; +using System.IO; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// Simple implementation of the ITextBuffer interface implemented using a + /// string. + /// Only for fall-back purposes. + /// + public class StringTextBufferStrategy : ITextBufferStrategy + { + string storedText = ""; + + public int Length { + get { + return storedText.Length; + } + } + + public void Insert(int offset, string text) + { + if (text != null) { + storedText = storedText.Insert(offset, text); + } + } + + public void Remove(int offset, int length) + { + storedText = storedText.Remove(offset, length); + } + + public void Replace(int offset, int length, string text) + { + Remove(offset, length); + Insert(offset, text); + } + + public string GetText(int offset, int length) + { + if (length == 0) { + return ""; + } + if (offset == 0 && length >= storedText.Length) { + return storedText; + } + return storedText.Substring(offset, Math.Min(length, storedText.Length - offset)); + } + + public char GetCharAt(int offset) + { + if (offset == Length) { + return '\0'; + } + return storedText[offset]; + } + + public void SetContent(string text) + { + storedText = text; + } + + public StringTextBufferStrategy() + { + } + + public static ITextBufferStrategy CreateTextBufferFromFile(string fileName) + { + if (!File.Exists(fileName)) { + throw new System.IO.FileNotFoundException(fileName); + } + StringTextBufferStrategy s = new StringTextBufferStrategy(); + s.SetContent(Util.FileReader.ReadFileContent(fileName, Encoding.Default)); + return s; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/TextLocation.cs b/ICSharpCode.TextEditorLinux/Src/Document/TextLocation.cs new file mode 100644 index 000000000..7403ea9c9 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/TextLocation.cs @@ -0,0 +1,128 @@ +// +// +// +// +// $Revision: 2658$ +// + +using System; + +namespace ICSharpCode.TextEditor +{ + /// + /// A line/column position. + /// Text editor lines/columns are counting from zero. + /// + public struct TextLocation : IComparable, IEquatable + { + /// + /// Represents no text location (-1, -1). + /// + public static readonly TextLocation Empty = new TextLocation(-1, -1); + + public TextLocation(int column, int line) + { + x = column; + y = line; + } + + int x, y; + + public int X { + get { return x; } + set { x = value; } + } + + public int Y { + get { return y; } + set { y = value; } + } + + public int Line { + get { return y; } + set { y = value; } + } + + public int Column { + get { return x; } + set { x = value; } + } + + public bool IsEmpty { + get { + return x <= 0 && y <= 0; + } + } + + public override string ToString() + { + return string.Format("(Line {1}, Col {0})", this.x, this.y); + } + + public override int GetHashCode() + { + return unchecked (87 * x.GetHashCode() ^ y.GetHashCode()); + } + + public override bool Equals(object obj) + { + if (!(obj is TextLocation)) return false; + return (TextLocation)obj == this; + } + + public bool Equals(TextLocation other) + { + return this == other; + } + + public static bool operator ==(TextLocation a, TextLocation b) + { + return a.x == b.x && a.y == b.y; + } + + public static bool operator !=(TextLocation a, TextLocation b) + { + return a.x != b.x || a.y != b.y; + } + + public static bool operator <(TextLocation a, TextLocation b) + { + if (a.y < b.y) + return true; + else if (a.y == b.y) + return a.x < b.x; + else + return false; + } + + public static bool operator >(TextLocation a, TextLocation b) + { + if (a.y > b.y) + return true; + else if (a.y == b.y) + return a.x > b.x; + else + return false; + } + + public static bool operator <=(TextLocation a, TextLocation b) + { + return !(a > b); + } + + public static bool operator >=(TextLocation a, TextLocation b) + { + return !(a < b); + } + + public int CompareTo(TextLocation other) + { + if (this == other) + return 0; + if (this < other) + return -1; + else + return 1; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Document/TextUtilities.cs b/ICSharpCode.TextEditorLinux/Src/Document/TextUtilities.cs new file mode 100644 index 000000000..9afaeaf09 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Document/TextUtilities.cs @@ -0,0 +1,313 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Diagnostics; +using System.Text; + +namespace ICSharpCode.TextEditor.Document +{ + + public sealed class TextUtilities + { + /// + /// This function takes a string and converts the whitespace in front of + /// it to tabs. If the length of the whitespace at the start of the string + /// was not a whole number of tabs then there will still be some spaces just + /// before the text starts. + /// the output string will be of the form: + /// 1. zero or more tabs + /// 2. zero or more spaces (less than tabIndent) + /// 3. the rest of the line + /// + public static string LeadingWhiteSpaceToTabs(string line, int tabIndent) { + StringBuilder sb = new StringBuilder(line.Length); + int consecutiveSpaces = 0; + int i = 0; + for(i = 0; i < line.Length; i++) { + if(line[i] == ' ') { + consecutiveSpaces++; + if(consecutiveSpaces == tabIndent) { + sb.Append('\t'); + consecutiveSpaces = 0; + } + } + else if(line[i] == '\t') { + sb.Append('\t'); + // if we had say 3 spaces then a tab and tabIndent was 4 then + // we would want to simply replace all of that with 1 tab + consecutiveSpaces = 0; + } + else { + break; + } + } + + if(i < line.Length) { + sb.Append(line.Substring(i-consecutiveSpaces)); + } + return sb.ToString(); + } + + public static bool IsLetterDigitOrUnderscore(char c) + { + if(!Char.IsLetterOrDigit(c)) { + return c == '_'; + } + return true; + } + + public enum CharacterType { + LetterDigitOrUnderscore, + WhiteSpace, + Other + } + + /// + /// This method returns the expression before a specified offset. + /// That method is used in code completion to determine the expression given + /// to the parser for type resolve. + /// + public static string GetExpressionBeforeOffset(TextArea textArea, int initialOffset) + { + IDocument document = textArea.Document; + int offset = initialOffset; + while (offset - 1 > 0) { + switch (document.GetCharAt(offset - 1)) { + case '\n': + case '\r': + case '}': + goto done; +// offset = SearchBracketBackward(document, offset - 2, '{','}'); +// break; + case ']': + offset = SearchBracketBackward(document, offset - 2, '[',']'); + break; + case ')': + offset = SearchBracketBackward(document, offset - 2, '(',')'); + break; + case '.': + --offset; + break; + case '"': + if (offset < initialOffset - 1) { + return null; + } + return "\"\""; + case '\'': + if (offset < initialOffset - 1) { + return null; + } + return "'a'"; + case '>': + if (document.GetCharAt(offset - 2) == '-') { + offset -= 2; + break; + } + goto done; + default: + if (Char.IsWhiteSpace(document.GetCharAt(offset - 1))) { + --offset; + break; + } + int start = offset - 1; + if (!IsLetterDigitOrUnderscore(document.GetCharAt(start))) { + goto done; + } + + while (start > 0 && IsLetterDigitOrUnderscore(document.GetCharAt(start - 1))) { + --start; + } + string word = document.GetText(start, offset - start).Trim(); + switch (word) { + case "ref": + case "out": + case "in": + case "return": + case "throw": + case "case": + goto done; + } + + if (word.Length > 0 && !IsLetterDigitOrUnderscore(word[0])) { + goto done; + } + offset = start; + break; + } + } + done: + //// simple exit fails when : is inside comment line or any other character + //// we have to check if we got several ids in resulting line, which usually happens when + //// id. is typed on next line after comment one + //// Would be better if lexer would parse properly such expressions. However this will cause + //// modifications in this area too - to get full comment line and remove it afterwards + if (offset < 0) + return string.Empty; + + string resText=document.GetText(offset, textArea.Caret.Offset - offset ).Trim(); + int pos=resText.LastIndexOf('\n'); + if (pos>=0) { + offset+=pos+1; + //// whitespaces and tabs, which might be inside, will be skipped by trim below + } + string expression = document.GetText(offset, textArea.Caret.Offset - offset ).Trim(); + return expression; + } + + + public static CharacterType GetCharacterType(char c) + { + if(IsLetterDigitOrUnderscore(c)) + return CharacterType.LetterDigitOrUnderscore; + if(Char.IsWhiteSpace(c)) + return CharacterType.WhiteSpace; + return CharacterType.Other; + } + + public static int GetFirstNonWSChar(IDocument document, int offset) + { + while (offset < document.TextLength && Char.IsWhiteSpace(document.GetCharAt(offset))) { + ++offset; + } + return offset; + } + + public static int FindWordEnd(IDocument document, int offset) + { + LineSegment line = document.GetLineSegmentForOffset(offset); + int endPos = line.Offset + line.Length; + while (offset < endPos && IsLetterDigitOrUnderscore(document.GetCharAt(offset))) { + ++offset; + } + + return offset; + } + + public static int FindWordStart(IDocument document, int offset) + { + LineSegment line = document.GetLineSegmentForOffset(offset); + + while (offset > line.Offset && !IsLetterDigitOrUnderscore(document.GetCharAt(offset - 1))) { + --offset; + } + + return offset; + } + + // go forward to the start of the next word + // if the cursor is at the start or in the middle of a word we move to the end of the word + // and then past any whitespace that follows it + // if the cursor is at the start or in the middle of some whitespace we move to the start of the + // next word + public static int FindNextWordStart(IDocument document, int offset) + { + int originalOffset = offset; + LineSegment line = document.GetLineSegmentForOffset(offset); + int endPos = line.Offset + line.Length; + // lets go to the end of the word, whitespace or operator + CharacterType t = GetCharacterType(document.GetCharAt(offset)); + while (offset < endPos && GetCharacterType(document.GetCharAt(offset)) == t) { + ++offset; + } + + // now we're at the end of the word, lets find the start of the next one by skipping whitespace + while (offset < endPos && GetCharacterType(document.GetCharAt(offset)) == CharacterType.WhiteSpace) { + ++offset; + } + + return offset; + } + + // go back to the start of the word we are on + // if we are already at the start of a word or if we are in whitespace, then go back + // to the start of the previous word + public static int FindPrevWordStart(IDocument document, int offset) + { + int originalOffset = offset; + if (offset > 0) { + LineSegment line = document.GetLineSegmentForOffset(offset); + CharacterType t = GetCharacterType(document.GetCharAt(offset - 1)); + while (offset > line.Offset && GetCharacterType(document.GetCharAt(offset - 1)) == t) { + --offset; + } + + // if we were in whitespace, and now we're at the end of a word or operator, go back to the beginning of it + if(t == CharacterType.WhiteSpace && offset > line.Offset) { + t = GetCharacterType(document.GetCharAt(offset - 1)); + while (offset > line.Offset && GetCharacterType(document.GetCharAt(offset - 1)) == t) { + --offset; + } + } + } + + return offset; + } + + public static string GetLineAsString(IDocument document, int lineNumber) + { + LineSegment line = document.GetLineSegment(lineNumber); + return document.GetText(line.Offset, line.Length); + } + + public static int SearchBracketBackward(IDocument document, int offset, char openBracket, char closingBracket) + { + return document.FormattingStrategy.SearchBracketBackward(document, offset, openBracket, closingBracket); + } + + public static int SearchBracketForward(IDocument document, int offset, char openBracket, char closingBracket) + { + return document.FormattingStrategy.SearchBracketForward(document, offset, openBracket, closingBracket); + } + + /// + /// Returns true, if the line lineNumber is empty or filled with whitespaces. + /// + public static bool IsEmptyLine(IDocument document, int lineNumber) + { + return IsEmptyLine(document, document.GetLineSegment(lineNumber)); + } + + /// + /// Returns true, if the line lineNumber is empty or filled with whitespaces. + /// + public static bool IsEmptyLine(IDocument document, LineSegment line) + { + for (int i = line.Offset; i < line.Offset + line.Length; ++i) { + char ch = document.GetCharAt(i); + if (!Char.IsWhiteSpace(ch)) { + return false; + } + } + return true; + } + + static bool IsWordPart(char ch) + { + return IsLetterDigitOrUnderscore(ch) || ch == '.'; + } + + public static string GetWordAt(IDocument document, int offset) + { + if (offset < 0 || offset >= document.TextLength - 1 || !IsWordPart(document.GetCharAt(offset))) { + return String.Empty; + } + int startOffset = offset; + int endOffset = offset; + while (startOffset > 0 && IsWordPart(document.GetCharAt(startOffset - 1))) { + --startOffset; + } + + while (endOffset < document.TextLength - 1 && IsWordPart(document.GetCharAt(endOffset + 1))) { + ++endOffset; + } + + Debug.Assert(endOffset >= startOffset); + return document.GetText(startOffset, endOffset - startOffset + 1); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/AbstractMargin.cs b/ICSharpCode.TextEditorLinux/Src/Gui/AbstractMargin.cs new file mode 100644 index 000000000..842d2c815 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/AbstractMargin.cs @@ -0,0 +1,115 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + public delegate void MarginMouseEventHandler(AbstractMargin sender, Point mousepos, MouseButtons mouseButtons); + public delegate void MarginPaintEventHandler(AbstractMargin sender, Graphics g, Rectangle rect); + + /// + /// This class views the line numbers and folding markers. + /// + public abstract class AbstractMargin + { + Cursor cursor = Cursors.Default; + + [CLSCompliant(false)] + protected Rectangle drawingPosition = new Rectangle(0, 0, 0, 0); + [CLSCompliant(false)] + protected TextArea textArea; + + public Rectangle DrawingPosition { + get { + return drawingPosition; + } + set { + drawingPosition = value; + } + } + + public TextArea TextArea { + get { + return textArea; + } + } + + public IDocument Document { + get { + return textArea.Document; + } + } + + public ITextEditorProperties TextEditorProperties { + get { + return textArea.Document.TextEditorProperties; + } + } + + public virtual Cursor Cursor { + get { + return cursor; + } + set { + cursor = value; + } + } + + public virtual Size Size { + get { + return new Size(-1, -1); + } + } + + public virtual bool IsVisible { + get { + return true; + } + } + + protected AbstractMargin(TextArea textArea) + { + this.textArea = textArea; + } + + public virtual void HandleMouseDown(Point mousepos, MouseButtons mouseButtons) + { + if (MouseDown != null) { + MouseDown(this, mousepos, mouseButtons); + } + } + public virtual void HandleMouseMove(Point mousepos, MouseButtons mouseButtons) + { + if (MouseMove != null) { + MouseMove(this, mousepos, mouseButtons); + } + } + public virtual void HandleMouseLeave(EventArgs e) + { + if (MouseLeave != null) { + MouseLeave(this, e); + } + } + + public virtual void Paint(Graphics g, Rectangle rect) + { + if (Painted != null) { + Painted(this, g, rect); + } + } + + public event MarginPaintEventHandler Painted; + public event MarginMouseEventHandler MouseDown; + public event MarginMouseEventHandler MouseMove; + public event EventHandler MouseLeave; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/BracketHighlighter.cs b/ICSharpCode.TextEditorLinux/Src/Gui/BracketHighlighter.cs new file mode 100644 index 000000000..7eeb362dd --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/BracketHighlighter.cs @@ -0,0 +1,86 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + public class Highlight + { + public TextLocation OpenBrace { get; set; } + public TextLocation CloseBrace { get; set; } + + public Highlight(TextLocation openBrace, TextLocation closeBrace) + { + this.OpenBrace = openBrace; + this.CloseBrace = closeBrace; + } + } + + public class BracketHighlightingSheme + { + char opentag; + char closingtag; + + public char OpenTag { + get { + return opentag; + } + set { + opentag = value; + } + } + + public char ClosingTag { + get { + return closingtag; + } + set { + closingtag = value; + } + } + + public BracketHighlightingSheme(char opentag, char closingtag) + { + this.opentag = opentag; + this.closingtag = closingtag; + } + + public Highlight GetHighlight(IDocument document, int offset) + { + int searchOffset; + if (document.TextEditorProperties.BracketMatchingStyle == BracketMatchingStyle.After) { + searchOffset = offset; + } else { + searchOffset = offset + 1; + } + char word = document.GetCharAt(Math.Max(0, Math.Min(document.TextLength - 1, searchOffset))); + + TextLocation endP = document.OffsetToPosition(searchOffset); + if (word == opentag) { + if (searchOffset < document.TextLength) { + int bracketOffset = TextUtilities.SearchBracketForward(document, searchOffset + 1, opentag, closingtag); + if (bracketOffset >= 0) { + TextLocation p = document.OffsetToPosition(bracketOffset); + return new Highlight(p, endP); + } + } + } else if (word == closingtag) { + if (searchOffset > 0) { + int bracketOffset = TextUtilities.SearchBracketBackward(document, searchOffset - 1, opentag, closingtag); + if (bracketOffset >= 0) { + TextLocation p = document.OffsetToPosition(bracketOffset); + return new Highlight(p, endP); + } + } + } + return null; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/BrushRegistry.cs b/ICSharpCode.TextEditorLinux/Src/Gui/BrushRegistry.cs new file mode 100644 index 000000000..ddba3cc3b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/BrushRegistry.cs @@ -0,0 +1,61 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Collections; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace ICSharpCode.TextEditor +{ + /// + /// Contains brushes/pens for the text editor to speed up drawing. Re-Creation of brushes and pens + /// seems too costly. + /// + public class BrushRegistry + { + static Hashtable brushes = new Hashtable(); + static Hashtable pens = new Hashtable(); + static Hashtable dotPens = new Hashtable(); + + public static Brush GetBrush(Color color) + { + if (!brushes.Contains(color)) { + Brush newBrush = new SolidBrush(color); + brushes.Add(color, newBrush); + return newBrush; + } + return brushes[color] as Brush; + } + + public static Pen GetPen(Color color) + { + if (!pens.Contains(color)) { + Pen newPen = new Pen(color); + pens.Add(color, newPen); + return newPen; + } + return pens[color] as Pen; + } + + public static Pen GetDotPen(Color bgColor, Color fgColor) + { + bool containsBgColor = dotPens.Contains(bgColor); + if (!containsBgColor || !((Hashtable)dotPens[bgColor]).Contains(fgColor)) { + if (!containsBgColor) { + dotPens[bgColor] = new Hashtable(); + } + + HatchBrush hb = new HatchBrush(HatchStyle.Percent50, bgColor, fgColor); + Pen newPen = new Pen(hb); + ((Hashtable)dotPens[bgColor])[fgColor] = newPen; + return newPen; + } + return ((Hashtable)dotPens[bgColor])[fgColor] as Pen; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/Caret.cs b/ICSharpCode.TextEditorLinux/Src/Gui/Caret.cs new file mode 100644 index 000000000..5f30ba9b0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/Caret.cs @@ -0,0 +1,568 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Runtime.InteropServices; + +using ICSharpCode.TextEditor.Document; +using System.Reflection; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor +{ + /// + /// In this enumeration are all caret modes listed. + /// + public enum CaretMode { + /// + /// If the caret is in insert mode typed characters will be + /// inserted at the caret position + /// + InsertMode, + + /// + /// If the caret is in overwirte mode typed characters will + /// overwrite the character at the caret position + /// + OverwriteMode + } + + + public class Caret : System.IDisposable + { + int line = 0; + int column = 0; + int desiredXPos = 0; + CaretMode caretMode; + + static bool caretCreated = false; + bool hidden = true; + TextArea textArea; + static TextArea staticTextArea; + Point currentPos = new Point(-1, -1); + Ime ime = null; + + /// + /// The 'prefered' xPos in which the caret moves, when it is moved + /// up/down. + /// + public int DesiredColumn { + get { + return desiredXPos; + } + set { + desiredXPos = value; + } + } + + /// + /// The current caret mode. + /// + public CaretMode CaretMode { + get { + return caretMode; + } + set { + caretMode = value; + OnCaretModeChanged(EventArgs.Empty); + } + } + + public int Line { + get { + return line; + } + set { + line = value; + ValidateCaretPos(); + UpdateCaretPosition(); + OnPositionChanged(EventArgs.Empty); + } + } + + public int Column { + get { + return column; + } + set { + column = value; + ValidateCaretPos(); + UpdateCaretPosition(); + OnPositionChanged(EventArgs.Empty); + } + } + + public TextLocation Position { + get { + return new TextLocation(column, line); + } + set { + line = value.Y; + column = value.X; + ValidateCaretPos(); + UpdateCaretPosition(); + OnPositionChanged(EventArgs.Empty); + } + } + + public int Offset { + get { + return textArea.Document.PositionToOffset(Position); + } + } + + public Caret(TextArea textArea) + { + this.textArea = textArea; + staticTextArea = textArea; + textArea.GotFocus += new EventHandler(GotFocus); + textArea.LostFocus += new EventHandler(LostFocus); + } + + public void Dispose() + { + textArea.GotFocus -= new EventHandler(GotFocus); + textArea.LostFocus -= new EventHandler(LostFocus); + textArea = null; + staticTextArea = null; +// DestroyCaret(); +// caretCreated = false; + } + + public TextLocation ValidatePosition(TextLocation pos) + { + int line = Math.Max(0, Math.Min(textArea.Document.TotalNumberOfLines - 1, pos.Y)); + int column = Math.Max(0, pos.X); + + if (column == int.MaxValue || !textArea.TextEditorProperties.AllowCaretBeyondEOL) { + LineSegment lineSegment = textArea.Document.GetLineSegment(line); + column = Math.Min(column, lineSegment.Length); + } + return new TextLocation(column, line); + } + + /// + /// If the caret position is outside the document text bounds + /// it is set to the correct position by calling ValidateCaretPos. + /// + public void ValidateCaretPos() + { + line = Math.Max(0, Math.Min(textArea.Document.TotalNumberOfLines - 1, line)); + column = Math.Max(0, column); + + if (column == int.MaxValue || !textArea.TextEditorProperties.AllowCaretBeyondEOL) { + LineSegment lineSegment = textArea.Document.GetLineSegment(line); + column = Math.Min(column, lineSegment.Length); + } + } + + void CreateCaret() + { + while (!caretCreated) { + switch (caretMode) { + case CaretMode.InsertMode: + caretCreated = CreateCaret(textArea.Handle, 0, 2, textArea.TextView.FontHeight); + break; + case CaretMode.OverwriteMode: + caretCreated = CreateCaret(textArea.Handle, 0, (int)textArea.TextView.SpaceWidth, textArea.TextView.FontHeight); + break; + } + } + if (currentPos.X < 0) { + ValidateCaretPos(); + currentPos = ScreenPosition; + } + SetCaretPos(currentPos.X, currentPos.Y); + ShowCaret(textArea.Handle); + } + + public void RecreateCaret() + { + DisposeCaret(); + if (!hidden) { + CreateCaret(); + } + } + + void DisposeCaret() + { + caretCreated = false; + //if (Environment.OSVersion.Platform != PlatformID.Unix && Environment.OSVersion.Platform != PlatformID.MacOSX) + HideCaret(textArea.Handle); + DestroyCaret(); + } + + void GotFocus(object sender, EventArgs e) + { + hidden = false; + if (!textArea.MotherTextEditorControl.IsInUpdate) { + CreateCaret(); + UpdateCaretPosition(); + } + } + + void LostFocus(object sender, EventArgs e) + { + hidden = true; + DisposeCaret(); + } + + public Point ScreenPosition { + get { + int xpos = textArea.TextView.GetDrawingXPos(this.line, this.column); + return new Point(textArea.TextView.DrawingPosition.X + xpos, + textArea.TextView.DrawingPosition.Y + + (textArea.Document.GetVisibleLine(this.line)) * textArea.TextView.FontHeight + - textArea.TextView.TextArea.VirtualTop.Y); + } + } + int oldLine = -1; + public void UpdateCaretPosition() + { + //Console.WriteLine("updatecaret " + ScreenPosition.X+"-"+ScreenPosition.Y+"-"+oldLine+"-"+line); + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + if (oldLine != line) + { + //Console.WriteLine(oldLine + "-" + line); + textArea.UpdateLine(oldLine); + //textArea.UpdateLine(line); + } + } + else + { + if (textArea.MotherTextAreaControl.TextEditorProperties.LineViewerStyle == LineViewerStyle.FullRow && oldLine != line) + { + textArea.UpdateLine(oldLine); + textArea.UpdateLine(line); + } + } + + + oldLine = line; + + + if (hidden || textArea.MotherTextEditorControl.IsInUpdate) { + return; + } + + //DisposeCaret(); + //Console.WriteLine("updatecaret " + ScreenPosition.X + "-" + ScreenPosition.Y + "-" + oldLine + "-" + line); + + if (!caretCreated) { + CreateCaret(); + } + if (caretCreated) { + ValidateCaretPos(); + int lineNr = this.line; + int xpos = textArea.TextView.GetDrawingXPos(lineNr, this.column); + //LineSegment lineSegment = textArea.Document.GetLineSegment(lineNr); + Point pos = ScreenPosition; + if (xpos >= 0) { + + bool success = SetCaretPos(pos.X, pos.Y); + if (!success) + { + DestroyCaret(); + caretCreated = false; + UpdateCaretPosition(); + } + + } + // set the input method editor location + /*if (ime == null) { + ime = new Ime(textArea.Handle, textArea.Document.TextEditorProperties.Font); + } else { + ime.HWnd = textArea.Handle; + ime.Font = textArea.Document.TextEditorProperties.Font; + } + ime.SetIMEWindowLocation(pos.X, pos.Y);*/ + + currentPos = pos; + } + } + + #region Native caret functions + /*[DllImport("User32.dll")] + static extern bool CreateCaret(IntPtr hWnd, int hBitmap, int nWidth, int nHeight); + + [DllImport("User32.dll")] + static extern bool SetCaretPos(int x, int y); + + [DllImport("User32.dll")] + static extern bool DestroyCaret(); + + [DllImport("User32.dll")] + static extern bool ShowCaret(IntPtr hWnd); + + [DllImport("User32.dll")] + static extern bool HideCaret(IntPtr hWnd);*/ + + [DllImport("User32.dll", EntryPoint="CreateCaret")] + static extern bool CreateCaretNative(IntPtr hWnd, int hBitmap, int nWidth, int nHeight); + + [DllImport("User32.dll", EntryPoint="SetCaretPos")] + static extern bool SetCaretPosNative(int x, int y); + + [DllImport("User32.dll", EntryPoint="DestroyCaret")] + static extern bool DestroyCaretNative(); + + [DllImport("User32.dll", EntryPoint="ShowCaret")] + static extern bool ShowCaretNative(IntPtr hWnd); + + [DllImport("User32.dll", EntryPoint="HideCaret")] + static extern bool HideCaretNative(IntPtr hWnd); + + static int caret_X; + static int caret_Y; + static int caret_width; + static int caret_height; + static int cur_line; + static IntPtr hwnd; + static bool visible; + static System.Windows.Forms.Timer timer; + + static bool CreateCaret(IntPtr hWnd, int hBitmap, int nWidth, int nHeight) + { + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + caret_width = nWidth; + caret_height = nHeight; + hwnd = hWnd; + if (create_caret == null) + { + create_caret = get_xplat().GetMethod("CreateCaret", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); + } + create_caret.Invoke(null, new object[] { hWnd, nWidth, nHeight }); + return true; + } + else + return CreateCaretNative(hWnd, hBitmap, nWidth, nHeight); + } + + static bool DestroyCaret() + { + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + /*if (timer != null && timer.Enabled) + { + timer.Stop(); + visible = false; + }*/ + + if (destroy_caret == null) + { + destroy_caret = get_xplat().GetMethod("DestroyCaret", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); + } + destroy_caret.Invoke(null, new object[] { hwnd }); + + return true; + } + else + return DestroyCaretNative(); + } + + static MethodInfo set_caret_pos = null; + static MethodInfo create_caret = null; + static MethodInfo destroy_caret = null; + static MethodInfo caret_visible = null; + static Type xplat = null; + + static bool SetCaretPos(int x, int y) + { + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + + /*if (caret_X != x || caret_Y != y) + { + HideCaret(hwnd); + caret_X = x; + caret_Y = y; + + ShowCaret(hwnd); + } + else + ShowCaret(hwnd); + return true;*/ + + if (set_caret_pos == null) + { + set_caret_pos = get_xplat().GetMethod("SetCaretPos", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); + } + set_caret_pos.Invoke(null, new object[] { hwnd, x, y}); + return true; + } + else + return SetCaretPosNative(x, y); + } + + static bool ShowCaret(IntPtr hWnd) + { + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + + /*if (timer != null && timer.Enabled) + { + timer.Stop(); + } + + if (timer == null) + { + timer = new System.Windows.Forms.Timer(); + timer.Interval = 500; + visible = false; + _ShowCaret(hwnd); + visible = true; + timer.Tick += delegate { if (!visible) _ShowCaret(hwnd); else _HideCaret(hwnd); }; + } + visible = false; + timer.Start();*/ + if (caret_visible == null) + { + caret_visible = get_xplat().GetMethod("CaretVisible", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); + } + caret_visible.Invoke(null, new object[] { hWnd, true }); + return true; + + } + else + return ShowCaretNative(hWnd); + } + + static Type get_xplat() + { + if (xplat != null) + return xplat; + Type[] types = typeof(Form).Assembly.GetTypes(); + foreach (Type t in types) + { + if (t.FullName == "System.Windows.Forms.XplatUI") + { + xplat = t; + return t; + } + } + return null; + } + + static bool HideCaret(IntPtr hWnd) + { + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + /*if (timer != null && timer.Enabled) + { + timer.Stop(); + } + visible = false; + //if (staticTextArea != null) + // staticTextArea.UpdateLine(staticTextArea.TextView.GetLogicalLine(caret_Y)); + Graphics gr = Graphics.FromHwnd(hWnd); + //gr.DrawRectangle(new Pen(Color.Black,caret_width),0,0,10,10); + gr.DrawLine(new Pen(Color.White, caret_width), caret_X, caret_Y, caret_X, caret_Y + caret_height); + gr.Dispose();*/ + if (caret_visible == null) + { + + caret_visible = get_xplat().GetMethod("CaretVisible", BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); + } + caret_visible.Invoke(null, new object[] { hWnd, false }); + return true; + } + else + return HideCaretNative(hWnd); + } + + static void _ShowCaret(IntPtr hWnd) + { + visible = true; + Graphics gr = Graphics.FromHwnd(hWnd); + //gr.DrawRectangle(new Pen(Color.Black,caret_width),0,0,10,10); + gr.DrawLine(new Pen(Color.Black,caret_width),caret_X,caret_Y,caret_X,caret_Y+caret_height); + gr.Dispose(); + + } + + static void _HideCaret(IntPtr hWnd) + { + /*if (timer != null && timer.Enabled) + { + timer.Stop(); + }*/ + visible = false; + Graphics gr = Graphics.FromHwnd(hWnd); + //gr.DrawRectangle(new Pen(Color.Black,caret_width),0,0,10,10); + gr.DrawLine(new Pen(Color.White, caret_width), caret_X, caret_Y, caret_X, caret_Y + caret_height); + gr.Dispose(); + //staticTextArea.UpdateLine(staticTextArea.TextView.GetLogicalLine(caret_Y)); + + } + + + #endregion + + bool firePositionChangedAfterUpdateEnd; + + void FirePositionChangedAfterUpdateEnd(object sender, EventArgs e) + { + OnPositionChanged(EventArgs.Empty); + } + + protected virtual void OnPositionChanged(EventArgs e) + { + if (this.textArea.MotherTextEditorControl.IsInUpdate) { + if (firePositionChangedAfterUpdateEnd == false) { + firePositionChangedAfterUpdateEnd = true; + this.textArea.Document.UpdateCommited += FirePositionChangedAfterUpdateEnd; + } + return; + } else if (firePositionChangedAfterUpdateEnd) { + this.textArea.Document.UpdateCommited -= FirePositionChangedAfterUpdateEnd; + firePositionChangedAfterUpdateEnd = false; + } + + List foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(line, column); + bool shouldUpdate = false; + foreach (FoldMarker foldMarker in foldings) { + shouldUpdate |= foldMarker.IsFolded; + foldMarker.IsFolded = false; + } + + if (shouldUpdate) { + textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty); + } + + if (PositionChanged != null) { + PositionChanged(this, e); + } + textArea.ScrollToCaret(); + } + + protected virtual void OnCaretModeChanged(EventArgs e) + { + if (CaretModeChanged != null) { + CaretModeChanged(this, e); + } + HideCaret(textArea.Handle); + DestroyCaret(); + caretCreated = false; + CreateCaret(); + ShowCaret(textArea.Handle); + } + + /// + /// Is called each time the caret is moved. + /// + public event EventHandler PositionChanged; + + /// + /// Is called each time the CaretMode has changed. + /// + public event EventHandler CaretModeChanged; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs new file mode 100644 index 000000000..20241ca50 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs @@ -0,0 +1,228 @@ +// +// +// +// +// $Revision: 2681 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + /// + /// Description of AbstractCompletionWindow. + /// + public abstract class AbstractCompletionWindow : System.Windows.Forms.Form + { + protected TextEditorControl control; + protected Size drawingSize; + Rectangle workingScreen; + Form parentForm; + + protected AbstractCompletionWindow(Form parentForm, TextEditorControl control) + { + workingScreen = Screen.GetWorkingArea(parentForm); +// SetStyle(ControlStyles.Selectable, false); + this.parentForm = parentForm; + this.control = control; + + SetLocation(); + StartPosition = FormStartPosition.Manual; + FormBorderStyle = FormBorderStyle.None; + ShowInTaskbar = false; + MinimumSize = new Size(1, 1); + Size = new Size(1, 1); + } + + protected virtual void SetLocation() + { + TextArea textArea = control.ActiveTextAreaControl.TextArea; + TextLocation caretPos = textArea.Caret.Position; + + int xpos = textArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X); + int rulerHeight = textArea.TextEditorProperties.ShowHorizontalRuler ? textArea.TextView.FontHeight : 0; + Point pos = new Point(textArea.TextView.DrawingPosition.X + xpos, + textArea.TextView.DrawingPosition.Y + (textArea.Document.GetVisibleLine(caretPos.Y)) * textArea.TextView.FontHeight + - textArea.TextView.TextArea.VirtualTop.Y + textArea.TextView.FontHeight + rulerHeight); + + Point location = control.ActiveTextAreaControl.PointToScreen(pos); + + // set bounds + Rectangle bounds = new Rectangle(location, drawingSize); + + if (!workingScreen.Contains(bounds)) { + if (bounds.Right > workingScreen.Right) { + bounds.X = workingScreen.Right - bounds.Width; + } + if (bounds.Left < workingScreen.Left) { + bounds.X = workingScreen.Left; + } + if (bounds.Top < workingScreen.Top) { + bounds.Y = workingScreen.Top; + } + if (bounds.Bottom > workingScreen.Bottom) { + bounds.Y = bounds.Y - bounds.Height - control.ActiveTextAreaControl.TextArea.TextView.FontHeight; + if (bounds.Bottom > workingScreen.Bottom) { + bounds.Y = workingScreen.Bottom - bounds.Height; + } + } + } + Bounds = bounds; + } + + protected override CreateParams CreateParams { + get { + CreateParams p = base.CreateParams; + AddShadowToWindow(p); + return p; + } + } + + static int shadowStatus; + + /// + /// Adds a shadow to the create params if it is supported by the operating system. + /// + public static void AddShadowToWindow(CreateParams createParams) + { + if (shadowStatus == 0) { + // Test OS version + shadowStatus = -1; // shadow not supported + if (Environment.OSVersion.Platform == PlatformID.Win32NT) { + Version ver = Environment.OSVersion.Version; + if (ver.Major > 5 || ver.Major == 5 && ver.Minor >= 1) { + shadowStatus = 1; + } + } + } + if (shadowStatus == 1 || Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + createParams.ClassStyle |= 0x00020000; // set CS_DROPSHADOW + } + } + + protected override bool ShowWithoutActivation { + get { + return true; + } + } + + protected void ShowCompletionWindow() + { + //MessageBox.Show("ShowCompletionWindow"); + Owner = parentForm; + Enabled = true; + this.Show(); + + if (parentForm != null) { + parentForm.LocationChanged += new EventHandler(this.ParentFormLocationChanged); + } + + control.ActiveTextAreaControl.VScrollBar.ValueChanged += new EventHandler(ParentFormLocationChanged); + control.ActiveTextAreaControl.HScrollBar.ValueChanged += new EventHandler(ParentFormLocationChanged); + control.ActiveTextAreaControl.TextArea.DoProcessDialogKey += new DialogKeyProcessor(ProcessTextAreaKey); + control.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(CaretOffsetChanged); + control.ActiveTextAreaControl.TextArea.LostFocus += new EventHandler(this.TextEditorLostFocus); + control.Resize += new EventHandler(ParentFormLocationChanged); + + foreach (Control c in Controls) { + c.MouseMove += ControlMouseMove; + } + control.Focus(); + } + + void ParentFormLocationChanged(object sender, EventArgs e) + { + SetLocation(); + } + + public virtual bool ProcessKeyEvent(char ch) + { + return false; + } + + protected virtual bool ProcessTextAreaKey(Keys keyData) + { + if (!Visible) { + return false; + } + switch (keyData) { + case Keys.Escape: + Close(); + return true; + } + return false; + } + + protected virtual void CaretOffsetChanged(object sender, EventArgs e) + { + } + + protected void TextEditorLostFocus(object sender, EventArgs e) + { + if (!control.ActiveTextAreaControl.TextArea.Focused + && !this.ContainsFocus && Environment.OSVersion.Platform != PlatformID.Unix + && Environment.OSVersion.Platform != PlatformID.MacOSX + ) + { + //MessageBox.Show("TextEditorLostFocus.Close()"); + // SSM 22/06/22 - убрал - и в Моно стала работать + //Close(); + } + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + //MessageBox.Show("control.Focus()"); + control.Focus(); // Да, именно так!!!!!!!!!!!!!! Не удалять!!! + //control.ActiveTextAreaControl.TextArea.Focus(); + } + + } + + protected override void OnClosed(EventArgs e) + { + base.OnClosed(e); + + // take out the inserted methods + parentForm.LocationChanged -= new EventHandler(ParentFormLocationChanged); + + foreach (Control c in Controls) { + c.MouseMove -= ControlMouseMove; + } + + if (control.ActiveTextAreaControl.VScrollBar != null) { + control.ActiveTextAreaControl.VScrollBar.ValueChanged -= new EventHandler(ParentFormLocationChanged); + } + if (control.ActiveTextAreaControl.HScrollBar != null) { + control.ActiveTextAreaControl.HScrollBar.ValueChanged -= new EventHandler(ParentFormLocationChanged); + } + + control.ActiveTextAreaControl.TextArea.LostFocus -= new EventHandler(this.TextEditorLostFocus); + control.ActiveTextAreaControl.Caret.PositionChanged -= new EventHandler(CaretOffsetChanged); + control.ActiveTextAreaControl.TextArea.DoProcessDialogKey -= new DialogKeyProcessor(ProcessTextAreaKey); + control.Resize -= new EventHandler(ParentFormLocationChanged); + Dispose(); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + ControlMouseMove(this, e); + } + + /// + /// Invoked when the mouse moves over this form or any child control. + /// Shows the mouse cursor on the text area if it has been hidden. + /// + /// + /// Derived classes should attach this handler to the MouseMove event + /// of all created controls which are not added to the Controls + /// collection. + /// + protected void ControlMouseMove(object sender, MouseEventArgs e) + { + control.ActiveTextAreaControl.TextArea.ShowHiddenCursor(false); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.cs b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.cs new file mode 100644 index 000000000..abfff7cb7 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.cs @@ -0,0 +1,293 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + /// + /// Description of CodeCompletionListView. + /// + public class CodeCompletionListView : System.Windows.Forms.UserControl + { + ICompletionData[] completionData; + int firstItem = 0; + int selectedItem = -1; + ImageList imageList; + + public ImageList ImageList { + get { + return imageList; + } + set { + imageList = value; + } + } + + public int FirstItem { + get { + return firstItem; + } + set { + if (firstItem != value) { + firstItem = value; + OnFirstItemChanged(EventArgs.Empty); + } + } + } + + public ICompletionData SelectedCompletionData { + get { + if (selectedItem < 0) { + return null; + } + return completionData[selectedItem]; + } + } + + public int ItemHeight { + get { + return Math.Max(imageList.ImageSize.Height, (int)(Font.Height * 1.25)); + } + } + + public int MaxVisibleItem { + get { + return Height / ItemHeight; + } + } + + public CodeCompletionListView(ICompletionData[] completionData) + { + Array.Sort(completionData); + this.completionData = completionData; + +// this.KeyDown += new System.Windows.Forms.KeyEventHandler(OnKey); +// SetStyle(ControlStyles.Selectable, false); +// SetStyle(ControlStyles.UserPaint, true); +// SetStyle(ControlStyles.DoubleBuffer, false); + } + + public void Close() + { + if (completionData != null) { + Array.Clear(completionData, 0, completionData.Length); + } + base.Dispose(); + } + + public void SelectIndex(int index) + { + int oldSelectedItem = selectedItem; + int oldFirstItem = firstItem; + + index = Math.Max(0, index); + selectedItem = Math.Max(0, Math.Min(completionData.Length - 1, index)); + if (selectedItem < firstItem) { + FirstItem = selectedItem; + } + if (firstItem + MaxVisibleItem <= selectedItem) { + FirstItem = selectedItem - MaxVisibleItem + 1; + } + if (oldSelectedItem != selectedItem) { + if (firstItem != oldFirstItem) { + Invalidate(); + } else { + int min = Math.Min(selectedItem, oldSelectedItem) - firstItem; + int max = Math.Max(selectedItem, oldSelectedItem) - firstItem; + Invalidate(new Rectangle(0, 1 + min * ItemHeight, Width, (max - min + 1) * ItemHeight)); + } + OnSelectedItemChanged(EventArgs.Empty); + } + } + + public void CenterViewOn(int index) + { + int oldFirstItem = this.FirstItem; + int firstItem = index - MaxVisibleItem / 2; + if (firstItem < 0) + this.FirstItem = 0; + else if (firstItem >= completionData.Length - MaxVisibleItem) + this.FirstItem = completionData.Length - MaxVisibleItem; + else + this.FirstItem = firstItem; + if (this.FirstItem != oldFirstItem) { + Invalidate(); + } + } + + public void ClearSelection() + { + if (selectedItem < 0) + return; + int itemNum = selectedItem - firstItem; + selectedItem = -1; + Invalidate(new Rectangle(0, itemNum * ItemHeight, Width, (itemNum + 1) * ItemHeight + 1)); + Update(); + OnSelectedItemChanged(EventArgs.Empty); + } + + public void PageDown() + { + SelectIndex(selectedItem + MaxVisibleItem); + } + + public void PageUp() + { + SelectIndex(selectedItem - MaxVisibleItem); + } + + public void SelectNextItem() + { + SelectIndex(selectedItem + 1); + } + + public void SelectPrevItem() + { + SelectIndex(selectedItem - 1); + } + + public void SelectItemWithStart(string startText) + { + if (startText == null || startText.Length == 0) return; + string originalStartText = startText; + startText = startText.ToLower(); + int bestIndex = -1; + int bestQuality = -1; + // Qualities: 0 = match start + // 1 = match start case sensitive + // 2 = full match + // 3 = full match case sensitive + double bestPriority = 0; + for (int i = 0; i < completionData.Length; ++i) { + string itemText = completionData[i].Text; + string lowerText = itemText.ToLower(); + if (lowerText.StartsWith(startText)) { + double priority = completionData[i].Priority; + int quality; + if (lowerText == startText) { + if (itemText == originalStartText) + quality = 3; + else + quality = 2; + } else if (itemText.StartsWith(originalStartText)) { + quality = 1; + } else { + quality = 0; + } + bool useThisItem; + if (bestQuality < quality) { + useThisItem = true; + } else { + if (bestIndex == selectedItem) { + useThisItem = false; + } else if (i == selectedItem) { + useThisItem = bestQuality == quality; + } else { + useThisItem = bestQuality == quality && bestPriority < priority; + } + } + if (useThisItem) { + bestIndex = i; + bestPriority = priority; + bestQuality = quality; + } + } + } + if (bestIndex < 0) { + ClearSelection(); + } else { + if (bestIndex < firstItem || firstItem + MaxVisibleItem <= bestIndex) { + SelectIndex(bestIndex); + CenterViewOn(bestIndex); + } else { + SelectIndex(bestIndex); + } + } + } + + protected override void OnPaint(PaintEventArgs pe) + { + float yPos = 1; + float itemHeight = ItemHeight; + // Maintain aspect ratio + int imageWidth = (int)(itemHeight * imageList.ImageSize.Width / imageList.ImageSize.Height); + + int curItem = firstItem; + Graphics g = pe.Graphics; + while (curItem < completionData.Length && yPos < Height) { + RectangleF drawingBackground = new RectangleF(1, yPos, Width - 2, itemHeight); + if (drawingBackground.IntersectsWith(pe.ClipRectangle)) { + // draw Background + if (curItem == selectedItem) { + g.FillRectangle(SystemBrushes.Highlight, drawingBackground); + } else { + g.FillRectangle(SystemBrushes.Window, drawingBackground); + } + + // draw Icon + int xPos = 0; + if (imageList != null && completionData[curItem].ImageIndex < imageList.Images.Count) { + g.DrawImage(imageList.Images[completionData[curItem].ImageIndex], new RectangleF(1, yPos, imageWidth, itemHeight)); + xPos = imageWidth; + } + + // draw text + if (curItem == selectedItem) { + g.DrawString(completionData[curItem].Text, Font, SystemBrushes.HighlightText, xPos, yPos); + } else { + g.DrawString(completionData[curItem].Text, Font, SystemBrushes.WindowText, xPos, yPos); + } + } + + yPos += itemHeight; + ++curItem; + } + g.DrawRectangle(SystemPens.Control, new Rectangle(0, 0, Width - 1, Height - 1)); + } + + protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) + { + float yPos = 1; + int curItem = firstItem; + float itemHeight = ItemHeight; + + while (curItem < completionData.Length && yPos < Height) { + RectangleF drawingBackground = new RectangleF(1, yPos, Width - 2, itemHeight); + if (drawingBackground.Contains(e.X, e.Y)) { + SelectIndex(curItem); + break; + } + yPos += itemHeight; + ++curItem; + } + } + + protected override void OnPaintBackground(PaintEventArgs pe) + { + } + + protected virtual void OnSelectedItemChanged(EventArgs e) + { + if (SelectedItemChanged != null) { + SelectedItemChanged(this, e); + } + } + + protected virtual void OnFirstItemChanged(EventArgs e) + { + if (FirstItemChanged != null) { + FirstItemChanged(this, e); + } + } + + public event EventHandler SelectedItemChanged; + public event EventHandler FirstItemChanged; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.resx b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionListView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionWindow.cs b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionWindow.cs new file mode 100644 index 000000000..0739a24f2 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/CodeCompletionWindow.cs @@ -0,0 +1,295 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public class CodeCompletionWindow : AbstractCompletionWindow + { + ICompletionData[] completionData; + CodeCompletionListView codeCompletionListView; + VScrollBar vScrollBar = new VScrollBar(); + ICompletionDataProvider dataProvider; + IDocument document; + + int startOffset; + int endOffset; + DeclarationViewWindow declarationViewWindow = null; + Rectangle workingScreen; + + public static CodeCompletionWindow ShowCompletionWindow(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar) + { + ICompletionData[] completionData = completionDataProvider.GenerateCompletionData(fileName, control.ActiveTextAreaControl.TextArea, firstChar); + if (completionData == null || completionData.Length == 0) { + return null; + } + CodeCompletionWindow codeCompletionWindow = new CodeCompletionWindow(completionDataProvider, completionData, parent, control); + codeCompletionWindow.ShowCompletionWindow(); + return codeCompletionWindow; + } + + CodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, Form parentForm, TextEditorControl control) : base(parentForm, control) + { + this.dataProvider = completionDataProvider; + this.completionData = completionData; + this.document = control.Document; + + workingScreen = Screen.GetWorkingArea(Location); + startOffset = control.ActiveTextAreaControl.Caret.Offset + 1; + endOffset = startOffset; + if (completionDataProvider.PreSelection != null) { + startOffset -= completionDataProvider.PreSelection.Length + 1; + endOffset--; + } + + codeCompletionListView = new CodeCompletionListView(completionData); + codeCompletionListView.ImageList = completionDataProvider.ImageList; + codeCompletionListView.Dock = DockStyle.Fill; + codeCompletionListView.SelectedItemChanged += new EventHandler(CodeCompletionListViewSelectedItemChanged); + codeCompletionListView.DoubleClick += new EventHandler(CodeCompletionListViewDoubleClick); + codeCompletionListView.Click += new EventHandler(CodeCompletionListViewClick); + Controls.Add(codeCompletionListView); + + const int MaxListLength = 10; + if (completionData.Length > MaxListLength) { + vScrollBar.Dock = DockStyle.Right; + vScrollBar.Minimum = 0; + vScrollBar.Maximum = completionData.Length - 1; + vScrollBar.SmallChange = 1; + vScrollBar.LargeChange = MaxListLength; + codeCompletionListView.FirstItemChanged += new EventHandler(CodeCompletionListViewFirstItemChanged); + Controls.Add(vScrollBar); + } + + this.drawingSize = new Size(codeCompletionListView.ItemHeight * 10, + codeCompletionListView.ItemHeight * Math.Min(MaxListLength, completionData.Length)); + SetLocation(); + + if (declarationViewWindow == null) { + declarationViewWindow = new DeclarationViewWindow(parentForm); + } + SetDeclarationViewLocation(); + declarationViewWindow.ShowDeclarationViewWindow(); + declarationViewWindow.MouseMove += ControlMouseMove; + control.Focus(); + CodeCompletionListViewSelectedItemChanged(this, EventArgs.Empty); + + if (completionDataProvider.DefaultIndex >= 0) { + codeCompletionListView.SelectIndex(completionDataProvider.DefaultIndex); + } + + if (completionDataProvider.PreSelection != null) { + CaretOffsetChanged(this, EventArgs.Empty); + } + + vScrollBar.ValueChanged += VScrollBarValueChanged; + document.DocumentAboutToBeChanged += DocumentAboutToBeChanged; + } + + bool inScrollUpdate; + + void CodeCompletionListViewFirstItemChanged(object sender, EventArgs e) + { + if (inScrollUpdate) return; + inScrollUpdate = true; + vScrollBar.Value = Math.Min(vScrollBar.Maximum, codeCompletionListView.FirstItem); + inScrollUpdate = false; + } + + void VScrollBarValueChanged(object sender, EventArgs e) + { + if (inScrollUpdate) return; + inScrollUpdate = true; + codeCompletionListView.FirstItem = vScrollBar.Value; + codeCompletionListView.Refresh(); + control.ActiveTextAreaControl.TextArea.Focus(); + inScrollUpdate = false; + } + + void SetDeclarationViewLocation() + { + // This method uses the side with more free space + int leftSpace = Bounds.Left - workingScreen.Left; + int rightSpace = workingScreen.Right - Bounds.Right; + Point pos; + // The declaration view window has better line break when used on + // the right side, so prefer the right side to the left. + if (rightSpace * 2 > leftSpace) + pos = new Point(Bounds.Right, Bounds.Top); + else + pos = new Point(Bounds.Left - declarationViewWindow.Width, Bounds.Top); + if (declarationViewWindow.Location != pos) { + declarationViewWindow.Location = pos; + } + } + + protected override void SetLocation() + { + base.SetLocation(); + if (declarationViewWindow != null) { + SetDeclarationViewLocation(); + } + } + + public void HandleMouseWheel(MouseEventArgs e) + { + int MAX_DELTA = 120; // basically it's constant now, but could be changed later by MS + int multiplier = e.Delta / MAX_DELTA; + multiplier *= System.Windows.Forms.SystemInformation.MouseWheelScrollLines * vScrollBar.SmallChange; + + int newValue; + if (System.Windows.Forms.SystemInformation.MouseWheelScrollLines > 0) { + newValue = this.vScrollBar.Value - (control.TextEditorProperties.MouseWheelScrollDown ? 1 : -1) * multiplier; + } else { + newValue = this.vScrollBar.Value - (control.TextEditorProperties.MouseWheelScrollDown ? 1 : -1) * multiplier; + } + vScrollBar.Value = Math.Max(vScrollBar.Minimum, Math.Min(vScrollBar.Maximum - vScrollBar.LargeChange + 1, newValue)); + } + + void CodeCompletionListViewSelectedItemChanged(object sender, EventArgs e) + { + ICompletionData data = codeCompletionListView.SelectedCompletionData; + if (data != null && data.Description != null && data.Description.Length > 0) { + declarationViewWindow.Description = data.Description; + SetDeclarationViewLocation(); + } else { + declarationViewWindow.Description = null; + } + } + + public override bool ProcessKeyEvent(char ch) + { + switch (dataProvider.ProcessKey(ch)) { + case CompletionDataProviderKeyResult.BeforeStartKey: + // increment start+end, then process as normal char + ++startOffset; + ++endOffset; + return base.ProcessKeyEvent(ch); + case CompletionDataProviderKeyResult.NormalKey: + // just process normally + return base.ProcessKeyEvent(ch); + case CompletionDataProviderKeyResult.InsertionKey: + return InsertSelectedItem(ch); + default: + throw new InvalidOperationException("Invalid return value of dataProvider.ProcessKey"); + } + } + + void DocumentAboutToBeChanged(object sender, DocumentEventArgs e) + { + // => startOffset test required so that this startOffset/endOffset are not incremented again + // for BeforeStartKey characters + if (e.Offset >= startOffset && e.Offset <= endOffset) { + if (e.Length > 0) { // length of removed region + endOffset -= e.Length; + } + if (!string.IsNullOrEmpty(e.Text)) { + endOffset += e.Text.Length; + } + } + } + + protected override void CaretOffsetChanged(object sender, EventArgs e) + { + int offset = control.ActiveTextAreaControl.Caret.Offset; + if (offset == startOffset) { + return; + } + if (offset < startOffset || offset > endOffset) { + Close(); + } else { + codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset, offset - startOffset)); + } + } + + protected override bool ProcessTextAreaKey(Keys keyData) + { + if (!Visible) { + return false; + } + + switch (keyData) { + case Keys.Home: + codeCompletionListView.SelectIndex(0); + return true; + case Keys.End: + codeCompletionListView.SelectIndex(completionData.Length-1); + return true; + case Keys.PageDown: + codeCompletionListView.PageDown(); + return true; + case Keys.PageUp: + codeCompletionListView.PageUp(); + return true; + case Keys.Down: + codeCompletionListView.SelectNextItem(); + return true; + case Keys.Up: + codeCompletionListView.SelectPrevItem(); + return true; + case Keys.Tab: + case Keys.Return: + InsertSelectedItem('\0'); + return true; + } + return base.ProcessTextAreaKey(keyData); + } + + void CodeCompletionListViewDoubleClick(object sender, EventArgs e) + { + InsertSelectedItem('\0'); + } + + void CodeCompletionListViewClick(object sender, EventArgs e) + { + control.ActiveTextAreaControl.TextArea.Focus(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) { + document.DocumentAboutToBeChanged -= DocumentAboutToBeChanged; + if (codeCompletionListView != null) { + codeCompletionListView.Dispose(); + codeCompletionListView = null; + } + if (declarationViewWindow != null) { + declarationViewWindow.Dispose(); + declarationViewWindow = null; + } + } + base.Dispose(disposing); + } + + bool InsertSelectedItem(char ch) + { + document.DocumentAboutToBeChanged -= DocumentAboutToBeChanged; + ICompletionData data = codeCompletionListView.SelectedCompletionData; + bool result = false; + if (data != null) { + control.BeginUpdate(); + + try { + if (endOffset - startOffset > 0) { + control.Document.Remove(startOffset, endOffset - startOffset); + } + Debug.Assert(startOffset <= document.TextLength); + result = dataProvider.InsertAction(data, control.ActiveTextAreaControl.TextArea, startOffset, ch); + } finally { + control.EndUpdate(); + } + } + Close(); + return result; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/DeclarationViewWindow.cs b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/DeclarationViewWindow.cs new file mode 100644 index 000000000..c9fe014b4 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/DeclarationViewWindow.cs @@ -0,0 +1,101 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public interface IDeclarationViewWindow + { + string Description { + get; + set; + } + void ShowDeclarationViewWindow(); + void CloseDeclarationViewWindow(); + } + + public class DeclarationViewWindow : Form, IDeclarationViewWindow + { + string description = String.Empty; + + public string Description { + get { + return description; + } + set { + description = value; + if (value == null && Visible) { + Visible = false; + } else if (value != null) { + if (!Visible) ShowDeclarationViewWindow(); + Refresh(); + } + } + } + + public bool HideOnClick; + + public DeclarationViewWindow(Form parent) + { + SetStyle(ControlStyles.Selectable, false); + StartPosition = FormStartPosition.Manual; + FormBorderStyle = FormBorderStyle.None; + Owner = parent; + ShowInTaskbar = false; + Size = new Size(0, 0); + base.CreateHandle(); + } + + protected override CreateParams CreateParams { + get { + CreateParams p = base.CreateParams; + AbstractCompletionWindow.AddShadowToWindow(p); + return p; + } + } + + protected override bool ShowWithoutActivation { + get { + return true; + } + } + + protected override void OnClick(EventArgs e) + { + base.OnClick(e); + if (HideOnClick) Hide(); + } + + public void ShowDeclarationViewWindow() + { + Show(); + } + + public void CloseDeclarationViewWindow() + { + Close(); + Dispose(); + } + + protected override void OnPaint(PaintEventArgs pe) + { + if (description != null && description.Length > 0) { + TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, description); + } + } + + protected override void OnPaintBackground(PaintEventArgs pe) + { + pe.Graphics.FillRectangle(SystemBrushes.Info, pe.ClipRectangle); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionData.cs b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionData.cs new file mode 100644 index 000000000..c5960f626 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionData.cs @@ -0,0 +1,112 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public interface ICompletionData : IComparable + { + int ImageIndex { + get; + } + + string Text { + get; + set; + } + + string Description { + get; + set; + } + + /// + /// Gets a priority value for the completion data item. + /// When selecting items by their start characters, the item with the highest + /// priority is selected first. + /// + double Priority { + get; + } + + /// + /// Insert the element represented by the completion data into the text + /// editor. + /// + /// TextArea to insert the completion data in. + /// Character that should be inserted after the completion data. + /// \0 when no character should be inserted. + /// Returns true when the insert action has processed the character + /// ; false when the character was not processed. + bool InsertAction(TextArea textArea, char ch); + } + + public class DefaultCompletionData : ICompletionData + { + string text; + string description; + int imageIndex; + + public int ImageIndex { + get { + return imageIndex; + } + } + + public string Text { + get { + return text; + } + set { + text = value; + } + } + + public string Description { + get { + return description; + } + set + { + description = value; + } + } + + double priority; + + public double Priority { + get { + return priority; + } + set { + priority = value; + } + } + + public virtual bool InsertAction(TextArea textArea, char ch) + { + textArea.InsertString(text); + return false; + } + + public DefaultCompletionData(string text, string description, int imageIndex) + { + this.text = text; + this.description = description; + this.imageIndex = imageIndex; + } + + public int CompareTo(object obj) + { + if (obj == null || !(obj is DefaultCompletionData)) { + return -1; + } + return text.CompareTo(((DefaultCompletionData)obj).Text); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionDataProvider.cs b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionDataProvider.cs new file mode 100644 index 000000000..7360d0a44 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/CompletionWindow/ICompletionDataProvider.cs @@ -0,0 +1,62 @@ +// +// +// +// +// $Revision: 2074 $ +// + +using System; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public interface ICompletionDataProvider + { + ImageList ImageList { + get; + } + string PreSelection { + get; + } + /// + /// Gets the index of the element in the list that is chosen by default. + /// + int DefaultIndex { + get; + } + + /// + /// Processes a keypress. Returns the action to be run with the key. + /// + CompletionDataProviderKeyResult ProcessKey(char key); + + /// + /// Executes the insertion. The provider should set the caret position and then + /// call data.InsertAction. + /// + bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key); + + /// + /// Generates the completion data. This method is called by the text editor control. + /// + ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped); + } + + public enum CompletionDataProviderKeyResult + { + /// + /// Normal key, used to choose an entry from the completion list + /// + NormalKey, + /// + /// This key triggers insertion of the completed expression + /// + InsertionKey, + /// + /// Increment both start and end offset of completion region when inserting this + /// key. Can be used to insert whitespace (or other characters) in front of the expression + /// while the completion window is open. + /// + BeforeStartKey + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/DrawableLine.cs b/ICSharpCode.TextEditorLinux/Src/Gui/DrawableLine.cs new file mode 100644 index 000000000..243303f4b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/DrawableLine.cs @@ -0,0 +1,190 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// A class that is able to draw a line on any control (outside the text editor) + /// + public class DrawableLine + { + static StringFormat sf = (StringFormat)System.Drawing.StringFormat.GenericTypographic.Clone(); + + List words = new List(); + SizeF spaceSize; + Font monospacedFont; + Font boldMonospacedFont; + + private class SimpleTextWord { + internal TextWordType Type; + internal string Word; + internal bool Bold; + internal Color Color; + + public SimpleTextWord(TextWordType Type, string Word, bool Bold, Color Color) + { + this.Type = Type; + this.Word = Word; + this.Bold = Bold; + this.Color = Color; + } + + internal readonly static SimpleTextWord Space = new SimpleTextWord(TextWordType.Space, " ", false, Color.Black); + internal readonly static SimpleTextWord Tab = new SimpleTextWord(TextWordType.Tab, "\t", false, Color.Black); + } + + public DrawableLine(IDocument document, LineSegment line, Font monospacedFont, Font boldMonospacedFont) + { + this.monospacedFont = monospacedFont; + this.boldMonospacedFont = boldMonospacedFont; + if (line.Words != null) { + foreach (TextWord word in line.Words) { + if (word.Type == TextWordType.Space) { + words.Add(SimpleTextWord.Space); + } else if (word.Type == TextWordType.Tab) { + words.Add(SimpleTextWord.Tab); + } else { + words.Add(new SimpleTextWord(TextWordType.Word, word.Word, word.Bold, word.Color)); + } + } + } else { + words.Add(new SimpleTextWord(TextWordType.Word, document.GetText(line), false, Color.Black)); + } + } + + public int LineLength { + get { + int length = 0; + foreach (SimpleTextWord word in words) { + length += word.Word.Length; + } + return length; + } + } + + public void SetBold(int startIndex, int endIndex, bool bold) + { + if (startIndex < 0) + throw new ArgumentException("startIndex must be >= 0"); + if (startIndex > endIndex) + throw new ArgumentException("startIndex must be <= endIndex"); + if (startIndex == endIndex) return; + int pos = 0; + for (int i = 0; i < words.Count; i++) { + SimpleTextWord word = words[i]; + if (pos >= endIndex) + break; + int wordEnd = pos + word.Word.Length; + // 3 possibilities: + if (startIndex <= pos && endIndex >= wordEnd) { + // word is fully in region: + word.Bold = bold; + } else if (startIndex <= pos) { + // beginning of word is in region + int inRegionLength = endIndex - pos; + SimpleTextWord newWord = new SimpleTextWord(word.Type, word.Word.Substring(inRegionLength), word.Bold, word.Color); + words.Insert(i + 1, newWord); + + word.Bold = bold; + word.Word = word.Word.Substring(0, inRegionLength); + } else if (startIndex < wordEnd) { + // end of word is in region (or middle of word is in region) + int notInRegionLength = startIndex - pos; + + SimpleTextWord newWord = new SimpleTextWord(word.Type, word.Word.Substring(notInRegionLength), word.Bold, word.Color); + // newWord.Bold will be set in the next iteration + words.Insert(i + 1, newWord); + + word.Word = word.Word.Substring(0, notInRegionLength); + } + pos = wordEnd; + } + } + + public static float DrawDocumentWord(Graphics g, string word, PointF position, Font font, Color foreColor) + { + if (word == null || word.Length == 0) { + return 0f; + } + SizeF wordSize = g.MeasureString(word, font, 32768, sf); + + g.DrawString(word, + font, + BrushRegistry.GetBrush(foreColor), + position, + sf); + return wordSize.Width; + } + + public SizeF GetSpaceSize(Graphics g) + { + if (spaceSize.IsEmpty) { + spaceSize = g.MeasureString("-", boldMonospacedFont, new PointF(0, 0), sf); + } + return spaceSize; + } + + public void DrawLine(Graphics g, ref float xPos, float xOffset, float yPos, Color c) + { + SizeF spaceSize = GetSpaceSize(g); + foreach (SimpleTextWord word in words) { + switch (word.Type) { + case TextWordType.Space: + xPos += spaceSize.Width; + break; + case TextWordType.Tab: + float tabWidth = spaceSize.Width * 4; + xPos += tabWidth; + xPos = (int)((xPos + 2) / tabWidth) * tabWidth; + break; + case TextWordType.Word: + xPos += DrawDocumentWord(g, + word.Word, + new PointF(xPos + xOffset, yPos), + word.Bold ? boldMonospacedFont : monospacedFont, + c == Color.Empty ? word.Color : c + ); + break; + } + } + } + + public void DrawLine(Graphics g, ref float xPos, float xOffset, float yPos) + { + DrawLine(g, ref xPos, xOffset, yPos, Color.Empty); + } + + public float MeasureWidth(Graphics g, float xPos) + { + SizeF spaceSize = GetSpaceSize(g); + foreach (SimpleTextWord word in words) { + switch (word.Type) { + case TextWordType.Space: + xPos += spaceSize.Width; + break; + case TextWordType.Tab: + float tabWidth = spaceSize.Width * 4; + xPos += tabWidth; + xPos = (int)((xPos + 2) / tabWidth) * tabWidth; + break; + case TextWordType.Word: + if (word.Word != null && word.Word.Length > 0) { + xPos += g.MeasureString(word.Word, word.Bold ? boldMonospacedFont : monospacedFont, 32768, sf).Width; + } + break; + } + } + return xPos; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/FoldMargin.cs b/ICSharpCode.TextEditorLinux/Src/Gui/FoldMargin.cs new file mode 100644 index 000000000..68e959e0e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/FoldMargin.cs @@ -0,0 +1,275 @@ +// +// +// +// +// $Revision: 2063 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class views the line numbers and folding markers. + /// + public class FoldMargin : AbstractMargin + { + int selectedFoldLine = -1; + + public override Size Size { + get { + return new Size((int)(textArea.TextView.FontHeight), + -1); + } + } + + public override bool IsVisible { + get { + return textArea.TextEditorProperties.EnableFolding; + } + } + + public FoldMargin(TextArea textArea) : base(textArea) + { + } + + public override void Paint(Graphics g, Rectangle rect) + { + if (rect.Width <= 0 || rect.Height <= 0) { + return; + } + HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers"); + HighlightColor foldLineColor = textArea.Document.HighlightingStrategy.GetColorFor("FoldLine"); + + + for (int y = 0; y < (DrawingPosition.Height + textArea.TextView.VisibleLineDrawingRemainder) / textArea.TextView.FontHeight + 1; ++y) { + Rectangle markerRectangle = new Rectangle(DrawingPosition.X, + DrawingPosition.Top + y * textArea.TextView.FontHeight - textArea.TextView.VisibleLineDrawingRemainder, + DrawingPosition.Width, + textArea.TextView.FontHeight); + + if (rect.IntersectsWith(markerRectangle)) { + // draw dotted separator line + if (textArea.Document.TextEditorProperties.ShowLineNumbers) { + g.FillRectangle(BrushRegistry.GetBrush(textArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), + new Rectangle(markerRectangle.X + 1, markerRectangle.Y, markerRectangle.Width - 1, markerRectangle.Height)); + + g.DrawLine(BrushRegistry.GetDotPen(lineNumberPainterColor.Color, lineNumberPainterColor.BackgroundColor), + base.drawingPosition.X, + markerRectangle.Y, + base.drawingPosition.X, + markerRectangle.Bottom); + } else { + g.FillRectangle(BrushRegistry.GetBrush(textArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), markerRectangle); + } + + int currentLine = textArea.Document.GetFirstLogicalLine(textArea.TextView.FirstPhysicalLine + y); + if (currentLine < textArea.Document.TotalNumberOfLines) { + PaintFoldMarker(g, currentLine, markerRectangle); + } + } + } + } + + bool SelectedFoldingFrom(List list) + { + if (list != null) { + for (int i = 0; i < list.Count; ++i) { + if (this.selectedFoldLine == list[i].StartLine) { + return true; + } + } + } + return false; + } + + void PaintFoldMarker(Graphics g, int lineNumber, Rectangle drawingRectangle) + { + HighlightColor foldLineColor = textArea.Document.HighlightingStrategy.GetColorFor("FoldLine"); + HighlightColor selectedFoldLine = textArea.Document.HighlightingStrategy.GetColorFor("SelectedFoldLine"); + + List foldingsWithStart = textArea.Document.FoldingManager.GetFoldingsWithStart(lineNumber); + List foldingsBetween = textArea.Document.FoldingManager.GetFoldingsContainsLineNumber(lineNumber); + List foldingsWithEnd = textArea.Document.FoldingManager.GetFoldingsWithEnd(lineNumber); + + bool isFoldStart = foldingsWithStart.Count > 0; + bool isBetween = foldingsBetween.Count > 0; + bool isFoldEnd = foldingsWithEnd.Count > 0; + + bool isStartSelected = SelectedFoldingFrom(foldingsWithStart); + bool isBetweenSelected = SelectedFoldingFrom(foldingsBetween); + bool isEndSelected = SelectedFoldingFrom(foldingsWithEnd); + + int foldMarkerSize = (int)Math.Round(textArea.TextView.FontHeight * 0.5f); + foldMarkerSize -= (foldMarkerSize) % 2; + int foldMarkerYPos = drawingRectangle.Y + (int)((drawingRectangle.Height - foldMarkerSize) / 2); + int xPos = drawingRectangle.X + (drawingRectangle.Width - foldMarkerSize) / 2 + foldMarkerSize / 2; + + + if (isFoldStart) { + bool isVisible = true; + bool moreLinedOpenFold = false; + foreach (FoldMarker foldMarker in foldingsWithStart) { + if (foldMarker.IsFolded) { + isVisible = false; + } else { + moreLinedOpenFold = foldMarker.EndLine > foldMarker.StartLine; + } + } + + bool isFoldEndFromUpperFold = false; + foreach (FoldMarker foldMarker in foldingsWithEnd) { + if (foldMarker.EndLine > foldMarker.StartLine && !foldMarker.IsFolded) { + isFoldEndFromUpperFold = true; + } + } + + DrawFoldMarker(g, new RectangleF(drawingRectangle.X + (drawingRectangle.Width - foldMarkerSize) / 2, + foldMarkerYPos, + foldMarkerSize, + foldMarkerSize), + isVisible, + isStartSelected + ); + + // draw line above fold marker + if (isBetween || isFoldEndFromUpperFold) { + g.DrawLine(BrushRegistry.GetPen(isBetweenSelected ? selectedFoldLine.Color : foldLineColor.Color), + xPos, + drawingRectangle.Top, + xPos, + foldMarkerYPos - 1); + } + + // draw line below fold marker + if (isBetween || moreLinedOpenFold) { + g.DrawLine(BrushRegistry.GetPen(isEndSelected || (isStartSelected && isVisible) || isBetweenSelected ? selectedFoldLine.Color : foldLineColor.Color), + xPos, + foldMarkerYPos + foldMarkerSize + 1, + xPos, + drawingRectangle.Bottom); + } + } else { + if (isFoldEnd) { + int midy = drawingRectangle.Top + drawingRectangle.Height / 2; + + // draw fold end marker + g.DrawLine(BrushRegistry.GetPen(isEndSelected ? selectedFoldLine.Color : foldLineColor.Color), + xPos, + midy, + xPos + foldMarkerSize / 2, + midy); + + // draw line above fold end marker + // must be drawn after fold marker because it might have a different color than the fold marker + g.DrawLine(BrushRegistry.GetPen(isBetweenSelected || isEndSelected ? selectedFoldLine.Color : foldLineColor.Color), + xPos, + drawingRectangle.Top, + xPos, + midy); + + // draw line below fold end marker + if (isBetween) { + g.DrawLine(BrushRegistry.GetPen(isBetweenSelected ? selectedFoldLine.Color : foldLineColor.Color), + xPos, + midy + 1, + xPos, + drawingRectangle.Bottom); + } + } else if (isBetween) { + // just draw the line :) + g.DrawLine(BrushRegistry.GetPen(isBetweenSelected ? selectedFoldLine.Color : foldLineColor.Color), + xPos, + drawingRectangle.Top, + xPos, + drawingRectangle.Bottom); + } + } + } + + public override void HandleMouseMove(Point mousepos, MouseButtons mouseButtons) + { + bool showFolding = textArea.Document.TextEditorProperties.EnableFolding; + int physicalLine = + (int)((mousepos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight); + int realline = textArea.Document.GetFirstLogicalLine(physicalLine); + + if (!showFolding || realline < 0 || realline + 1 >= textArea.Document.TotalNumberOfLines) { + return; + } + + List foldMarkers = textArea.Document.FoldingManager.GetFoldingsWithStart(realline); + int oldSelection = selectedFoldLine; + if (foldMarkers.Count > 0) { + selectedFoldLine = realline; + } else { + selectedFoldLine = -1; + } + if (oldSelection != selectedFoldLine) { + textArea.Refresh(this); + } + } + + public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons) + { + bool showFolding = textArea.Document.TextEditorProperties.EnableFolding; + int physicalLine = + (int)((mousepos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight); + int realline = textArea.Document.GetFirstLogicalLine(physicalLine); + + // focus the textarea if the user clicks on the line number view + textArea.Focus(); + + if (!showFolding || realline < 0 || realline + 1 >= textArea.Document.TotalNumberOfLines) { + return; + } + + List foldMarkers = textArea.Document.FoldingManager.GetFoldingsWithStart(realline); + foreach (FoldMarker fm in foldMarkers) { + fm.IsFolded = !fm.IsFolded; + } + textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty); + } + + public override void HandleMouseLeave(EventArgs e) + { + if (selectedFoldLine != -1) { + selectedFoldLine = -1; + textArea.Refresh(this); + } + } + + #region Drawing functions + void DrawFoldMarker(Graphics g, RectangleF rectangle, bool isOpened, bool isSelected) + { + HighlightColor foldMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("FoldMarker"); + HighlightColor foldLineColor = textArea.Document.HighlightingStrategy.GetColorFor("FoldLine"); + HighlightColor selectedFoldLine = textArea.Document.HighlightingStrategy.GetColorFor("SelectedFoldLine"); + + Rectangle intRect = new Rectangle((int)rectangle.X, (int)rectangle.Y, (int)rectangle.Width, (int)rectangle.Height); + g.FillRectangle(BrushRegistry.GetBrush(foldMarkerColor.BackgroundColor), intRect); + g.DrawRectangle(BrushRegistry.GetPen(isSelected ? selectedFoldLine.Color : foldMarkerColor.Color), intRect); + + int space = (int)Math.Round(((double)rectangle.Height) / 8d) + 1; + int mid = intRect.Height / 2 + intRect.Height % 2; + + g.DrawLine(BrushRegistry.GetPen(foldLineColor.BackgroundColor), + rectangle.X + space, + rectangle.Y + mid, + rectangle.X + rectangle.Width - space, + rectangle.Y + mid); + + if (!isOpened) { + g.DrawLine(BrushRegistry.GetPen(foldLineColor.BackgroundColor), + rectangle.X + mid, + rectangle.Y + space, + rectangle.X + mid, + rectangle.Y + rectangle.Height - space); + } + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/GutterMargin.cs b/ICSharpCode.TextEditorLinux/Src/Gui/GutterMargin.cs new file mode 100644 index 000000000..a3903066d --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/GutterMargin.cs @@ -0,0 +1,158 @@ +// +// +// +// +// $Revision: 2680 $ +// + +using System; +using System.Drawing; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class views the line numbers and folding markers. + /// + public class GutterMargin : AbstractMargin, IDisposable + { + StringFormat numberStringFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); + + public static Cursor RightLeftCursor; + + static GutterMargin() + { + Stream cursorStream = Assembly.GetCallingAssembly().GetManifestResourceStream("ICSharpCode.TextEditor.Resources.RightArrow.cur"); + RightLeftCursor = new Cursor(cursorStream); + cursorStream.Close(); + } + + public void Dispose() + { + numberStringFormat.Dispose(); + } + + public override Cursor Cursor { + get { + return RightLeftCursor; + } + } + + public override Size Size { + get { + return new Size((int)(textArea.TextView.WideSpaceWidth + * Math.Max(3, (int)Math.Log10(textArea.Document.TotalNumberOfLines) + 1)), + -1); + } + } + + public override bool IsVisible { + get { + return textArea.TextEditorProperties.ShowLineNumbers; + } + } + + public GutterMargin(TextArea textArea) : base(textArea) + { + numberStringFormat.LineAlignment = StringAlignment.Far; + numberStringFormat.FormatFlags = StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.FitBlackBox | + StringFormatFlags.NoWrap | StringFormatFlags.NoClip; + } + + public override void Paint(Graphics g, Rectangle rect) + { + if (rect.Width <= 0 || rect.Height <= 0) { + return; + } + HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers"); + int fontHeight = textArea.TextView.FontHeight; + Brush fillBrush = textArea.Enabled ? BrushRegistry.GetBrush(lineNumberPainterColor.BackgroundColor) : SystemBrushes.InactiveBorder; + Brush drawBrush = BrushRegistry.GetBrush(lineNumberPainterColor.Color); + for (int y = 0; y < (DrawingPosition.Height + textArea.TextView.VisibleLineDrawingRemainder) / fontHeight + 1; ++y) { + int ypos = drawingPosition.Y + fontHeight * y - textArea.TextView.VisibleLineDrawingRemainder; + Rectangle backgroundRectangle = new Rectangle(drawingPosition.X, ypos, drawingPosition.Width, fontHeight); + if (rect.IntersectsWith(backgroundRectangle)) { + g.FillRectangle(fillBrush, backgroundRectangle); + int curLine = textArea.Document.GetFirstLogicalLine(textArea.Document.GetVisibleLine(textArea.TextView.FirstVisibleLine) + y); + + if (curLine < textArea.Document.TotalNumberOfLines) { + g.DrawString((curLine + 1).ToString(), + lineNumberPainterColor.GetFont(TextEditorProperties.FontContainer), + drawBrush, + backgroundRectangle, + numberStringFormat); + } + } + } + } + + public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons) + { + TextLocation selectionStartPos; + + textArea.SelectionManager.selectFrom.where = WhereFrom.Gutter; + int realline = textArea.TextView.GetLogicalLine(mousepos.Y); + if (realline >= 0 && realline < textArea.Document.TotalNumberOfLines) { + // shift-select + if((Control.ModifierKeys & Keys.Shift) != 0) { + if(!textArea.SelectionManager.HasSomethingSelected && realline != textArea.Caret.Position.Y) { + if (realline >= textArea.Caret.Position.Y) + { // at or below starting selection, place the cursor on the next line + // nothing is selected so make a new selection from cursor + selectionStartPos = textArea.Caret.Position; + // whole line selection - start of line to start of next line + if (realline < textArea.Document.TotalNumberOfLines - 1) + { + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new TextLocation(0, realline + 1))); + textArea.Caret.Position = new TextLocation(0, realline + 1); + } + else + { + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new TextLocation(textArea.Document.GetLineSegment(realline).Length + 1, realline))); + textArea.Caret.Position = new TextLocation(textArea.Document.GetLineSegment(realline).Length + 1, realline); + } + } + else + { // prior lines to starting selection, place the cursor on the same line as the new selection + // nothing is selected so make a new selection from cursor + selectionStartPos = textArea.Caret.Position; + // whole line selection - start of line to start of next line + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new TextLocation(selectionStartPos.X, selectionStartPos.Y))); + textArea.SelectionManager.ExtendSelection(new TextLocation(selectionStartPos.X, selectionStartPos.Y), new TextLocation(0, realline)); + textArea.Caret.Position = new TextLocation(0, realline); + } + } + else + { + // let MouseMove handle a shift-click in a gutter + MouseEventArgs e = new MouseEventArgs(mouseButtons, 1, mousepos.X, mousepos.Y, 0); + textArea.RaiseMouseMove(e); + } + } else { // this is a new selection with no shift-key + // sync the textareamousehandler mouse location + // (fixes problem with clicking out into a menu then back to the gutter whilst + // there is a selection) + textArea.mousepos = mousepos; + + selectionStartPos = new TextLocation(0, realline); + textArea.SelectionManager.ClearSelection(); + // whole line selection - start of line to start of next line + if (realline < textArea.Document.TotalNumberOfLines - 1) + { + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new TextLocation(selectionStartPos.X, selectionStartPos.Y + 1))); + textArea.Caret.Position = new TextLocation(selectionStartPos.X, selectionStartPos.Y + 1); + } + else + { + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, new TextLocation(0, realline), new TextLocation(textArea.Document.GetLineSegment(realline).Length + 1, selectionStartPos.Y))); + textArea.Caret.Position = new TextLocation(textArea.Document.GetLineSegment(realline).Length + 1, selectionStartPos.Y); + } + } + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/HRuler.cs b/ICSharpCode.TextEditorLinux/Src/Gui/HRuler.cs new file mode 100644 index 000000000..952d4dca0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/HRuler.cs @@ -0,0 +1,54 @@ +// +// +// +// +// $Revision: 1925 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor +{ + /// + /// Horizontal ruler - text column measuring ruler at the top of the text area. + /// + public class HRuler : Control + { + TextArea textArea; + + public HRuler(TextArea textArea) + { + this.textArea = textArea; + } + + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + Graphics g = e.Graphics; + int num = 0; + for (float x = textArea.TextView.DrawingPosition.Left; x < textArea.TextView.DrawingPosition.Right; x += textArea.TextView.WideSpaceWidth) { + int offset = (Height * 2) / 3; + if (num % 5 == 0) { + offset = (Height * 4) / 5; + } + + if (num % 10 == 0) { + offset = 1; + } + ++num; + g.DrawLine(Pens.Black, + (int)x, offset, (int)x, Height - offset); + } + } + + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) + { + e.Graphics.FillRectangle(Brushes.White, + new Rectangle(0, + 0, + Width, + Height)); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/IconBarMargin.cs b/ICSharpCode.TextEditorLinux/Src/Gui/IconBarMargin.cs new file mode 100644 index 000000000..28edd4a19 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/IconBarMargin.cs @@ -0,0 +1,316 @@ +// +// +// +// +// $Revision: 2314 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + public static class ScreenScale + { + public static double scale = -1; + public static void FirstCalcScale(Form f) + { + var gr = f.CreateGraphics(); + scale = (double)gr.DpiX / 96; + gr.Dispose(); + } + public static double Calc() + { + if (scale > 0) + return scale; + return 1.5; + /* if (System.Windows.Forms.Application.OpenForms.Count == 0) + return 1.5; + var Handle = System.Windows.Forms.Application.OpenForms[0].Handle; + var gr = Graphics.FromHwnd(Handle); + var dpiXProperty = typeof(System.Windows.SystemParameters).GetProperty("DpiX", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); + var dpiX = (int)dpiXProperty.GetValue(null, null); + scale = (double)gr.DpiX / 96;*/ + //return 1.5; + } + } + + /// + /// This class views the line numbers and folding markers. + /// + public class IconBarMargin : AbstractMargin + { + static int iconBarWidth = 18 + Convert.ToInt32(Math.Max(0,(ScreenScale.Calc() - 1) * 16)); + + static readonly Size iconBarSize = new Size(iconBarWidth, -1); + + public override Size Size { + get { + return new Size(18 + Convert.ToInt32(Math.Max(0, (ScreenScale.Calc() - 1) * 16)), -1); ; + } + } + + public override bool IsVisible { + get { + return textArea.TextEditorProperties.IsIconBarVisible; + } + } + + + public IconBarMargin(TextArea textArea) : base(textArea) + { + } + + public override void Paint(Graphics g, Rectangle rect) + { + if (rect.Width <= 0 || rect.Height <= 0) { + return; + } + // paint background + g.FillRectangle(SystemBrushes.Control, new Rectangle(drawingPosition.X, rect.Top, drawingPosition.Width - 1, rect.Height)); + g.DrawLine(SystemPens.ControlDark, base.drawingPosition.Right - 1, rect.Top, base.drawingPosition.Right - 1, rect.Bottom); + + // paint icons + foreach (Bookmark mark in textArea.Document.BookmarkManager.Marks) { + int lineNumber = textArea.Document.GetVisibleLine(mark.LineNumber); + int lineHeight = textArea.TextView.FontHeight; + int yPos = (int)(lineNumber * lineHeight) - textArea.VirtualTop.Y; + if (IsLineInsideRegion(yPos, yPos + lineHeight, rect.Y, rect.Bottom)) { + if (lineNumber == textArea.Document.GetVisibleLine(mark.LineNumber - 1)) { + // marker is inside folded region, do not draw it + continue; + } + mark.Draw(this, g, new Point(0, yPos)); + } + } + base.Paint(g, rect); + } + + public override void HandleMouseDown(Point mousePos, MouseButtons mouseButtons) + { + int clickedVisibleLine = (mousePos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight; + int lineNumber = textArea.Document.GetFirstLogicalLine(clickedVisibleLine); + + if ((mouseButtons & MouseButtons.Right) == MouseButtons.Right) { + if (textArea.Caret.Line != lineNumber) { + textArea.Caret.Line = lineNumber; + } + } + + List marks = textArea.Document.BookmarkManager.Marks; + List marksInLine = new List(); + int oldCount = marks.Count; + foreach (Bookmark mark in marks) { + if (mark.LineNumber == lineNumber) { + marksInLine.Add(mark); + } + } + for (int i = marksInLine.Count - 1; i >= 0; i--) { + Bookmark mark = marksInLine[i]; + if (mark.Click(textArea, new MouseEventArgs(mouseButtons, 1, mousePos.X, mousePos.Y, 0))) { + if (oldCount != marks.Count) { + textArea.UpdateLine(lineNumber); + } + return; + } + } + base.HandleMouseDown(mousePos, mouseButtons); + } + + private static Bitmap brpt_bmp; + + public static Bitmap BrptBitmap + { + get + { + if (brpt_bmp == null) + if (ScreenScale.Calc()>=1.75) + brpt_bmp = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ICSharpCode.TextEditor.Resources.Breakpoint32x32.png")); + else brpt_bmp = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ICSharpCode.TextEditor.Resources.Breakpoint24x24.png")); + return brpt_bmp; + } + } + + private static Bitmap condBrptBitmap; + + public static Bitmap CondBrptBitmap + { + get + { + if (condBrptBitmap == null) + condBrptBitmap = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ICSharpCode.TextEditor.Resources.ConditionBreakpoint24x24.png")); + return condBrptBitmap; + } + } + + #region Drawing functions + public void DrawBreakpoint(Graphics g, int y, bool isEnabled, bool willBeHit, bool onCondition) + { + int diameter = Math.Min(iconBarWidth - 2, textArea.TextView.FontHeight); + SmoothingMode mode = g.SmoothingMode; + g.SmoothingMode = SmoothingMode.HighQuality; + Rectangle rect = new Rectangle(0, + y + (textArea.TextView.FontHeight - diameter) / 2, + diameter, + diameter); + + if (!onCondition) + //g.DrawImage(BrptBitmap,rect.X,rect.Y); // SSM 17/04/2020 + g.DrawImage(BrptBitmap, rect); + else + //g.DrawImage(CondBrptBitmap,rect.X,rect.Y); + g.DrawImage(CondBrptBitmap, rect); + g.SmoothingMode = mode; + return; + using (GraphicsPath path = new GraphicsPath()) { + path.AddEllipse(rect); + using (PathGradientBrush pthGrBrush = new PathGradientBrush(path)) { + pthGrBrush.CenterPoint = new PointF(rect.Left + rect.Width / 3 , rect.Top + rect.Height / 3); + //pthGrBrush.CenterColor = Color.MistyRose; + pthGrBrush.CenterColor = Color.Moccasin; + //Color[] colors = {willBeHit?Color.Firebrick:Color.Olive}; + Color[] colors = {willBeHit?Color.Firebrick:Color.Firebrick}; + pthGrBrush.SurroundColors = colors; + + if (isEnabled) { + g.FillEllipse(pthGrBrush, rect); + } else { + g.FillEllipse(SystemBrushes.Control, rect); + using (Pen pen = new Pen(pthGrBrush)) { + g.DrawEllipse(pen, new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2)); + } + } + } + } + g.SmoothingMode = SmoothingMode.Default; + } + + public void DrawBookmark(Graphics g, int y, bool isEnabled) + { + int delta = textArea.TextView.FontHeight / 8; + Rectangle rect = new Rectangle(1, y + delta, base.drawingPosition.Width - 4, textArea.TextView.FontHeight - delta * 2); + if (isEnabled) { + using (Brush brush = new LinearGradientBrush(new Point(rect.Left, rect.Top), + new Point(rect.Right, rect.Bottom), + Color.SkyBlue, + Color.White)) { + FillRoundRect(g, brush, rect); + } + } else { + FillRoundRect(g, Brushes.White, rect); + } + using (Brush brush = new LinearGradientBrush(new Point(rect.Left, rect.Top), + new Point(rect.Right, rect.Bottom), + Color.SkyBlue, + Color.Blue)) { + using (Pen pen = new Pen(brush)) { + DrawRoundRect(g, pen, rect); + } + } + } + + public void DrawArrow(Graphics g, int y) + { + int delta = textArea.TextView.FontHeight / 8; + Rectangle rect = new Rectangle(1, y + delta, base.drawingPosition.Width - 4, textArea.TextView.FontHeight - delta * 2); + using (Brush brush = new LinearGradientBrush(new Point(rect.Left, rect.Top), + new Point(rect.Right, rect.Bottom), + Color.LightYellow, + Color.Yellow)) { + FillArrow(g, brush, rect); + } + + using (Brush brush = new LinearGradientBrush(new Point(rect.Left, rect.Top), + new Point(rect.Right, rect.Bottom), + Color.Yellow, + Color.Brown)) { + using (Pen pen = new Pen(brush)) { + DrawArrow(g, pen, rect); + } + } + } + + GraphicsPath CreateArrowGraphicsPath(Rectangle r) + { + GraphicsPath gp = new GraphicsPath(); + int halfX = r.Width / 2; + int halfY = r.Height/ 2; + gp.AddLine(r.X, r.Y + halfY/2, r.X + halfX, r.Y + halfY/2); + gp.AddLine(r.X + halfX, r.Y + halfY/2, r.X + halfX, r.Y); + gp.AddLine(r.X + halfX, r.Y, r.Right, r.Y + halfY); + gp.AddLine(r.Right, r.Y + halfY, r.X + halfX, r.Bottom); + gp.AddLine(r.X + halfX, r.Bottom, r.X + halfX, r.Bottom - halfY/2); + gp.AddLine(r.X + halfX, r.Bottom - halfY/2, r.X, r.Bottom - halfY/2); + gp.AddLine(r.X, r.Bottom - halfY/2, r.X, r.Y + halfY/2); + gp.CloseFigure(); + return gp; + } + + GraphicsPath CreateRoundRectGraphicsPath(Rectangle r) + { + GraphicsPath gp = new GraphicsPath(); + int radius = r.Width / 2; + gp.AddLine(r.X + radius, r.Y, r.Right - radius, r.Y); + gp.AddArc(r.Right - radius, r.Y, radius, radius, 270, 90); + + gp.AddLine(r.Right, r.Y + radius, r.Right, r.Bottom - radius); + gp.AddArc(r.Right - radius, r.Bottom - radius, radius, radius, 0, 90); + + gp.AddLine(r.Right - radius, r.Bottom, r.X + radius, r.Bottom); + gp.AddArc(r.X, r.Bottom - radius, radius, radius, 90, 90); + + gp.AddLine(r.X, r.Bottom - radius, r.X, r.Y + radius); + gp.AddArc(r.X, r.Y, radius, radius, 180, 90); + + gp.CloseFigure(); + return gp; + } + + void DrawRoundRect(Graphics g, Pen p , Rectangle r) + { + using (GraphicsPath gp = CreateRoundRectGraphicsPath(r)) { + g.DrawPath(p, gp); + } + } + + void FillRoundRect(Graphics g, Brush b , Rectangle r) + { + using (GraphicsPath gp = CreateRoundRectGraphicsPath(r)) { + g.FillPath(b, gp); + } + } + + void DrawArrow(Graphics g, Pen p , Rectangle r) + { + using (GraphicsPath gp = CreateArrowGraphicsPath(r)) { + g.DrawPath(p, gp); + } + } + + void FillArrow(Graphics g, Brush b , Rectangle r) + { + using (GraphicsPath gp = CreateArrowGraphicsPath(r)) { + g.FillPath(b, gp); + } + } + + #endregion + + static bool IsLineInsideRegion(int top, int bottom, int regionTop, int regionBottom) + { + if (top >= regionTop && top <= regionBottom) { + // Region overlaps the line's top edge. + return true; + } else if(regionTop > top && regionTop < bottom) { + // Region's top edge inside line. + return true; + } + return false; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/Ime.cs b/ICSharpCode.TextEditorLinux/Src/Gui/Ime.cs new file mode 100644 index 000000000..c16cdd49c --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/Ime.cs @@ -0,0 +1,175 @@ +// +// +// +// +// $Revision: 2561 $ +// + +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor +{ + /// + /// Used internally, not for own use. + /// + internal class Ime + { + public Ime(IntPtr hWnd, Font font) + { + string PROCESSOR_ARCHITEW6432 = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"); + if (PROCESSOR_ARCHITEW6432 == "IA64" || PROCESSOR_ARCHITEW6432 == "AMD64" || Environment.Version >= new Version(4,0)) { + disableIME = true; + } + this.hWnd = hWnd; + this.hIMEWnd = ImmGetDefaultIMEWnd(hWnd); + this.font = font; + SetIMEWindowFont(font); + } + + private Font font = null; + public Font Font + { + get { + return font; + } + set { + if (!value.Equals(font)) { + font = value; + lf = null; + SetIMEWindowFont(value); + } + } + } + + public IntPtr HWnd + { + set { + if (this.hWnd != value) { + this.hWnd = value; + this.hIMEWnd = ImmGetDefaultIMEWnd(value); + SetIMEWindowFont(font); + } + } + } + + [ DllImport("imm32.dll") ] + private static extern IntPtr ImmGetDefaultIMEWnd(IntPtr hWnd); + + [ DllImport("user32.dll") ] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, COMPOSITIONFORM lParam); + [ DllImport("user32.dll") ] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, [In, MarshalAs(UnmanagedType.LPStruct)] LOGFONT lParam); + + [ StructLayout(LayoutKind.Sequential) ] + private class COMPOSITIONFORM + { + public int dwStyle = 0; + public POINT ptCurrentPos = null; + public RECT rcArea = null; + } + + [ StructLayout(LayoutKind.Sequential) ] + private class POINT + { + public int x = 0; + public int y = 0; + } + + [ StructLayout(LayoutKind.Sequential) ] + private class RECT + { + public int left = 0; + public int top = 0; + public int right = 0; + public int bottom = 0; + } + + private const int WM_IME_CONTROL = 0x0283; + + private const int IMC_SETCOMPOSITIONWINDOW = 0x000c; + private IntPtr hIMEWnd; + private IntPtr hWnd; + private const int CFS_POINT = 0x0002; + + [ StructLayout(LayoutKind.Sequential) ] + private class LOGFONT + { + public int lfHeight = 0; + public int lfWidth = 0; + public int lfEscapement = 0; + public int lfOrientation = 0; + public int lfWeight = 0; + public byte lfItalic = 0; + public byte lfUnderline = 0; + public byte lfStrikeOut = 0; + public byte lfCharSet = 0; + public byte lfOutPrecision = 0; + public byte lfClipPrecision = 0; + public byte lfQuality = 0; + public byte lfPitchAndFamily = 0; + [ MarshalAs(UnmanagedType.ByValTStr, SizeConst=32) ] public string lfFaceName = null; + } + private const int IMC_SETCOMPOSITIONFONT = 0x000a; + LOGFONT lf = null; + static bool disableIME; + + private void SetIMEWindowFont(Font f) + { + if (disableIME || hIMEWnd == IntPtr.Zero) return; + + if (lf == null) { + lf = new LOGFONT(); + f.ToLogFont(lf); + lf.lfFaceName = f.Name; // This is very important! "Font.ToLogFont" Method sets invalid value to LOGFONT.lfFaceName + } + + try { + SendMessage( + hIMEWnd, + WM_IME_CONTROL, + new IntPtr(IMC_SETCOMPOSITIONFONT), + lf + ); + } catch (AccessViolationException ex) { + Handle(ex); + } + } + + public void SetIMEWindowLocation(int x, int y) + { + if (disableIME || hIMEWnd == IntPtr.Zero) return; + + POINT p = new POINT(); + p.x = x; + p.y = y; + + COMPOSITIONFORM lParam = new COMPOSITIONFORM(); + lParam.dwStyle = CFS_POINT; + lParam.ptCurrentPos = p; + lParam.rcArea = new RECT(); + + try { + SendMessage( + hIMEWnd, + WM_IME_CONTROL, + new IntPtr(IMC_SETCOMPOSITIONWINDOW), + lParam + ); + } catch (AccessViolationException ex) { + Handle(ex); + } + } + + void Handle(Exception ex) + { + Console.WriteLine(ex); + if (!disableIME) { + disableIME = true; + MessageBox.Show("Error calling IME: " + ex.Message + "\nIME is disabled.", "IME error"); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/IInsightDataProvider.cs b/ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/IInsightDataProvider.cs new file mode 100644 index 000000000..b40f252f7 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/IInsightDataProvider.cs @@ -0,0 +1,53 @@ +// +// +// +// +// $Revision: 2318 $ +// + +using System; + +namespace ICSharpCode.TextEditor.Gui.InsightWindow +{ + public interface IInsightDataProvider + { + /// + /// Tells the insight provider to prepare its data. + /// + /// The name of the edited file + /// The text area in which the file is being edited + void SetupDataProvider(string fileName, TextArea textArea); + + /// + /// Notifies the insight provider that the caret offset has changed. + /// + /// Return true to close the insight window (e.g. when the + /// caret was moved outside the region where insight is displayed for). + /// Return false to keep the window open. + bool CaretOffsetChanged(); + + /// + /// Gets the text to display in the insight window. + /// + /// The number of the active insight entry. + /// Multiple insight entries might be multiple overloads of the same method. + /// The text to display, e.g. a multi-line string where + /// the first line is the method definition, followed by a description. + string GetInsightData(int number); + + /// + /// Gets the number of available insight entries, e.g. the number of available + /// overloads to call. + /// + int InsightDataCount { + get; + } + + /// + /// Gets the index of the entry to initially select. + /// + int DefaultIndex { + get; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/InsightWindow.cs b/ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/InsightWindow.cs new file mode 100644 index 000000000..828427b6b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/InsightWindow/InsightWindow.cs @@ -0,0 +1,203 @@ +// +// +// +// +// $Revision: 2681 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.TextEditor.Gui.InsightWindow +{ + public class InsightWindow : AbstractCompletionWindow + { + public InsightWindow(Form parentForm, TextEditorControl control) : base(parentForm, control) + { + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + } + + public void ShowInsightWindow() + { + if (!Visible) { + if (insightDataProviderStack.Count > 0) { + ShowCompletionWindow(); + } + } else { + Refresh(); + } + } + + #region Event handling routines + protected override bool ProcessTextAreaKey(Keys keyData) + { + if (!Visible) { + return false; + } + switch (keyData) { + case Keys.Down: + if (DataProvider != null && DataProvider.InsightDataCount > 0) { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + Refresh(); + } + return true; + case Keys.Up: + if (DataProvider != null && DataProvider.InsightDataCount > 0) { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + Refresh(); + } + return true; + } + return base.ProcessTextAreaKey(keyData); + } + + protected override void CaretOffsetChanged(object sender, EventArgs e) + { + // move the window under the caret (don't change the x position) + TextLocation caretPos = control.ActiveTextAreaControl.Caret.Position; + int y = (int)((1 + caretPos.Y) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight) + - control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1 + + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y; + + int xpos = control.ActiveTextAreaControl.TextArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X); + int ypos = (control.ActiveTextAreaControl.Document.GetVisibleLine(caretPos.Y) + 1) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight + - control.ActiveTextAreaControl.TextArea.VirtualTop.Y; + int rulerHeight = control.TextEditorProperties.ShowHorizontalRuler ? control.ActiveTextAreaControl.TextArea.TextView.FontHeight : 0; + + Point p = control.ActiveTextAreaControl.PointToScreen(new Point(xpos, ypos + rulerHeight)); + if (p.Y != Location.Y) { + Location = p; + } + + while (DataProvider != null && DataProvider.CaretOffsetChanged()) { + CloseCurrentDataProvider(); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + control.ActiveTextAreaControl.TextArea.Focus(); + if (TipPainterTools.DrawingRectangle1.Contains(e.X, e.Y)) { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + Refresh(); + } + if (TipPainterTools.DrawingRectangle2.Contains(e.X, e.Y)) { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + Refresh(); + } + } + + #endregion + + + public void HandleMouseWheel(MouseEventArgs e) + { + if (DataProvider != null && DataProvider.InsightDataCount > 0) { + if (e.Delta > 0) { + if (control.TextEditorProperties.MouseWheelScrollDown) { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + } else { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + } + } if (e.Delta < 0) { + if (control.TextEditorProperties.MouseWheelScrollDown) { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + } else { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + } + } + Refresh(); + } + } + + #region Insight Window Drawing routines + protected override void OnPaint(PaintEventArgs pe) + { + string methodCountMessage = null, description; + if (DataProvider == null || DataProvider.InsightDataCount < 1) { + description = "Unknown Method"; + } else { + if (DataProvider.InsightDataCount > 1) { + methodCountMessage = control.GetRangeDescription(CurrentData + 1, DataProvider.InsightDataCount); + } + description = DataProvider.GetInsightData(CurrentData); + } + + drawingSize = TipPainterTools.GetDrawingSizeHelpTipFromCombinedDescription(this, + pe.Graphics, + Font, + methodCountMessage, + description); + if (drawingSize != Size) { + SetLocation(); + } else { + TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, methodCountMessage, description); + } + } + + protected override void OnPaintBackground(PaintEventArgs pe) + { + pe.Graphics.FillRectangle(SystemBrushes.Info, pe.ClipRectangle); + } + #endregion + + #region InsightDataProvider handling + Stack insightDataProviderStack = new Stack(); + + int CurrentData { + get { + return insightDataProviderStack.Peek().currentData; + } + set { + insightDataProviderStack.Peek().currentData = value; + } + } + + IInsightDataProvider DataProvider { + get { + if (insightDataProviderStack.Count == 0) { + return null; + } + return insightDataProviderStack.Peek().dataProvider; + } + } + + public void AddInsightDataProvider(IInsightDataProvider provider, string fileName) + { + provider.SetupDataProvider(fileName, control.ActiveTextAreaControl.TextArea); + if (provider.InsightDataCount > 0) { + insightDataProviderStack.Push(new InsightDataProviderStackElement(provider)); + } + } + + void CloseCurrentDataProvider() + { + insightDataProviderStack.Pop(); + if (insightDataProviderStack.Count == 0) { + Close(); + } else { + Refresh(); + } + } + + class InsightDataProviderStackElement + { + public int currentData; + public IInsightDataProvider dataProvider; + + public InsightDataProviderStackElement(IInsightDataProvider dataProvider) + { + this.currentData = Math.Max(dataProvider.DefaultIndex, 0); + this.dataProvider = dataProvider; + } + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextArea.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextArea.cs new file mode 100644 index 000000000..f19b189d8 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextArea.cs @@ -0,0 +1,1019 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Text; +using System.Text; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Actions; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; + +namespace ICSharpCode.TextEditor +{ + public delegate bool KeyEventHandler(char ch); + public delegate bool DialogKeyProcessor(Keys keyData); + + /// + /// This class paints the textarea. + /// + [ToolboxItem(false)] + public class TextArea : Control + { + bool hiddenMouseCursor = false; + /// + /// The position where the mouse cursor was when it was hidden. Sometimes the text editor gets MouseMove + /// events when typing text even if the mouse is not moved. + /// + Point mouseCursorHidePosition; + + Point virtualTop = new Point(0, 0); + TextAreaControl motherTextAreaControl; + TextEditorControl motherTextEditorControl; + + List bracketshemes = new List(); + TextAreaClipboardHandler textAreaClipboardHandler; + bool autoClearSelection = false; + + List leftMargins = new List(); + + TextView textView; + GutterMargin gutterMargin; + FoldMargin foldMargin; + IconBarMargin iconBarMargin; + + SelectionManager selectionManager; + Caret caret; + + internal Point mousepos = new Point(0, 0); + //public Point selectionStartPos = new Point(0,0); + + bool disposed; + + [Browsable(false)] + public IList LeftMargins { + get { + return leftMargins.AsReadOnly(); + } + } + + public void InsertLeftMargin(int index, AbstractMargin margin) + { + leftMargins.Insert(index, margin); + Refresh(); + } + + public TextEditorControl MotherTextEditorControl { + get { + return motherTextEditorControl; + } + } + + public TextAreaControl MotherTextAreaControl { + get { + return motherTextAreaControl; + } + } + + public SelectionManager SelectionManager { + get { + return selectionManager; + } + } + + public Caret Caret { + get { + return caret; + } + } + + public TextView TextView { + get { + return textView; + } + } + + public GutterMargin GutterMargin { + get { + return gutterMargin; + } + } + + public FoldMargin FoldMargin { + get { + return foldMargin; + } + } + + public IconBarMargin IconBarMargin { + get { + return iconBarMargin; + } + } + + public Encoding Encoding { + get { + return motherTextEditorControl.Encoding; + } + } + public int MaxVScrollValue { + get { + return (Document.GetVisibleLine(Document.TotalNumberOfLines - 1) + 1 + TextView.VisibleLineCount * 2 / 3) * TextView.FontHeight; + } + } + + public Point VirtualTop { + get { + return virtualTop; + } + set { + Point newVirtualTop = new Point(value.X, Math.Min(MaxVScrollValue, Math.Max(0, value.Y))); + if (virtualTop != newVirtualTop) { + virtualTop = newVirtualTop; + motherTextAreaControl.VScrollBar.Value = virtualTop.Y; + Invalidate(); + } + } + } + + public bool AutoClearSelection { + get { + return autoClearSelection; + } + set { + autoClearSelection = value; + } + } + + [Browsable(false)] + public IDocument Document { + get { + return motherTextEditorControl.Document; + } + } + + public TextAreaClipboardHandler ClipboardHandler { + get { + return textAreaClipboardHandler; + } + } + + + public ITextEditorProperties TextEditorProperties { + get { + return motherTextEditorControl.TextEditorProperties; + } + } + + public TextArea(TextEditorControl motherTextEditorControl, TextAreaControl motherTextAreaControl) + { + this.motherTextAreaControl = motherTextAreaControl; + this.motherTextEditorControl = motherTextEditorControl; + + caret = new Caret(this); + selectionManager = new SelectionManager(Document, this); + + this.textAreaClipboardHandler = new TextAreaClipboardHandler(this); + + ResizeRedraw = true; + + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); +// SetStyle(ControlStyles.AllPaintingInWmPaint, true); +// SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.Opaque, false); + SetStyle(ControlStyles.ResizeRedraw, true); + SetStyle(ControlStyles.Selectable, true); + + textView = new TextView(this); + + gutterMargin = new GutterMargin(this); + foldMargin = new FoldMargin(this); + iconBarMargin = new IconBarMargin(this); + leftMargins.AddRange(new AbstractMargin[] { iconBarMargin, gutterMargin, foldMargin }); + OptionsChanged(); + + + new TextAreaMouseHandler(this).Attach(); + new TextAreaDragDropHandler().Attach(this); + + bracketshemes.Add(new BracketHighlightingSheme('{', '}')); + bracketshemes.Add(new BracketHighlightingSheme('(', ')')); + bracketshemes.Add(new BracketHighlightingSheme('[', ']')); + + caret.PositionChanged += new EventHandler(SearchMatchingBracket); + Document.TextContentChanged += new EventHandler(TextContentChanged); + Document.FoldingManager.FoldingsChanged += new EventHandler(DocumentFoldingsChanged); + } + + public void UpdateMatchingBracket() + { + SearchMatchingBracket(null, null); + } + + void TextContentChanged(object sender, EventArgs e) + { + Caret.Position = new TextLocation(0, 0); + SelectionManager.SelectionCollection.Clear(); + } + void SearchMatchingBracket(object sender, EventArgs e) + { + if (!TextEditorProperties.ShowMatchingBracket) { + textView.Highlight = null; + return; + } + int oldLine1 = -1, oldLine2 = -1; + if (textView.Highlight != null && textView.Highlight.OpenBrace.Y >=0 && textView.Highlight.OpenBrace.Y < Document.TotalNumberOfLines) { + oldLine1 = textView.Highlight.OpenBrace.Y; + } + if (textView.Highlight != null && textView.Highlight.CloseBrace.Y >=0 && textView.Highlight.CloseBrace.Y < Document.TotalNumberOfLines) { + oldLine2 = textView.Highlight.CloseBrace.Y; + } + textView.Highlight = FindMatchingBracketHighlight(); + if (oldLine1 >= 0) + UpdateLine(oldLine1); + if (oldLine2 >= 0 && oldLine2 != oldLine1) + UpdateLine(oldLine2); + if (textView.Highlight != null) { + int newLine1 = textView.Highlight.OpenBrace.Y; + int newLine2 = textView.Highlight.CloseBrace.Y; + if (newLine1 != oldLine1 && newLine1 != oldLine2) + UpdateLine(newLine1); + if (newLine2 != oldLine1 && newLine2 != oldLine2 && newLine2 != newLine1) + UpdateLine(newLine2); + } + } + + public Highlight FindMatchingBracketHighlight() + { + if (Caret.Offset == 0) + return null; + foreach (BracketHighlightingSheme bracketsheme in bracketshemes) { + Highlight highlight = bracketsheme.GetHighlight(Document, Caret.Offset - 1); + if (highlight != null) { + return highlight; + } + } + return null; + } + + public void SetDesiredColumn() + { + Caret.DesiredColumn = TextView.GetDrawingXPos(Caret.Line, Caret.Column) + VirtualTop.X; + } + + public void SetCaretToDesiredColumn() + { + FoldMarker dummy; + Caret.Position = textView.GetLogicalColumn(Caret.Line, Caret.DesiredColumn + VirtualTop.X, out dummy); + } + + public void OptionsChanged() + { + UpdateMatchingBracket(); + textView.OptionsChanged(); + caret.RecreateCaret(); + caret.UpdateCaretPosition(); + Refresh(); + } + + AbstractMargin lastMouseInMargin; + + protected override void OnMouseLeave(System.EventArgs e) + { + base.OnMouseLeave(e); + this.Cursor = Cursors.Default; + if (lastMouseInMargin != null) { + lastMouseInMargin.HandleMouseLeave(EventArgs.Empty); + lastMouseInMargin = null; + } + CloseToolTip(); + } + + internal bool on_icon_bar_clicked(System.Windows.Forms.MouseEventArgs e) + { + mousepos = new Point(e.X, e.Y); + foreach (AbstractMargin margin in leftMargins) { + if (margin.DrawingPosition.Contains(e.X, e.Y) && margin is IconBarMargin) { + return true; + } + } + return false; + } + + protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) + { + // this corrects weird problems when text is selected, + // then a menu item is selected, then the text is + // clicked again - it correctly synchronises the + // click position + mousepos = new Point(e.X, e.Y); +// if (e.Button == MouseButtons.Right) +// { +// foreach (AbstractMargin margin in leftMargins) { +// if (margin.DrawingPosition.Contains(e.X, e.Y) && margin is IconBarMargin) { +// margin.HandleMouseDown(new Point(e.X, e.Y), e.Button); +// CloseToolTip(); +// return; +// } +// } +// } + base.OnMouseDown(e); + CloseToolTip(); + + foreach (AbstractMargin margin in leftMargins) { + if (margin.DrawingPosition.Contains(e.X, e.Y) && margin.IsVisible) { + margin.HandleMouseDown(new Point(e.X, e.Y), e.Button); + } + } + } + + /// + /// Shows the mouse cursor if it has been hidden. + /// + /// true to always show the cursor or false to show it only if it has been moved since it was hidden. + internal void ShowHiddenCursor(bool forceShow) + { + if (hiddenMouseCursor) { + if (mouseCursorHidePosition != Cursor.Position || forceShow) { + Cursor.Show(); + hiddenMouseCursor = false; + } + } + } + + + // static because the mouse can only be in one text area and we don't want to have + // tooltips of text areas from inactive tabs floating around. + static DeclarationViewWindow toolTip; + static string oldToolTip; + + void SetToolTip(string text, int lineNumber) + { + if (toolTip == null || toolTip.IsDisposed) + toolTip = new DeclarationViewWindow(this.FindForm()); + if (oldToolTip == text) + return; + if (text == null) { + toolTip.Hide(); + } else { + Point p = Control.MousePosition; + Point cp = PointToClient(p); + if (lineNumber >= 0) { + lineNumber = this.Document.GetVisibleLine(lineNumber); + p.Y = (p.Y - cp.Y) + (lineNumber * this.TextView.FontHeight) - this.virtualTop.Y; + } + p.Offset(3, 3); + toolTip.Location = p; + toolTip.Description = text; + toolTip.HideOnClick = true; + toolTip.Show(); + } + oldToolTip = text; + } + + public event ToolTipRequestEventHandler ToolTipRequest; + + protected virtual void OnToolTipRequest(ToolTipRequestEventArgs e) + { + if (ToolTipRequest != null) { + ToolTipRequest(this, e); + } + } + + bool toolTipActive; + /// + /// Rectangle in text area that caused the current tool tip. + /// Prevents tooltip from re-showing when it was closed because of a click or keyboard + /// input and the mouse was not used. + /// + Rectangle toolTipRectangle; + + void CloseToolTip() + { + if (toolTipActive) { + //Console.WriteLine("Closing tooltip"); + toolTipActive = false; + SetToolTip(null, -1); + } + ResetMouseEventArgs(); + } + + protected override void OnMouseHover(EventArgs e) + { + //System.IO.File.AppendAllText("d:\\logP.txt", "OnMouseHover" + $" {Control.MousePosition.ToString()} {DateTime.Now}\n"); + //MessageBox.Show("OnMHOne"); + //MessageBox.Show(MouseButtons.ToString()); + // Под Mono MouseButtons возвращает цену на дрова + //if (MouseButtons == MouseButtons.None) { + + //MessageBox.Show("P:"+ Control.MousePosition.ToString()); + RequestToolTip(PointToClient(Control.MousePosition)); + //} else { + // CloseToolTip(); + //} + base.OnMouseHover(e); + //toolTipRectangle = new Rectangle(- 40, - 40, 8, 8); + //toolTipRectangle = Rectangle.Empty; + //toolTipActive = true; + } + + protected void RequestToolTip(Point mousePos) + { + //MessageBox.Show("RequestToolTip"); + if (toolTipRectangle.Contains(mousePos)) { + if (!toolTipActive) + ResetMouseEventArgs(); + //return; + } + + //Console.WriteLine("Request tooltip for " + mousePos); + + toolTipRectangle = new Rectangle(mousePos.X - 4, mousePos.Y - 4, 8, 8); + + TextLocation logicPos = textView.GetLogicalPosition(mousePos.X - textView.DrawingPosition.Left, + mousePos.Y - textView.DrawingPosition.Top); + bool inDocument = textView.DrawingPosition.Contains(mousePos) + && logicPos.Y >= 0 && logicPos.Y < Document.TotalNumberOfLines; + ToolTipRequestEventArgs args = new ToolTipRequestEventArgs(mousePos, logicPos, inDocument); + OnToolTipRequest(args); + if (args.ToolTipShown) { + //Console.WriteLine("Set tooltip to " + args.toolTipText); + toolTipActive = true; + SetToolTip(args.toolTipText, inDocument ? logicPos.Y + 1 : -1); + } else { + CloseToolTip(); + } + } + + // external interface to the attached event + internal void RaiseMouseMove(MouseEventArgs e) + { + OnMouseMove(e); + } + + //private int mx = -1; + //private int my = -1; + private DateTime dt0 = DateTime.Now; + int deltaTime = 0; + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + /*if (e.X == mx && e.Y == my) + { + if (deltaTime < 400) + { + deltaTime = (DateTime.Now - dt0).Milliseconds; + //System.IO.File.AppendAllText("d:\\logP.txt", "OnMouseMove" + $" {deltaTime} {DateTime.Now}\n"); + } + else + { + //System.IO.File.AppendAllText("d:\\logP.txt", "OnMouseMove22222" + $" {deltaTime} {DateTime.Now}\n"); + deltaTime = 0; + // MouseHower аналог + OnMouseHover(EventArgs.Empty); + } + } + else + { + deltaTime = 0; + // Снова ждать 400 мс + }*/ + + //mx = e.X; + //my = e.Y; + + + if (!toolTipRectangle.Contains(e.Location)) + { + toolTipRectangle = Rectangle.Empty; + if (deltaTime < 400) + { + deltaTime = (DateTime.Now - dt0).Milliseconds; + } + else + { + deltaTime = 0; + dt0 = DateTime.Now; + //if (toolTipActive) // Что то с этим условием не так + toolTipActive = true; + RequestToolTip(e.Location); + } + } + foreach (AbstractMargin margin in leftMargins) { + if (margin.DrawingPosition.Contains(e.X, e.Y) && margin.IsVisible) { + this.Cursor = margin.Cursor; + margin.HandleMouseMove(new Point(e.X, e.Y), e.Button); + if (lastMouseInMargin != margin) { + if (lastMouseInMargin != null) { + lastMouseInMargin.HandleMouseLeave(EventArgs.Empty); + } + lastMouseInMargin = margin; + } + return; + } + } + if (lastMouseInMargin != null) { + lastMouseInMargin.HandleMouseLeave(EventArgs.Empty); + lastMouseInMargin = null; + } + if (textView.DrawingPosition.Contains(e.X, e.Y)) { + TextLocation realmousepos = TextView.GetLogicalPosition(e.X - TextView.DrawingPosition.X, e.Y - TextView.DrawingPosition.Y); + if(SelectionManager.IsSelected(Document.PositionToOffset(realmousepos)) && MouseButtons == MouseButtons.None) { + // mouse is hovering over a selection, so show default mouse + this.Cursor = Cursors.Default; + } else { + // mouse is hovering over text area, not a selection, so show the textView cursor + this.Cursor = textView.Cursor; + } + return; + } + this.Cursor = Cursors.Default; + } + AbstractMargin updateMargin = null; + + public void Refresh(AbstractMargin margin) + { + updateMargin = margin; + Invalidate(updateMargin.DrawingPosition); + Update(); + updateMargin = null; + } + + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) + { + } + + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + int currentXPos = 0; + int currentYPos = 0; + bool adjustScrollBars = false; + Graphics g = e.Graphics; + Rectangle clipRectangle = e.ClipRectangle; + + bool isFullRepaint = clipRectangle.X == 0 && clipRectangle.Y == 0 + && clipRectangle.Width == this.Width && clipRectangle.Height == this.Height; + + g.TextRenderingHint = this.TextEditorProperties.TextRenderingHint; + + if (updateMargin != null) { + updateMargin.Paint(g, updateMargin.DrawingPosition); +// clipRectangle.Intersect(updateMargin.DrawingPosition); + } + + if (clipRectangle.Width <= 0 || clipRectangle.Height <= 0) { + return; + } + + foreach (AbstractMargin margin in leftMargins) { + if (margin.IsVisible) { + Rectangle marginRectangle = new Rectangle(currentXPos , currentYPos, margin.Size.Width, Height - currentYPos); + if (marginRectangle != margin.DrawingPosition) { + // margin changed size + if (!isFullRepaint && !clipRectangle.Contains(marginRectangle)) { + Invalidate(); // do a full repaint + } + adjustScrollBars = true; + margin.DrawingPosition = marginRectangle; + } + currentXPos += margin.DrawingPosition.Width; + if (clipRectangle.IntersectsWith(marginRectangle)) { + marginRectangle.Intersect(clipRectangle); + if (!marginRectangle.IsEmpty) { + margin.Paint(g, marginRectangle); + } + } + } + } + + Rectangle textViewArea = new Rectangle(currentXPos, currentYPos, Width - currentXPos, Height - currentYPos); + if (textViewArea != textView.DrawingPosition) { + adjustScrollBars = true; + textView.DrawingPosition = textViewArea; + } + if (clipRectangle.IntersectsWith(textViewArea)) { + textViewArea.Intersect(clipRectangle); + if (!textViewArea.IsEmpty) { + textView.Paint(g, textViewArea); + } + } + + if (adjustScrollBars) { + this.motherTextAreaControl.AdjustScrollBars(); + } + + Caret.UpdateCaretPosition(); + + base.OnPaint(e); + } + void DocumentFoldingsChanged(object sender, EventArgs e) + { + Invalidate(); + this.motherTextAreaControl.AdjustScrollBars(); + } + + #region keyboard handling methods + + /// + /// This method is called on each Keypress + /// + /// + /// True, if the key is handled by this method and should NOT be + /// inserted in the textarea. + /// + protected internal virtual bool HandleKeyPress(char ch) + { + if (KeyEventHandler != null) { + return KeyEventHandler(ch); + } + return false; + } + + // Fixes SD2-747: Form containing the text editor and a button with a shortcut + protected override bool IsInputChar(char charCode) + { + return true; + } + + public void SimulateKeyPress(char ch) + { + if (Document.ReadOnly) { + return; + } + + if (TextEditorProperties.UseCustomLine == true) { + if (SelectionManager.HasSomethingSelected) { + if (SelectionManager.SelectionIsReadonly) + return; + } else if (Document.CustomLineManager.IsReadOnly(Caret.Line, false) == true) + return; + } + + if (ch < ' ') { + return; + } + + if (!hiddenMouseCursor && TextEditorProperties.HideMouseCursor) { + if (this.ClientRectangle.Contains(PointToClient(Cursor.Position))) { + mouseCursorHidePosition = Cursor.Position; + hiddenMouseCursor = true; + Cursor.Hide(); + } + } + CloseToolTip(); + + motherTextEditorControl.BeginUpdate(); + Document.UndoStack.StartUndoGroup(); + // INSERT char + if (!HandleKeyPress(ch)) { + switch (Caret.CaretMode) { + case CaretMode.InsertMode: + InsertChar(ch); + break; + case CaretMode.OverwriteMode: + ReplaceChar(ch); + break; + default: + Debug.Assert(false, "Unknown caret mode " + Caret.CaretMode); + break; + } + } + + int currentLineNr = Caret.Line; + Document.FormattingStrategy.FormatLine(this, currentLineNr, Document.PositionToOffset(Caret.Position), ch); + + motherTextEditorControl.EndUpdate(); + Document.UndoStack.EndUndoGroup(); + } + + protected override void OnKeyPress(KeyPressEventArgs e) + { + base.OnKeyPress(e); + SimulateKeyPress(e.KeyChar); + e.Handled = true; + } + + /// + /// This method executes a dialog key + /// + public bool ExecuteDialogKey(Keys keyData) + { + // try, if a dialog key processor was set to use this + if (DoProcessDialogKey != null && DoProcessDialogKey(keyData)) { + return true; + } + + if (keyData == Keys.Back || keyData == Keys.Delete || keyData == Keys.Enter) { + if (TextEditorProperties.UseCustomLine == true) { + if (SelectionManager.HasSomethingSelected) { + if (SelectionManager.SelectionIsReadonly) + return true; + } else { + int curLineNr = Document.GetLineNumberForOffset(Caret.Offset); + if (Document.CustomLineManager.IsReadOnly(curLineNr, false) == true) + return true; + if ((Caret.Column == 0) && (curLineNr - 1 >= 0) && keyData == Keys.Back && + Document.CustomLineManager.IsReadOnly(curLineNr - 1, false) == true) + return true; + if (keyData == Keys.Delete) { + LineSegment curLine = Document.GetLineSegment(curLineNr); + if (curLine.Offset + curLine.Length == Caret.Offset && + Document.CustomLineManager.IsReadOnly(curLineNr + 1, false) == true) { + return true; + } + } + } + } + } + + // if not (or the process was 'silent', use the standard edit actions + IEditAction action = motherTextEditorControl.GetEditAction(keyData); + AutoClearSelection = true; + if (action != null) { + motherTextEditorControl.BeginUpdate(); + try { + lock (Document) { + action.Execute(this); + if (SelectionManager.HasSomethingSelected && AutoClearSelection /*&& caretchanged*/) { + if (Document.TextEditorProperties.DocumentSelectionMode == DocumentSelectionMode.Normal) { + SelectionManager.ClearSelection(); + } + } + } + } finally { + motherTextEditorControl.EndUpdate(); + Caret.UpdateCaretPosition(); + } + return true; + } + return false; + } + + protected override bool ProcessDialogKey(Keys keyData) + { + return ExecuteDialogKey(keyData) || base.ProcessDialogKey(keyData); + } + #endregion + + public void ScrollToCaret() + { + motherTextAreaControl.ScrollToCaret(); + } + + public void ScrollTo(int line) + { + motherTextAreaControl.ScrollTo(line); + } + + public void BeginUpdate() + { + motherTextEditorControl.BeginUpdate(); + } + + public void EndUpdate() + { + motherTextEditorControl.EndUpdate(); + } + + public bool EnableCutOrPaste { + get { + if (motherTextAreaControl == null) + return false; + if (TextEditorProperties.UseCustomLine == true) { + if (SelectionManager.HasSomethingSelected == true) { + if (SelectionManager.SelectionIsReadonly) + return false; + } + if (Document.CustomLineManager.IsReadOnly(Caret.Line, false) == true) + return false; + } + return true; + + } + } + + string GenerateWhitespaceString(int length) + { + return new String(' ', length); + } + /// + /// Inserts a single character at the caret position + /// + public void InsertChar(char ch) + { + bool updating = motherTextEditorControl.IsInUpdate; + if (!updating) { + BeginUpdate(); + } + + // filter out forgein whitespace chars and replace them with standard space (ASCII 32) + if (Char.IsWhiteSpace(ch) && ch != '\t' && ch != '\n') { + ch = ' '; + } + + Document.UndoStack.StartUndoGroup(); + if (Document.TextEditorProperties.DocumentSelectionMode == DocumentSelectionMode.Normal && + SelectionManager.SelectionCollection.Count > 0) { + Caret.Position = SelectionManager.SelectionCollection[0].StartPosition; + SelectionManager.RemoveSelectedText(); + } + LineSegment caretLine = Document.GetLineSegment(Caret.Line); + int offset = Caret.Offset; + // use desired column for generated whitespaces + int dc=Math.Min(Caret.Column,Caret.DesiredColumn); + if (caretLine.Length < dc && ch != '\n') { + Document.Insert(offset, GenerateWhitespaceString(dc - caretLine.Length) + ch); + } else { + Document.Insert(offset, ch.ToString()); + } + Document.UndoStack.EndUndoGroup(); + ++Caret.Column; + + if (!updating) { + EndUpdate(); + UpdateLineToEnd(Caret.Line, Caret.Column); + } + + // I prefer to set NOT the standard column, if you type something +// ++Caret.DesiredColumn; + } + + /// + /// Inserts a whole string at the caret position + /// + public void InsertString(string str) + { + bool updating = motherTextEditorControl.IsInUpdate; + if (!updating) { + BeginUpdate(); + } + try { + Document.UndoStack.StartUndoGroup(); + if (Document.TextEditorProperties.DocumentSelectionMode == DocumentSelectionMode.Normal && + SelectionManager.SelectionCollection.Count > 0) { + Caret.Position = SelectionManager.SelectionCollection[0].StartPosition; + SelectionManager.RemoveSelectedText(); + } + + int oldOffset = Document.PositionToOffset(Caret.Position); + int oldLine = Caret.Line; + LineSegment caretLine = Document.GetLineSegment(Caret.Line); + if (caretLine.Length < Caret.Column) { + int whiteSpaceLength = Caret.Column - caretLine.Length; + Document.Insert(oldOffset, GenerateWhitespaceString(whiteSpaceLength) + str); + Caret.Position = Document.OffsetToPosition(oldOffset + str.Length + whiteSpaceLength); + } else { + Document.Insert(oldOffset, str); + Caret.Position = Document.OffsetToPosition(oldOffset + str.Length); + } + Document.UndoStack.EndUndoGroup(); + if (oldLine != Caret.Line) { + UpdateToEnd(oldLine); + } else { + UpdateLineToEnd(Caret.Line, Caret.Column); + } + } finally { + if (!updating) { + Document.UndoStack.EndUndoGroup(); + EndUpdate(); + } + } + } + + /// + /// Replaces a char at the caret position + /// + public void ReplaceChar(char ch) + { + bool updating = motherTextEditorControl.IsInUpdate; + if (!updating) { + BeginUpdate(); + } + if (Document.TextEditorProperties.DocumentSelectionMode == DocumentSelectionMode.Normal && SelectionManager.SelectionCollection.Count > 0) { + Caret.Position = SelectionManager.SelectionCollection[0].StartPosition; + SelectionManager.RemoveSelectedText(); + } + + int lineNr = Caret.Line; + LineSegment line = Document.GetLineSegment(lineNr); + int offset = Document.PositionToOffset(Caret.Position); + if (offset < line.Offset + line.Length) { + Document.Replace(offset, 1, ch.ToString()); + } else { + Document.Insert(offset, ch.ToString()); + } + if (!updating) { + EndUpdate(); + UpdateLineToEnd(lineNr, Caret.Column); + } + ++Caret.Column; +// ++Caret.DesiredColumn; + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (disposing) { + if (!disposed) { + disposed = true; + if (caret != null) { + caret.PositionChanged -= new EventHandler(SearchMatchingBracket); + caret.Dispose(); + } + if (selectionManager != null) { + selectionManager.Dispose(); + } + Document.TextContentChanged -= new EventHandler(TextContentChanged); + Document.FoldingManager.FoldingsChanged -= new EventHandler(DocumentFoldingsChanged); + motherTextAreaControl = null; + motherTextEditorControl = null; + foreach (AbstractMargin margin in leftMargins) { + if (margin is IDisposable) + (margin as IDisposable).Dispose(); + } + textView.Dispose(); + } + } + } + + #region UPDATE Commands + internal void UpdateLine(int line) + { + UpdateLines(0, line, line); + } + + internal void UpdateLines(int lineBegin, int lineEnd) + { + UpdateLines(0, lineBegin, lineEnd); + } + + internal void UpdateToEnd(int lineBegin) + { +// if (lineBegin > FirstPhysicalLine + textView.VisibleLineCount) { +// return; +// } + + lineBegin = Document.GetVisibleLine(lineBegin); + int y = Math.Max( 0, (int)(lineBegin * textView.FontHeight)); + y = Math.Max(0, y - this.virtualTop.Y); + Rectangle r = new Rectangle(0, + y, + Width, + Height - y); + Invalidate(r); + } + + internal void UpdateLineToEnd(int lineNr, int xStart) + { + UpdateLines(xStart, lineNr, lineNr); + } + + internal void UpdateLine(int line, int begin, int end) + { + UpdateLines(line, line); + } + int FirstPhysicalLine { + get { + return VirtualTop.Y / textView.FontHeight; + } + } + internal void UpdateLines(int xPos, int lineBegin, int lineEnd) + { +// if (lineEnd < FirstPhysicalLine || lineBegin > FirstPhysicalLine + textView.VisibleLineCount) { +// return; +// } + + InvalidateLines((int)(xPos * this.TextView.WideSpaceWidth), lineBegin, lineEnd); + } + + void InvalidateLines(int xPos, int lineBegin, int lineEnd) + { + lineBegin = Math.Max(Document.GetVisibleLine(lineBegin), FirstPhysicalLine); + lineEnd = Math.Min(Document.GetVisibleLine(lineEnd), FirstPhysicalLine + textView.VisibleLineCount); + int y = Math.Max( 0, (int)(lineBegin * textView.FontHeight)); + int height = Math.Min(textView.DrawingPosition.Height, (int)((1 + lineEnd - lineBegin) * (textView.FontHeight + 1))); + + Rectangle r = new Rectangle(0, + y - 1 - this.virtualTop.Y, + Width, + height + 3); + + Invalidate(r); + } + #endregion + public event KeyEventHandler KeyEventHandler; + public event DialogKeyProcessor DoProcessDialogKey; + + //internal void + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaClipboardHandler.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaClipboardHandler.cs new file mode 100644 index 000000000..7cb8f5af1 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaClipboardHandler.cs @@ -0,0 +1,249 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.TextEditor +{ + public class TextAreaClipboardHandler + { + TextArea textArea; + + public bool EnableCut { + get { + return textArea.EnableCutOrPaste; //textArea.SelectionManager.HasSomethingSelected; + } + } + + public bool EnableCopy { + get { + return true; //textArea.SelectionManager.HasSomethingSelected; + } + } + + public bool EnablePaste { + get { + try { + return Clipboard.ContainsText(); + } catch (ExternalException) { + return false; + } + } + } + + public bool EnableDelete { + get { + return textArea.SelectionManager.HasSomethingSelected && textArea.EnableCutOrPaste; + } + } + + public bool EnableSelectAll { + get { + return true; + } + } + + public TextAreaClipboardHandler(TextArea textArea) + { + this.textArea = textArea; + textArea.SelectionManager.SelectionChanged += new EventHandler(DocumentSelectionChanged); + } + + void DocumentSelectionChanged(object sender, EventArgs e) + { +// ((DefaultWorkbench)WorkbenchSingleton.Workbench).UpdateToolbars(); + } + + string LineSelectedType + { + get { + return "MSDEVLineSelect"; // This is the type VS 2003 and 2005 use for flagging a whole line copy + } + } + + bool CopyTextToClipboard(string stringToCopy, bool asLine) + { + if (stringToCopy.Length > 0) { + DataObject dataObject = new DataObject(); + dataObject.SetData(DataFormats.UnicodeText, true, stringToCopy); + if (asLine) { + MemoryStream lineSelected = new MemoryStream(1); + lineSelected.WriteByte(1); + dataObject.SetData(LineSelectedType, false, lineSelected); + } + // Default has no highlighting, therefore we don't need RTF output + if (textArea.Document.HighlightingStrategy.Name != "Default") { + dataObject.SetData(DataFormats.Rtf, RtfWriter.GenerateRtf(textArea)); + } + OnCopyText(new CopyTextEventArgs(stringToCopy)); + + SafeSetClipboard(dataObject); + return true; + } else { + return false; + } + } + + // Code duplication: TextAreaClipboardHandler.cs also has SafeSetClipboard + [ThreadStatic] static int SafeSetClipboardDataVersion; + + static void SafeSetClipboard(object dataObject) + { + // Work around ExternalException bug. (SD2-426) + // Best reproducable inside Virtual PC. + int version = unchecked(++SafeSetClipboardDataVersion); + try { + Clipboard.SetDataObject(dataObject, true); + } catch (ExternalException) { + Timer timer = new Timer(); + timer.Interval = 100; + timer.Tick += delegate { + timer.Stop(); + timer.Dispose(); + if (SafeSetClipboardDataVersion == version) { + try { + Clipboard.SetDataObject(dataObject, true, 10, 50); + } catch (ExternalException) { } + } + }; + timer.Start(); + } + } + + bool CopyTextToClipboard(string stringToCopy) + { + return CopyTextToClipboard(stringToCopy, false); + } + + public void Cut(object sender, EventArgs e) + { + if (textArea.TextEditorProperties.UseCustomLine == true) { + if (textArea.SelectionManager.HasSomethingSelected) { + if (textArea.SelectionManager.SelectionIsReadonly) + return; + } else if (textArea.Document.CustomLineManager.IsReadOnly(textArea.Caret.Line, false) == true) + return; + } + if (CopyTextToClipboard(textArea.SelectionManager.SelectedText)) { + // Remove text + textArea.BeginUpdate(); + textArea.Caret.Position = textArea.SelectionManager.SelectionCollection[0].StartPosition; + textArea.SelectionManager.RemoveSelectedText(); + textArea.EndUpdate(); + } else if (textArea.Document.TextEditorProperties.CutCopyWholeLine){ + // No text was selected, select and cut the entire line + int curLineNr = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); + LineSegment lineWhereCaretIs = textArea.Document.GetLineSegment(curLineNr); + string caretLineText = textArea.Document.GetText(lineWhereCaretIs.Offset, lineWhereCaretIs.TotalLength); + textArea.SelectionManager.SetSelection(textArea.Document.OffsetToPosition(lineWhereCaretIs.Offset), textArea.Document.OffsetToPosition(lineWhereCaretIs.Offset + lineWhereCaretIs.TotalLength)); + if (CopyTextToClipboard(caretLineText, true)) { + // remove line + textArea.BeginUpdate(); + textArea.Caret.Position = textArea.Document.OffsetToPosition(lineWhereCaretIs.Offset); + textArea.SelectionManager.RemoveSelectedText(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.PositionToEnd, new TextLocation(0, curLineNr))); + textArea.EndUpdate(); + } + } + } + + public void Copy(object sender, EventArgs e) + { + if (!CopyTextToClipboard(textArea.SelectionManager.SelectedText) && textArea.Document.TextEditorProperties.CutCopyWholeLine) { + // No text was selected, select the entire line, copy it, and then deselect + int curLineNr = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); + LineSegment lineWhereCaretIs = textArea.Document.GetLineSegment(curLineNr); + string caretLineText = textArea.Document.GetText(lineWhereCaretIs.Offset, lineWhereCaretIs.TotalLength); + CopyTextToClipboard(caretLineText, true); + } + } + + public void Paste(object sender, EventArgs e) + { + if (textArea.TextEditorProperties.UseCustomLine == true) { + if (textArea.SelectionManager.HasSomethingSelected) { + if (textArea.SelectionManager.SelectionIsReadonly) + return; + } else if (textArea.Document.CustomLineManager.IsReadOnly(textArea.Caret.Line, false) == true) + return; + } + // Clipboard.GetDataObject may throw an exception... + for (int i = 0;; i++) { + try { + IDataObject data = Clipboard.GetDataObject(); + bool fullLine = data.GetDataPresent(LineSelectedType); + if (data.GetDataPresent(DataFormats.UnicodeText)) { + string text = (string)data.GetData(DataFormats.UnicodeText); + if (text.Length > 0) { + textArea.Document.UndoStack.StartUndoGroup(); + if (textArea.SelectionManager.HasSomethingSelected) { + Delete(sender, e); + } + if (fullLine) { + int col = textArea.Caret.Column; + textArea.Caret.Column = 0; + textArea.InsertString(text); + textArea.Caret.Column = col; + } + else { + textArea.InsertString(text); + } + textArea.Document.UndoStack.EndUndoGroup(); + } + } + return; + } catch (ExternalException) { + // GetDataObject does not provide RetryTimes parameter + if (i > 5) throw; + } + } + } + + public void Delete(object sender, EventArgs e) + { + new ICSharpCode.TextEditor.Actions.Delete().Execute(textArea); + } + + public void SelectAll(object sender, EventArgs e) + { + new ICSharpCode.TextEditor.Actions.SelectWholeDocument().Execute(textArea); + } + + protected virtual void OnCopyText(CopyTextEventArgs e) + { + if (CopyText != null) { + CopyText(this, e); + } + } + + public event CopyTextEventHandler CopyText; + } + + public delegate void CopyTextEventHandler(object sender, CopyTextEventArgs e); + public class CopyTextEventArgs : EventArgs + { + string text; + + public string Text { + get { + return text; + } + } + + public CopyTextEventArgs(string text) + { + this.text = text; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaControl.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaControl.cs new file mode 100644 index 000000000..8e0157dc2 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaControl.cs @@ -0,0 +1,471 @@ +// +// +// +// +// $Revision: 2681 $ +// + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class paints the textarea. + /// + [ToolboxItem(false)] + public class TextAreaControl : Panel + { + TextEditorControl motherTextEditorControl; + + HRuler hRuler = null; + + VScrollBar vScrollBar = new VScrollBar(); + HScrollBar hScrollBar = new HScrollBar(); + TextArea textArea; + bool doHandleMousewheel = true; + bool disposed; + + public TextArea TextArea { + get { + return textArea; + } + } + + public SelectionManager SelectionManager { + get { + return textArea.SelectionManager; + } + } + + public Caret Caret { + get { + return textArea.Caret; + } + } + + [Browsable(false)] + public IDocument Document { + get { + if (motherTextEditorControl != null) + return motherTextEditorControl.Document; + return null; + } + } + + public ITextEditorProperties TextEditorProperties { + get { + if (motherTextEditorControl != null) + return motherTextEditorControl.TextEditorProperties; + return null; + } + } + + public VScrollBar VScrollBar { + get { + return vScrollBar; + } + } + + public HScrollBar HScrollBar { + get { + return hScrollBar; + } + } + + public bool DoHandleMousewheel { + get { + return doHandleMousewheel; + } + set { + doHandleMousewheel = value; + } + } + + public TextAreaControl(TextEditorControl motherTextEditorControl) + { + this.motherTextEditorControl = motherTextEditorControl; + + this.textArea = new TextArea(motherTextEditorControl, this); + Controls.Add(textArea); + + vScrollBar.ValueChanged += new EventHandler(VScrollBarValueChanged); + Controls.Add(this.vScrollBar); + + hScrollBar.ValueChanged += new EventHandler(HScrollBarValueChanged); + Controls.Add(this.hScrollBar); + ResizeRedraw = true; + + Document.TextContentChanged += DocumentTextContentChanged; + Document.DocumentChanged += AdjustScrollBarsOnDocumentChange; + Document.UpdateCommited += AdjustScrollBarsOnCommittedUpdate; + } + + protected override void Dispose(bool disposing) + { + if (disposing) { + if (!disposed) { + disposed = true; + Document.TextContentChanged -= DocumentTextContentChanged; + Document.DocumentChanged -= AdjustScrollBarsOnDocumentChange; + Document.UpdateCommited -= AdjustScrollBarsOnCommittedUpdate; + motherTextEditorControl = null; + if (vScrollBar != null) { + vScrollBar.Dispose(); + vScrollBar = null; + } + if (hScrollBar != null) { + hScrollBar.Dispose(); + hScrollBar = null; + } + if (hRuler != null) { + hRuler.Dispose(); + hRuler = null; + } + } + } + base.Dispose(disposing); + } + + void DocumentTextContentChanged(object sender, EventArgs e) + { + // after the text content is changed abruptly, we need to validate the + // caret position - otherwise the caret position is invalid for a short amount + // of time, which can break client code that expects that the caret position is always valid + Caret.ValidateCaretPos(); + } + + protected override void OnResize(System.EventArgs e) + { + base.OnResize(e); + ResizeTextArea(); + } + + public void ResizeTextArea() + { + int y = 0; + int h = 0; + if (hRuler != null) { + hRuler.Bounds = new Rectangle(0, + 0, + Width - SystemInformation.HorizontalScrollBarArrowWidth, + textArea.TextView.FontHeight); + + y = hRuler.Bounds.Bottom; + h = hRuler.Bounds.Height; + } + + textArea.Bounds = new Rectangle(0, y, + Width - SystemInformation.HorizontalScrollBarArrowWidth, + Height - SystemInformation.VerticalScrollBarArrowHeight - h); + SetScrollBarBounds(); + } + + public void SetScrollBarBounds() + { + vScrollBar.Bounds = new Rectangle(textArea.Bounds.Right, 0, SystemInformation.HorizontalScrollBarArrowWidth, Height - SystemInformation.VerticalScrollBarArrowHeight); + hScrollBar.Bounds = new Rectangle(0, + textArea.Bounds.Bottom, + Width - SystemInformation.HorizontalScrollBarArrowWidth, + SystemInformation.VerticalScrollBarArrowHeight); + } + + bool adjustScrollBarsOnNextUpdate; + Point scrollToPosOnNextUpdate; + + void AdjustScrollBarsOnDocumentChange(object sender, DocumentEventArgs e) + { + if (motherTextEditorControl.IsInUpdate == false) { + AdjustScrollBarsClearCache(); + AdjustScrollBars(); + } else { + adjustScrollBarsOnNextUpdate = true; + } + } + + void AdjustScrollBarsOnCommittedUpdate(object sender, EventArgs e) + { + if (motherTextEditorControl.IsInUpdate == false) { + if (!scrollToPosOnNextUpdate.IsEmpty) { + ScrollTo(scrollToPosOnNextUpdate.Y, scrollToPosOnNextUpdate.X); + } + if (adjustScrollBarsOnNextUpdate) { + AdjustScrollBarsClearCache(); + AdjustScrollBars(); + } + } + } + + int[] lineLengthCache; + const int LineLengthCacheAdditionalSize = 100; + + void AdjustScrollBarsClearCache() + { + if (lineLengthCache != null) { + if (lineLengthCache.Length < this.Document.TotalNumberOfLines + 2 * LineLengthCacheAdditionalSize) { + lineLengthCache = null; + } else { + Array.Clear(lineLengthCache, 0, lineLengthCache.Length); + } + } + } + + public void AdjustScrollBars() + { + try + { + adjustScrollBarsOnNextUpdate = false; + vScrollBar.Minimum = 0; + // number of visible lines in document (folding!) + vScrollBar.Maximum = textArea.MaxVScrollValue; + int max = 0; + + int firstLine = textArea.TextView.FirstVisibleLine; + int lastLine = this.Document.GetFirstLogicalLine(textArea.TextView.FirstPhysicalLine + textArea.TextView.VisibleLineCount); + if (lastLine >= this.Document.TotalNumberOfLines) + lastLine = this.Document.TotalNumberOfLines - 1; + + if (lineLengthCache == null || lineLengthCache.Length <= lastLine) { + lineLengthCache = new int[lastLine + LineLengthCacheAdditionalSize]; + } + + for (int lineNumber = firstLine; lineNumber <= lastLine; lineNumber++) { + LineSegment lineSegment = this.Document.GetLineSegment(lineNumber); + if (Document.FoldingManager.IsLineVisible(lineNumber)) { + if (lineLengthCache[lineNumber] > 0) { + max = Math.Max(max, lineLengthCache[lineNumber]); + } else { + int visualLength = textArea.TextView.GetVisualColumnFast(lineSegment, lineSegment.Length); + lineLengthCache[lineNumber] = Math.Max(1, visualLength); + max = Math.Max(max, visualLength); + } + } + } + hScrollBar.Minimum = 0; + hScrollBar.Maximum = (Math.Max(max + 20, textArea.TextView.VisibleColumnCount - 1)); + + vScrollBar.LargeChange = Math.Max(0, textArea.TextView.DrawingPosition.Height); + vScrollBar.SmallChange = Math.Max(0, textArea.TextView.FontHeight); + + hScrollBar.LargeChange = Math.Max(0, textArea.TextView.VisibleColumnCount - 1); + hScrollBar.SmallChange = Math.Max(0, (int)textArea.TextView.SpaceWidth); + } + catch + { + + } + } + + public void OptionsChanged() + { + textArea.OptionsChanged(); + + if (textArea.TextEditorProperties.ShowHorizontalRuler) { + if (hRuler == null) { + hRuler = new HRuler(textArea); + Controls.Add(hRuler); + ResizeTextArea(); + } else { + hRuler.Invalidate(); + } + } else { + if (hRuler != null) { + Controls.Remove(hRuler); + hRuler.Dispose(); + hRuler = null; + ResizeTextArea(); + } + } + + AdjustScrollBars(); + } + + void VScrollBarValueChanged(object sender, EventArgs e) + { + textArea.VirtualTop = new Point(textArea.VirtualTop.X, vScrollBar.Value); + textArea.Invalidate(); + AdjustScrollBars(); + } + + void HScrollBarValueChanged(object sender, EventArgs e) + { + textArea.VirtualTop = new Point(hScrollBar.Value * textArea.TextView.WideSpaceWidth, textArea.VirtualTop.Y); + textArea.Invalidate(); + } + + public void HandleMouseWheel(MouseEventArgs e) + { + if ((Control.ModifierKeys & Keys.Control) != 0 && TextEditorProperties.MouseWheelTextZoom) { + if (e.Delta > 0) { + motherTextEditorControl.Font = new Font(motherTextEditorControl.Font.Name, + motherTextEditorControl.Font.Size + 1); + + } else { + motherTextEditorControl.Font = new Font(motherTextEditorControl.Font.Name, + Math.Max(6, motherTextEditorControl.Font.Size - 1)); + + + } + } else { + int MAX_DELTA = 120; // basically it's constant now, but could be changed later by MS + int multiplier = Math.Abs(e.Delta) / MAX_DELTA; + + int newValue; + if (System.Windows.Forms.SystemInformation.MouseWheelScrollLines > 0) { + newValue = this.vScrollBar.Value - (TextEditorProperties.MouseWheelScrollDown ? 1 : -1) * Math.Sign(e.Delta) * System.Windows.Forms.SystemInformation.MouseWheelScrollLines * vScrollBar.SmallChange * multiplier; + } else { + newValue = this.vScrollBar.Value - (TextEditorProperties.MouseWheelScrollDown ? 1 : -1) * Math.Sign(e.Delta) * vScrollBar.LargeChange; + } + vScrollBar.Value = Math.Max(vScrollBar.Minimum, Math.Min(vScrollBar.Maximum, newValue)); + } + } + + protected override void OnMouseWheel(MouseEventArgs e) + { + base.OnMouseWheel(e); + if (DoHandleMousewheel) { + HandleMouseWheel(e); + } + } + + public void ScrollToCaret() + { + ScrollTo(textArea.Caret.Line, textArea.Caret.Column); + } + + public void ScrollTo(int line, int column) + { + if (motherTextEditorControl.IsInUpdate) { + scrollToPosOnNextUpdate = new Point(column, line); + return; + } else { + scrollToPosOnNextUpdate = Point.Empty; + } + + ScrollTo(line); + + int curCharMin = (int)(this.hScrollBar.Value - this.hScrollBar.Minimum); + int curCharMax = curCharMin + textArea.TextView.VisibleColumnCount; + + int pos = textArea.TextView.GetVisualColumn(line, column); + + if (textArea.TextView.VisibleColumnCount < 0) { + hScrollBar.Value = 0; + } else { + if (pos < curCharMin) { + hScrollBar.Value = (int)(Math.Max(0, pos - scrollMarginHeight)); + } else { + if (pos > curCharMax) { + hScrollBar.Value = (int)Math.Max(0, Math.Min(hScrollBar.Maximum, (pos - textArea.TextView.VisibleColumnCount + scrollMarginHeight))); + } + } + } + } + + int scrollMarginHeight = 3; + + /// + /// Ensure that is visible. + /// + public void ScrollTo(int line) + { + line = Math.Max(0, Math.Min(Document.TotalNumberOfLines - 1, line)); + line = Document.GetVisibleLine(line); + int curLineMin = textArea.TextView.FirstPhysicalLine; + if (textArea.TextView.LineHeightRemainder > 0) { + curLineMin ++; + } + + if (line - scrollMarginHeight + 3 < curLineMin) { + this.vScrollBar.Value = Math.Max(0, Math.Min(this.vScrollBar.Maximum, (line - scrollMarginHeight + 3) * textArea.TextView.FontHeight)) ; + VScrollBarValueChanged(this, EventArgs.Empty); + } else { + int curLineMax = curLineMin + this.textArea.TextView.VisibleLineCount; + if (line + scrollMarginHeight - 1 > curLineMax) { + if (this.textArea.TextView.VisibleLineCount == 1) { + this.vScrollBar.Value = Math.Max(0, Math.Min(this.vScrollBar.Maximum, (line - scrollMarginHeight - 1) * textArea.TextView.FontHeight)) ; + } else { + this.vScrollBar.Value = Math.Min(this.vScrollBar.Maximum, + (line - this.textArea.TextView.VisibleLineCount + scrollMarginHeight - 1)* textArea.TextView.FontHeight) ; + } + VScrollBarValueChanged(this, EventArgs.Empty); + } + } + } + + /// + /// Scroll so that the specified line is centered. + /// + /// Line to center view on + /// If this action would cause scrolling by less than or equal to + /// lines in any direction, don't scroll. + /// Use -1 to always center the view. + public void CenterViewOn(int line, int treshold) + { + line = Math.Max(0, Math.Min(Document.TotalNumberOfLines - 1, line)); + // convert line to visible line: + line = Document.GetVisibleLine(line); + // subtract half the visible line count + line -= textArea.TextView.VisibleLineCount / 2; + + int curLineMin = textArea.TextView.FirstPhysicalLine; + if (textArea.TextView.LineHeightRemainder > 0) { + curLineMin ++; + } + if (Math.Abs(curLineMin - line) > treshold) { + // scroll: + this.vScrollBar.Value = Math.Max(0, Math.Min(this.vScrollBar.Maximum, (line - scrollMarginHeight + 3) * textArea.TextView.FontHeight)) ; + VScrollBarValueChanged(this, EventArgs.Empty); + } + } + + public void JumpTo(int line) + { + line = Math.Min(line, Document.TotalNumberOfLines - 1); + string text = Document.GetText(Document.GetLineSegment(line)); + JumpTo(line, text.Length - text.TrimStart().Length); + } + + public void JumpTo(int line, int column) + { + textArea.Focus(); + textArea.SelectionManager.ClearSelection(); + textArea.Caret.Position = new TextLocation(column, line); + textArea.SetDesiredColumn(); + ScrollToCaret(); + } + + public event MouseEventHandler ShowContextMenu; + + protected override void WndProc(ref Message m) + { + if (m.Msg == 0x007B) { // handle WM_CONTEXTMENU + if (ShowContextMenu != null) { + long lParam = m.LParam.ToInt64(); + int x = unchecked((short)(lParam & 0xffff)); + int y = unchecked((short)((lParam & 0xffff0000) >> 16)); + if (x == -1 && y == -1) { + Point pos = Caret.ScreenPosition; + ShowContextMenu(this, new MouseEventArgs(MouseButtons.None, 0, pos.X, pos.Y + textArea.TextView.FontHeight, 0)); + } else { + Point pos = PointToClient(new Point(x, y)); + ShowContextMenu(this, new MouseEventArgs(MouseButtons.Right, 1, pos.X, pos.Y, 0)); + } + } + } + base.WndProc(ref m); + } + + protected override void OnEnter(EventArgs e) + { + // SD2-1072 - Make sure the caret line is valid if anyone + // has handlers for the Enter event. + Caret.ValidateCaretPos(); + base.OnEnter(e); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaDragDropHandler.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaDragDropHandler.cs new file mode 100644 index 000000000..f1b22c82f --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaDragDropHandler.cs @@ -0,0 +1,127 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + public class TextAreaDragDropHandler + { + TextArea textArea; + + public void Attach(TextArea textArea) + { + this.textArea = textArea; + textArea.AllowDrop = true; + + textArea.DragEnter += new DragEventHandler(OnDragEnter); + textArea.DragDrop += new DragEventHandler(OnDragDrop); + textArea.DragOver += new DragEventHandler(OnDragOver); + } + + static DragDropEffects GetDragDropEffect(DragEventArgs e) + { + if ((e.AllowedEffect & DragDropEffects.Move) > 0 && + (e.AllowedEffect & DragDropEffects.Copy) > 0) { + return (e.KeyState & 8) > 0 ? DragDropEffects.Copy : DragDropEffects.Move; + } else if ((e.AllowedEffect & DragDropEffects.Move) > 0) { + return DragDropEffects.Move; + } else if ((e.AllowedEffect & DragDropEffects.Copy) > 0) { + return DragDropEffects.Copy; + } + return DragDropEffects.None; + } + + protected void OnDragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(typeof(string))) { + e.Effect = GetDragDropEffect(e); + } + } + + + void InsertString(int offset, string str) + { + textArea.Document.Insert(offset, str); + + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, + textArea.Document.OffsetToPosition(offset), + textArea.Document.OffsetToPosition(offset + str.Length))); + textArea.Caret.Position = textArea.Document.OffsetToPosition(offset + str.Length); + textArea.Refresh(); + } + + protected void OnDragDrop(object sender, DragEventArgs e) + { + Point p = textArea.PointToClient(new Point(e.X, e.Y)); + + if (e.Data.GetDataPresent(typeof(string))) { + textArea.BeginUpdate(); + try { + int offset = textArea.Caret.Offset; + if (textArea.TextEditorProperties.UseCustomLine + && textArea.Document.CustomLineManager.IsReadOnly(textArea.Caret.Line, false)) + { + // prevent dragging text into readonly section + return; + } + textArea.Document.UndoStack.StartUndoGroup(); + if (e.Data.GetDataPresent(typeof(DefaultSelection))) { + ISelection sel = (ISelection)e.Data.GetData(typeof(DefaultSelection)); + if (sel.ContainsPosition(textArea.Caret.Position)) { + return; + } + if (GetDragDropEffect(e) == DragDropEffects.Move) { + if (textArea.TextEditorProperties.UseCustomLine + && textArea.Document.CustomLineManager.IsReadOnly(sel, false)) + { + // prevent dragging text out of readonly section + return; + } + int len = sel.Length; + textArea.Document.Remove(sel.Offset, len); + if (sel.Offset < offset) { + offset -= len; + } + } + } + textArea.SelectionManager.ClearSelection(); + InsertString(offset, (string)e.Data.GetData(typeof(string))); + textArea.Document.UndoStack.EndUndoGroup(); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + } finally { + textArea.EndUpdate(); + } + } + } + + protected void OnDragOver(object sender, DragEventArgs e) + { + if (!textArea.Focused) { + textArea.Focus(); + } + + Point p = textArea.PointToClient(new Point(e.X, e.Y)); + + if (textArea.TextView.DrawingPosition.Contains(p.X, p.Y)) { + TextLocation realmousepos= textArea.TextView.GetLogicalPosition(p.X - textArea.TextView.DrawingPosition.X, + p.Y - textArea.TextView.DrawingPosition.Y); + int lineNr = Math.Min(textArea.Document.TotalNumberOfLines - 1, Math.Max(0, realmousepos.Y)); + + textArea.Caret.Position = new TextLocation(realmousepos.X, lineNr); + textArea.SetDesiredColumn(); + if (e.Data.GetDataPresent(typeof(string))) { + e.Effect = GetDragDropEffect(e); + } + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaMouseHandler.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaMouseHandler.cs new file mode 100644 index 000000000..fbdc394ed --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaMouseHandler.cs @@ -0,0 +1,485 @@ +// +// +// +// +// $Revision: 2680 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class handles all mouse stuff for a textArea. + /// + public class TextAreaMouseHandler + { + TextArea textArea; + bool doubleclick = false; + bool clickedOnSelectedText = false; + + MouseButtons button; + + static readonly Point nilPoint = new Point(-1, -1); + Point mousedownpos = nilPoint; + Point lastmousedownpos = nilPoint; + + bool gotmousedown = false; + bool dodragdrop = false; + + public TextAreaMouseHandler(TextArea ttextArea) + { + textArea = ttextArea; + } + + public void Attach() + { + textArea.Click += new EventHandler(TextAreaClick); + textArea.MouseMove += new MouseEventHandler(TextAreaMouseMove); + + textArea.MouseDown += new MouseEventHandler(OnMouseDown); + textArea.DoubleClick += new EventHandler(OnDoubleClick); + textArea.MouseLeave += new EventHandler(OnMouseLeave); + textArea.MouseUp += new MouseEventHandler(OnMouseUp); + textArea.LostFocus += new EventHandler(TextAreaLostFocus); + textArea.ToolTipRequest += new ToolTipRequestEventHandler(OnToolTipRequest); + } + + void OnToolTipRequest(object sender, ToolTipRequestEventArgs e) + { + if (e.ToolTipShown) + return; + Point mousepos = e.MousePosition; + FoldMarker marker = textArea.TextView.GetFoldMarkerFromPosition(mousepos.X - textArea.TextView.DrawingPosition.X, + mousepos.Y - textArea.TextView.DrawingPosition.Y); + if (marker != null && marker.IsFolded) { + StringBuilder sb = new StringBuilder(marker.InnerText); + + // max 10 lines + int endLines = 0; + for (int i = 0; i < sb.Length; ++i) { + if (sb[i] == '\n') { + ++endLines; + if (endLines >= 10) { + sb.Remove(i + 1, sb.Length - i - 1); + sb.Append(Environment.NewLine); + sb.Append("..."); + break; + + } + } + } + sb.Replace("\t", " "); + e.ShowToolTip(sb.ToString()); + return; + } + + List markers = textArea.Document.MarkerStrategy.GetMarkers(e.LogicalPosition); + foreach (TextMarker tm in markers) { + if (tm.ToolTip != null) { + e.ShowToolTip(tm.ToolTip.Replace("\t", " ")); + return; + } + } + } + + void ShowHiddenCursorIfMovedOrLeft() + { + textArea.ShowHiddenCursor(!textArea.Focused || + !textArea.ClientRectangle.Contains(textArea.PointToClient(Cursor.Position))); + } + + void TextAreaLostFocus(object sender, EventArgs e) + { + // The call to ShowHiddenCursorIfMovedOrLeft is delayed + // until pending messages have been processed + // so that it can properly detect whether the TextArea + // has really lost focus. + // For example, the CodeCompletionWindow gets focus when it is shown, + // but immediately gives back focus to the TextArea. + textArea.BeginInvoke(new MethodInvoker(ShowHiddenCursorIfMovedOrLeft)); + } + + void OnMouseLeave(object sender, EventArgs e) + { + ShowHiddenCursorIfMovedOrLeft(); + gotmousedown = false; + mousedownpos = nilPoint; + } + + void OnMouseUp(object sender, MouseEventArgs e) + { + textArea.SelectionManager.selectFrom.where = WhereFrom.None; + gotmousedown = false; + mousedownpos = nilPoint; + } + + void TextAreaClick(object sender, EventArgs e) + { + Point mousepos; + mousepos = textArea.mousepos; + + if (dodragdrop) + { + return; + } + + if (clickedOnSelectedText && textArea.TextView.DrawingPosition.Contains(mousepos.X, mousepos.Y)) + { + textArea.SelectionManager.ClearSelection(); + + TextLocation clickPosition = textArea.TextView.GetLogicalPosition( + mousepos.X - textArea.TextView.DrawingPosition.X, + mousepos.Y - textArea.TextView.DrawingPosition.Y); + textArea.Caret.Position = clickPosition; + textArea.SetDesiredColumn(); + } + } + + + void TextAreaMouseMove(object sender, MouseEventArgs e) + { + textArea.mousepos = e.Location; + + // honour the starting selection strategy + switch (textArea.SelectionManager.selectFrom.where) + { + case WhereFrom.Gutter: + ExtendSelectionToMouse(); + return; + + case WhereFrom.TArea: + break; + + } + textArea.ShowHiddenCursor(false); + if (dodragdrop) { + dodragdrop = false; + return; + } + + doubleclick = false; + textArea.mousepos = new Point(e.X, e.Y); + + if (clickedOnSelectedText) { + if (Math.Abs(mousedownpos.X - e.X) >= SystemInformation.DragSize.Width / 2 || + Math.Abs(mousedownpos.Y - e.Y) >= SystemInformation.DragSize.Height / 2) + { + clickedOnSelectedText = false; + ISelection selection = textArea.SelectionManager.GetSelectionAt(textArea.Caret.Offset); + if (selection != null) { + string text = selection.SelectedText; + if (text != null && text.Length > 0) { + DataObject dataObject = new DataObject (); + dataObject.SetData(DataFormats.UnicodeText, true, text); + dataObject.SetData(selection); + dodragdrop = true; + textArea.DoDragDrop(dataObject, DragDropEffects.All); + } + } + } + + return; + } + + if (e.Button == MouseButtons.Left) { + if (gotmousedown && textArea.SelectionManager.selectFrom.where == WhereFrom.TArea) + { + ExtendSelectionToMouse(); + } + } + } + + void ExtendSelectionToMouse() + { + Point mousepos; + mousepos = textArea.mousepos; + TextLocation realmousepos = textArea.TextView.GetLogicalPosition( + Math.Max(0, mousepos.X - textArea.TextView.DrawingPosition.X), + mousepos.Y - textArea.TextView.DrawingPosition.Y); + int y = realmousepos.Y; + realmousepos = textArea.Caret.ValidatePosition(realmousepos); + TextLocation oldPos = textArea.Caret.Position; + if (oldPos == realmousepos && textArea.SelectionManager.selectFrom.where != WhereFrom.Gutter) + { + return; + } + + // the selection is from the gutter + if (textArea.SelectionManager.selectFrom.where == WhereFrom.Gutter) { + if(realmousepos.Y < textArea.SelectionManager.SelectionStart.Y) { + // the selection has moved above the startpoint + textArea.Caret.Position = new TextLocation(0, realmousepos.Y); + } else { + // the selection has moved below the startpoint + textArea.Caret.Position = textArea.SelectionManager.NextValidPosition(realmousepos.Y); + } + } else { + textArea.Caret.Position = realmousepos; + } + + // moves selection across whole words for double-click initiated selection + if (!minSelection.IsEmpty && textArea.SelectionManager.SelectionCollection.Count > 0 && textArea.SelectionManager.selectFrom.where == WhereFrom.TArea) { + // Extend selection when selection was started with double-click + ISelection selection = textArea.SelectionManager.SelectionCollection[0]; + TextLocation min = textArea.SelectionManager.GreaterEqPos(minSelection, maxSelection) ? maxSelection : minSelection; + TextLocation max = textArea.SelectionManager.GreaterEqPos(minSelection, maxSelection) ? minSelection : maxSelection; + if (textArea.SelectionManager.GreaterEqPos(max, realmousepos) && textArea.SelectionManager.GreaterEqPos(realmousepos, min)) { + textArea.SelectionManager.SetSelection(min, max); + } else if (textArea.SelectionManager.GreaterEqPos(max, realmousepos)) { + int moff = textArea.Document.PositionToOffset(realmousepos); + min = textArea.Document.OffsetToPosition(FindWordStart(textArea.Document, moff)); + textArea.SelectionManager.SetSelection(min, max); + } else { + int moff = textArea.Document.PositionToOffset(realmousepos); + max = textArea.Document.OffsetToPosition(FindWordEnd(textArea.Document, moff)); + textArea.SelectionManager.SetSelection(min, max); + } + } else { + textArea.SelectionManager.ExtendSelection(oldPos, textArea.Caret.Position); + } + textArea.SetDesiredColumn(); + } + + void DoubleClickSelectionExtend() + { + Point mousepos; + mousepos = textArea.mousepos; + + textArea.SelectionManager.ClearSelection(); + if (textArea.TextView.DrawingPosition.Contains(mousepos.X, mousepos.Y)) + { + FoldMarker marker = textArea.TextView.GetFoldMarkerFromPosition(mousepos.X - textArea.TextView.DrawingPosition.X, + mousepos.Y - textArea.TextView.DrawingPosition.Y); + if (marker != null && marker.IsFolded) { + marker.IsFolded = false; + textArea.MotherTextAreaControl.AdjustScrollBars(); + } + if (textArea.Caret.Offset < textArea.Document.TextLength) { + switch (textArea.Document.GetCharAt(textArea.Caret.Offset)) { + case '"': + if (textArea.Caret.Offset < textArea.Document.TextLength) { + int next = FindNext(textArea.Document, textArea.Caret.Offset + 1, '"'); + minSelection = textArea.Caret.Position; + if (next > textArea.Caret.Offset && next < textArea.Document.TextLength) + next += 1; + maxSelection = textArea.Document.OffsetToPosition(next); + } + break; + default: + minSelection = textArea.Document.OffsetToPosition(FindWordStart(textArea.Document, textArea.Caret.Offset)); + maxSelection = textArea.Document.OffsetToPosition(FindWordEnd(textArea.Document, textArea.Caret.Offset)); + break; + + } + textArea.Caret.Position = maxSelection; + textArea.SelectionManager.ExtendSelection(minSelection, maxSelection); + } + + if (textArea.SelectionManager.selectionCollection.Count > 0) { + ISelection selection = textArea.SelectionManager.selectionCollection[0]; + + selection.StartPosition = minSelection; + selection.EndPosition = maxSelection; + textArea.SelectionManager.SelectionStart = minSelection; + } + + // after a double-click selection, the caret is placed correctly, + // but it is not positioned internally. The effect is when the cursor + // is moved up or down a line, the caret will take on the column first + // clicked on for the double-click + textArea.SetDesiredColumn(); + + // HACK WARNING !!! + // must refresh here, because when a error tooltip is showed and the underlined + // code is double clicked the textArea don't update corrctly, updateline doesn't + // work ... but the refresh does. + // Mike + textArea.Refresh(); + } + } + + void OnMouseDown(object sender, MouseEventArgs e) + { + Point mousepos; + textArea.mousepos = e.Location; + mousepos = e.Location; + + if (dodragdrop) + { + return; + } + + if (doubleclick) { + doubleclick = false; + return; + } + + if (textArea.TextView.DrawingPosition.Contains(mousepos.X, mousepos.Y)) { + gotmousedown = true; + textArea.SelectionManager.selectFrom.where = WhereFrom.TArea; + button = e.Button; + + // double-click + if (button == MouseButtons.Left && e.Clicks == 2) { + int deltaX = Math.Abs(lastmousedownpos.X - e.X); + int deltaY = Math.Abs(lastmousedownpos.Y - e.Y); + if (deltaX <= SystemInformation.DoubleClickSize.Width && + deltaY <= SystemInformation.DoubleClickSize.Height) { + DoubleClickSelectionExtend(); + lastmousedownpos = new Point(e.X, e.Y); + + if (textArea.SelectionManager.selectFrom.where == WhereFrom.Gutter) { + if (!minSelection.IsEmpty && !maxSelection.IsEmpty && textArea.SelectionManager.SelectionCollection.Count > 0) { + textArea.SelectionManager.SelectionCollection[0].StartPosition = minSelection; + textArea.SelectionManager.SelectionCollection[0].EndPosition = maxSelection; + textArea.SelectionManager.SelectionStart = minSelection; + + minSelection = TextLocation.Empty; + maxSelection = TextLocation.Empty; + } + } + return; + } + } + minSelection = TextLocation.Empty; + maxSelection = TextLocation.Empty; + + lastmousedownpos = mousedownpos = new Point(e.X, e.Y); + + if (button == MouseButtons.Left) { + FoldMarker marker = textArea.TextView.GetFoldMarkerFromPosition(mousepos.X - textArea.TextView.DrawingPosition.X, + mousepos.Y - textArea.TextView.DrawingPosition.Y); + if (marker != null && marker.IsFolded) { + if (textArea.SelectionManager.HasSomethingSelected) { + clickedOnSelectedText = true; + } + + textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.TextView.Document, new TextLocation(marker.StartColumn, marker.StartLine), new TextLocation(marker.EndColumn, marker.EndLine))); + textArea.Focus(); + return; + } + + if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) { + ExtendSelectionToMouse(); + } else { + TextLocation realmousepos = textArea.TextView.GetLogicalPosition(mousepos.X - textArea.TextView.DrawingPosition.X, mousepos.Y - textArea.TextView.DrawingPosition.Y); + clickedOnSelectedText = false; + + int offset = textArea.Document.PositionToOffset(realmousepos); + + if (textArea.SelectionManager.HasSomethingSelected && + textArea.SelectionManager.IsSelected(offset)) { + clickedOnSelectedText = true; + } else { + textArea.SelectionManager.ClearSelection(); + if (mousepos.Y > 0 && mousepos.Y < textArea.TextView.DrawingPosition.Height) { + TextLocation pos = new TextLocation(); + pos.Y = Math.Min(textArea.Document.TotalNumberOfLines - 1, realmousepos.Y); + pos.X = realmousepos.X; + textArea.Caret.Position = pos; + textArea.SetDesiredColumn(); + } + } + } + } else if (button == MouseButtons.Right) { + // Rightclick sets the cursor to the click position unless + // the previous selection was clicked + TextLocation realmousepos = textArea.TextView.GetLogicalPosition(mousepos.X - textArea.TextView.DrawingPosition.X, mousepos.Y - textArea.TextView.DrawingPosition.Y); + int offset = textArea.Document.PositionToOffset(realmousepos); + if (!textArea.SelectionManager.HasSomethingSelected || + !textArea.SelectionManager.IsSelected(offset)) + { + textArea.SelectionManager.ClearSelection(); + if (mousepos.Y > 0 && mousepos.Y < textArea.TextView.DrawingPosition.Height) { + TextLocation pos = new TextLocation(); + pos.Y = Math.Min(textArea.Document.TotalNumberOfLines - 1, realmousepos.Y); + pos.X = realmousepos.X; + textArea.Caret.Position = pos; + textArea.SetDesiredColumn(); + } + } + } + } + textArea.Focus(); + } + + int FindNext(IDocument document, int offset, char ch) + { + LineSegment line = document.GetLineSegmentForOffset(offset); + int endPos = line.Offset + line.Length; + + while (offset < endPos && document.GetCharAt(offset) != ch) { + ++offset; + } + return offset; + } + + bool IsSelectableChar(char ch) + { + return Char.IsLetterOrDigit(ch) || ch=='_'; + } + + int FindWordStart(IDocument document, int offset) + { + LineSegment line = document.GetLineSegmentForOffset(offset); + + if (offset > 0 && Char.IsWhiteSpace(document.GetCharAt(offset - 1)) && Char.IsWhiteSpace(document.GetCharAt(offset))) { + while (offset > line.Offset && Char.IsWhiteSpace(document.GetCharAt(offset - 1))) { + --offset; + } + } else if (IsSelectableChar(document.GetCharAt(offset)) || (offset > 0 && Char.IsWhiteSpace(document.GetCharAt(offset)) && IsSelectableChar(document.GetCharAt(offset - 1)))) { + while (offset > line.Offset && IsSelectableChar(document.GetCharAt(offset - 1))) { + --offset; + } + } else { + if (offset > 0 && !Char.IsWhiteSpace(document.GetCharAt(offset - 1)) && !IsSelectableChar(document.GetCharAt(offset - 1)) ) { + return Math.Max(0, offset - 1); + } + } + return offset; + } + + int FindWordEnd(IDocument document, int offset) + { + LineSegment line = document.GetLineSegmentForOffset(offset); + int endPos = line.Offset + line.Length; + offset = Math.Min(offset, endPos - 1); + + if (IsSelectableChar(document.GetCharAt(offset))) { + while (offset < endPos && IsSelectableChar(document.GetCharAt(offset))) { + ++offset; + } + } else if (Char.IsWhiteSpace(document.GetCharAt(offset))) { + if (offset > 0 && Char.IsWhiteSpace(document.GetCharAt(offset - 1))) { + while (offset < endPos && Char.IsWhiteSpace(document.GetCharAt(offset))) { + ++offset; + } + } + } else { + return Math.Max(0, offset + 1); + } + + return offset; + } + TextLocation minSelection = TextLocation.Empty; + TextLocation maxSelection = TextLocation.Empty; + + void OnDoubleClick(object sender, System.EventArgs e) + { + if (dodragdrop) { + return; + } + + textArea.SelectionManager.selectFrom.where = WhereFrom.TArea; + doubleclick = true; + + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaUpdate.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaUpdate.cs new file mode 100644 index 000000000..dd1999083 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextAreaUpdate.cs @@ -0,0 +1,85 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor +{ + /// + /// This enum describes all implemented request types + /// + public enum TextAreaUpdateType { + WholeTextArea, + SingleLine, + SinglePosition, + PositionToLineEnd, + PositionToEnd, + LinesBetween + } + + /// + /// This class is used to request an update of the textarea + /// + public class TextAreaUpdate + { + TextLocation position; + TextAreaUpdateType type; + + public TextAreaUpdateType TextAreaUpdateType { + get { + return type; + } + } + + public TextLocation Position { + get { + return position; + } + } + + /// + /// Creates a new instance of + /// + public TextAreaUpdate(TextAreaUpdateType type) + { + this.type = type; + } + + /// + /// Creates a new instance of + /// + public TextAreaUpdate(TextAreaUpdateType type, TextLocation position) + { + this.type = type; + this.position = position; + } + + /// + /// Creates a new instance of + /// + public TextAreaUpdate(TextAreaUpdateType type, int startLine, int endLine) + { + this.type = type; + this.position = new TextLocation(startLine, endLine); + } + + /// + /// Creates a new instance of + /// + public TextAreaUpdate(TextAreaUpdateType type, int singleLine) + { + this.type = type; + this.position = new TextLocation(0, singleLine); + } + + public override string ToString() + { + return String.Format("[TextAreaUpdate: Type={0}, Position={1}]", type, position); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControl.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControl.cs new file mode 100644 index 000000000..a40b7d75a --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControl.cs @@ -0,0 +1,393 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Printing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class is used for a basic text area control + /// + [ToolboxBitmap("ICSharpCode.TextEditor.Resources.TextEditorControl.bmp")] + [ToolboxItem(true)] + public class TextEditorControl : TextEditorControlBase + { + protected Panel textAreaPanel = new Panel(); + TextAreaControl primaryTextArea; + Splitter textAreaSplitter = null; + TextAreaControl secondaryTextArea = null; + + PrintDocument printDocument = null; + + [Browsable(false)] + public PrintDocument PrintDocument { + get { + if (printDocument == null) { + printDocument = new PrintDocument(); + printDocument.BeginPrint += new PrintEventHandler(this.BeginPrint); + printDocument.PrintPage += new PrintPageEventHandler(this.PrintPage); + } + return printDocument; + } + } + + TextAreaControl activeTextAreaControl; + + public override TextAreaControl ActiveTextAreaControl { + get { + return activeTextAreaControl; + } + } + + protected void SetActiveTextAreaControl(TextAreaControl value) + { + if (activeTextAreaControl != value) { + activeTextAreaControl = value; + + if (ActiveTextAreaControlChanged != null) { + ActiveTextAreaControlChanged(this, EventArgs.Empty); + } + } + } + + public event EventHandler ActiveTextAreaControlChanged; + + public TextEditorControl() + { + SetStyle(ControlStyles.ContainerControl, true); + + textAreaPanel.Dock = DockStyle.Fill; + + Document = (new DocumentFactory()).CreateDocument(); + Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(); + + primaryTextArea = new TextAreaControl(this); + activeTextAreaControl = primaryTextArea; + primaryTextArea.TextArea.GotFocus += delegate { + SetActiveTextAreaControl(primaryTextArea); + }; + primaryTextArea.Dock = DockStyle.Fill; + textAreaPanel.Controls.Add(primaryTextArea); + InitializeTextAreaControl(primaryTextArea); + Controls.Add(textAreaPanel); + ResizeRedraw = true; + Document.UpdateCommited += new EventHandler(CommitUpdateRequested); + OptionsChanged(); + } + + protected virtual void InitializeTextAreaControl(TextAreaControl newControl) + { + } + + public override void OptionsChanged() + { + primaryTextArea.OptionsChanged(); + if (secondaryTextArea != null) { + secondaryTextArea.OptionsChanged(); + } + } + + public void Split() + { + if (secondaryTextArea == null) { + secondaryTextArea = new TextAreaControl(this); + secondaryTextArea.Dock = DockStyle.Bottom; + secondaryTextArea.Height = Height / 2; + + secondaryTextArea.TextArea.GotFocus += delegate { + SetActiveTextAreaControl(secondaryTextArea); + }; + + textAreaSplitter = new Splitter(); + textAreaSplitter.BorderStyle = BorderStyle.FixedSingle ; + textAreaSplitter.Height = 8; + textAreaSplitter.Dock = DockStyle.Bottom; + textAreaPanel.Controls.Add(textAreaSplitter); + textAreaPanel.Controls.Add(secondaryTextArea); + InitializeTextAreaControl(secondaryTextArea); + secondaryTextArea.OptionsChanged(); + } else { + SetActiveTextAreaControl(primaryTextArea); + + textAreaPanel.Controls.Remove(secondaryTextArea); + textAreaPanel.Controls.Remove(textAreaSplitter); + + secondaryTextArea.Dispose(); + textAreaSplitter.Dispose(); + secondaryTextArea = null; + textAreaSplitter = null; + } + } + + [Browsable(false)] + public bool EnableUndo { + get { + return Document.UndoStack.CanUndo; + } + } + + [Browsable(false)] + public bool EnableRedo { + get { + return Document.UndoStack.CanRedo; + } + } + + public void Undo() + { + if (Document.ReadOnly) { + return; + } + if (Document.UndoStack.CanUndo) { + BeginUpdate(); + Document.UndoStack.Undo(); + + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + this.primaryTextArea.TextArea.UpdateMatchingBracket(); + if (secondaryTextArea != null) { + this.secondaryTextArea.TextArea.UpdateMatchingBracket(); + } + EndUpdate(); + } + } + + public void Redo() + { + if (Document.ReadOnly) { + return; + } + if (Document.UndoStack.CanRedo) { + BeginUpdate(); + Document.UndoStack.Redo(); + + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea)); + this.primaryTextArea.TextArea.UpdateMatchingBracket(); + if (secondaryTextArea != null) { + this.secondaryTextArea.TextArea.UpdateMatchingBracket(); + } + EndUpdate(); + } + } + + public void SetHighlighting(string name) + { + Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(name); + } + + protected override void Dispose(bool disposing) + { + if (disposing) { + if (printDocument != null) { + printDocument.BeginPrint -= new PrintEventHandler(this.BeginPrint); + printDocument.PrintPage -= new PrintPageEventHandler(this.PrintPage); + printDocument = null; + } + Document.UndoStack.ClearAll(); + Document.UpdateCommited -= new EventHandler(CommitUpdateRequested); + if (textAreaPanel != null) { + if (secondaryTextArea != null) { + secondaryTextArea.Dispose(); + textAreaSplitter.Dispose(); + secondaryTextArea = null; + textAreaSplitter = null; + } + if (primaryTextArea != null) { + primaryTextArea.Dispose(); + } + textAreaPanel.Dispose(); + textAreaPanel = null; + } + } + base.Dispose(disposing); + } + + #region Update Methods + public override void EndUpdate() + { + base.EndUpdate(); + Document.CommitUpdate(); + } + + void CommitUpdateRequested(object sender, EventArgs e) + { + if (IsInUpdate) { + return; + } + foreach (TextAreaUpdate update in Document.UpdateQueue) { + switch (update.TextAreaUpdateType) { + case TextAreaUpdateType.PositionToEnd: + this.primaryTextArea.TextArea.UpdateToEnd(update.Position.Y); + if (this.secondaryTextArea != null) { + this.secondaryTextArea.TextArea.UpdateToEnd(update.Position.Y); + } + break; + case TextAreaUpdateType.PositionToLineEnd: + case TextAreaUpdateType.SingleLine: + this.primaryTextArea.TextArea.UpdateLine(update.Position.Y); + if (this.secondaryTextArea != null) { + this.secondaryTextArea.TextArea.UpdateLine(update.Position.Y); + } + break; + case TextAreaUpdateType.SinglePosition: + this.primaryTextArea.TextArea.UpdateLine(update.Position.Y, update.Position.X, update.Position.X); + if (this.secondaryTextArea != null) { + this.secondaryTextArea.TextArea.UpdateLine(update.Position.Y, update.Position.X, update.Position.X); + } + break; + case TextAreaUpdateType.LinesBetween: + this.primaryTextArea.TextArea.UpdateLines(update.Position.X, update.Position.Y); + if (this.secondaryTextArea != null) { + this.secondaryTextArea.TextArea.UpdateLines(update.Position.X, update.Position.Y); + } + break; + case TextAreaUpdateType.WholeTextArea: + this.primaryTextArea.TextArea.Invalidate(); + if (this.secondaryTextArea != null) { + this.secondaryTextArea.TextArea.Invalidate(); + } + break; + } + } + Document.UpdateQueue.Clear(); +// this.primaryTextArea.TextArea.Update(); +// if (this.secondaryTextArea != null) { +// this.secondaryTextArea.TextArea.Update(); +// } + } + #endregion + + #region Printing routines + int curLineNr = 0; + float curTabIndent = 0; + StringFormat printingStringFormat; + + void BeginPrint(object sender, PrintEventArgs ev) + { + curLineNr = 0; + printingStringFormat = (StringFormat)System.Drawing.StringFormat.GenericTypographic.Clone(); + + // 100 should be enough for everyone ...err ? + float[] tabStops = new float[100]; + for (int i = 0; i < tabStops.Length; ++i) { + tabStops[i] = TabIndent * primaryTextArea.TextArea.TextView.WideSpaceWidth; + } + + printingStringFormat.SetTabStops(0, tabStops); + } + + void Advance(ref float x, ref float y, float maxWidth, float size, float fontHeight) + { + if (x + size < maxWidth) { + x += size; + } else { + x = curTabIndent; + y += fontHeight; + } + } + + // btw. I hate source code duplication ... but this time I don't care !!!! + float MeasurePrintingHeight(Graphics g, LineSegment line, float maxWidth) + { + float xPos = 0; + float yPos = 0; + float fontHeight = Font.GetHeight(g); +// bool gotNonWhitespace = false; + curTabIndent = 0; + FontContainer fontContainer = TextEditorProperties.FontContainer; + foreach (TextWord word in line.Words) { + switch (word.Type) { + case TextWordType.Space: + Advance(ref xPos, ref yPos, maxWidth, primaryTextArea.TextArea.TextView.SpaceWidth, fontHeight); +// if (!gotNonWhitespace) { +// curTabIndent = xPos; +// } + break; + case TextWordType.Tab: + Advance(ref xPos, ref yPos, maxWidth, TabIndent * primaryTextArea.TextArea.TextView.WideSpaceWidth, fontHeight); +// if (!gotNonWhitespace) { +// curTabIndent = xPos; +// } + break; + case TextWordType.Word: +// if (!gotNonWhitespace) { +// gotNonWhitespace = true; +// curTabIndent += TabIndent * primaryTextArea.TextArea.TextView.GetWidth(' '); +// } + SizeF drawingSize = g.MeasureString(word.Word, word.GetFont(fontContainer), new SizeF(maxWidth, fontHeight * 100), printingStringFormat); + Advance(ref xPos, ref yPos, maxWidth, drawingSize.Width, fontHeight); + break; + } + } + return yPos + fontHeight; + } + + void DrawLine(Graphics g, LineSegment line, float yPos, RectangleF margin) + { + float xPos = 0; + float fontHeight = Font.GetHeight(g); + bool gotNonWhitespace = false; + curTabIndent = 0 ; + + FontContainer fontContainer = TextEditorProperties.FontContainer; + foreach (TextWord word in line.Words) { + switch (word.Type) { + case TextWordType.Space: + Advance(ref xPos, ref yPos, margin.Width, primaryTextArea.TextArea.TextView.SpaceWidth, fontHeight); + if (!gotNonWhitespace) { + curTabIndent = xPos; + } + break; + case TextWordType.Tab: + Advance(ref xPos, ref yPos, margin.Width, TabIndent * primaryTextArea.TextArea.TextView.WideSpaceWidth, fontHeight); + if (!gotNonWhitespace) { + curTabIndent = xPos; + } + break; + case TextWordType.Word: + if (!gotNonWhitespace) { + gotNonWhitespace = true; +// curTabIndent += TabIndent * primaryTextArea.TextArea.TextView.GetWidth(' '); + } + g.DrawString(word.Word, word.GetFont(fontContainer), BrushRegistry.GetBrush(word.Color), xPos + margin.X, yPos); + SizeF drawingSize = g.MeasureString(word.Word, word.GetFont(fontContainer), new SizeF(margin.Width, fontHeight * 100), printingStringFormat); + Advance(ref xPos, ref yPos, margin.Width, drawingSize.Width, fontHeight); + break; + } + } + } + + void PrintPage(object sender, PrintPageEventArgs ev) + { + Graphics g = ev.Graphics; + float yPos = ev.MarginBounds.Top; + + while (curLineNr < Document.TotalNumberOfLines) { + LineSegment curLine = Document.GetLineSegment(curLineNr); + if (curLine.Words != null) { + float drawingHeight = MeasurePrintingHeight(g, curLine, ev.MarginBounds.Width); + if (drawingHeight + yPos > ev.MarginBounds.Bottom) { + break; + } + + DrawLine(g, curLine, yPos, ev.MarginBounds); + yPos += drawingHeight; + } + ++curLineNr; + } + + // If more lines exist, print another page. + ev.HasMorePages = curLineNr < Document.TotalNumberOfLines; + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControlBase.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControlBase.cs new file mode 100644 index 000000000..34b4f53a0 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextEditorControlBase.cs @@ -0,0 +1,757 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Text; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Actions; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class is used for a basic text area control + /// + [ToolboxItem(false)] + public abstract class TextEditorControlBase : UserControl + { + string currentFileName = null; + int updateLevel = 0; + IDocument document; + + /// + /// This hashtable contains all editor keys, where + /// the key is the key combination and the value the + /// action. + /// + protected Dictionary editactions = new Dictionary(); + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public ITextEditorProperties TextEditorProperties { + get { + return document.TextEditorProperties; + } + set { + document.TextEditorProperties = value; + OptionsChanged(); + } + } + + Encoding encoding; + + /// + /// Current file's character encoding + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public Encoding Encoding { + get { + if (encoding == null) + return TextEditorProperties.Encoding; + return encoding; + } + set { + encoding = value; + } + } + + /// + /// The current file name + /// + [Browsable(false)] + [ReadOnly(true)] + public string FileName { + get { + return currentFileName; + } + set { + if (currentFileName != value) { + currentFileName = value; + OnFileNameChanged(EventArgs.Empty); + } + } + } + + /// + /// The current document + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public IDocument Document { + get { + return document; + } + set { + if (value == null) + throw new ArgumentNullException("value"); + if (document != null) { + document.DocumentChanged -= OnDocumentChanged; + } + document = value; + document.UndoStack.TextEditorControl = this; + document.DocumentChanged += OnDocumentChanged; + } + } + + void OnDocumentChanged(object sender, EventArgs e) + { + OnTextChanged(e); + } + + [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] + [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))] + public override string Text { + get { + return Document.TextContent; + } + set { + Document.TextContent = value; + } + } + + [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)] + public new event EventHandler TextChanged + { + add { base.TextChanged += value; } + remove { base.TextChanged -= value; } + } + + static Font ParseFont(string font) + { + string[] descr = font.Split(new char[]{',', '='}); + return new Font(descr[1], Single.Parse(descr[3])); + } + + /// + /// If set to true the contents can't be altered. + /// + [Browsable(false)] + [ReadOnly(true)] + public bool IsReadOnly { + get { + return Document.ReadOnly; + } + set { + Document.ReadOnly = value; + } + } + + /// + /// true, if the textarea is updating it's status, while + /// it updates it status no redraw operation occurs. + /// + [Browsable(false)] + public bool IsInUpdate { + get { + return updateLevel > 0; + } + } + + /// + /// supposedly this is the way to do it according to .NET docs, + /// as opposed to setting the size in the constructor + /// + protected override Size DefaultSize { + get { + return new Size(100, 100); + } + } + + #region Document Properties + /// + /// If true spaces are shown in the textarea + /// + [Category("Appearance")] + [DefaultValue(false)] + [Description("If true spaces are shown in the textarea")] + public bool ShowSpaces { + get { + return document.TextEditorProperties.ShowSpaces; + } + set { + document.TextEditorProperties.ShowSpaces = value; + OptionsChanged(); + } + } + + /// + /// Specifies the quality of text rendering (whether to use hinting and/or anti-aliasing). + /// + [Category("Appearance")] + [DefaultValue(TextRenderingHint.SystemDefault)] + [Description("Specifies the quality of text rendering (whether to use hinting and/or anti-aliasing).")] + public TextRenderingHint TextRenderingHint { + get { + return document.TextEditorProperties.TextRenderingHint; + } + set { + document.TextEditorProperties.TextRenderingHint = value; + OptionsChanged(); + } + } + + /// + /// If true tabs are shown in the textarea + /// + [Category("Appearance")] + [DefaultValue(false)] + [Description("If true tabs are shown in the textarea")] + public bool ShowTabs { + get { + return document.TextEditorProperties.ShowTabs; + } + set { + document.TextEditorProperties.ShowTabs = value; + OptionsChanged(); + } + } + + /// + /// If true EOL markers are shown in the textarea + /// + [Category("Appearance")] + [DefaultValue(false)] + [Description("If true EOL markers are shown in the textarea")] + public bool ShowEOLMarkers { + get { + return document.TextEditorProperties.ShowEOLMarker; + } + set { + document.TextEditorProperties.ShowEOLMarker = value; + OptionsChanged(); + } + } + + /// + /// If true the horizontal ruler is shown in the textarea + /// + [Category("Appearance")] + [DefaultValue(false)] + [Description("If true the horizontal ruler is shown in the textarea")] + public bool ShowHRuler { + get { + return document.TextEditorProperties.ShowHorizontalRuler; + } + set { + document.TextEditorProperties.ShowHorizontalRuler = value; + OptionsChanged(); + } + } + + /// + /// If true the vertical ruler is shown in the textarea + /// + [Category("Appearance")] + [DefaultValue(true)] + [Description("If true the vertical ruler is shown in the textarea")] + public bool ShowVRuler { + get { + return document.TextEditorProperties.ShowVerticalRuler; + } + set { + document.TextEditorProperties.ShowVerticalRuler = value; + OptionsChanged(); + } + } + + /// + /// The row in which the vertical ruler is displayed + /// + [Category("Appearance")] + [DefaultValue(80)] + [Description("The row in which the vertical ruler is displayed")] + public int VRulerRow { + get { + return document.TextEditorProperties.VerticalRulerRow; + } + set { + document.TextEditorProperties.VerticalRulerRow = value; + OptionsChanged(); + } + } + + /// + /// If true line numbers are shown in the textarea + /// + [Category("Appearance")] + [DefaultValue(true)] + [Description("If true line numbers are shown in the textarea")] + public bool ShowLineNumbers { + get { + return document.TextEditorProperties.ShowLineNumbers; + } + set { + document.TextEditorProperties.ShowLineNumbers = value; + OptionsChanged(); + } + } + + /// + /// If true invalid lines are marked in the textarea + /// + [Category("Appearance")] + [DefaultValue(false)] + [Description("If true invalid lines are marked in the textarea")] + public bool ShowInvalidLines { + get { + return document.TextEditorProperties.ShowInvalidLines; + } + set { + document.TextEditorProperties.ShowInvalidLines = value; + OptionsChanged(); + } + } + + /// + /// If true folding is enabled in the textarea + /// + [Category("Appearance")] + [DefaultValue(true)] + [Description("If true folding is enabled in the textarea")] + public bool EnableFolding { + get { + return document.TextEditorProperties.EnableFolding; + } + set { + document.TextEditorProperties.EnableFolding = value; + OptionsChanged(); + } + } + + [Category("Appearance")] + [DefaultValue(true)] + [Description("If true matching brackets are highlighted")] + public bool ShowMatchingBracket { + get { + return document.TextEditorProperties.ShowMatchingBracket; + } + set { + document.TextEditorProperties.ShowMatchingBracket = value; + OptionsChanged(); + } + } + + [Category("Appearance")] + [DefaultValue(false)] + [Description("If true the icon bar is displayed")] + public bool IsIconBarVisible { + get { + return document.TextEditorProperties.IsIconBarVisible; + } + set { + document.TextEditorProperties.IsIconBarVisible = value; + OptionsChanged(); + } + } + + /// + /// The width in spaces of a tab character + /// + [Category("Appearance")] + //[DefaultValue(4)] + [Description("The width in spaces of a tab character")] + public int TabIndent { + get { + return document.TextEditorProperties.TabIndent; + } + set { + document.TextEditorProperties.TabIndent = value; + OptionsChanged(); + } + } + + /// + /// The line viewer style + /// + [Category("Appearance")] + [DefaultValue(LineViewerStyle.None)] + [Description("The line viewer style")] + public LineViewerStyle LineViewerStyle { + get { + return document.TextEditorProperties.LineViewerStyle; + } + set { + document.TextEditorProperties.LineViewerStyle = value; + OptionsChanged(); + } + } + + /// + /// The indent style + /// + [Category("Behavior")] + [DefaultValue(IndentStyle.Smart)] + [Description("The indent style")] + public IndentStyle IndentStyle { + get { + return document.TextEditorProperties.IndentStyle; + } + set { + document.TextEditorProperties.IndentStyle = value; + OptionsChanged(); + } + } + + /// + /// if true spaces are converted to tabs + /// + [Category("Behavior")] + [DefaultValue(false)] + [Description("Converts tabs to spaces while typing")] + public bool ConvertTabsToSpaces { + get { + return document.TextEditorProperties.ConvertTabsToSpaces; + } + set { + document.TextEditorProperties.ConvertTabsToSpaces = value; + OptionsChanged(); + } + } + + /// + /// if true spaces are converted to tabs + /// + [Category("Behavior")] + [DefaultValue(false)] + [Description("Hide the mouse cursor while typing")] + public bool HideMouseCursor { + get { + return document.TextEditorProperties.HideMouseCursor; + } + set { + document.TextEditorProperties.HideMouseCursor = value; + OptionsChanged(); + } + } + + /// + /// if true spaces are converted to tabs + /// + [Category("Behavior")] + [DefaultValue(false)] + [Description("Allows the caret to be placed beyond the end of line")] + public bool AllowCaretBeyondEOL { + get { + return document.TextEditorProperties.AllowCaretBeyondEOL; + } + set { + document.TextEditorProperties.AllowCaretBeyondEOL = value; + OptionsChanged(); + } + } + /// + /// if true spaces are converted to tabs + /// + [Category("Behavior")] + [DefaultValue(BracketMatchingStyle.After)] + [Description("Specifies if the bracket matching should match the bracket before or after the caret.")] + public BracketMatchingStyle BracketMatchingStyle { + get { + return document.TextEditorProperties.BracketMatchingStyle; + } + set { + document.TextEditorProperties.BracketMatchingStyle = value; + OptionsChanged(); + } + } + + /// + /// The base font of the text area. No bold or italic fonts + /// can be used because bold/italic is reserved for highlighting + /// purposes. + /// + [Browsable(true)] + [Description("The base font of the text area. No bold or italic fonts can be used because bold/italic is reserved for highlighting purposes.")] + public override Font Font { + get { + return document.TextEditorProperties.Font; + } + set { + document.TextEditorProperties.Font = value; + OptionsChanged(); + } + } + + #endregion + public abstract TextAreaControl ActiveTextAreaControl { + get; + } + + protected TextEditorControlBase() + { + GenerateDefaultActions(); + HighlightingManager.Manager.ReloadSyntaxHighlighting += new EventHandler(OnReloadHighlighting); + } + + protected virtual void OnReloadHighlighting(object sender, EventArgs e) + { + if (Document.HighlightingStrategy != null) { + try { + Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy(Document.HighlightingStrategy.Name); + } catch (HighlightingDefinitionInvalidException ex) { + MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + OptionsChanged(); + } + } + + public bool IsEditAction(Keys keyData) + { + return editactions.ContainsKey(keyData); + } + + internal IEditAction GetEditAction(Keys keyData) + { + if (!IsEditAction(keyData)) { + return null; + } + return (IEditAction)editactions[keyData]; + } + + void GenerateDefaultActions() + { + editactions[Keys.Left] = new CaretLeft(); + editactions[Keys.Left | Keys.Shift] = new ShiftCaretLeft(); + editactions[Keys.Left | Keys.Control] = new WordLeft(); + editactions[Keys.Left | Keys.Control | Keys.Shift] = new ShiftWordLeft(); + editactions[Keys.Right] = new CaretRight(); + editactions[Keys.Right | Keys.Shift] = new ShiftCaretRight(); + editactions[Keys.Right | Keys.Control] = new WordRight(); + editactions[Keys.Right | Keys.Control | Keys.Shift] = new ShiftWordRight(); + editactions[Keys.Up] = new CaretUp(); + editactions[Keys.Up | Keys.Shift] = new ShiftCaretUp(); + editactions[Keys.Up | Keys.Control] = new ScrollLineUp(); + editactions[Keys.Down] = new CaretDown(); + editactions[Keys.Down | Keys.Shift] = new ShiftCaretDown(); + editactions[Keys.Down | Keys.Control] = new ScrollLineDown(); + + editactions[Keys.Insert] = new ToggleEditMode(); + editactions[Keys.Insert | Keys.Control] = new Copy(); + editactions[Keys.Insert | Keys.Shift] = new Paste(); + editactions[Keys.Delete] = new Delete(); + editactions[Keys.Delete | Keys.Shift] = new Cut(); + editactions[Keys.Home] = new Home(); + editactions[Keys.Home | Keys.Shift] = new ShiftHome(); + editactions[Keys.Home | Keys.Control] = new MoveToStart(); + editactions[Keys.Home | Keys.Control | Keys.Shift] = new ShiftMoveToStart(); + editactions[Keys.End] = new End(); + editactions[Keys.End | Keys.Shift] = new ShiftEnd(); + editactions[Keys.End | Keys.Control] = new MoveToEnd(); + editactions[Keys.End | Keys.Control | Keys.Shift] = new ShiftMoveToEnd(); + editactions[Keys.PageUp] = new MovePageUp(); + editactions[Keys.PageUp | Keys.Shift] = new ShiftMovePageUp(); + editactions[Keys.PageDown] = new MovePageDown(); + editactions[Keys.PageDown | Keys.Shift] = new ShiftMovePageDown(); + + editactions[Keys.Return] = new Return(); + editactions[Keys.Tab] = new Tab(); + editactions[Keys.Tab | Keys.Shift] = new ShiftTab(); + editactions[Keys.Back] = new Backspace(); + editactions[Keys.Back | Keys.Shift] = new Backspace(); + + editactions[Keys.X | Keys.Control] = new Cut(); + editactions[Keys.C | Keys.Control] = new Copy(); + editactions[Keys.V | Keys.Control] = new Paste(); + + editactions[Keys.A | Keys.Control] = new SelectWholeDocument(); + editactions[Keys.Escape] = new ClearAllSelections(); + + editactions[Keys.Divide | Keys.Control] = new ToggleComment(); + editactions[Keys.OemQuestion | Keys.Control] = new ToggleComment(); + + editactions[Keys.Back | Keys.Alt] = new Actions.Undo(); + editactions[Keys.Z | Keys.Control] = new Actions.Undo(); + editactions[Keys.Y | Keys.Control] = new Redo(); + + editactions[Keys.Delete | Keys.Control] = new DeleteWord(); + editactions[Keys.Back | Keys.Control] = new WordBackspace(); + editactions[Keys.D | Keys.Control] = new DeleteLine(); + editactions[Keys.D | Keys.Shift | Keys.Control] = new DeleteToLineEnd(); + + editactions[Keys.B | Keys.Control] = new GotoMatchingBrace(); + } + + /// + /// Call this method before a long update operation this + /// 'locks' the text area so that no screen update occurs. + /// + public virtual void BeginUpdate() + { + ++updateLevel; + } + + /// + /// Call this method to 'unlock' the text area. After this call + /// screen update can occur. But no automatical refresh occurs you + /// have to commit the updates in the queue. + /// + public virtual void EndUpdate() + { + Debug.Assert(updateLevel > 0); + updateLevel = Math.Max(0, updateLevel - 1); + } + + public void LoadFile(string fileName) + { + LoadFile(fileName, true, true); + } + + /// + /// Loads a file given by fileName + /// + /// The name of the file to open + /// Automatically load the highlighting for the file + /// Automatically detect file encoding and set Encoding property to the detected encoding. + public void LoadFile(string fileName, bool autoLoadHighlighting, bool autodetectEncoding) + { + using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { + LoadFile(fileName, fs, autoLoadHighlighting, autodetectEncoding); + } + } + + /// + /// Loads a file from the specified stream. + /// + /// The name of the file to open. Used to find the correct highlighting strategy + /// if autoLoadHighlighting is active, and sets the filename property to this value. + /// The stream to actually load the file content from. + /// Automatically load the highlighting for the file + /// Automatically detect file encoding and set Encoding property to the detected encoding. + public void LoadFile(string fileName, Stream stream, bool autoLoadHighlighting, bool autodetectEncoding) + { + if (stream == null) + throw new ArgumentNullException("stream"); + + BeginUpdate(); + document.TextContent = String.Empty; + document.UndoStack.ClearAll(); + document.BookmarkManager.Clear(); + if (autoLoadHighlighting) { + try { + document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategyForFile(fileName); + } catch (HighlightingDefinitionInvalidException ex) { + MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + if (autodetectEncoding) { + Encoding encoding = this.Encoding; + Document.TextContent = Util.FileReader.ReadFileContent(stream, ref encoding); + if (Document.TextContent.IndexOf('\r') == -1 && Document.TextContent.IndexOf('\n') != -1) + Document.TextContent = Document.TextContent.Replace("\n", "\r\n"); + this.Encoding = encoding; + } else { + using (StreamReader reader = new StreamReader(fileName, this.Encoding)) { + Document.TextContent = reader.ReadToEnd(); + } + } + + this.FileName = fileName; + OptionsChanged(); + Document.UpdateQueue.Clear(); + EndUpdate(); + + Refresh(); + } + + /// + /// Gets if the document can be saved with the current encoding without losing data. + /// + public bool CanSaveWithCurrentEncoding() + { + if (encoding == null || Util.FileReader.IsUnicode(encoding)) + return true; + // not a unicode codepage + string text = document.TextContent; + return encoding.GetString(encoding.GetBytes(text)) == text; + } + + /// + /// Saves the text editor content into the file. + /// + public void SaveFile(string fileName) + { + using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)) { + SaveFile(fs); + } + this.FileName = fileName; + } + + /// + /// Saves the text editor content into the specified stream. + /// Does not close the stream. + /// + public void SaveFile(Stream stream) + { + StreamWriter streamWriter = new StreamWriter(stream, this.Encoding ?? Encoding.UTF8); + + // save line per line to apply the LineTerminator to all lines + // (otherwise we might save files with mixed-up line endings) + foreach (LineSegment line in Document.LineSegmentCollection) { + streamWriter.Write(Document.GetText(line.Offset, line.Length)); + if (line.DelimiterLength > 0) { + // only save line terminator if the line has one + streamWriter.Write(document.TextEditorProperties.LineTerminator); + } + } + streamWriter.Flush(); + } + + public abstract void OptionsChanged(); + + // Localization ISSUES + + // used in insight window + public virtual string GetRangeDescription(int selectedItem, int itemCount) + { + StringBuilder sb=new StringBuilder(selectedItem.ToString()); + sb.Append(" from "); + sb.Append(itemCount.ToString()); + return sb.ToString(); + } + + /// + /// Overwritten refresh method that does nothing if the control is in + /// an update cycle. + /// + public override void Refresh() + { + if (IsInUpdate) { + return; + } + base.Refresh(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) { + HighlightingManager.Manager.ReloadSyntaxHighlighting -= new EventHandler(OnReloadHighlighting); + document.HighlightingStrategy = null; + document.UndoStack.TextEditorControl = null; + } + base.Dispose(disposing); + } + + protected virtual void OnFileNameChanged(EventArgs e) + { + if (FileNameChanged != null) { + FileNameChanged(this, e); + } + } + + public event EventHandler FileNameChanged; + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs b/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs new file mode 100644 index 000000000..c631eb41c --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/TextView.cs @@ -0,0 +1,1179 @@ +// +// +// +// +// $Revision: 2681 $ +// + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor +{ + /// + /// This class paints the textarea. + /// + public class TextView : AbstractMargin, IDisposable + { + int fontHeight; + //Hashtable charWitdh = new Hashtable(); + //StringFormat measureStringFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); + Highlight highlight; + int physicalColumn = 0; // used for calculating physical column during paint + + public void Dispose() + { + measureCache.Clear(); + //measureStringFormat.Dispose(); + } + + public Highlight Highlight { + get { + return highlight; + } + set { + highlight = value; + } + } + + public int FirstPhysicalLine { + get { + return textArea.VirtualTop.Y / fontHeight; + } + } + public int LineHeightRemainder { + get { + return textArea.VirtualTop.Y % fontHeight; + } + } + /// Gets the first visible logical line. + public int FirstVisibleLine { + get { + return textArea.Document.GetFirstLogicalLine(textArea.VirtualTop.Y / fontHeight); + } + set { + if (FirstVisibleLine != value) { + textArea.VirtualTop = new Point(textArea.VirtualTop.X, textArea.Document.GetVisibleLine(value) * fontHeight); + + } + } + } + + public int VisibleLineDrawingRemainder { + get { + return textArea.VirtualTop.Y % fontHeight; + } + } + + public int FontHeight { + get { + return fontHeight; + } + } + + public int VisibleLineCount { + get { + return 1 + DrawingPosition.Height / fontHeight; + } + } + + public int VisibleColumnCount { + get { + return (int)(DrawingPosition.Width / WideSpaceWidth) - 1; + } + } + + public TextView(TextArea textArea) : base(textArea) + { + base.Cursor = Cursors.IBeam; + OptionsChanged(); + } + + static int GetFontHeight(Font font) + { + int height1 = TextRenderer.MeasureText("_", font).Height; + int height2 = (int)Math.Ceiling(font.GetHeight()); + return Math.Max(height1, height2) + 1; + } + + int spaceWidth; + + /// + /// Gets the width of a space character. + /// This value can be quite small in some fonts - consider using WideSpaceWidth instead. + /// + public int SpaceWidth { + get { + return spaceWidth; + } + } + + int wideSpaceWidth; + + /// + /// Gets the width of a 'wide space' (=one quarter of a tab, if tab is set to 4 spaces). + /// On monospaced fonts, this is the same value as spaceWidth. + /// + public int WideSpaceWidth { + get { + return wideSpaceWidth; + } + } + + Font lastFont; + + public void OptionsChanged() + { + this.lastFont = TextEditorProperties.FontContainer.RegularFont; + this.fontHeight = GetFontHeight(lastFont); + // use minimum width - in some fonts, space has no width but kerning is used instead + // -> DivideByZeroException + this.spaceWidth = Math.Max(GetWidth(' ', lastFont), 1); + // tab should have the width of 4*'x' + this.wideSpaceWidth = Math.Max(spaceWidth, GetWidth('x', lastFont)); + } + + #region Paint functions + public override void Paint(Graphics g, Rectangle rect) + { + if (rect.Width <= 0 || rect.Height <= 0) { + return; + } + + // Just to ensure that fontHeight and char widths are always correct... + if (lastFont != TextEditorProperties.FontContainer.RegularFont) { + OptionsChanged(); + textArea.Invalidate(); + } + + int horizontalDelta = textArea.VirtualTop.X; + if (horizontalDelta > 0) { + g.SetClip(this.DrawingPosition); + } + + for (int y = 0; y < (DrawingPosition.Height + VisibleLineDrawingRemainder) / fontHeight + 1; ++y) { + Rectangle lineRectangle = new Rectangle(DrawingPosition.X - horizontalDelta, + DrawingPosition.Top + y * fontHeight - VisibleLineDrawingRemainder, + DrawingPosition.Width + horizontalDelta, + fontHeight); + + if (rect.IntersectsWith(lineRectangle)) { + int fvl = textArea.Document.GetVisibleLine(FirstVisibleLine); + int currentLine = textArea.Document.GetFirstLogicalLine(textArea.Document.GetVisibleLine(FirstVisibleLine) + y); + PaintDocumentLine(g, currentLine, lineRectangle); + } + } + + DrawMarkerDraw(g); + + if (horizontalDelta > 0) { + g.ResetClip(); + } + } + + bool yellow = false; + bool red = false; + bool orange_red = false; + + void PaintDocumentLine(Graphics g, int lineNumber, Rectangle lineRectangle) + { + yellow = false; + red = false; + orange_red = false; + Debug.Assert(lineNumber >= 0); + Brush bgColorBrush = GetBgColorBrush(lineNumber); + Brush backgroundBrush = textArea.Enabled ? bgColorBrush : SystemBrushes.InactiveBorder; + + if (lineNumber >= textArea.Document.TotalNumberOfLines) { + g.FillRectangle(backgroundBrush, lineRectangle); + if (TextEditorProperties.ShowInvalidLines) { + DrawInvalidLineMarker(g, lineRectangle.Left, lineRectangle.Top); + } + if (TextEditorProperties.ShowVerticalRuler) { + DrawVerticalRuler(g, lineRectangle); + } +// bgColorBrush.Dispose(); + return; + } + Color col = Color.Empty; + IList markers=null; + try + { + Brush brush = GetMarkerBrushAt(Document.GetLineSegment(lineNumber).Offset,0,ref col, out markers); + if (brush == BrushRegistry.GetBrush(Color.Red)) + { + red = true; + } + else if (brush == BrushRegistry.GetBrush(Color.Yellow)) + { + yellow = true; + } + else if (brush == BrushRegistry.GetBrush(Color.OrangeRed)) + { + orange_red = true; + } + } + catch + { + + } + int physicalXPos = lineRectangle.X; + + // there can't be a folding wich starts in an above line and ends here, because the line is a new one, + // there must be a return before this line. + int column = 0; + physicalColumn = 0; + if (TextEditorProperties.EnableFolding) { + while (true) { + List starts = textArea.Document.FoldingManager.GetFoldedFoldingsWithStartAfterColumn(lineNumber, column - 1); + if (starts == null || starts.Count <= 0) { + if (lineNumber < textArea.Document.TotalNumberOfLines) { + physicalXPos = PaintLinePart(g, lineNumber, column, textArea.Document.GetLineSegment(lineNumber).Length, lineRectangle, physicalXPos); + } + break; + } + // search the first starting folding + FoldMarker firstFolding = (FoldMarker)starts[0]; + foreach (FoldMarker fm in starts) { + if (fm.StartColumn < firstFolding.StartColumn) { + firstFolding = fm; + } + } + starts.Clear(); + + physicalXPos = PaintLinePart(g, lineNumber, column, firstFolding.StartColumn, lineRectangle, physicalXPos); + column = firstFolding.EndColumn; + lineNumber = firstFolding.EndLine; + if (lineNumber >= textArea.Document.TotalNumberOfLines) { + Debug.Assert(false, "Folding ends after document end"); + break; + } + + ColumnRange selectionRange2 = textArea.SelectionManager.GetSelectionAtLine(lineNumber); + bool drawSelected = ColumnRange.WholeColumn.Equals(selectionRange2) || firstFolding.StartColumn >= selectionRange2.StartColumn && firstFolding.EndColumn <= selectionRange2.EndColumn; + + physicalXPos = PaintFoldingText(g, lineNumber, physicalXPos, lineRectangle, firstFolding.FoldText, drawSelected); + } + } else { + physicalXPos = PaintLinePart(g, lineNumber, 0, textArea.Document.GetLineSegment(lineNumber).Length, lineRectangle, physicalXPos); + } + + if (lineNumber < textArea.Document.TotalNumberOfLines) { + // Paint things after end of line + ColumnRange selectionRange = textArea.SelectionManager.GetSelectionAtLine(lineNumber); + LineSegment currentLine = textArea.Document.GetLineSegment(lineNumber); + HighlightColor selectionColor = textArea.Document.HighlightingStrategy.GetColorFor("Selection"); + + bool selectionBeyondEOL = selectionRange.EndColumn > currentLine.Length || ColumnRange.WholeColumn.Equals(selectionRange); + + if (TextEditorProperties.ShowEOLMarker) { + HighlightColor eolMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("EOLMarkers"); + physicalXPos += DrawEOLMarker(g, eolMarkerColor.Color, selectionBeyondEOL ? bgColorBrush : backgroundBrush, physicalXPos, lineRectangle.Y); + } else { + if (selectionBeyondEOL) { + g.FillRectangle(BrushRegistry.GetBrush(selectionColor.BackgroundColor), new RectangleF(physicalXPos, lineRectangle.Y, WideSpaceWidth, lineRectangle.Height)); + physicalXPos += WideSpaceWidth; + } + } + + Brush fillBrush = selectionBeyondEOL && TextEditorProperties.AllowCaretBeyondEOL ? bgColorBrush : backgroundBrush; + if (yellow) fillBrush = BrushRegistry.GetBrush(Color.Yellow); + else if (red) fillBrush = BrushRegistry.GetBrush(Color.Red); + else if (orange_red) fillBrush = BrushRegistry.GetBrush(Color.OrangeRed); + g.FillRectangle(fillBrush, + new RectangleF(physicalXPos, lineRectangle.Y, lineRectangle.Width - physicalXPos + lineRectangle.X, lineRectangle.Height)); + } + if (TextEditorProperties.ShowVerticalRuler) { + DrawVerticalRuler(g, lineRectangle); + } +// bgColorBrush.Dispose(); + } + + bool DrawLineMarkerAtLine(int lineNumber) + { + return lineNumber == base.textArea.Caret.Line && textArea.MotherTextAreaControl.TextEditorProperties.LineViewerStyle == LineViewerStyle.FullRow; + } + + Brush GetBgColorBrush(int lineNumber) + { + if (DrawLineMarkerAtLine(lineNumber)) { + HighlightColor caretLine = textArea.Document.HighlightingStrategy.GetColorFor("CaretMarker"); + return BrushRegistry.GetBrush(caretLine.Color); + } + HighlightBackground background = (HighlightBackground)textArea.Document.HighlightingStrategy.GetColorFor("Default"); + Color bgColor = background.BackgroundColor; + if (textArea.MotherTextAreaControl.TextEditorProperties.UseCustomLine == true) + { + bgColor = textArea.Document.CustomLineManager.GetCustomColor(lineNumber, bgColor); + } + return BrushRegistry.GetBrush(bgColor); + } + + const int additionalFoldTextSize = 1; + + int PaintFoldingText(Graphics g, int lineNumber, int physicalXPos, Rectangle lineRectangle, string text, bool drawSelected) + { + // TODO: get font and color from the highlighting file + HighlightColor selectionColor = textArea.Document.HighlightingStrategy.GetColorFor("Selection"); + Brush bgColorBrush = drawSelected ? BrushRegistry.GetBrush(selectionColor.BackgroundColor) : GetBgColorBrush(lineNumber); + Brush backgroundBrush = textArea.Enabled ? bgColorBrush : SystemBrushes.InactiveBorder; + + Font font = textArea.TextEditorProperties.FontContainer.RegularFont; + + int wordWidth = MeasureStringWidth(g, text, font) + additionalFoldTextSize; + Rectangle rect = new Rectangle(physicalXPos, lineRectangle.Y, wordWidth, lineRectangle.Height - 1); + + g.FillRectangle(backgroundBrush, rect); + + physicalColumn += text.Length; + DrawString(g, + text, + font, + drawSelected ? selectionColor.Color : Color.Gray, + rect.X + 1, rect.Y); + g.DrawRectangle(BrushRegistry.GetPen(drawSelected ? Color.DarkGray : Color.Gray), rect.X, rect.Y, rect.Width, rect.Height); + + return physicalXPos + wordWidth + 1; + } + + struct MarkerToDraw { + internal TextMarker marker; + internal RectangleF drawingRect; + + public MarkerToDraw(TextMarker marker, RectangleF drawingRect) + { + this.marker = marker; + this.drawingRect = drawingRect; + } + } + + List markersToDraw = new List(); + + void DrawMarker(Graphics g, TextMarker marker, RectangleF drawingRect) + { + // draw markers later so they can overdraw the following text + markersToDraw.Add(new MarkerToDraw(marker, drawingRect)); + } + + void DrawMarkerDraw(Graphics g) + { + List lst = new List(); + RectangleF res_rect = RectangleF.Empty; + foreach (MarkerToDraw m in markersToDraw) { + TextMarker marker = m.marker; + RectangleF drawingRect = m.drawingRect; + float drawYPos = drawingRect.Bottom - 1; + switch (marker.TextMarkerType) { + case TextMarkerType.Underlined: + g.DrawLine(BrushRegistry.GetPen(marker.Color), drawingRect.X, drawYPos, drawingRect.Right, drawYPos); + break; + case TextMarkerType.WaveLine: + int reminder = ((int)drawingRect.X) % 6; + for (float i = (int)drawingRect.X - reminder; i < drawingRect.Right; i += 6) { + g.DrawLine(BrushRegistry.GetPen(marker.Color), i, drawYPos + 3 - 4, i + 3, drawYPos + 1 - 4); + if (i + 3 < drawingRect.Right) { + g.DrawLine(BrushRegistry.GetPen(marker.Color), i + 3, drawYPos + 1 - 4, i + 6, drawYPos + 3 - 4); + } + } + break; + case TextMarkerType.SolidBlock: + g.FillRectangle(BrushRegistry.GetBrush(marker.Color), drawingRect); + break; + case TextMarkerType.Cant: +// Pen p = new Pen(Color.Gray); +// p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; +// g.DrawRectangle(p,drawingRect.X,drawingRect.Y,drawingRect.Width,drawingRect.Height); + if (!res_rect.IsEmpty) + res_rect = RectangleF.Union(res_rect,drawingRect); + else + res_rect = drawingRect; + break; + } + } + if (!res_rect.IsEmpty) + { + Pen p = new Pen(Color.Gray); + p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; + g.DrawRectangle(p,res_rect.X,res_rect.Y,res_rect.Width,res_rect.Height); + } + markersToDraw.Clear(); + } + + /// + /// Get the marker brush (for solid block markers) at a given position. + /// + /// The offset. + /// The length. + /// All markers that have been found. + /// The Brush or null when no marker was found. + Brush GetMarkerBrushAt(int offset, int length, ref Color foreColor, out IList markers) + { + markers = Document.MarkerStrategy.GetMarkers(offset, length); + foreach (TextMarker marker in markers) { + if (marker.TextMarkerType == TextMarkerType.SolidBlock) { + if (marker.OverrideForeColor) { + foreColor = marker.ForeColor; + } + return BrushRegistry.GetBrush(marker.Color); + } + else if (marker.TextMarkerType == TextMarkerType.Underlined) + { + foreColor = marker.Color; + return BrushRegistry.GetBrush(Color.White); + } + } + return null; + } + + int PaintLinePart(Graphics g, int lineNumber, int startColumn, int endColumn, Rectangle lineRectangle, int physicalXPos) + { + bool drawLineMarker = DrawLineMarkerAtLine(lineNumber); + Brush backgroundBrush = textArea.Enabled ? GetBgColorBrush(lineNumber) : SystemBrushes.InactiveBorder; + + HighlightColor selectionColor = textArea.Document.HighlightingStrategy.GetColorFor("Selection"); + ColumnRange selectionRange = textArea.SelectionManager.GetSelectionAtLine(lineNumber); + HighlightColor tabMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("TabMarkers"); + HighlightColor spaceMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("SpaceMarkers"); + + LineSegment currentLine = textArea.Document.GetLineSegment(lineNumber); + + Brush selectionBackgroundBrush = BrushRegistry.GetBrush(selectionColor.BackgroundColor); + + if (currentLine.Words == null) { + return physicalXPos; + } + + int currentWordOffset = 0; // we cannot use currentWord.Offset because it is not set on space words + + TextWord currentWord; + TextWord nextCurrentWord = null; + FontContainer fontContainer = TextEditorProperties.FontContainer; + for (int wordIdx = 0; wordIdx < currentLine.Words.Count; wordIdx++) { + currentWord = currentLine.Words[wordIdx]; + if (currentWordOffset < startColumn) { + // TODO: maybe we need to split at startColumn when we support fold markers + // inside words + currentWordOffset += currentWord.Length; + continue; + } + repeatDrawCurrentWord: + //physicalXPos += 10; // leave room between drawn words - useful for debugging the drawing code + if (currentWordOffset >= endColumn || physicalXPos >= lineRectangle.Right) { + break; + } + int currentWordEndOffset = currentWordOffset + currentWord.Length - 1; + TextWordType currentWordType = currentWord.Type; + + IList markers; + Color wordForeColor; + if (currentWordType == TextWordType.Space) + wordForeColor = spaceMarkerColor.Color; + else if (currentWordType == TextWordType.Tab) + wordForeColor = tabMarkerColor.Color; + else + wordForeColor = currentWord.Color; + Brush wordBackBrush = GetMarkerBrushAt(currentLine.Offset + currentWordOffset, currentWord.Length, ref wordForeColor, out markers); +// if (wordBackBrush == BrushRegistry.GetBrush(Color.Yellow)) +// yellow = true; +// else if (wordBackBrush == BrushRegistry.GetBrush(Color.Red)) +// red = true; +// else if (wordBackBrush == BrushRegistry.GetBrush(Color.OrangeRed)) +// orange_red = true; + + // It is possible that we have to split the current word because a marker/the selection begins/ends inside it + if (currentWord.Length > 1) { + int splitPos = int.MaxValue; + if (highlight != null) { + // split both before and after highlight + if (highlight.OpenBrace.Y == lineNumber) { + if (highlight.OpenBrace.X >= currentWordOffset && highlight.OpenBrace.X <= currentWordEndOffset) { + splitPos = Math.Min(splitPos, highlight.OpenBrace.X - currentWordOffset); + } + } + if (highlight.CloseBrace.Y == lineNumber) { + if (highlight.CloseBrace.X >= currentWordOffset && highlight.CloseBrace.X <= currentWordEndOffset) { + splitPos = Math.Min(splitPos, highlight.CloseBrace.X - currentWordOffset); + } + } + if (splitPos == 0) { + splitPos = 1; // split after highlight + } + } + if (endColumn < currentWordEndOffset) { // split when endColumn is reached + splitPos = Math.Min(splitPos, endColumn - currentWordOffset); + } + if (selectionRange.StartColumn > currentWordOffset && selectionRange.StartColumn <= currentWordEndOffset) { + splitPos = Math.Min(splitPos, selectionRange.StartColumn - currentWordOffset); + } else if (selectionRange.EndColumn > currentWordOffset && selectionRange.EndColumn <= currentWordEndOffset) { + splitPos = Math.Min(splitPos, selectionRange.EndColumn - currentWordOffset); + } + foreach (TextMarker marker in markers) { + if (marker.TextMarkerType == TextMarkerType.SolidBlock) + { +// if (marker.Color == Color.Yellow) +// yellow = true; +// else if (marker.Color == Color.Red) +// red = true; +// else if (marker.Color == Color.OrangeRed) +// orange_red = true; + //g.FillRectangle(BrushRegistry.GetBrush(marker.Color),new RectangleF(lineRectangle.X,lineRectangle.Y,700,300)); + } + int markerColumn = marker.Offset - currentLine.Offset; + int markerEndColumn = marker.EndOffset - currentLine.Offset + 1; // make end offset exclusive + if (markerColumn > currentWordOffset && markerColumn <= currentWordEndOffset) { + splitPos = Math.Min(splitPos, markerColumn - currentWordOffset); + } else if (markerEndColumn > currentWordOffset && markerEndColumn <= currentWordEndOffset) { + splitPos = Math.Min(splitPos, markerEndColumn - currentWordOffset); + } + } + if (splitPos != int.MaxValue) { + if (nextCurrentWord != null) + throw new ApplicationException("split part invalid: first part cannot be splitted further"); + nextCurrentWord = TextWord.Split(ref currentWord, splitPos); + goto repeatDrawCurrentWord; // get markers for first word part + } + } + + // get colors from selection status: + if (ColumnRange.WholeColumn.Equals(selectionRange) || (selectionRange.StartColumn <= currentWordOffset + && selectionRange.EndColumn > currentWordEndOffset)) + { + // word is completely selected + wordBackBrush = selectionBackgroundBrush; + if (selectionColor.HasForeground) { + wordForeColor = selectionColor.Color; + } + } else if (drawLineMarker) { + wordBackBrush = backgroundBrush; + } + + if (wordBackBrush == null) { // use default background if no other background is set + if (currentWord.SyntaxColor != null && currentWord.SyntaxColor.HasBackground) + wordBackBrush = BrushRegistry.GetBrush(currentWord.SyntaxColor.BackgroundColor); + else + wordBackBrush = backgroundBrush; + } + + RectangleF wordRectangle; + + if (currentWord.Type == TextWordType.Space) { + ++physicalColumn; + + wordRectangle = new RectangleF(physicalXPos, lineRectangle.Y, SpaceWidth, lineRectangle.Height); + g.FillRectangle(wordBackBrush, wordRectangle); + + if (TextEditorProperties.ShowSpaces) { + DrawSpaceMarker(g, wordForeColor, physicalXPos, lineRectangle.Y); + } + physicalXPos += SpaceWidth; + } else if (currentWord.Type == TextWordType.Tab) { + + physicalColumn += TextEditorProperties.TabIndent; + physicalColumn = (physicalColumn / TextEditorProperties.TabIndent) * TextEditorProperties.TabIndent; + // go to next tabstop + int physicalTabEnd = ((physicalXPos + MinTabWidth - lineRectangle.X) + / WideSpaceWidth / TextEditorProperties.TabIndent) + * WideSpaceWidth * TextEditorProperties.TabIndent + lineRectangle.X; + physicalTabEnd += WideSpaceWidth * TextEditorProperties.TabIndent; + + wordRectangle = new RectangleF(physicalXPos, lineRectangle.Y, physicalTabEnd - physicalXPos, lineRectangle.Height); + g.FillRectangle(wordBackBrush, wordRectangle); + + if (TextEditorProperties.ShowTabs) { + DrawTabMarker(g, wordForeColor, physicalXPos, lineRectangle.Y); + } + physicalXPos = physicalTabEnd; + } else { + Brush tmp_brush = wordBackBrush; + + //modified + if (highlight != null && wordBackBrush != selectionBackgroundBrush) + { + if (highlight.OpenBrace.Y == lineNumber && highlight.OpenBrace.X == currentWordOffset || + highlight.CloseBrace.Y == lineNumber && highlight.CloseBrace.X == currentWordOffset) + { + + wordBackBrush = BrushRegistry.GetBrush(System.Drawing.Color.FromArgb(219, 224, 204)); + } + } + //end modified + int wordWidth = DrawDocumentWord(g, + currentWord.Word, + new Point(physicalXPos, lineRectangle.Y), + currentWord.GetFont(fontContainer), + wordForeColor, + wordBackBrush); + wordRectangle = new RectangleF(physicalXPos, lineRectangle.Y, wordWidth, lineRectangle.Height); + wordBackBrush = tmp_brush; + physicalXPos += wordWidth; + } + foreach (TextMarker marker in markers) { + if (marker.TextMarkerType != TextMarkerType.SolidBlock) { + DrawMarker(g, marker, wordRectangle); + } + } + + // draw bracket highlight + /*if (highlight != null) { + if (highlight.OpenBrace.Y == lineNumber && highlight.OpenBrace.X == currentWordOffset || + highlight.CloseBrace.Y == lineNumber && highlight.CloseBrace.X == currentWordOffset) { + DrawBracketHighlight(g, new Rectangle((int)wordRectangle.X, lineRectangle.Y, (int)wordRectangle.Width - 1, lineRectangle.Height - 1)); + } + }*/ + + currentWordOffset += currentWord.Length; + if (nextCurrentWord != null) { + currentWord = nextCurrentWord; + nextCurrentWord = null; + goto repeatDrawCurrentWord; + } + } + if (physicalXPos < lineRectangle.Right && endColumn >= currentLine.Length) { + // draw markers at line end + IList markers = Document.MarkerStrategy.GetMarkers(currentLine.Offset + currentLine.Length); + foreach (TextMarker marker in markers) { + if (marker.TextMarkerType != TextMarkerType.SolidBlock) { + DrawMarker(g, marker, new RectangleF(physicalXPos, lineRectangle.Y, WideSpaceWidth, lineRectangle.Height)); + } + } + } + return physicalXPos; + } + + int DrawDocumentWord(Graphics g, string word, Point position, Font font, Color foreColor, Brush backBrush) + { + if (word == null || word.Length == 0) { + return 0; + } + + if (word.Length > MaximumWordLength) { + int width = 0; + for (int i = 0; i < word.Length; i += MaximumWordLength) { + Point pos = position; + pos.X += width; + if (i + MaximumWordLength < word.Length) + width += DrawDocumentWord(g, word.Substring(i, MaximumWordLength), pos, font, foreColor, backBrush); + else + width += DrawDocumentWord(g, word.Substring(i, word.Length - i), pos, font, foreColor, backBrush); + } + return width; + } + + int wordWidth = MeasureStringWidth(g, word, font); + + //num = ++num % 3; + g.FillRectangle(backBrush, //num == 0 ? Brushes.LightBlue : num == 1 ? Brushes.LightGreen : Brushes.Yellow, + new RectangleF(position.X, position.Y, wordWidth + 1, FontHeight)); +// Pen p = new Pen(System.Drawing.Color.Gray); +// p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; +// g.DrawRectangle(p,new Rectangle(position.X, position.Y, wordWidth-1, FontHeight-1)); + DrawString(g, + word, + font, + foreColor, + position.X, + position.Y); + return wordWidth; + } + + struct WordFontPair { + string word; + Font font; + public WordFontPair(string word, Font font) { + this.word = word; + this.font = font; + } + public override bool Equals(object obj) { + WordFontPair myWordFontPair = (WordFontPair)obj; + if (!word.Equals(myWordFontPair.word)) return false; + return font.Equals(myWordFontPair.font); + } + + public override int GetHashCode() { + return word.GetHashCode() ^ font.GetHashCode(); + } + } + + Dictionary measureCache = new Dictionary(); + + // split words after 1000 characters. Fixes GDI+ crash on very longs words, for example + // a 100 KB Base64-file without any line breaks. + const int MaximumWordLength = 1000; + const int MaximumCacheSize = 2000; + + int MeasureStringWidth(Graphics g, string word, Font font) + { + int width; + + if (word == null || word.Length == 0) + return 0; + if (word.Length > MaximumWordLength) { + width = 0; + for (int i = 0; i < word.Length; i += MaximumWordLength) { + if (i + MaximumWordLength < word.Length) + width += MeasureStringWidth(g, word.Substring(i, MaximumWordLength), font); + else + width += MeasureStringWidth(g, word.Substring(i, word.Length - i), font); + } + return width; + } + if (measureCache.TryGetValue(new WordFontPair(word, font), out width)) { + return width; + } + if (measureCache.Count > MaximumCacheSize) { + measureCache.Clear(); + } + + // This code here provides better results than MeasureString! + // Example line that is measured wrong: + // txt.GetPositionFromCharIndex(txt.SelectionStart) + // (Verdana 10, highlighting makes GetP... bold) -> note the space between 'x' and '(' + // this also fixes "jumping" characters when selecting in non-monospace fonts + // [...] + // Replaced GDI+ measurement with GDI measurement: faster and even more exact + width = TextRenderer.MeasureText(g, word, font, new Size(short.MaxValue, short.MaxValue), textFormatFlags).Width; + measureCache.Add(new WordFontPair(word, font), width); + return width; + } + + // Important: Some flags combinations work on WinXP, but not on Win2000. + // Make sure to test changes here on all operating systems. + const TextFormatFlags textFormatFlags = + TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix | TextFormatFlags.PreserveGraphicsClipping; + #endregion + + #region Conversion Functions + Dictionary> fontBoundCharWidth = new Dictionary>(); + + public int GetWidth(char ch, Font font) + { + if (!fontBoundCharWidth.ContainsKey(font)) { + fontBoundCharWidth.Add(font, new Dictionary()); + } + if (!fontBoundCharWidth[font].ContainsKey(ch)) { + using (Graphics g = textArea.CreateGraphics()) { + return GetWidth(g, ch, font); + } + } + return fontBoundCharWidth[font][ch]; + } + + public int GetWidth(Graphics g, char ch, Font font) + { + if (!fontBoundCharWidth.ContainsKey(font)) { + fontBoundCharWidth.Add(font, new Dictionary()); + } + if (!fontBoundCharWidth[font].ContainsKey(ch)) { + //Console.WriteLine("Calculate character width: " + ch); + fontBoundCharWidth[font].Add(ch, MeasureStringWidth(g, ch.ToString(), font)); + } + return fontBoundCharWidth[font][ch]; + } + + public int GetVisualColumn(int logicalLine, int logicalColumn) + { + int column = 0; + using (Graphics g = textArea.CreateGraphics()) { + CountColumns(ref column, 0, logicalColumn, logicalLine, g); + } + return column; + } + + public int GetVisualColumnFast(LineSegment line, int logicalColumn) + { + int lineOffset = line.Offset; + int tabIndent = Document.TextEditorProperties.TabIndent; + int guessedColumn = 0; + for (int i = 0; i < logicalColumn; ++i) { + char ch; + if (i >= line.Length) { + ch = ' '; + } else { + ch = Document.GetCharAt(lineOffset + i); + } + switch (ch) { + case '\t': + guessedColumn += tabIndent; + guessedColumn = (guessedColumn / tabIndent) * tabIndent; + break; + default: + ++guessedColumn; + break; + } + } + return guessedColumn; + } + + /// + /// returns line/column for a visual point position + /// + public TextLocation GetLogicalPosition(Point mousePosition) + { + FoldMarker dummy; + return GetLogicalColumn(GetLogicalLine(mousePosition.Y), mousePosition.X, out dummy); + } + + /// + /// returns line/column for a visual point position + /// + public TextLocation GetLogicalPosition(int visualPosX, int visualPosY) + { + FoldMarker dummy; + return GetLogicalColumn(GetLogicalLine(visualPosY), visualPosX, out dummy); + } + + /// + /// returns line/column for a visual point position + /// + public FoldMarker GetFoldMarkerFromPosition(int visualPosX, int visualPosY) + { + FoldMarker foldMarker; + GetLogicalColumn(GetLogicalLine(visualPosY), visualPosX, out foldMarker); + return foldMarker; + } + + /// + /// returns logical line number for a visual point + /// + public int GetLogicalLine(int visualPosY) + { + int clickedVisualLine = Math.Max(0, (visualPosY + this.textArea.VirtualTop.Y) / fontHeight); + return Document.GetFirstLogicalLine(clickedVisualLine); + } + + internal TextLocation GetLogicalColumn(int lineNumber, int visualPosX, out FoldMarker inFoldMarker) + { + visualPosX += textArea.VirtualTop.X; + + inFoldMarker = null; + if (lineNumber >= Document.TotalNumberOfLines) { + return new TextLocation((int)(visualPosX / WideSpaceWidth), lineNumber); + } + if (visualPosX <= 0) { + return new TextLocation(0, lineNumber); + } + + int start = 0; // column + int posX = 0; // visual position + + int result; + using (Graphics g = textArea.CreateGraphics()) { + do { + LineSegment line = Document.GetLineSegment(lineNumber); + FoldMarker nextFolding = FindNextFoldedFoldingOnLineAfterColumn(lineNumber, start-1); + int end = nextFolding != null ? nextFolding.StartColumn : int.MaxValue; + result = GetLogicalColumnInternal(g, line, start, end, ref posX, visualPosX); + if (result < 0) { + // reached fold marker + lineNumber = nextFolding.EndLine; + start = nextFolding.EndColumn; + int newPosX = posX + 1 + MeasureStringWidth(g, nextFolding.FoldText, TextEditorProperties.FontContainer.RegularFont); + if (newPosX >= visualPosX) { + inFoldMarker = nextFolding; + if (IsNearerToAThanB(visualPosX, posX, newPosX)) + return new TextLocation(nextFolding.StartColumn, nextFolding.StartLine); + else + return new TextLocation(nextFolding.EndColumn, nextFolding.EndLine); + } + posX = newPosX; + } + } while (result < 0); + } + return new TextLocation(result, lineNumber); + } + + int GetLogicalColumnInternal(Graphics g, LineSegment line, int start, int end, ref int drawingPos, int targetVisualPosX) + { + if (start == end) + return -1; + Debug.Assert(start < end); + Debug.Assert(drawingPos < targetVisualPosX); + + int tabIndent = Document.TextEditorProperties.TabIndent; + + /*float spaceWidth = SpaceWidth; + float drawingPos = 0; + LineSegment currentLine = Document.GetLineSegment(logicalLine); + List words = currentLine.Words; + if (words == null) return 0; + int wordCount = words.Count; + int wordOffset = 0; + FontContainer fontContainer = TextEditorProperties.FontContainer; + */ + FontContainer fontContainer = TextEditorProperties.FontContainer; + + List words = line.Words; + if (words == null) return 0; + int wordOffset = 0; + for (int i = 0; i < words.Count; i++) { + TextWord word = words[i]; + if (wordOffset >= end) { + return -1; + } + if (wordOffset + word.Length >= start) { + int newDrawingPos; + switch (word.Type) { + case TextWordType.Space: + newDrawingPos = drawingPos + spaceWidth; + if (newDrawingPos >= targetVisualPosX) + return IsNearerToAThanB(targetVisualPosX, drawingPos, newDrawingPos) ? wordOffset : wordOffset+1; + break; + case TextWordType.Tab: + // go to next tab position + drawingPos = (int)((drawingPos + MinTabWidth) / tabIndent / WideSpaceWidth) * tabIndent * WideSpaceWidth; + newDrawingPos = drawingPos + tabIndent * WideSpaceWidth; + if (newDrawingPos >= targetVisualPosX) + return IsNearerToAThanB(targetVisualPosX, drawingPos, newDrawingPos) ? wordOffset : wordOffset+1; + break; + case TextWordType.Word: + int wordStart = Math.Max(wordOffset, start); + int wordLength = Math.Min(wordOffset + word.Length, end) - wordStart; + string text = Document.GetText(line.Offset + wordStart, wordLength); + Font font = word.GetFont(fontContainer) ?? fontContainer.RegularFont; + newDrawingPos = drawingPos + MeasureStringWidth(g, text, font); + if (newDrawingPos >= targetVisualPosX) { + for (int j = 0; j < text.Length; j++) { + newDrawingPos = drawingPos + MeasureStringWidth(g, text[j].ToString(), font); + if (newDrawingPos >= targetVisualPosX) { + if (IsNearerToAThanB(targetVisualPosX, drawingPos, newDrawingPos)) + return wordStart + j; + else + return wordStart + j + 1; + } + drawingPos = newDrawingPos; + } + return wordStart + text.Length; + } + break; + default: + throw new NotSupportedException(); + } + drawingPos = newDrawingPos; + } + wordOffset += word.Length; + } + return wordOffset; + } + + static bool IsNearerToAThanB(int num, int a, int b) + { + return Math.Abs(a - num) < Math.Abs(b - num); + } + + FoldMarker FindNextFoldedFoldingOnLineAfterColumn(int lineNumber, int column) + { + List list = Document.FoldingManager.GetFoldedFoldingsWithStartAfterColumn(lineNumber, column); + if (list.Count != 0) + return list[0]; + else + return null; + } + + const int MinTabWidth = 4; + + float CountColumns(ref int column, int start, int end, int logicalLine, Graphics g) + { + if (start > end) throw new ArgumentException("start > end"); + if (start == end) return 0; + float spaceWidth = SpaceWidth; + float drawingPos = 0; + int tabIndent = Document.TextEditorProperties.TabIndent; + LineSegment currentLine = Document.GetLineSegment(logicalLine); + List words = currentLine.Words; + if (words == null) return 0; + int wordCount = words.Count; + int wordOffset = 0; + FontContainer fontContainer = TextEditorProperties.FontContainer; + for (int i = 0; i < wordCount; i++) { + TextWord word = words[i]; + if (wordOffset >= end) + break; + if (wordOffset + word.Length >= start) { + switch (word.Type) { + case TextWordType.Space: + drawingPos += spaceWidth; + break; + case TextWordType.Tab: + // go to next tab position + drawingPos = (int)((drawingPos + MinTabWidth) / tabIndent / WideSpaceWidth) * tabIndent * WideSpaceWidth; + drawingPos += tabIndent * WideSpaceWidth; + break; + case TextWordType.Word: + int wordStart = Math.Max(wordOffset, start); + int wordLength = Math.Min(wordOffset + word.Length, end) - wordStart; + string text = Document.GetText(currentLine.Offset + wordStart, wordLength); + drawingPos += MeasureStringWidth(g, text, word.GetFont(fontContainer) ?? fontContainer.RegularFont); + break; + } + } + wordOffset += word.Length; + } + for (int j = currentLine.Length; j < end; j++) { + drawingPos += WideSpaceWidth; + } + // add one pixel in column calculation to account for floating point calculation errors + column += (int)((drawingPos + 1) / WideSpaceWidth); + + /* OLD Code (does not work for fonts like Verdana) + for (int j = start; j < end; ++j) { + char ch; + if (j >= line.Length) { + ch = ' '; + } else { + ch = Document.GetCharAt(line.Offset + j); + } + + switch (ch) { + case '\t': + int oldColumn = column; + column += tabIndent; + column = (column / tabIndent) * tabIndent; + drawingPos += (column - oldColumn) * spaceWidth; + break; + default: + ++column; + TextWord word = line.GetWord(j); + if (word == null || word.Font == null) { + drawingPos += GetWidth(ch, TextEditorProperties.Font); + } else { + drawingPos += GetWidth(ch, word.Font); + } + break; + } + } + //*/ + return drawingPos; + } + + public int GetDrawingXPos(int logicalLine, int logicalColumn) + { + List foldings = Document.FoldingManager.GetTopLevelFoldedFoldings(); + int i; + FoldMarker f = null; + // search the last folding that's interresting + for (i = foldings.Count - 1; i >= 0; --i) { + f = foldings[i]; + if (f.StartLine < logicalLine || f.StartLine == logicalLine && f.StartColumn < logicalColumn) { + break; + } + FoldMarker f2 = foldings[i / 2]; + if (f2.StartLine > logicalLine || f2.StartLine == logicalLine && f2.StartColumn >= logicalColumn) { + i /= 2; + } + } + int lastFolding = 0; + int firstFolding = 0; + int column = 0; + int tabIndent = Document.TextEditorProperties.TabIndent; + float drawingPos; + Graphics g = textArea.CreateGraphics(); + // if no folding is interresting + if (f == null || !(f.StartLine < logicalLine || f.StartLine == logicalLine && f.StartColumn < logicalColumn)) { + drawingPos = CountColumns(ref column, 0, logicalColumn, logicalLine, g); + return (int)(drawingPos - textArea.VirtualTop.X); + } + + // if logicalLine/logicalColumn is in folding + if (f.EndLine > logicalLine || f.EndLine == logicalLine && f.EndColumn > logicalColumn) { + logicalColumn = f.StartColumn; + logicalLine = f.StartLine; + --i; + } + lastFolding = i; + + // search backwards until a new visible line is reched + for (; i >= 0; --i) { + f = (FoldMarker)foldings[i]; + if (f.EndLine < logicalLine) { // reached the begin of a new visible line + break; + } + } + firstFolding = i + 1; + + if (lastFolding < firstFolding) { + drawingPos = CountColumns(ref column, 0, logicalColumn, logicalLine, g); + return (int)(drawingPos - textArea.VirtualTop.X); + } + + int foldEnd = 0; + drawingPos = 0; + for (i = firstFolding; i <= lastFolding; ++i) { + f = foldings[i]; + drawingPos += CountColumns(ref column, foldEnd, f.StartColumn, f.StartLine, g); + foldEnd = f.EndColumn; + column += f.FoldText.Length; + drawingPos += additionalFoldTextSize; + drawingPos += MeasureStringWidth(g, f.FoldText, TextEditorProperties.FontContainer.RegularFont); + } + drawingPos += CountColumns(ref column, foldEnd, logicalColumn, logicalLine, g); + g.Dispose(); + return (int)(drawingPos - textArea.VirtualTop.X); + } + #endregion + + #region DrawHelper functions + void DrawBracketHighlight(Graphics g, Rectangle rect) + { + g.FillRectangle(BrushRegistry.GetBrush(System.Drawing.Color.FromArgb(219, 224, 204)), rect); + //g.DrawRectangle(Pens.Blue, rect); + } + + void DrawString(Graphics g, string text, Font font, Color color, int x, int y) + { + if (Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix) + x += 2; + TextRenderer.DrawText(g, text, font, new Point(x, y), color, textFormatFlags); + } + + void DrawInvalidLineMarker(Graphics g, int x, int y) + { + HighlightColor invalidLinesColor = textArea.Document.HighlightingStrategy.GetColorFor("InvalidLines"); + DrawString(g, "~", invalidLinesColor.GetFont(TextEditorProperties.FontContainer), invalidLinesColor.Color, x, y); + } + + void DrawSpaceMarker(Graphics g, Color color, int x, int y) + { + HighlightColor spaceMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("SpaceMarkers"); + DrawString(g, "\u00B7", spaceMarkerColor.GetFont(TextEditorProperties.FontContainer), color, x, y); + } + + void DrawTabMarker(Graphics g, Color color, int x, int y) + { + HighlightColor tabMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("TabMarkers"); + DrawString(g, "\u00BB", tabMarkerColor.GetFont(TextEditorProperties.FontContainer), color, x, y); + } + + int DrawEOLMarker(Graphics g, Color color, Brush backBrush, int x, int y) + { + HighlightColor eolMarkerColor = textArea.Document.HighlightingStrategy.GetColorFor("EOLMarkers"); + + int width = GetWidth('\u00B6', eolMarkerColor.GetFont(TextEditorProperties.FontContainer)); + g.FillRectangle(backBrush, + new RectangleF(x, y, width, fontHeight)); + + DrawString(g, "\u00B6", eolMarkerColor.GetFont(TextEditorProperties.FontContainer), color, x, y); + return width; + } + + void DrawVerticalRuler(Graphics g, Rectangle lineRectangle) + { + int xpos = WideSpaceWidth * TextEditorProperties.VerticalRulerRow - textArea.VirtualTop.X; + if (xpos <= 0) { + return; + } + HighlightColor vRulerColor = textArea.Document.HighlightingStrategy.GetColorFor("VRuler"); + + g.DrawLine(BrushRegistry.GetPen(vRulerColor.Color), + drawingPosition.Left + xpos, + lineRectangle.Top, + drawingPosition.Left + xpos, + lineRectangle.Bottom); + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Gui/ToolTipRequestEventArgs.cs b/ICSharpCode.TextEditorLinux/Src/Gui/ToolTipRequestEventArgs.cs new file mode 100644 index 000000000..883995558 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Gui/ToolTipRequestEventArgs.cs @@ -0,0 +1,62 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor +{ + public delegate void ToolTipRequestEventHandler(object sender, ToolTipRequestEventArgs e); + + public class ToolTipRequestEventArgs + { + Point mousePosition; + TextLocation logicalPosition; + bool inDocument; + + public Point MousePosition { + get { + return mousePosition; + } + } + + public TextLocation LogicalPosition { + get { + return logicalPosition; + } + } + + public bool InDocument { + get { + return inDocument; + } + } + + /// + /// Gets if some client handling the event has already shown a tool tip. + /// + public bool ToolTipShown { + get { + return toolTipText != null; + } + } + + internal string toolTipText; + + public void ShowToolTip(string text) + { + toolTipText = text; + } + + public ToolTipRequestEventArgs(Point mousePosition, TextLocation logicalPosition, bool inDocument) + { + this.mousePosition = mousePosition; + this.logicalPosition = logicalPosition; + this.inDocument = inDocument; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Undo/IUndoableOperation.cs b/ICSharpCode.TextEditorLinux/Src/Undo/IUndoableOperation.cs new file mode 100644 index 000000000..472f92c64 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Undo/IUndoableOperation.cs @@ -0,0 +1,26 @@ +// +// +// +// +// $Revision: 915 $ +// + +namespace ICSharpCode.TextEditor.Undo +{ + /// + /// This Interface describes a the basic Undo/Redo operation + /// all Undo Operations must implement this interface. + /// + public interface IUndoableOperation + { + /// + /// Undo the last operation + /// + void Undo(); + + /// + /// Redo the last operation + /// + void Redo(); + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Undo/UndoQueue.cs b/ICSharpCode.TextEditorLinux/Src/Undo/UndoQueue.cs new file mode 100644 index 000000000..6e386f61d --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Undo/UndoQueue.cs @@ -0,0 +1,53 @@ +// +// +// +// +// $Revision: 2161 $ +// + +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace ICSharpCode.TextEditor.Undo +{ + /// + /// This class stacks the last x operations from the undostack and makes + /// one undo/redo operation from it. + /// + internal sealed class UndoQueue : IUndoableOperation + { + List undolist = new List(); + + /// + /// + public UndoQueue(Stack stack, int numops) + { + if (stack == null) { + throw new ArgumentNullException("stack"); + } + + Debug.Assert(numops > 0 , "ICSharpCode.TextEditor.Undo.UndoQueue : numops should be > 0"); + if (numops > stack.Count) { + numops = stack.Count; + } + + for (int i = 0; i < numops; ++i) { + undolist.Add(stack.Pop()); + } + } + public void Undo() + { + for (int i = 0; i < undolist.Count; ++i) { + undolist[i].Undo(); + } + } + + public void Redo() + { + for (int i = undolist.Count - 1 ; i >= 0 ; --i) { + undolist[i].Redo(); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Undo/UndoStack.cs b/ICSharpCode.TextEditorLinux/Src/Undo/UndoStack.cs new file mode 100644 index 000000000..5eb439f57 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Undo/UndoStack.cs @@ -0,0 +1,223 @@ +// +// +// +// +// $Revision: 2659 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Undo +{ + /// + /// This class implements an undo stack + /// + public class UndoStack + { + Stack undostack = new Stack(); + Stack redostack = new Stack(); + + public TextEditorControlBase TextEditorControl = null; + + /// + /// + public event EventHandler ActionUndone; + /// + /// + public event EventHandler ActionRedone; + + /// + /// Gets/Sets if changes to the document are protocolled by the undo stack. + /// Used internally to disable the undo stack temporarily while undoing an action. + /// + internal bool AcceptChanges = true; + + /// + /// Gets if there are actions on the undo stack. + /// + public bool CanUndo { + get { + return undostack.Count > 0; + } + } + + /// + /// Gets if there are actions on the redo stack. + /// + public bool CanRedo { + get { + return redostack.Count > 0; + } + } + + /// + /// Gets the number of actions on the undo stack. + /// + public int UndoItemCount { + get { + return undostack.Count; + } + } + + /// + /// Gets the number of actions on the redo stack. + /// + public int RedoItemCount { + get { + return redostack.Count; + } + } + +// /// +// /// You call this method to pool the last x operations from the undo stack +// /// to make 1 operation from it. +// /// +// public void CombineLast(int actionCount) +// { +// undostack.Push(new UndoQueue(undostack, actionCount)); +// } + + int undoGroupDepth; + int actionCountInUndoGroup; + + public void StartUndoGroup() + { + if (undoGroupDepth == 0) { + actionCountInUndoGroup = 0; + } + undoGroupDepth++; + } + + public void EndUndoGroup() + { + if (undoGroupDepth == 0) + return; + //throw new InvalidOperationException("There are no open undo groups"); + undoGroupDepth--; + if (undoGroupDepth == 0 && actionCountInUndoGroup > 1) { + undostack.Push(new UndoQueue(undostack, actionCountInUndoGroup)); + } + } + + /// + /// Call this method to undo the last operation on the stack + /// + public void Undo() + { + while (undoGroupDepth != 0) // SSM 24.08.18 - грязный хак в попытке исправления ошибки с Ctrl-Z + { + EndUndoGroup(); + } + if (undoGroupDepth != 0) { + throw new InvalidOperationException("cannot perform Undo/Redo while undo group is open"); + } + if (undostack.Count > 0) { + IUndoableOperation uedit = (IUndoableOperation)undostack.Pop(); + redostack.Push(uedit); + uedit.Undo(); + OnActionUndone(); + } + } + + /// + /// Call this method to redo the last undone operation + /// + public void Redo() + { + if (undoGroupDepth != 0) { + throw new InvalidOperationException("cannot perform Undo/Redo while undo group is open"); + } + if (redostack.Count > 0) { + IUndoableOperation uedit = (IUndoableOperation)redostack.Pop(); + undostack.Push(uedit); + uedit.Redo(); + OnActionRedone(); + } + } + + /// + /// Call this method to push an UndoableOperation on the undostack, the redostack + /// will be cleared, if you use this method. + /// + public void Push(IUndoableOperation operation) + { + if (operation == null) { + throw new ArgumentNullException("UndoStack.Push(UndoableOperation operation) : operation can't be null"); + } + + if (AcceptChanges) { + StartUndoGroup(); + undostack.Push(operation); + actionCountInUndoGroup++; + if (TextEditorControl != null) { + undostack.Push(new UndoableSetCaretPosition(this, TextEditorControl.ActiveTextAreaControl.Caret.Position)); + actionCountInUndoGroup++; + } + EndUndoGroup(); + ClearRedoStack(); + } + } + + /// + /// Call this method, if you want to clear the redo stack + /// + public void ClearRedoStack() + { + redostack.Clear(); + } + + /// + /// Clears both the undo and redo stack. + /// + public void ClearAll() + { + undostack.Clear(); + redostack.Clear(); + actionCountInUndoGroup = 0; + } + + /// + /// + protected void OnActionUndone() + { + if (ActionUndone != null) { + ActionUndone(null, null); + } + } + + /// + /// + protected void OnActionRedone() + { + if (ActionRedone != null) { + ActionRedone(null, null); + } + } + + class UndoableSetCaretPosition : IUndoableOperation + { + UndoStack stack; + TextLocation pos; + TextLocation redoPos; + + public UndoableSetCaretPosition(UndoStack stack, TextLocation pos) + { + this.stack = stack; + this.pos = pos; + } + + public void Undo() + { + redoPos = stack.TextEditorControl.ActiveTextAreaControl.Caret.Position; + stack.TextEditorControl.ActiveTextAreaControl.Caret.Position = pos; + } + + public void Redo() + { + stack.TextEditorControl.ActiveTextAreaControl.Caret.Position = redoPos; + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Undo/UndoableDelete.cs b/ICSharpCode.TextEditorLinux/Src/Undo/UndoableDelete.cs new file mode 100644 index 000000000..fc0a5aa57 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Undo/UndoableDelete.cs @@ -0,0 +1,72 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Diagnostics; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Undo +{ + /// + /// This class is for the undo of Document insert operations + /// + public class UndoableDelete : IUndoableOperation + { + IDocument document; +// int oldCaretPos; + int offset; + string text; + + /// + /// Creates a new instance of + /// + public UndoableDelete(IDocument document, int offset, string text) + { + if (document == null) { + throw new ArgumentNullException("document"); + } + if (offset < 0 || offset > document.TextLength) { + throw new ArgumentOutOfRangeException("offset"); + } + + Debug.Assert(text != null, "text can't be null"); +// oldCaretPos = document.Caret.Offset; + this.document = document; + this.offset = offset; + this.text = text; + } + + /// + /// Undo last operation + /// + public void Undo() + { + // we clear all selection direct, because the redraw + // is done per refresh at the end of the action +// textArea.SelectionManager.SelectionCollection.Clear(); + document.UndoStack.AcceptChanges = false; + document.Insert(offset, text); +// document.Caret.Offset = Math.Min(document.TextLength, Math.Max(0, oldCaretPos)); + document.UndoStack.AcceptChanges = true; + } + + /// + /// Redo last undone operation + /// + public void Redo() + { + // we clear all selection direct, because the redraw + // is done per refresh at the end of the action +// textArea.SelectionManager.SelectionCollection.Clear(); + + document.UndoStack.AcceptChanges = false; + document.Remove(offset, text.Length); +// document.Caret.Offset = Math.Min(document.TextLength, Math.Max(0, document.Caret.Offset)); + document.UndoStack.AcceptChanges = true; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Undo/UndoableInsert.cs b/ICSharpCode.TextEditorLinux/Src/Undo/UndoableInsert.cs new file mode 100644 index 000000000..5591a1d1e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Undo/UndoableInsert.cs @@ -0,0 +1,73 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Diagnostics; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Undo +{ + /// + /// This class is for the undo of Document insert operations + /// + public class UndoableInsert : IUndoableOperation + { + IDocument document; +// int oldCaretPos; + int offset; + string text; + + /// + /// Creates a new instance of + /// + public UndoableInsert(IDocument document, int offset, string text) + { + if (document == null) { + throw new ArgumentNullException("document"); + } + if (offset < 0 || offset > document.TextLength) { + throw new ArgumentOutOfRangeException("offset"); + } + + Debug.Assert(text != null, "text can't be null"); +// oldCaretPos = document.Caret.Offset; + this.document = document; + this.offset = offset; + this.text = text; + } + + /// + /// Undo last operation + /// + public void Undo() + { + // we clear all selection direct, because the redraw + // is done per refresh at the end of the action +// document.SelectionCollection.Clear(); + + document.UndoStack.AcceptChanges = false; + document.Remove(offset, text.Length); +// document.Caret.Offset = Math.Min(document.TextLength, Math.Max(0, oldCaretPos)); + document.UndoStack.AcceptChanges = true; + } + + /// + /// Redo last undone operation + /// + public void Redo() + { + // we clear all selection direct, because the redraw + // is done per refresh at the end of the action +// document.SelectionCollection.Clear(); + + document.UndoStack.AcceptChanges = false; + document.Insert(offset, text); +// document.Caret.Offset = Math.Min(document.TextLength, Math.Max(0, document.Caret.Offset)); + document.UndoStack.AcceptChanges = true; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Undo/UndoableReplace.cs b/ICSharpCode.TextEditorLinux/Src/Undo/UndoableReplace.cs new file mode 100644 index 000000000..77f51f4ed --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Undo/UndoableReplace.cs @@ -0,0 +1,75 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using System.Diagnostics; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Undo +{ + /// + /// This class is for the undo of Document insert operations + /// + public class UndoableReplace : IUndoableOperation + { + IDocument document; +// int oldCaretPos; + int offset; + string text; + string origText; + + /// + /// Creates a new instance of + /// + public UndoableReplace(IDocument document, int offset, string origText, string text) + { + if (document == null) { + throw new ArgumentNullException("document"); + } + if (offset < 0 || offset > document.TextLength) { + throw new ArgumentOutOfRangeException("offset"); + } + + Debug.Assert(text != null, "text can't be null"); +// oldCaretPos = document.Caret.Offset; + this.document = document; + this.offset = offset; + this.text = text; + this.origText = origText; + } + + /// + /// Undo last operation + /// + public void Undo() + { + // we clear all selection direct, because the redraw + // is done per refresh at the end of the action +// document.SelectionCollection.Clear(); + + document.UndoStack.AcceptChanges = false; + document.Replace(offset, text.Length, origText); +// document.Caret.Offset = Math.Min(document.TextLength, Math.Max(0, oldCaretPos)); + document.UndoStack.AcceptChanges = true; + } + + /// + /// Redo last undone operation + /// + public void Redo() + { + // we clear all selection direct, because the redraw + // is done per refresh at the end of the action +// document.SelectionCollection.Clear(); + + document.UndoStack.AcceptChanges = false; + document.Replace(offset, origText.Length, text); +// document.Caret.Offset = Math.Min(document.TextLength, Math.Max(0, document.Caret.Offset)); + document.UndoStack.AcceptChanges = true; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/AugmentableRedBlackTree.cs b/ICSharpCode.TextEditorLinux/Src/Util/AugmentableRedBlackTree.cs new file mode 100644 index 000000000..33bc9665c --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/AugmentableRedBlackTree.cs @@ -0,0 +1,590 @@ +// +// +// +// +// $Revision: 2497 $ +// + +using System; +using System.Text; +using System.Diagnostics; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Util +{ + internal sealed class RedBlackTreeNode + { + internal RedBlackTreeNode left, right, parent; + internal T val; + internal bool color; + + internal RedBlackTreeNode(T val) + { + this.val = val; + } + + internal RedBlackTreeNode LeftMost { + get { + RedBlackTreeNode node = this; + while (node.left != null) + node = node.left; + return node; + } + } + + internal RedBlackTreeNode RightMost { + get { + RedBlackTreeNode node = this; + while (node.right != null) + node = node.right; + return node; + } + } + } + + internal interface IRedBlackTreeHost : IComparer + { + bool Equals(T a, T b); + + void UpdateAfterChildrenChange(RedBlackTreeNode node); + void UpdateAfterRotateLeft(RedBlackTreeNode node); + void UpdateAfterRotateRight(RedBlackTreeNode node); + } + + /// + /// Description of RedBlackTree. + /// + internal sealed class AugmentableRedBlackTree : ICollection where Host : IRedBlackTreeHost + { + readonly Host host; + int count; + internal RedBlackTreeNode root; + + public AugmentableRedBlackTree(Host host) + { + if (host == null) throw new ArgumentNullException("host"); + this.host = host; + } + + public int Count { + get { return count; } + } + + public void Clear() + { + root = null; + count = 0; + } + + #region Debugging code + #if DEBUG + /// + /// Check tree for consistency and being balanced. + /// + [Conditional("DATACONSISTENCYTEST")] + void CheckProperties() + { + int blackCount = -1; + CheckNodeProperties(root, null, RED, 0, ref blackCount); + + int nodeCount = 0; + foreach (T val in this) { + nodeCount++; + } + Debug.Assert(count == nodeCount); + } + + /* + 1. A node is either red or black. + 2. The root is black. + 3. All leaves are black. (The leaves are the NIL children.) + 4. Both children of every red node are black. (So every red node must have a black parent.) + 5. Every simple path from a node to a descendant leaf contains the same number of black nodes. (Not counting the leaf node.) + */ + void CheckNodeProperties(RedBlackTreeNode node, RedBlackTreeNode parentNode, bool parentColor, int blackCount, ref int expectedBlackCount) + { + if (node == null) return; + + Debug.Assert(node.parent == parentNode); + + if (parentColor == RED) { + Debug.Assert(node.color == BLACK); + } + if (node.color == BLACK) { + blackCount++; + } + if (node.left == null && node.right == null) { + // node is a leaf node: + if (expectedBlackCount == -1) + expectedBlackCount = blackCount; + else + Debug.Assert(expectedBlackCount == blackCount); + } + CheckNodeProperties(node.left, node, node.color, blackCount, ref expectedBlackCount); + CheckNodeProperties(node.right, node, node.color, blackCount, ref expectedBlackCount); + } + + public string GetTreeAsString() + { + StringBuilder b = new StringBuilder(); + AppendTreeToString(root, b, 0); + return b.ToString(); + } + + static void AppendTreeToString(RedBlackTreeNode node, StringBuilder b, int indent) + { + if (node.color == RED) + b.Append("RED "); + else + b.Append("BLACK "); + b.AppendLine(node.val.ToString()); + indent += 2; + if (node.left != null) { + b.Append(' ', indent); + b.Append("L: "); + AppendTreeToString(node.left, b, indent); + } + if (node.right != null) { + b.Append(' ', indent); + b.Append("R: "); + AppendTreeToString(node.right, b, indent); + } + } + #endif + #endregion + + #region Add + public void Add(T item) + { + AddInternal(new RedBlackTreeNode(item)); + #if DEBUG + CheckProperties(); + #endif + } + + void AddInternal(RedBlackTreeNode newNode) + { + Debug.Assert(newNode.color == BLACK); + if (root == null) { + count = 1; + root = newNode; + return; + } + // Insert into the tree + RedBlackTreeNode parentNode = root; + while (true) { + if (host.Compare(newNode.val, parentNode.val) <= 0) { + if (parentNode.left == null) { + InsertAsLeft(parentNode, newNode); + return; + } + parentNode = parentNode.left; + } else { + if (parentNode.right == null) { + InsertAsRight(parentNode, newNode); + return; + } + parentNode = parentNode.right; + } + } + } + + internal void InsertAsLeft(RedBlackTreeNode parentNode, RedBlackTreeNode newNode) + { + Debug.Assert(parentNode.left == null); + parentNode.left = newNode; + newNode.parent = parentNode; + newNode.color = RED; + host.UpdateAfterChildrenChange(parentNode); + FixTreeOnInsert(newNode); + count++; + } + + internal void InsertAsRight(RedBlackTreeNode parentNode, RedBlackTreeNode newNode) + { + Debug.Assert(parentNode.right == null); + parentNode.right = newNode; + newNode.parent = parentNode; + newNode.color = RED; + host.UpdateAfterChildrenChange(parentNode); + FixTreeOnInsert(newNode); + count++; + } + + void FixTreeOnInsert(RedBlackTreeNode node) + { + Debug.Assert(node != null); + Debug.Assert(node.color == RED); + Debug.Assert(node.left == null || node.left.color == BLACK); + Debug.Assert(node.right == null || node.right.color == BLACK); + + RedBlackTreeNode parentNode = node.parent; + if (parentNode == null) { + // we inserted in the root -> the node must be black + // since this is a root node, making the node black increments the number of black nodes + // on all paths by one, so it is still the same for all paths. + node.color = BLACK; + return; + } + if (parentNode.color == BLACK) { + // if the parent node where we inserted was black, our red node is placed correctly. + // since we inserted a red node, the number of black nodes on each path is unchanged + // -> the tree is still balanced + return; + } + // parentNode is red, so there is a conflict here! + + // because the root is black, parentNode is not the root -> there is a grandparent node + RedBlackTreeNode grandparentNode = parentNode.parent; + RedBlackTreeNode uncleNode = Sibling(parentNode); + if (uncleNode != null && uncleNode.color == RED) { + parentNode.color = BLACK; + uncleNode.color = BLACK; + grandparentNode.color = RED; + FixTreeOnInsert(grandparentNode); + return; + } + // now we know: parent is red but uncle is black + // First rotation: + if (node == parentNode.right && parentNode == grandparentNode.left) { + RotateLeft(parentNode); + node = node.left; + } else if (node == parentNode.left && parentNode == grandparentNode.right) { + RotateRight(parentNode); + node = node.right; + } + // because node might have changed, reassign variables: + parentNode = node.parent; + grandparentNode = parentNode.parent; + + // Now recolor a bit: + parentNode.color = BLACK; + grandparentNode.color = RED; + // Second rotation: + if (node == parentNode.left && parentNode == grandparentNode.left) { + RotateRight(grandparentNode); + } else { + // because of the first rotation, this is guaranteed: + Debug.Assert(node == parentNode.right && parentNode == grandparentNode.right); + RotateLeft(grandparentNode); + } + } + + void ReplaceNode(RedBlackTreeNode replacedNode, RedBlackTreeNode newNode) + { + if (replacedNode.parent == null) { + Debug.Assert(replacedNode == root); + root = newNode; + } else { + if (replacedNode.parent.left == replacedNode) + replacedNode.parent.left = newNode; + else + replacedNode.parent.right = newNode; + } + if (newNode != null) { + newNode.parent = replacedNode.parent; + } + replacedNode.parent = null; + } + + void RotateLeft(RedBlackTreeNode p) + { + // let q be p's right child + RedBlackTreeNode q = p.right; + Debug.Assert(q != null); + Debug.Assert(q.parent == p); + // set q to be the new root + ReplaceNode(p, q); + + // set p's right child to be q's left child + p.right = q.left; + if (p.right != null) p.right.parent = p; + // set q's left child to be p + q.left = p; + p.parent = q; + host.UpdateAfterRotateLeft(p); + } + + void RotateRight(RedBlackTreeNode p) + { + // let q be p's left child + RedBlackTreeNode q = p.left; + Debug.Assert(q != null); + Debug.Assert(q.parent == p); + // set q to be the new root + ReplaceNode(p, q); + + // set p's left child to be q's right child + p.left = q.right; + if (p.left != null) p.left.parent = p; + // set q's right child to be p + q.right = p; + p.parent = q; + host.UpdateAfterRotateRight(p); + } + + RedBlackTreeNode Sibling(RedBlackTreeNode node) + { + if (node == node.parent.left) + return node.parent.right; + else + return node.parent.left; + } + #endregion + + #region Remove + public void RemoveAt(RedBlackTreeIterator iterator) + { + RedBlackTreeNode node = iterator.node; + if (node == null) + throw new ArgumentException("Invalid iterator"); + while (node.parent != null) + node = node.parent; + if (node != root) + throw new ArgumentException("Iterator does not belong to this tree"); + RemoveNode(iterator.node); + #if DEBUG + CheckProperties(); + #endif + } + + internal void RemoveNode(RedBlackTreeNode removedNode) + { + if (removedNode.left != null && removedNode.right != null) { + // replace removedNode with it's in-order successor + + RedBlackTreeNode leftMost = removedNode.right.LeftMost; + RemoveNode(leftMost); // remove leftMost from its current location + + // and overwrite the removedNode with it + ReplaceNode(removedNode, leftMost); + leftMost.left = removedNode.left; + if (leftMost.left != null) leftMost.left.parent = leftMost; + leftMost.right = removedNode.right; + if (leftMost.right != null) leftMost.right.parent = leftMost; + leftMost.color = removedNode.color; + + host.UpdateAfterChildrenChange(leftMost); + if (leftMost.parent != null) host.UpdateAfterChildrenChange(leftMost.parent); + return; + } + + count--; + + // now either removedNode.left or removedNode.right is null + // get the remaining child + RedBlackTreeNode parentNode = removedNode.parent; + RedBlackTreeNode childNode = removedNode.left ?? removedNode.right; + ReplaceNode(removedNode, childNode); + if (parentNode != null) host.UpdateAfterChildrenChange(parentNode); + if (removedNode.color == BLACK) { + if (childNode != null && childNode.color == RED) { + childNode.color = BLACK; + } else { + FixTreeOnDelete(childNode, parentNode); + } + } + } + + static RedBlackTreeNode Sibling(RedBlackTreeNode node, RedBlackTreeNode parentNode) + { + Debug.Assert(node == null || node.parent == parentNode); + if (node == parentNode.left) + return parentNode.right; + else + return parentNode.left; + } + + const bool RED = true; + const bool BLACK = false; + + static bool GetColor(RedBlackTreeNode node) + { + return node != null ? node.color : BLACK; + } + + void FixTreeOnDelete(RedBlackTreeNode node, RedBlackTreeNode parentNode) + { + Debug.Assert(node == null || node.parent == parentNode); + if (parentNode == null) + return; + + // warning: node may be null + RedBlackTreeNode sibling = Sibling(node, parentNode); + if (sibling.color == RED) { + parentNode.color = RED; + sibling.color = BLACK; + if (node == parentNode.left) { + RotateLeft(parentNode); + } else { + RotateRight(parentNode); + } + + sibling = Sibling(node, parentNode); // update value of sibling after rotation + } + + if (parentNode.color == BLACK + && sibling.color == BLACK + && GetColor(sibling.left) == BLACK + && GetColor(sibling.right) == BLACK) + { + sibling.color = RED; + FixTreeOnDelete(parentNode, parentNode.parent); + return; + } + + if (parentNode.color == RED + && sibling.color == BLACK + && GetColor(sibling.left) == BLACK + && GetColor(sibling.right) == BLACK) + { + sibling.color = RED; + parentNode.color = BLACK; + return; + } + + if (node == parentNode.left && + sibling.color == BLACK && + GetColor(sibling.left) == RED && + GetColor(sibling.right) == BLACK) + { + sibling.color = RED; + sibling.left.color = BLACK; + RotateRight(sibling); + } + else if (node == parentNode.right && + sibling.color == BLACK && + GetColor(sibling.right) == RED && + GetColor(sibling.left) == BLACK) + { + sibling.color = RED; + sibling.right.color = BLACK; + RotateLeft(sibling); + } + sibling = Sibling(node, parentNode); // update value of sibling after rotation + + sibling.color = parentNode.color; + parentNode.color = BLACK; + if (node == parentNode.left) { + if (sibling.right != null) { + Debug.Assert(sibling.right.color == RED); + sibling.right.color = BLACK; + } + RotateLeft(parentNode); + } else { + if (sibling.left != null) { + Debug.Assert(sibling.left.color == RED); + sibling.left.color = BLACK; + } + RotateRight(parentNode); + } + } + #endregion + + #region Find/LowerBound/UpperBound/GetEnumerator + /// + /// Returns the iterator pointing to the specified item, or an iterator in End state if the item is not found. + /// + public RedBlackTreeIterator Find(T item) + { + RedBlackTreeIterator it = LowerBound(item); + while (it.IsValid && host.Compare(it.Current, item) == 0) { + if (host.Equals(it.Current, item)) + return it; + it.MoveNext(); + } + return default(RedBlackTreeIterator); + } + + /// + /// Returns the iterator pointing to the first item greater or equal to . + /// + public RedBlackTreeIterator LowerBound(T item) + { + RedBlackTreeNode node = root; + RedBlackTreeNode resultNode = null; + while (node != null) { + if (host.Compare(node.val, item) < 0) { + node = node.right; + } else { + resultNode = node; + node = node.left; + } + } + return new RedBlackTreeIterator(resultNode); + } + + /// + /// Returns the iterator pointing to the first item greater than . + /// + public RedBlackTreeIterator UpperBound(T item) + { + RedBlackTreeIterator it = LowerBound(item); + while (it.IsValid && host.Compare(it.Current, item) == 0) { + it.MoveNext(); + } + return it; + } + + /// + /// Gets a tree iterator that starts on the first node. + /// + public RedBlackTreeIterator Begin() + { + if (root == null) return default(RedBlackTreeIterator); + return new RedBlackTreeIterator(root.LeftMost); + } + + /// + /// Gets a tree iterator that starts one node before the first node. + /// + public RedBlackTreeIterator GetEnumerator() + { + if (root == null) return default(RedBlackTreeIterator); + RedBlackTreeNode dummyNode = new RedBlackTreeNode(default(T)); + dummyNode.right = root; + return new RedBlackTreeIterator(dummyNode); + } + #endregion + + #region ICollection members + public bool Contains(T item) + { + return Find(item).IsValid; + } + + public bool Remove(T item) + { + RedBlackTreeIterator it = Find(item); + if (!it.IsValid) { + return false; + } else { + RemoveAt(it); + return true; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + bool ICollection.IsReadOnly { + get { return false; } + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (array == null) throw new ArgumentNullException("array"); + foreach (T val in this) { + array[arrayIndex++] = val; + } + } + #endregion + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/FileReader.cs b/ICSharpCode.TextEditorLinux/Src/Util/FileReader.cs new file mode 100644 index 000000000..f6abf5a8d --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/FileReader.cs @@ -0,0 +1,152 @@ +// +// +// +// +// $Revision: 2682 $ +// + +using System; +using System.IO; +using System.Text; + +namespace ICSharpCode.TextEditor.Util +{ + /// + /// Class that can open text files with auto-detection of the encoding. + /// + public static class FileReader + { + public static bool IsUnicode(Encoding encoding) + { + int codepage = encoding.CodePage; + // return true if codepage is any UTF codepage + return codepage == 65001 || codepage == 65000 || codepage == 1200 || codepage == 1201; + } + + public static string ReadFileContent(Stream fs, ref Encoding encoding) + { + using (StreamReader reader = OpenStream(fs, encoding)) { + reader.Peek(); + encoding = reader.CurrentEncoding; + return reader.ReadToEnd(); + } + } + + public static string ReadFileContent(string fileName, Encoding encoding) + { + using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { + return ReadFileContent(fs, ref encoding); + } + } + + public static StreamReader OpenStream(Stream fs, Encoding defaultEncoding) + { + if (fs == null) + throw new ArgumentNullException("fs"); + + if (fs.Length >= 2) { + // the autodetection of StreamReader is not capable of detecting the difference + // between ISO-8859-1 and UTF-8 without BOM. + int firstByte = fs.ReadByte(); + int secondByte = fs.ReadByte(); + switch ((firstByte << 8) | secondByte) { + case 0x0000: // either UTF-32 Big Endian or a binary file; use StreamReader + case 0xfffe: // Unicode BOM (UTF-16 LE or UTF-32 LE) + case 0xfeff: // UTF-16 BE BOM + case 0xefbb: // start of UTF-8 BOM + // StreamReader autodetection works + fs.Position = 0; + return new StreamReader(fs); + default: + return AutoDetect(fs, (byte)firstByte, (byte)secondByte, defaultEncoding); + } + } else { + if (defaultEncoding != null) { + return new StreamReader(fs, defaultEncoding); + } else { + return new StreamReader(fs); + } + } + } + + static StreamReader AutoDetect(Stream fs, byte firstByte, byte secondByte, Encoding defaultEncoding) + { + int max = (int)Math.Min(fs.Length, 500000); // look at max. 500 KB + const int ASCII = 0; + const int Error = 1; + const int UTF8 = 2; + const int UTF8Sequence = 3; + int state = ASCII; + int sequenceLength = 0; + byte b; + for (int i = 0; i < max; i++) { + if (i == 0) { + b = firstByte; + } else if (i == 1) { + b = secondByte; + } else { + b = (byte)fs.ReadByte(); + } + if (b < 0x80) { + // normal ASCII character + if (state == UTF8Sequence) { + state = Error; + break; + } + } else if (b < 0xc0) { + // 10xxxxxx : continues UTF8 byte sequence + if (state == UTF8Sequence) { + --sequenceLength; + if (sequenceLength < 0) { + state = Error; + break; + } else if (sequenceLength == 0) { + state = UTF8; + } + } else { + state = Error; + break; + } + } else if (b >= 0xc2 && b < 0xf5) { + // beginning of byte sequence + if (state == UTF8 || state == ASCII) { + state = UTF8Sequence; + if (b < 0xe0) { + sequenceLength = 1; // one more byte following + } else if (b < 0xf0) { + sequenceLength = 2; // two more bytes following + } else { + sequenceLength = 3; // three more bytes following + } + } else { + state = Error; + break; + } + } else { + // 0xc0, 0xc1, 0xf5 to 0xff are invalid in UTF-8 (see RFC 3629) + state = Error; + break; + } + } + fs.Position = 0; + switch (state) { + case ASCII: + case Error: + // when the file seems to be ASCII or non-UTF8, + // we read it using the user-specified encoding so it is saved again + // using that encoding. + if (IsUnicode(defaultEncoding)) { + // the file is not Unicode, so don't read it using Unicode even if the + // user has choosen Unicode as the default encoding. + + // If we don't do this, SD will end up always adding a Byte Order Mark + // to ASCII files. + defaultEncoding = Encoding.Default; // use system encoding instead + } + return new StreamReader(fs, defaultEncoding); + default: + return new StreamReader(fs); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/LookupTable.cs b/ICSharpCode.TextEditorLinux/Src/Util/LookupTable.cs new file mode 100644 index 000000000..d04d3b3ef --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/LookupTable.cs @@ -0,0 +1,140 @@ +// +// +// +// +// $Revision: 1965 $ +// + +using System; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Util +{ + /// + /// This class implements a keyword map. It implements a digital search trees (tries) to find + /// a word. + /// + public class LookupTable + { + Node root = new Node(null, null); + bool casesensitive; + int length; + + /// + /// The number of elements in the table + /// + public int Count { + get { + return length; + } + } + + /// + /// Get the object, which was inserted under the keyword (line, at offset, with length length), + /// returns null, if no such keyword was inserted. + /// + public object this[IDocument document, LineSegment line, int offset, int length] { + get { + if(length == 0) { + return null; + } + Node next = root; + + int wordOffset = line.Offset + offset; + if (casesensitive) { + for (int i = 0; i < length; ++i) { + int index = ((int)document.GetCharAt(wordOffset + i)) % 256; + next = next.leaf[index]; + + if (next == null) { + return null; + } + + if (next.color != null && TextUtility.RegionMatches(document, wordOffset, length, next.word)) { + return next.color; + } + } + } else { + for (int i = 0; i < length; ++i) { + int index = ((int)Char.ToUpper(document.GetCharAt(wordOffset + i))) % 256; + + next = next.leaf[index]; + + if (next == null) { + return null; + } + + if (next.color != null && TextUtility.RegionMatches(document, casesensitive, wordOffset, length, next.word)) { + return next.color; + } + } + } + return null; + } + } + + /// + /// Inserts an object in the tree, under keyword + /// + public object this[string keyword] { + set { + Node node = root; + Node next = root; + if (!casesensitive) { + keyword = keyword.ToUpper(); + } + ++length; + + // insert word into the tree + for (int i = 0; i < keyword.Length; ++i) { + int index = ((int)keyword[i]) % 256; // index of curchar + bool d = keyword[i] == '\\'; + + next = next.leaf[index]; // get node to this index + + if (next == null) { // no node created -> insert word here + node.leaf[index] = new Node(value, keyword); + break; + } + + if (next.word != null && next.word.Length != i) { // node there, take node content and insert them again + string tmpword = next.word; // this word will be inserted 1 level deeper (better, don't need too much + object tmpcolor = next.color; // string comparisons for finding.) + next.color = next.word = null; + this[tmpword] = tmpcolor; + } + + if (i == keyword.Length - 1) { // end of keyword reached, insert node there, if a node was here it was + next.word = keyword; // reinserted, if it has the same length (keyword EQUALS this word) it will be overwritten + next.color = value; + break; + } + + node = next; + } + } + } + + /// + /// Creates a new instance of + /// + public LookupTable(bool casesensitive) + { + this.casesensitive = casesensitive; + } + + class Node + { + public Node(object color, string word) + { + this.word = word; + this.color = color; + } + + public string word; + public object color; + + public Node[] leaf = new Node[256]; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/RedBlackTreeIterator.cs b/ICSharpCode.TextEditorLinux/Src/Util/RedBlackTreeIterator.cs new file mode 100644 index 000000000..3b972e04e --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/RedBlackTreeIterator.cs @@ -0,0 +1,85 @@ +// +// +// +// +// $Revision: 2497 $ +// + +using System; +using System.Diagnostics; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Util +{ + internal struct RedBlackTreeIterator : IEnumerator + { + internal RedBlackTreeNode node; + + internal RedBlackTreeIterator(RedBlackTreeNode node) + { + this.node = node; + } + + public bool IsValid { + get { return node != null; } + } + + public T Current { + get { + if (node != null) + return node.val; + else + throw new InvalidOperationException(); + } + } + + object System.Collections.IEnumerator.Current { + get { + return this.Current; + } + } + + void IDisposable.Dispose() + { + } + + void System.Collections.IEnumerator.Reset() + { + throw new NotSupportedException(); + } + + public bool MoveNext() + { + if (node == null) + return false; + if (node.right != null) { + node = node.right.LeftMost; + } else { + RedBlackTreeNode oldNode; + do { + oldNode = node; + node = node.parent; + // we are on the way up from the right part, don't output node again + } while (node != null && node.right == oldNode); + } + return node != null; + } + + public bool MoveBack() + { + if (node == null) + return false; + if (node.left != null) { + node = node.left.RightMost; + } else { + RedBlackTreeNode oldNode; + do { + oldNode = node; + node = node.parent; + // we are on the way up from the left part, don't output node again + } while (node != null && node.left == oldNode); + } + return node != null; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/RtfWriter.cs b/ICSharpCode.TextEditorLinux/Src/Util/RtfWriter.cs new file mode 100644 index 000000000..971a97ce5 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/RtfWriter.cs @@ -0,0 +1,190 @@ +// +// +// +// +// $Revision: 4453 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Util +{ + public class RtfWriter + { + static Dictionary colors; + static int colorNum; + static StringBuilder colorString; + + public static string GenerateRtf(TextArea textArea) + { + colors = new Dictionary(); + colorNum = 0; + colorString = new StringBuilder(); + + + StringBuilder rtf = new StringBuilder(); + + rtf.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1031"); + BuildFontTable(textArea.Document, rtf); + rtf.Append('\n'); + + string fileContent = BuildFileContent(textArea); + BuildColorTable(textArea.Document, rtf); + rtf.Append('\n'); + rtf.Append(@"\viewkind4\uc1\pard"); + rtf.Append(fileContent); + rtf.Append("}"); + return rtf.ToString(); + } + + static void BuildColorTable(IDocument doc, StringBuilder rtf) + { + rtf.Append(@"{\colortbl ;"); + rtf.Append(colorString.ToString()); + rtf.Append("}"); + } + + static void BuildFontTable(IDocument doc, StringBuilder rtf) + { + rtf.Append(@"{\fonttbl"); + rtf.Append(@"{\f0\fmodern\fprq1\fcharset0 " + doc.TextEditorProperties.Font.Name + ";}"); + rtf.Append("}"); + } + + static string BuildFileContent(TextArea textArea) + { + StringBuilder rtf = new StringBuilder(); + bool firstLine = true; + Color curColor = Color.Black; + bool oldItalic = false; + bool oldBold = false; + bool escapeSequence = false; + + foreach (ISelection selection in textArea.SelectionManager.SelectionCollection) { + int selectionOffset = textArea.Document.PositionToOffset(selection.StartPosition); + int selectionEndOffset = textArea.Document.PositionToOffset(selection.EndPosition); + for (int i = selection.StartPosition.Y; i <= selection.EndPosition.Y; ++i) { + LineSegment line = textArea.Document.GetLineSegment(i); + int offset = line.Offset; + if (line.Words == null) { + continue; + } + + foreach (TextWord word in line.Words) { + switch (word.Type) { + case TextWordType.Space: + if (selection.ContainsOffset(offset)) { + rtf.Append(' '); + } + ++offset; + break; + + case TextWordType.Tab: + if (selection.ContainsOffset(offset)) { + rtf.Append(@"\tab"); + } + ++offset; + escapeSequence = true; + break; + + case TextWordType.Word: + Color c = word.Color; + + if (offset + word.Word.Length > selectionOffset && offset < selectionEndOffset) { + string colorstr = c.R + ", " + c.G + ", " + c.B; + + if (!colors.ContainsKey(colorstr)) { + colors[colorstr] = ++colorNum; + colorString.Append(@"\red" + c.R + @"\green" + c.G + @"\blue" + c.B + ";"); + } + if (c != curColor || firstLine) { + rtf.Append(@"\cf" + colors[colorstr].ToString()); + curColor = c; + escapeSequence = true; + } + + if (oldItalic != word.Italic) { + if (word.Italic) { + rtf.Append(@"\i"); + } else { + rtf.Append(@"\i0"); + } + oldItalic = word.Italic; + escapeSequence = true; + } + + if (oldBold != word.Bold) { + if (word.Bold) { + rtf.Append(@"\b"); + } else { + rtf.Append(@"\b0"); + } + oldBold = word.Bold; + escapeSequence = true; + } + + if (firstLine) { + rtf.Append(@"\f0\fs" + (textArea.TextEditorProperties.Font.Size * 2)); + firstLine = false; + } + if (escapeSequence) { + rtf.Append(' '); + escapeSequence = false; + } + string printWord; + if (offset < selectionOffset) { + printWord = word.Word.Substring(selectionOffset - offset); + } else if (offset + word.Word.Length > selectionEndOffset) { + printWord = word.Word.Substring(0, (offset + word.Word.Length) - selectionEndOffset); + } else { + printWord = word.Word; + } + + AppendText(rtf, printWord); + } + offset += word.Length; + break; + } + } + if (offset < selectionEndOffset) { + rtf.Append(@"\par"); + } + rtf.Append('\n'); + } + } + + return rtf.ToString(); + } + + static void AppendText(StringBuilder rtfOutput, string text) + { + //rtf.Append(printWord.Replace(@"\", @"\\").Replace("{", "\\{").Replace("}", "\\}")); + foreach (char c in text) { + switch (c) { + case '\\': + rtfOutput.Append(@"\\"); + break; + case '{': + rtfOutput.Append("\\{"); + break; + case '}': + rtfOutput.Append("\\}"); + break; + default: + if (c < 256) { + rtfOutput.Append(c); + } else { + // yes, RTF really expects signed 16-bit integers! + rtfOutput.Append("\\u" + unchecked((short)c).ToString() + "?"); + } + break; + } + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TextUtility.cs b/ICSharpCode.TextEditorLinux/Src/Util/TextUtility.cs new file mode 100644 index 000000000..66341d38c --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TextUtility.cs @@ -0,0 +1,81 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; + +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Util +{ + public class TextUtility + { + + public static bool RegionMatches(IDocument document, int offset, int length, string word) + { + if (length != word.Length || document.TextLength < offset + length) { + return false; + } + + for (int i = 0; i < length; ++i) { + if (document.GetCharAt(offset + i) != word[i]) { + return false; + } + } + return true; + } + + public static bool RegionMatches(IDocument document, bool casesensitive, int offset, int length, string word) + { + if (casesensitive) { + return RegionMatches(document, offset, length, word); + } + + if (length != word.Length || document.TextLength < offset + length) { + return false; + } + + for (int i = 0; i < length; ++i) { + if (Char.ToUpper(document.GetCharAt(offset + i)) != Char.ToUpper(word[i])) { + return false; + } + } + return true; + } + + public static bool RegionMatches(IDocument document, int offset, int length, char[] word) + { + if (length != word.Length || document.TextLength < offset + length) { + return false; + } + + for (int i = 0; i < length; ++i) { + if (document.GetCharAt(offset + i) != word[i]) { + return false; + } + } + return true; + } + + public static bool RegionMatches(IDocument document, bool casesensitive, int offset, int length, char[] word) + { + if (casesensitive) { + return RegionMatches(document, offset, length, word); + } + + if (length != word.Length || document.TextLength < offset + length) { + return false; + } + + for (int i = 0; i < length; ++i) { + if (Char.ToUpper(document.GetCharAt(offset + i)) != Char.ToUpper(word[i])) { + return false; + } + } + return true; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TipPainter.cs b/ICSharpCode.TextEditorLinux/Src/Util/TipPainter.cs new file mode 100644 index 000000000..61d4163ec --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TipPainter.cs @@ -0,0 +1,124 @@ +// +// +// +// +// $Revision: 2487 $ +// + +using System.Drawing; +using System.Drawing.Text; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Util +{ + static class TipPainter + { + const float HorizontalBorder = 2; + const float VerticalBorder = 1; + static RectangleF workingArea = RectangleF.Empty; + + //static StringFormat centerTipFormat = CreateTipStringFormat(); + + public static Size GetTipSize(Control control, Graphics graphics, Font font, string description) + { + return GetTipSize(control, graphics, new TipText (graphics, font, description)); + } + + public static Size GetTipSize(Control control, Graphics graphics, TipSection tipData) + { + Size tipSize = Size.Empty; + SizeF tipSizeF = SizeF.Empty; + + if (workingArea == RectangleF.Empty) { + Form ownerForm = control.FindForm(); + if (ownerForm.Owner != null) { + ownerForm = ownerForm.Owner; + } + + workingArea = Screen.GetWorkingArea(ownerForm); + } + + PointF screenLocation = control.PointToScreen(Point.Empty); + + SizeF maxLayoutSize = new SizeF(workingArea.Right - screenLocation.X - HorizontalBorder * 2, + workingArea.Bottom - screenLocation.Y - VerticalBorder * 2); + + if (maxLayoutSize.Width > 0 && maxLayoutSize.Height > 0) { + //graphics.TextRenderingHint = + //TextRenderingHint.AntiAliasGridFit; + + tipData.SetMaximumSize(maxLayoutSize); + tipSizeF = tipData.GetRequiredSize(); + tipData.SetAllocatedSize(tipSizeF); + + tipSizeF += new SizeF(HorizontalBorder * 2, + VerticalBorder * 2); + tipSize = Size.Ceiling(tipSizeF); + } + + if (control.ClientSize != tipSize) { + control.ClientSize = tipSize; + } + + return tipSize; + } + + public static Size DrawTip(Control control, Graphics graphics, Font font, string description) + { + return DrawTip(control, graphics, new TipText (graphics, font, description)); + } + + public static Size DrawTip(Control control, Graphics graphics, TipSection tipData) + { + Size tipSize = Size.Empty; + SizeF tipSizeF = SizeF.Empty; + + PointF screenLocation = control.PointToScreen(Point.Empty); + + if (workingArea == RectangleF.Empty) { + Form ownerForm = control.FindForm(); + if (ownerForm.Owner != null) { + ownerForm = ownerForm.Owner; + } + + workingArea = Screen.GetWorkingArea(ownerForm); + } + + SizeF maxLayoutSize = new SizeF(workingArea.Right - screenLocation.X - HorizontalBorder * 2, + workingArea.Bottom - screenLocation.Y - VerticalBorder * 2); + + if (maxLayoutSize.Width > 0 && maxLayoutSize.Height > 0) { + //graphics.TextRenderingHint = + //TextRenderingHint.AntiAliasGridFit; + + tipData.SetMaximumSize(maxLayoutSize); + tipSizeF = tipData.GetRequiredSize(); + tipData.SetAllocatedSize(tipSizeF); + + tipSizeF += new SizeF(HorizontalBorder * 2, + VerticalBorder * 2); + tipSize = Size.Ceiling(tipSizeF); + } + + if (control.ClientSize != tipSize) { + control.ClientSize = tipSize; + } + + if (tipSize != Size.Empty) { + Rectangle borderRectangle = new Rectangle + (Point.Empty, tipSize - new Size(1, 1)); + + RectangleF displayRectangle = new RectangleF + (HorizontalBorder, VerticalBorder, + tipSizeF.Width - HorizontalBorder * 2, + tipSizeF.Height - VerticalBorder * 2); + + // DrawRectangle draws from Left to Left + Width. A bug? :-/ + graphics.DrawRectangle(SystemPens.WindowFrame, + borderRectangle); + tipData.Draw(new PointF(HorizontalBorder, VerticalBorder)); + } + return tipSize; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TipPainterTools.cs b/ICSharpCode.TextEditorLinux/Src/Util/TipPainterTools.cs new file mode 100644 index 000000000..5fe96ad13 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TipPainterTools.cs @@ -0,0 +1,168 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Util +{ + class TipPainterTools + { + const int SpacerSize = 4; + + private TipPainterTools() + { + + } + public static Size GetDrawingSizeHelpTipFromCombinedDescription(Control control, + Graphics graphics, + Font font, + string countMessage, + string description) + { + string basicDescription = null; + string documentation = null; + + if (IsVisibleText(description)) { + string[] splitDescription = description.Split(new char[] { '\n' }, 2); + + if (splitDescription.Length > 0) { + basicDescription = splitDescription[0]; + + if (splitDescription.Length > 1) { + documentation = splitDescription[1].Trim(); + } + } + } + + return GetDrawingSizeDrawHelpTip(control, graphics, font, countMessage, basicDescription, documentation); + } + + public static Size DrawHelpTipFromCombinedDescription(Control control, + Graphics graphics, + Font font, + string countMessage, + string description) + { + string basicDescription = null; + string documentation = null; + + if (IsVisibleText(description)) { + string[] splitDescription = description.Split + (new char[] { '\n' }, 2); + + if (splitDescription.Length > 0) { + basicDescription = splitDescription[0]; + + if (splitDescription.Length > 1) { + documentation = splitDescription[1].Trim(); + } + } + } + + return DrawHelpTip(control, graphics, font, countMessage, + basicDescription, documentation); + } + + // btw. I know it's ugly. + public static Rectangle DrawingRectangle1; + public static Rectangle DrawingRectangle2; + + public static Size GetDrawingSizeDrawHelpTip(Control control, + Graphics graphics, Font font, + string countMessage, + string basicDescription, + string documentation) + { + if (IsVisibleText(countMessage) || + IsVisibleText(basicDescription) || + IsVisibleText(documentation)) { + // Create all the TipSection objects. + CountTipText countMessageTip = new CountTipText(graphics, font, countMessage); + + TipSpacer countSpacer = new TipSpacer(graphics, new SizeF(IsVisibleText(countMessage) ? 4 : 0, 0)); + + TipText descriptionTip = new TipText(graphics, font, basicDescription); + + TipSpacer docSpacer = new TipSpacer(graphics, new SizeF(0, IsVisibleText(documentation) ? 4 : 0)); + + TipText docTip = new TipText(graphics, font, documentation); + + // Now put them together. + TipSplitter descSplitter = new TipSplitter(graphics, false, + descriptionTip, + docSpacer + ); + + TipSplitter mainSplitter = new TipSplitter(graphics, true, + countMessageTip, + countSpacer, + descSplitter); + + TipSplitter mainSplitter2 = new TipSplitter(graphics, false, + mainSplitter, + docTip); + + // Show it. + Size size = TipPainter.GetTipSize(control, graphics, mainSplitter2); + DrawingRectangle1 = countMessageTip.DrawingRectangle1; + DrawingRectangle2 = countMessageTip.DrawingRectangle2; + return size; + } + return Size.Empty; + } + public static Size DrawHelpTip(Control control, + Graphics graphics, Font font, + string countMessage, + string basicDescription, + string documentation) + { + if (IsVisibleText(countMessage) || + IsVisibleText(basicDescription) || + IsVisibleText(documentation)) { + // Create all the TipSection objects. + CountTipText countMessageTip = new CountTipText(graphics, font, countMessage); + + TipSpacer countSpacer = new TipSpacer(graphics, new SizeF(IsVisibleText(countMessage) ? 4 : 0, 0)); + + TipText descriptionTip = new TipText(graphics, font, basicDescription); + + TipSpacer docSpacer = new TipSpacer(graphics, new SizeF(0, IsVisibleText(documentation) ? 4 : 0)); + + TipText docTip = new TipText(graphics, font, documentation); + + // Now put them together. + TipSplitter descSplitter = new TipSplitter(graphics, false, + descriptionTip, + docSpacer + ); + + TipSplitter mainSplitter = new TipSplitter(graphics, true, + countMessageTip, + countSpacer, + descSplitter); + + TipSplitter mainSplitter2 = new TipSplitter(graphics, false, + mainSplitter, + docTip); + + // Show it. + Size size = TipPainter.DrawTip(control, graphics, mainSplitter2); + DrawingRectangle1 = countMessageTip.DrawingRectangle1; + DrawingRectangle2 = countMessageTip.DrawingRectangle2; + return size; + } + return Size.Empty; + } + + static bool IsVisibleText(string text) + { + return text != null && text.Length > 0; + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TipSection.cs b/ICSharpCode.TextEditorLinux/Src/Util/TipSection.cs new file mode 100644 index 000000000..d1881fb9d --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TipSection.cs @@ -0,0 +1,84 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + abstract class TipSection + { + SizeF tipAllocatedSize; + Graphics tipGraphics; + SizeF tipMaxSize; + SizeF tipRequiredSize; + + protected TipSection(Graphics graphics) + { + tipGraphics = graphics; + } + + public abstract void Draw(PointF location); + + public SizeF GetRequiredSize() + { + return tipRequiredSize; + } + + public void SetAllocatedSize(SizeF allocatedSize) + { + Debug.Assert(allocatedSize.Width >= tipRequiredSize.Width && + allocatedSize.Height >= tipRequiredSize.Height); + + tipAllocatedSize = allocatedSize; OnAllocatedSizeChanged(); + } + + public void SetMaximumSize(SizeF maximumSize) + { + tipMaxSize = maximumSize; OnMaximumSizeChanged(); + } + + protected virtual void OnAllocatedSizeChanged() + { + + } + + protected virtual void OnMaximumSizeChanged() + { + + } + + protected void SetRequiredSize(SizeF requiredSize) + { + requiredSize.Width = Math.Max(0, requiredSize.Width); + requiredSize.Height = Math.Max(0, requiredSize.Height); + requiredSize.Width = Math.Min(tipMaxSize.Width, requiredSize.Width); + requiredSize.Height = Math.Min(tipMaxSize.Height, requiredSize.Height); + + tipRequiredSize = requiredSize; + } + + protected Graphics Graphics { + get { + return tipGraphics; + } + } + + protected SizeF AllocatedSize { + get { + return tipAllocatedSize; + } + } + + protected SizeF MaximumSize { + get { + return tipMaxSize; + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TipSpacer.cs b/ICSharpCode.TextEditorLinux/Src/Util/TipSpacer.cs new file mode 100644 index 000000000..1391df0a2 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TipSpacer.cs @@ -0,0 +1,36 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + class TipSpacer: TipSection + { + SizeF spacerSize; + + public TipSpacer(Graphics graphics, SizeF size): base(graphics) + { + spacerSize = size; + } + + public override void Draw(PointF location) + { + + } + + protected override void OnMaximumSizeChanged() + { + base.OnMaximumSizeChanged(); + + SetRequiredSize(new SizeF + (Math.Min(MaximumSize.Width, spacerSize.Width), + Math.Min(MaximumSize.Height, spacerSize.Height))); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TipSplitter.cs b/ICSharpCode.TextEditorLinux/Src/Util/TipSplitter.cs new file mode 100644 index 000000000..576a17264 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TipSplitter.cs @@ -0,0 +1,99 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + class TipSplitter: TipSection + { + bool isHorizontal; + float [] offsets; + TipSection[] tipSections; + + public TipSplitter(Graphics graphics, bool horizontal, params TipSection[] sections): base(graphics) + { + Debug.Assert(sections != null); + + isHorizontal = horizontal; + offsets = new float[sections.Length]; + tipSections = (TipSection[])sections.Clone(); + } + + public override void Draw(PointF location) + { + if (isHorizontal) { + for (int i = 0; i < tipSections.Length; i ++) { + tipSections[i].Draw + (new PointF(location.X + offsets[i], location.Y)); + } + } else { + for (int i = 0; i < tipSections.Length; i ++) { + tipSections[i].Draw + (new PointF(location.X, location.Y + offsets[i])); + } + } + } + + protected override void OnMaximumSizeChanged() + { + base.OnMaximumSizeChanged(); + + float currentDim = 0; + float otherDim = 0; + SizeF availableArea = MaximumSize; + + for (int i = 0; i < tipSections.Length; i ++) { + TipSection section = (TipSection)tipSections[i]; + + section.SetMaximumSize(availableArea); + + SizeF requiredArea = section.GetRequiredSize(); + offsets[i] = currentDim; + + // It's best to start on pixel borders, so this will + // round up to the nearest pixel. Otherwise there are + // weird cutoff artifacts. + float pixelsUsed; + + if (isHorizontal) { + pixelsUsed = (float)Math.Ceiling(requiredArea.Width); + currentDim += pixelsUsed; + + availableArea.Width = Math.Max + (0, availableArea.Width - pixelsUsed); + + otherDim = Math.Max(otherDim, requiredArea.Height); + } else { + pixelsUsed = (float)Math.Ceiling(requiredArea.Height); + currentDim += pixelsUsed; + + availableArea.Height = Math.Max + (0, availableArea.Height - pixelsUsed); + + otherDim = Math.Max(otherDim, requiredArea.Width); + } + } + + foreach (TipSection section in tipSections) { + if (isHorizontal) { + section.SetAllocatedSize(new SizeF(section.GetRequiredSize().Width, otherDim)); + } else { + section.SetAllocatedSize(new SizeF(otherDim, section.GetRequiredSize().Height)); + } + } + + if (isHorizontal) { + SetRequiredSize(new SizeF(currentDim, otherDim)); + } else { + SetRequiredSize(new SizeF(otherDim, currentDim)); + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/TipText.cs b/ICSharpCode.TextEditorLinux/Src/Util/TipText.cs new file mode 100644 index 000000000..9499ed527 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/TipText.cs @@ -0,0 +1,183 @@ +// +// +// +// +// $Revision: 2561 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + class CountTipText: TipText + { + float triHeight = 10; + float triWidth = 10; + + public CountTipText(Graphics graphics, Font font, string text) : base(graphics, font, text) + { + } + + void DrawTriangle(float x, float y, bool flipped) + { + Brush brush = BrushRegistry.GetBrush(Color.FromArgb(192, 192, 192)); + base.Graphics.FillRectangle(brush, new RectangleF(x, y, triHeight, triHeight)); + float triHeight2 = triHeight / 2; + float triHeight4 = triHeight / 4; + brush = Brushes.Black; + if (flipped) { + base.Graphics.FillPolygon(brush, new PointF[] { + new PointF(x, y + triHeight2 - triHeight4), + new PointF(x + triWidth / 2, y + triHeight2 + triHeight4), + new PointF(x + triWidth, y + triHeight2 - triHeight4), + }); + + } else { + base.Graphics.FillPolygon(brush, new PointF[] { + new PointF(x, y + triHeight2 + triHeight4), + new PointF(x + triWidth / 2, y + triHeight2 - triHeight4), + new PointF(x + triWidth, y + triHeight2 + triHeight4), + }); + } + } + + public Rectangle DrawingRectangle1; + public Rectangle DrawingRectangle2; + + public override void Draw(PointF location) + { + if (tipText != null && tipText.Length > 0) { + base.Draw(new PointF(location.X + triWidth + 4, location.Y)); + DrawingRectangle1 = new Rectangle((int)location.X + 2, + (int)location.Y + 2, + (int)(triWidth), + (int)(triHeight)); + DrawingRectangle2 = new Rectangle((int)(location.X + base.AllocatedSize.Width - triWidth - 2), + (int)location.Y + 2, + (int)(triWidth), + (int)(triHeight)); + DrawTriangle(location.X + 2, location.Y + 2, false); + DrawTriangle(location.X + base.AllocatedSize.Width - triWidth - 2, location.Y + 2, true); + } + } + + protected override void OnMaximumSizeChanged() + { + if (IsTextVisible()) { + SizeF tipSize = Graphics.MeasureString + (tipText, tipFont, MaximumSize, + GetInternalStringFormat()); + tipSize.Width += triWidth * 2 + 8; + SetRequiredSize(tipSize); + } else { + SetRequiredSize(SizeF.Empty); + } + } + + } + + class TipText: TipSection + { + protected StringAlignment horzAlign; + protected StringAlignment vertAlign; + protected Color tipColor; + protected Font tipFont; + protected StringFormat tipFormat; + protected string tipText; + + public TipText(Graphics graphics, Font font, string text): + base(graphics) + { + tipFont = font; tipText = text; + if (text != null && text.Length > short.MaxValue) + throw new ArgumentException("TipText: text too long (max. is " + short.MaxValue + " characters)", "text"); + + Color = SystemColors.InfoText; + HorizontalAlignment = StringAlignment.Near; + VerticalAlignment = StringAlignment.Near; + } + + public override void Draw(PointF location) + { + if (IsTextVisible()) { + RectangleF drawRectangle = new RectangleF(location, AllocatedSize); + + Graphics.DrawString(tipText, tipFont, + /*BrushRegistry.GetBrush(Color)*/SystemBrushes.InfoText, + drawRectangle, + GetInternalStringFormat()); + } + } + + protected StringFormat GetInternalStringFormat() + { + if (tipFormat == null) { + tipFormat = CreateTipStringFormat(horzAlign, vertAlign); + } + + return tipFormat; + } + + protected override void OnMaximumSizeChanged() + { + base.OnMaximumSizeChanged(); + + if (IsTextVisible()) { + SizeF tipSize = Graphics.MeasureString + (tipText, tipFont, MaximumSize, + GetInternalStringFormat()); + + SetRequiredSize(tipSize); + } else { + SetRequiredSize(SizeF.Empty); + } + } + + static StringFormat CreateTipStringFormat(StringAlignment horizontalAlignment, StringAlignment verticalAlignment) + { + StringFormat format = (StringFormat)StringFormat.GenericDefault.Clone(); + format.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.MeasureTrailingSpaces; + // note: Align Near, Line Center seemed to do something before + + format.Alignment = horizontalAlignment; + format.LineAlignment = verticalAlignment; + + return format; + } + + protected bool IsTextVisible() + { + return tipText != null && tipText.Length > 0; + } + + public Color Color { + get { + return tipColor; + } + set { + tipColor = value; + } + } + + public StringAlignment HorizontalAlignment { + get { + return horzAlign; + } + set { + horzAlign = value; + tipFormat = null; + } + } + + public StringAlignment VerticalAlignment { + get { + return vertAlign; + } + set { + vertAlign = value; + tipFormat = null; + } + } + } +} diff --git a/ICSharpCode.TextEditorLinux/Src/Util/WeakCollection.cs b/ICSharpCode.TextEditorLinux/Src/Util/WeakCollection.cs new file mode 100644 index 000000000..48a40478b --- /dev/null +++ b/ICSharpCode.TextEditorLinux/Src/Util/WeakCollection.cs @@ -0,0 +1,136 @@ +// +// +// +// +// $Revision: 2683 $ +// + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Util +{ + /// + /// A collection that does not allows its elements to be garbage-collected (unless there are other + /// references to the elements). Elements will disappear from the collection when they are + /// garbage-collected. + /// + /// The WeakCollection is not thread-safe, not even for read-only access! + /// No methods may be called on the WeakCollection while it is enumerated, not even a Contains or + /// creating a second enumerator. + /// The WeakCollection does not preserve any order among its contents; the ordering may be different each + /// time the collection is enumerated. + /// + /// Since items may disappear at any time when they are garbage collected, this class + /// cannot provide a useful implementation for Count and thus cannot implement the ICollection interface. + /// + public class WeakCollection : IEnumerable where T : class + { + readonly List innerList = new List(); + + /// + /// Adds an element to the collection. Runtime: O(n). + /// + public void Add(T item) + { + if (item == null) + throw new ArgumentNullException("item"); + CheckNoEnumerator(); + if (innerList.Count == innerList.Capacity || (innerList.Count % 32) == 31) + innerList.RemoveAll(delegate(WeakReference r) { return !r.IsAlive; }); + innerList.Add(new WeakReference(item)); + } + + /// + /// Removes all elements from the collection. Runtime: O(n). + /// + public void Clear() + { + innerList.Clear(); + CheckNoEnumerator(); + } + + /// + /// Checks if the collection contains an item. Runtime: O(n). + /// + public bool Contains(T item) + { + if (item == null) + throw new ArgumentNullException("item"); + CheckNoEnumerator(); + foreach (T element in this) { + if (item.Equals(element)) + return true; + } + return false; + } + + /// + /// Removes an element from the collection. Returns true if the item is found and removed, + /// false when the item is not found. + /// Runtime: O(n). + /// + public bool Remove(T item) + { + if (item == null) + throw new ArgumentNullException("item"); + CheckNoEnumerator(); + for (int i = 0; i < innerList.Count;) { + T element = (T)innerList[i].Target; + if (element == null) { + RemoveAt(i); + } else if (element == item) { + RemoveAt(i); + return true; + } else { + i++; + } + } + return false; + } + + void RemoveAt(int i) + { + int lastIndex = innerList.Count - 1; + innerList[i] = innerList[lastIndex]; + innerList.RemoveAt(lastIndex); + } + + bool hasEnumerator; + + void CheckNoEnumerator() + { + if (hasEnumerator) + throw new InvalidOperationException("The WeakCollection is already being enumerated, it cannot be modified at the same time. Ensure you dispose the first enumerator before modifying the WeakCollection."); + } + + /// + /// Enumerates the collection. + /// Each MoveNext() call on the enumerator is O(1), thus the enumeration is O(n). + /// + public IEnumerator GetEnumerator() + { + if (hasEnumerator) + throw new InvalidOperationException("The WeakCollection is already being enumerated, it cannot be enumerated twice at the same time. Ensure you dispose the first enumerator before using another enumerator."); + try { + hasEnumerator = true; + for (int i = 0; i < innerList.Count;) { + T element = (T)innerList[i].Target; + if (element == null) { + RemoveAt(i); + } else { + yield return element; + i++; + } + } + } finally { + hasEnumerator = false; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/ICSharpCode.TextEditorLinux/copyright.txt b/ICSharpCode.TextEditorLinux/copyright.txt new file mode 100644 index 000000000..914c9875c --- /dev/null +++ b/ICSharpCode.TextEditorLinux/copyright.txt @@ -0,0 +1,10 @@ +Copyright 2002-2010 by + + AlphaSierraPapa, Christoph Wille + Vordernberger Strasse 27/8 + A-8700 Leoben + Austria + + email: office@alphasierrapapa.com + court of jurisdiction: Landesgericht Leoben + diff --git a/ICSharpCode.TextEditorLinux/license.txt b/ICSharpCode.TextEditorLinux/license.txt new file mode 100644 index 000000000..e8fd74ca4 --- /dev/null +++ b/ICSharpCode.TextEditorLinux/license.txt @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/Libraries/WeifenLuo.WinFormsUI.Docking.ThemeVS2005Linux.dll b/Libraries/WeifenLuo.WinFormsUI.Docking.ThemeVS2005Linux.dll new file mode 100644 index 0000000000000000000000000000000000000000..72fa5e691490582d06675f079313f01ae5cf49de GIT binary patch literal 90112 zcmbqc31C#k`JeaR=IxPl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Linux.dll b/Libraries/WeifenLuo.WinFormsUI.DockingLinux.dll new file mode 100644 index 0000000000000000000000000000000000000000..7ef0539950e4b86f88687d6e6c624b3eda9c67af GIT binary patch literal 244736 zcmb?^37i~NwSG-icl9z$rl%*}J(FZ+5=bbzdnQY>B%mbh$S&(lSi%m0Kw+97X6P7q zMS{;=z!h9jpFBkrSKM(|@VTP_aewam#Q*bY_ z%@YJW(RvUf~p0P-EVa&pRLL$h-4VT|^1N>)wz@&?5 zh2F`(F~_-RVsmrzr9g^qOuG-y{csb1>yTX&n=juKf|0t4H7M(2v-pk@a^hzN?TSC@ z<~nKT+hLdU+i};)3D$8w{U*=3XQks@h4gPXxZOD;Zg8aIF{?XWf z75xih|JC#_g1>s5JKY6Sj`z53^BQ1V^eL`-m>a-uzLyF&gHm;z;tJ2%VADGdF+UB#nx&R#qXv276Hun)mn;pZ;}NX7HG!)4Cp;m_W4^jA zfvMZ1Qk)k)WB0*NB$;-4JM4rEFoE-KfPnt^ets!@Ipn~(6^ROag34M;5RNQiJ+UR)Bb%wql(B?S*O&u#5lg%TCh&*XZJ%w4e^~)U#IT+1qPfyh zmu&T0S{a5WvZf|2)^b!Ys_S~exsaSJv|bg(bRi4E>$GmCO^$dB%)OzvfLV?(?q@UTT2NBQy{u!)*l~TL&gUoB|J}|&a}`TgS`oD zTWHn6&Zf+5o<>BTh-voF+BB*v{q;ur-`d>R@VzIC9&7_T130yWej*kA|SG@`e%0uCHvCM8@f3Q!F<{4^*qQh1@Sx|-|HuuH6u;VqlI1${ zoh64l$U5!o?I?2sVt``?g6$9?}D z5juRSWau$W%@&$Y6XpsS5G$4`x2P2A;#Eimvlw;84?l#kv=%*H_+k2Plv-7v=S~Be zLjIPtdWpBXS*YHIdiQ2jjO&{lA#E#inY?ocWsOV*Z6<>X5#1Q;D!Vb3M7jmK%)524 zA!<-TQC>&z@xyBXc;P1enwGUrU5EpjRcYo1Z|;a0X6T#ImR z5;1#4-EsE>l11%xH@`2k0I+5`{!HsQY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dQB#?o640Fd;&Wv#k z_w`JajkPoS%2Mpc9O%$sOY~eGCs}FJrf&*K*X9Q#Ln+bQixfSMQw>Bgb!gUb24#USh4uT5vpGngPegkTHIv)cfE1swB zmozA*E0HR{ZQ(jR8}rkHLV+?3z#jo!eFCDx6;(fHp+I-!8~8jxY_-sX37Be9^bX zYM!|0qlSF&vX~1F+&t(SLjB^}i>TTyCC1WF;D@rg+~JQhrff_((#NyvvvuTy%1G;@ zK6N>OGUf8fLi+gr(xQ%F(@0rI8$sFVG;%e?ts_fBr&d8SF_BX@q`*2{IF8mW5#rwi Wpq MenuItems, List ToolBarItems); + } + + + public enum VisualEnvironmentState + { + CaretPosChangedMouse, + CaretPosChangedKeyboard, + StartCompilerLoading, + FinishCompilerLoading, + ProcessStarting, + ProcessStartingDebug, + ProcessExited + } + public delegate void ChangeVisualEnvironmentStateDelegate(VisualEnvironmentState State, object obj); + // SSM 16/05/22 - RunManager + public delegate void RunnerManagerActionDelegate(string fileName); + + public enum SourceLocationAction + { + SelectAndGotoBeg, + SelectAndGotoEnd, + GotoBeg, + GotoEnd, + NavigationGoto, + FindSelection + } + public enum VisualEnvironmentCompilerAction + { + Run, + Build, + Rebuild, + Stop, + OpenFile, + GetDirectory, + GetCurrentSourceFileName, + SetCurrentSourceFileText, + AddTextToCompilerMessages, + SaveFile, + BuildUnit, + AddMessageToErrorListWindow, + SetCurrentSourceFileTextFormatting, + PT4PositionCursorAfterTask + } + + public delegate IAsyncResult InvokeDegegate(Delegate method, params object[] args); + public interface IVisualEnvironmentCompiler + { + PascalABCCompiler.ICompiler Compiler + { + get; + } + PascalABCCompiler.Compiler StandartCompiler + { + get; + } + PascalABCCompiler.RemoteCompiler RemoteCompiler + { + get; + } + PascalABCCompiler.CompilerType DefaultCompilerType + { + get; + set; + } + void ExecuteSourceLocationAction(PascalABCCompiler.SourceLocation SourceLocation, SourceLocationAction Action); + event ChangeVisualEnvironmentStateDelegate ChangeVisualEnvironmentState; + + object ExecuteAction(VisualEnvironmentCompilerAction Action, object obj); + + string Compile(PascalABCCompiler.CompilerOptions CompilerOptions); + void StartCompile(PascalABCCompiler.CompilerOptions CompilerOptions); + + object SourceFilesProvider(string FileName, PascalABCCompiler.SourceFileOperation FileOperation); + InvokeDegegate BeginInvoke + { + get; + } + + } + + public interface ICodeFileDocument + { + string FileName + { + get; + } + + string EXEFileName + { + get; + } + + + + int LinesCount + { + get; + } + + ICSharpCode.TextEditor.TextEditorControl TextEditor + { + get; + } + + string Text + { + get; + set; + } + + bool FromMetadata + { + get; + } + + bool DocumentChanged + { + get; + } + + string ToolTipText + { + get; + set; + } + + bool Run + { + get; + set; + } + + void LoadFromFile(string fileName); + + } + + public interface ITextEditorControl + { + void SetFocus(); + int CaretLine { get; set; } + int CaretColumn { get; set; } + } + + public class ListItemEventArgs : EventArgs + { + IListItem listItem; + + public IListItem ListItem + { + get + { + return listItem; + } + } + + public ListItemEventArgs(IListItem listItem) + { + this.listItem = listItem; + } + } + + public interface IUserOptions + { + bool RedirectConsoleIO { get; set; } + bool ShowLineNums { get; set; } + bool EnableFolding { get; set; } + bool ShowMathBraket { get; set; } + bool ConverTabsToSpaces { get; set; } + bool DeleteEXEAfterExecute { get; set; } + bool DeletePDBAfterExecute { get; set; } + bool UseOutputDirectory { get; set; } + string OutputDirectory { get; set; } + bool PauseInRunModeIfConsole { get; set; } + string DefaultSourceFileNameFormat { get; set; } + int TabIndent { get; set; } + int EditorFontSize { get; set; } + bool AllowCodeCompletion { get; set; } + bool CodeCompletionHint { get; set; } + bool CodeCompletionDot { get; set; } + bool CodeCompletionParams { get; set; } + bool SaveSourceFilesIfComilationOk { get; set; } + int CodeCompletionNamespaceVisibleRange { get; set; } + int CursorTabCount { get; set; } + bool ShowCompletionInfoByGroup { get; set; } + bool EnableSmartIntellisense { get; set; } + bool ShowQuickClassBrowserPanel { get; set; } + bool AllowCodeFormatting { get; set; } + bool SkipStakTraceItemIfSourceFileInSystemDirectory { get; set; } + bool AlwaysAttachDebuggerAtStart { get; set; } + string CurrentFontFamily { get; set; } + bool HighlightOperatorBrackets { get; set; } + bool UseDllForSystemUnits { get; set; } + bool PABCDllChecked { get; set; } + bool AutoInsertCodeIsEnabledOnStartup { get; set; } + bool UseSemanticIntellisense { get; set; } + } + + public interface IListItem + { + int ImageIndex { get; } + string Name { get; } + string SpecialName { get; set; } + string Text { get; } + bool CanEditText { get; } + string Type { get; } + bool HasSubItems { get; } + IList SubItems { get; } + bool IsLiteral { get; } + System.Drawing.Image Image { get; } + event EventHandler Changed; + } + + public interface IWorkbenchFileService + { + bool OpenFile(string FileName, string PreferedFileName, bool notOpenDesigner = false); + void RenameFile(string OldFileName, string NewFileName); + void CloseFile(string FileName); + void ReloadFile(string FileName); + bool SaveAll(bool Question); + void SetFileAsChanged(string FileName); + void OpenTabWithText(string tabName, string Text); + ICodeFileDocument OpenFileForDebug(string FileName); + void CloseAllButThis(ICodeFileDocument nonCloseTab); + void PrintActiveDocument(); + } + + public interface IWorkbenchProjectService + { + void NewProject(); + void OpenProject(string projectFileName); + bool CloseProject(); + void SaveProject(); + void AddLastProject(string FileName); + } + + public interface IWorkbenchDesignerService + { + void DisableDesigner(); + void EnableDesigner(); + void GenerateAllDesignersCode(); + void SetActiveDesignerDirty(); + } + + public interface IWorkbenchRunService + { + event RunnerManagerActionDelegate Starting; // + event RunnerManagerActionDelegate Exited; // + bool IsRun(); + bool IsRun(string FileName); + bool Run(bool RedirectConsoleIO); + bool Stop(); + void Stop(string FileName); + bool Run(bool forDebugging, bool startWithGoto, bool need_first_brpt); + bool Run(ICodeFileDocument tabPage, bool forDebugging, bool startWithGoto, bool needFirstBreakpoint); + void Run(string fileName, bool redirectIO, string ModeName, bool RunWithPause, string WorkingDirectory, string CommandLineArguments, bool attachDebugger, bool fictive_attach); + bool HasRunArgument(string FileName); + string GetRunArgument(string FileName); + void AddRunArgument(string FileName, string argument); + ICodeFileDocument GetRunTab(string FileName); + void SendInputTextToProcess(); + void UpdateReadRequest(bool changeSelected); + void KillAll(); + } + + public interface IWorkbenchUpdateService + { + void CheckForUpdates(); + } + + public interface IWorkbenchBuildService + { + string Compile(string FileName, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment); + string Compile(PascalABCCompiler.IProjectInfo project, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment); + bool Build(); + bool Rebuild(); + bool Build(string FileName); + void StartCompile(bool rebuild); + + List ErrorsList + { + get; + } + + PascalABCCompiler.CompilerOptions CompilerOptions + { + get; + } + } + + public interface IWidgetStatusContoller + { + void SetStartDebugEnabled(); + void SetStartDebugDisabled(); + void SetDebugStopDisabled(); + void SetDebugStopEnabled(); + void SetAddExprMenuVisible(bool val); + void SetDisassemblyMenuVisible(bool val); + void SetDebugTabsVisible(bool val); + void SetDebugPausedDisabled(); + void SetPlayButtonsVisible(bool val); + void SetStopEnabled(bool enabled); + void SetCompilingButtonsEnabled(bool Enabled); + void SetDebugButtonsEnabled(bool val); + void SetOptionsEnabled(bool val); + bool CompilingButtonsEnabled { get; set; } + void EnableCodeCompletionToolTips(bool val); + void ChangeContinueDebugNameOnStart(); + void ChangeStartDebugNameOnContinue(); + } + + public interface IHelpService + { + void ExecShowHelpF1(); + void OpenMSDN(); + } + + public interface IEditorService + { + void SetFocusToEditor(); + void ExecSelectAll(); + void ExecGotoLine(); + void ExecFindReferences(); + void ExecCut(); + void ExecCopy(); + void ExecPaste(); + void ExecReplace(); + void ExecFind(); + void ExecFindNext(); + void ExecUndo(); + void ExecRedo(); + void CollapseRegions(); + void CodeFormat(); + void SetEditorDisabled(bool val); + } + + public interface IWorkbenchDebuggerOperationsService + { + void RefreshPad(IList items); + void GotoWatch(); + void AddVariable(string expr, bool show_tab); + void AddDebugPage(ICodeFileDocument tabPage); + void ClearWatch(); + void ClearLocalVarTree(); + void ClearDebugTabs(); + void DisplayDisassembledCode(string code); + } + + public interface IWorkbenchOperationsService + { + void ClearTabStack(); + void SendNewLineToInputTextBox(); + void AddTextToOutputWindowSync(string fileName, string text); + void WriteToOutputBox(string message, bool is_exc); + void ClearOutputTextBoxForTabPage(ICodeFileDocument tabPage); + void AddTabWithUrl(string title, string url); + void AddTextToCompilerMessagesSync(string text); + } + + public interface IWorkbenchOptionService + { + void SaveOptions(); + void LoadOptions(); + void UpdateUserOptions(); + } + + public interface IWorkbenchDocumentService + { + ICodeFileDocument CurrentCodeFileDocument { get; set; } + ICodeFileDocument ActiveCodeFileDocument { get; set; } + ICodeFileDocument LastSelectedTab { get; } + bool ContainsTab(ICodeFileDocument tab); + bool ContainsTab(string FileName); + ICodeFileDocument GetDocument(string FileName); + ICodeFileDocument GetTabPageForMainFile(); + void SetTabPageText(ICodeFileDocument tp); + } + + public interface IWorkbenchServiceContainer + { + IWorkbenchDocumentService DocumentService { get; } + IWorkbenchOptionService OptionsService { get; } + IEditorService EditorService { get; } + IHelpService HelpService { get; } + IWorkbenchDebuggerOperationsService DebuggerOperationsService { get; } + IWorkbenchBuildService BuildService { get; } + IWorkbenchFileService FileService { get; } + IWorkbenchProjectService ProjectService { get; } + IWorkbenchRunService RunService { get; } + IWorkbenchDesignerService DesignerService { get; } + IWorkbenchOperationsService OperationsService { get; } + IWorkbenchUpdateService UpdateService { get; } + ICodeCompletionService CodeCompletionService { get; } + } + + public interface ICodeCompletionService + { + PascalABCCompiler.Parsers.ICodeCompletionDomConverter GetConverter(string FileName); + void SetAsChanged(string FileName); + void RegisterFileForParsing(string FileName); + } + + public interface IWorkbench + { + IVisualEnvironmentCompiler VisualEnvironmentCompiler { get; } + IWidgetStatusContoller WidgetController { get; } + IDebuggerManager DebuggerManager { get; } + System.Windows.Forms.Form MainForm { get; } + IWorkbenchServiceContainer ServiceContainer { get; } + IUserOptions UserOptions { get; } + PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager { get; } + string CurrentEXEFileName { get; } + ICompilerConsoleWindow CompilerConsoleWindow { get; } + IOutputWindow OutputWindow { get; } + IErrorListWindow ErrorsListWindow { get; } + IDisassemblyWindow DisassemblyWindow { get; } + void BeginInvoke(Delegate del, params object[] args); + } + + public interface ICompilerConsoleWindow + { + void ClearConsole(); + } + + public interface IErrorListWindow + { + void ShowErrorsSync(List errors, bool ChangeViewTab); + void ClearErrorList(); + } + + public interface IDisassemblyWindow + { + bool IsVisible { get; } + void ClearWindow(); + } + + public interface IOutputWindow + { + bool InputPanelVisible { get; set; } + string InputTextBoxText { get; set; } + void ClearTextBox(); + void InputTextBoxCursorToEnd(); + void OutputTextBoxScrolToEnd(); + void AppendTextToOutputBox(string Text); + } + + public interface IValue + { + } + + public interface IRetValue + { + IValue ObjectValue { get; } + object PrimitiveValue { get; } + } + + public interface IProcess + { + bool HasExited { get; } + } + + public interface IProcessEventArgs + { + IProcess Process { get; } + } + + public interface IDebuggerManager + { + bool IsRunning { get; } + bool IsRun(string FileName); + bool IsRun(string ExeFileName, string SourceFileName); + string MakeValueView(IValue value); + IRetValue Evaluate(string expr); + void NullProcessHandleIfNeed(string FileName); + void Attach(uint handle, string fileName, bool real_attach, bool late_attach); + void Continue(); + void StepInto(); + void StepOver(); + void RunToCursor(); + event EventHandler DebuggeeStateChanged; + } + + public interface ILanguageManager + { + PascalABCCompiler.ICompiler StandartCompiler { get; } + PascalABCCompiler.ICompiler RemoteCompiler { get; } + IDebuggerManager Debugger { get; } + } +} diff --git a/PluginsSupportLinux/PluginsSupportLinux.csproj b/PluginsSupportLinux/PluginsSupportLinux.csproj new file mode 100644 index 000000000..de836d517 --- /dev/null +++ b/PluginsSupportLinux/PluginsSupportLinux.csproj @@ -0,0 +1,123 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E009E776-9280-4061-B5CA-7F0C3E2D3C2A} + Library + Properties + VisualPascalABCPlugins + PluginsSupportLinux + + + 4.0 + + + v4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + true + + + pdbonly + true + ..\bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + + + + + {A25D26FB-3043-4BCF-833E-E3F4C3BE795E} + CompilerTools + + + {1e42361a-eda3-4872-88af-a3aaf600d36d} + Compiler + + + {44A01F9E-DCE7-470C-AAE5-C3DE0CCBEE3B} + Errors + + + {2d18be89-d210-49eb-a9dd-2246fbb3df6d} + ICSharpCode.TextEditorLinux + + + {af2efd7b-69dd-4b43-af65-b59b29349c23} + ParserTools + + + {c2cac65a-b2ae-4ccc-b067-e6b8e75df73a} + SyntaxTree + + + {1c9c945a-586d-42a2-a06b-65d84fa7ff78} + TreeConverter + + + + + False + Клиентский профиль .NET Framework 3.5 SP1 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Установщик Windows 3.1 + true + + + + + \ No newline at end of file diff --git a/PluginsSupportLinux/Properties/AssemblyInfo.cs b/PluginsSupportLinux/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..e22ae1a5d --- /dev/null +++ b/PluginsSupportLinux/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PluginsController")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PluginsController")] +[assembly: AssemblyCopyright("Copyright © Ivan Bondarev, Stanislav Mikhalkovich")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9cf0ea7a-1a8a-4f96-a536-2b9f450aae82")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index af5705145..f50f40f14 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.3.3129 +3.8.3.3134 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index fb2cdb8dc..e5f8d7321 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.3.3129' +!define VERSION '3.8.3.3134' diff --git a/VisualPascalABCNETLinux/ABCHealth.Designer.cs b/VisualPascalABCNETLinux/ABCHealth.Designer.cs new file mode 100644 index 000000000..3cfc7511f --- /dev/null +++ b/VisualPascalABCNETLinux/ABCHealth.Designer.cs @@ -0,0 +1,48 @@ +namespace VisualPascalABC +{ + partial class ABCHealth + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ABCHealth)); + this.SuspendLayout(); + // + // ABCHealth + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(474, 331); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ABCHealth"; + this.Text = "Здоровье PascalABC.NET программы"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ABCHealth.cs b/VisualPascalABCNETLinux/ABCHealth.cs new file mode 100644 index 000000000..a6a8442e8 --- /dev/null +++ b/VisualPascalABCNETLinux/ABCHealth.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class ABCHealth : Form + { + public ABCHealth() + { + InitializeComponent(); + this.Font = new Font(this.Font.FontFamily, 10); + this.Activated += OnActivated; + //this.Paint += OnPaint; + } + + private int i = 0; + private void OnActivated(object sender, EventArgs e) + { + } + } +} diff --git a/VisualPascalABCNETLinux/ABCHealth.ico b/VisualPascalABCNETLinux/ABCHealth.ico new file mode 100644 index 0000000000000000000000000000000000000000..2d2e71bda8d432851df7c8dea66c51978f5a0b41 GIT binary patch literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x#lH~{6)!G9`&wG$iv_mn38Z_khU z-;^2lzcwZCe?`2{|B@*8|M{U#|8oLu|7ZAG{!jHb1LI^5V-%Y=Ol?KsqjUcK`}_aj zUj$C|Hbqggc}C~|fB*i0@nm=9|1b;_V_^6Xmj{Vu`dOmr-!`Wgt{0{UnMT(S@((iD zxnL4j{UCkl7-VjKm?N_G|9h59!>S+V26X#NqTEpQA6Pyc?mw8{K{PJ?ptwN>hgQ#n ztNr);_y2#tej@nLaD|x#iig^i0A%g|kFHw`R*!5ajE&(Qp#G-Ja1{L~Hm?BlL2Ca3 zb>1}J_`qAw}=Y!neTatvL|J?44aQ!d|eD+VO%7iHc)0Ylx zgY#kbA-fqa2DBSw|MZ4@xOx!d>XAJtd~^PJJ$X` pxn;%wV;h$IKfGqa{{t)M{NJ~1=KtM`rhxH|`4hnU(aQr;`2g&(U+n+@ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/ABCHealth.resx b/VisualPascalABCNETLinux/ABCHealth.resx new file mode 100644 index 000000000..42c814ccb --- /dev/null +++ b/VisualPascalABCNETLinux/ABCHealth.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA + AAD///////////////////////////////////////////////////////////////////////////// + //////////////////+tkYH/jHVj/4dvXP+CaVb/fWRR/3hfTP90Wkf/b1VC/2xRPf9oTTn/ZUs2/2VL + Nv9jSDP/////////////////sJWF///////////////////////////////////////+/v3//v39//79 + /f/+/f3/ZUs1/////////////////7OYif/+/v7//v7+/5NHI/+TRyP/k0cj//7+/v/+/v7/AAD///7+ + /v/+/v7//v7+/2lOOf////////////////+2nI3//v7+/5NHI//+/v7//v7+//7+/v/+/v7//v7+/wAA + ///+/v7//v7+//7+/v9sUT3/////////////////uaCS//7+/v+TRyP//v7+//7+/v/+/v7/AAD//wAA + //8AAP//AAD//wAA///+/v7/b1ZB/////////////////7yklv/+/v7/k0cj//7+/v/+/v7//v7+//7+ + /v/+/v7/AAD///7+/v/+/v7//v7+/3RaRv/////////////////Ap5v//v7+//7+/v+TRyP/k0cj/5NH + I//+/v7//v7+/wAA///+/v7//v7+//7+/v94X0z/////////////////wque//7+/v/+/v7//vv7//76 + +f/+/v7//v7+//7+/v/+/v7//v7+//7+/v/+/f3/fWRQ/////////////////8Wuo//+/v7/k0cj//7+ + /v/+/v7/k0cj//7+/v+TRyP/k0cj/5NHI//+/v7//v39/4JpV//////////////////Is6j//////5NH + I//9/f3//f39/5NHI//+/v7/k0cj//7+/v/+/v7/k0cj//79/f+Hblz/////////////////y7at//// + //+TRyP/k0cj/5NHI/+TRyP//v7+/5NHI/+TRyP/k0cj//7+/v/+/f3/jXRi/////////////////867 + sf//////k0cj////////////k0cj//7+/v+TRyP//v7+//7+/v+TRyP//v39/5J6af////////////// + ///SwLb///////////+TRyP/k0cj//7+/v/+/v7/k0cj/5NHI/+TRyP//v39//79/f+XgG////////// + ////////1cS8///////////////////////////////////////+/v3//v39//79/f/+/f3/nYZ1//// + /////////////9jJwf/VxLz/0sC2/8+8sv/MuK3/ybSo/8awpP/DrKD/wKmc/76mmf+7opT/u6KU/7if + kP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ABCNET32.ico b/VisualPascalABCNETLinux/ABCNET32.ico new file mode 100644 index 0000000000000000000000000000000000000000..f9965425ae2ebbfdc2c459cc7bf5721f150f98d3 GIT binary patch literal 766 zcmc(cF>b>!3`LouLp!-sXG2SKj1B_gty5-SB72FzK$}TxHRUQkPDi7#QF>xOWycnR z?4?YJPoJLbZ3{uuN2*pK zvFr-l{wiu*W--*%QNbkE&7|Pu<{*WV6hob6+B_?uCq_F#U-(3!Te+af+MQ>;BYuoR z59wv*R~^4>zxY*8w;3%{|Ew=OMwDmdtV;|!W^4mv&JyEi&TvjK)V&Ydd#^|5T(Ef+ zltZQBaAn-6ihnm27r + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.dgvModules = new System.Windows.Forms.ListView(); + this.chType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chCopyright = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.button1 = new System.Windows.Forms.Button(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.linkLabel2 = new System.Windows.Forms.LinkLabel(); + this.lVersion = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.lVersionText = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.linkLabel3 = new System.Windows.Forms.LinkLabel(); + this.label13 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + this.flowLayoutPanel3.SuspendLayout(); + this.flowLayoutPanel2.SuspendLayout(); + this.flowLayoutPanel4.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.dgvModules); + this.groupBox1.Location = new System.Drawing.Point(8, 146); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(520, 137); + this.groupBox1.TabIndex = 12; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "COMPONENTS"; + this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); + // + // dgvModules + // + this.dgvModules.AllowColumnReorder = true; + this.dgvModules.AutoArrange = false; + this.dgvModules.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chType, + this.chName, + this.chVersion, + this.chCopyright}); + this.dgvModules.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvModules.FullRowSelect = true; + this.dgvModules.GridLines = true; + this.dgvModules.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.dgvModules.HideSelection = false; + this.dgvModules.Location = new System.Drawing.Point(3, 16); + this.dgvModules.MultiSelect = false; + this.dgvModules.Name = "dgvModules"; + this.dgvModules.Size = new System.Drawing.Size(514, 118); + this.dgvModules.TabIndex = 3; + this.dgvModules.UseCompatibleStateImageBehavior = false; + this.dgvModules.View = System.Windows.Forms.View.Details; + // + // chType + // + this.chType.Text = "TYPE"; + this.chType.Width = 65; + // + // chName + // + this.chName.Text = "NAME"; + this.chName.Width = 170; + // + // chVersion + // + this.chVersion.Text = "VERSION"; + this.chVersion.Width = 74; + // + // chCopyright + // + this.chCopyright.Text = "COPYRIGHT"; + this.chCopyright.Width = 200; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(222, 289); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(107, 23); + this.button1.TabIndex = 13; + this.button1.Text = "!OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new System.Drawing.Point(11, 105); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(124, 13); + this.linkLabel1.TabIndex = 20; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "!PASCALABCNET_SITE"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // linkLabel2 + // + this.linkLabel2.AutoSize = true; + this.linkLabel2.Location = new System.Drawing.Point(11, 122); + this.linkLabel2.Name = "linkLabel2"; + this.linkLabel2.Size = new System.Drawing.Size(139, 13); + this.linkLabel2.TabIndex = 21; + this.linkLabel2.TabStop = true; + this.linkLabel2.Text = "!PASCALABCNET_FORUM"; + this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); + // + // lVersion + // + this.lVersion.AutoSize = true; + this.lVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lVersion.ForeColor = System.Drawing.Color.DarkGreen; + this.lVersion.Location = new System.Drawing.Point(65, 0); + this.lVersion.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.lVersion.Name = "lVersion"; + this.lVersion.Size = new System.Drawing.Size(44, 13); + this.lVersion.TabIndex = 5; + this.lVersion.Text = "vesion"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label12.Location = new System.Drawing.Point(3, 0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(311, 13); + this.label12.TabIndex = 17; + this.label12.Text = "Copyright (c) 2005, 2021 Ivan Bondarev, Stanislav Mikhalkovich"; + this.label12.Click += new System.EventHandler(this.label12_Click); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(3, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(49, 13); + this.label9.TabIndex = 22; + this.label9.Text = "MADEIN"; + // + // lVersionText + // + this.lVersionText.AutoSize = true; + this.lVersionText.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lVersionText.Location = new System.Drawing.Point(3, 0); + this.lVersionText.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); + this.lVersionText.Name = "lVersionText"; + this.lVersionText.Size = new System.Drawing.Size(62, 13); + this.lVersionText.TabIndex = 4; + this.lVersionText.Text = "VERSION"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label1.ForeColor = System.Drawing.Color.Black; + this.label1.Location = new System.Drawing.Point(3, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 3; + this.label1.Text = "PascalABC.NET"; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel3, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel2, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel4, 0, 2); + this.tableLayoutPanel1.Location = new System.Drawing.Point(5, 8); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 4; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(332, 95); + this.tableLayoutPanel1.TabIndex = 23; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.label1); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(326, 17); + this.flowLayoutPanel1.TabIndex = 0; + // + // flowLayoutPanel3 + // + this.flowLayoutPanel3.Controls.Add(this.lVersionText); + this.flowLayoutPanel3.Controls.Add(this.lVersion); + this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel3.Location = new System.Drawing.Point(3, 23); + this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.flowLayoutPanel3.Name = "flowLayoutPanel3"; + this.flowLayoutPanel3.Size = new System.Drawing.Size(326, 20); + this.flowLayoutPanel3.TabIndex = 2; + // + // flowLayoutPanel2 + // + this.flowLayoutPanel2.Controls.Add(this.label9); + this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 69); + this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.flowLayoutPanel2.Name = "flowLayoutPanel2"; + this.flowLayoutPanel2.Size = new System.Drawing.Size(326, 23); + this.flowLayoutPanel2.TabIndex = 1; + // + // flowLayoutPanel4 + // + this.flowLayoutPanel4.Controls.Add(this.label12); + this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel4.Location = new System.Drawing.Point(3, 49); + this.flowLayoutPanel4.Name = "flowLayoutPanel4"; + this.flowLayoutPanel4.Size = new System.Drawing.Size(326, 17); + this.flowLayoutPanel4.TabIndex = 3; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label4.Location = new System.Drawing.Point(10, 49); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(93, 13); + this.label4.TabIndex = 22; + this.label4.Text = "!DEVELOPERS"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label5.Location = new System.Drawing.Point(23, 62); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(85, 13); + this.label5.TabIndex = 23; + this.label5.Text = "DEVELOPERS1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label2.Location = new System.Drawing.Point(10, 16); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(110, 13); + this.label2.TabIndex = 26; + this.label2.Text = "PROJECT_ADMIN"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label3.Location = new System.Drawing.Point(23, 30); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(120, 13); + this.label3.TabIndex = 16; + this.label3.Text = "PROJECT_ADMIN_FIO"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.linkLabel3); + this.groupBox2.Controls.Add(this.label13); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.groupBox2.Location = new System.Drawing.Point(343, 8); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(185, 132); + this.groupBox2.TabIndex = 14; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "DEVELOPERS"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label6.Location = new System.Drawing.Point(23, 76); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(85, 13); + this.label6.TabIndex = 29; + this.label6.Text = "DEVELOPERS2"; + // + // linkLabel3 + // + this.linkLabel3.AutoSize = true; + this.linkLabel3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.linkLabel3.Location = new System.Drawing.Point(10, 112); + this.linkLabel3.Name = "linkLabel3"; + this.linkLabel3.Size = new System.Drawing.Size(196, 13); + this.linkLabel3.TabIndex = 24; + this.linkLabel3.TabStop = true; + this.linkLabel3.Text = "!PASCALABCNET_DEVELOPERS"; + this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label13.Location = new System.Drawing.Point(23, 90); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(85, 13); + this.label13.TabIndex = 28; + this.label13.Text = "DEVELOPERS3"; + // + // AboutBox + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(534, 346); + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.linkLabel2); + this.Controls.Add(this.linkLabel1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AboutBox"; + this.Padding = new System.Windows.Forms.Padding(9, 9, 9, 9); + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FORMTEXT"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AboutBox_FormClosing); + this.Load += new System.EventHandler(this.AboutBox_Load); + this.Shown += new System.EventHandler(this.AboutBox_Shown); + this.groupBox1.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.flowLayoutPanel3.ResumeLayout(false); + this.flowLayoutPanel3.PerformLayout(); + this.flowLayoutPanel2.ResumeLayout(false); + this.flowLayoutPanel2.PerformLayout(); + this.flowLayoutPanel4.ResumeLayout(false); + this.flowLayoutPanel4.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.LinkLabel linkLabel2; + private System.Windows.Forms.Label lVersion; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label lVersionText; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.GroupBox groupBox2; + public System.Windows.Forms.ListView dgvModules; + private System.Windows.Forms.ColumnHeader chType; + private System.Windows.Forms.ColumnHeader chName; + private System.Windows.Forms.ColumnHeader chVersion; + private System.Windows.Forms.ColumnHeader chCopyright; + private System.Windows.Forms.LinkLabel linkLabel3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label13; + } +} diff --git a/VisualPascalABCNETLinux/AboutBox.cs b/VisualPascalABCNETLinux/AboutBox.cs new file mode 100644 index 000000000..4790e8561 --- /dev/null +++ b/VisualPascalABCNETLinux/AboutBox.cs @@ -0,0 +1,239 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using System.Reflection; +using System.IO; + +namespace VisualPascalABC +{ + public partial class AboutBox : Form + { + public AboutBox() + { + InitializeComponent(); + // Initialize the AboutBox to display the product information from the assembly information. + // Change assembly information settings for your application through either: + // - Project->Properties->Application->Assembly Information + // - AssemblyInfo.cs + /*this.Text = String.Format("About {0}", AssemblyTitle); + this.labelProductName.Text = AssemblyProduct; + this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); + this.labelCopyright.Text = AssemblyCopyright; + this.labelCompanyName.Text = AssemblyCompany; + this.textBoxDescription.Text = AssemblyDescription;*/ + } + + #region Assembly Attribute Accessors + + public string AssemblyTitle + { + get + { + // Get all Title attributes on this assembly + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); + // If there is at least one Title attribute + if (attributes.Length > 0) + { + // Select the first one + AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; + // If it is not an empty string, return it + if (titleAttribute.Title != "") + return titleAttribute.Title; + } + // If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + } + } + + public string AssemblyVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + } + + public string AssemblyDescription + { + get + { + // Get all Description attributes on this assembly + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); + // If there aren't any Description attributes, return an empty string + if (attributes.Length == 0) + return ""; + // If there is a Description attribute, return its value + return ((AssemblyDescriptionAttribute)attributes[0]).Description; + } + } + + public string AssemblyProduct + { + get + { + // Get all Product attributes on this assembly + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); + // If there aren't any Product attributes, return an empty string + if (attributes.Length == 0) + return ""; + // If there is a Product attribute, return its value + return ((AssemblyProductAttribute)attributes[0]).Product; + } + } + + public string AssemblyCopyright(Assembly a) + { + + // Get all Copyright attributes on this assembly + object[] attributes = a.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + // If there aren't any Copyright attributes, return an empty string + if (attributes.Length == 0) + return ""; + // If there is a Copyright attribute, return its value + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + + public string AssemblyCompany + { + get + { + // Get all Company attributes on this assembly + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); + // If there aren't any Company attributes, return an empty string + if (attributes.Length == 0) + return ""; + // If there is a Company attribute, return its value + return ((AssemblyCompanyAttribute)attributes[0]).Company; + } + } + #endregion + + private void AboutBox_Load(object sender, EventArgs e) + { + + } + + private void AboutBox_Shown(object sender, EventArgs e) + { + + lVersion.Text = string.Format("{0}, сборка {1} ({2})", PascalABCCompiler.Compiler.ShortVersion, RevisionClass.Revision, PascalABCCompiler.Compiler.VersionDateTime.ToShortDateString()); + dgvModules.Items.Clear(); + + string apppatch = Path.GetDirectoryName(Application.ExecutablePath); + + VisualEnvironmentCompiler vec = (Owner as Form1).VisualEnvironmentCompiler; + PascalABCCompiler.ICompiler comp = vec.StandartCompiler; + if (comp != null) + { + Assembly a = Assembly.GetAssembly(comp.GetType()); + dgvModules.Items.Add(MakeItem("Core", "PascalABCCompiler.Core", a.GetName().Version.ToString(), "Copyright © 2005-2021 by Ivan Bondarev, Stanislav Mikhalkovich")); + foreach (PascalABCCompiler.Parsers.IParser parser in comp.ParsersController.Parsers) + dgvModules.Items.Add(MakeItem("Parser",parser.Name, parser.Version, parser.Copyright)); + foreach (PascalABCCompiler.SemanticTreeConverters.ISemanticTreeConverter conv in comp.SemanticTreeConvertersController.SemanticTreeConverters) + dgvModules.Items.Add(MakeItem("Converter", conv.Name, conv.Version, conv.Copyright)); + foreach (VisualPascalABCPlugins.IVisualPascalABCPlugin plugin in vec.PluginsController.Plugins) + dgvModules.Items.Add(MakeItem("Plugin",plugin.Name, plugin.Version, plugin.Copyright)); + + } + + dgvModules.Items.Add(MakeItem(Assembly.LoadFile(Path.Combine(apppatch,"ICSharpCode.TextEditor.dll")))); + dgvModules.Items.Add(MakeItem(Assembly.LoadFile(Path.Combine(apppatch,"Debugger.Core.dll")))); + dgvModules.Items.Add(MakeItem(Assembly.LoadFile(Path.Combine(apppatch,"WeifenLuo.WinFormsUI.Docking.dll")))); + ActiveControl = button1; + /*lbComponents.Items.Clear(); + PascalABCCompiler.Compiler comp = (Owner as Form1).VisualEnvironmentCompiler.Compiler; + if (comp != null) + { + lbComponents.Items.Add(BuildComponentString(comp)); + foreach (PascalABCCompiler.ParserTools.BaseParser parser in comp.ParsersController.Parsers) + lbComponents.Items.Add("Language: "+BuildComponentString(parser)); + foreach (VisualPascalABCPlugins.IVisualPascalABCPlugin plugin in (Owner as Form1).VisualEnvironmentCompiler.PluginsController.Plugins) + lbComponents.Items.Add("Plugin: "+BuildComponentString(plugin)); + foreach (PascalABCCompiler.SemanticTreeConverters.ISemanticTreeConverter conv in (Owner as Form1).VisualEnvironmentCompiler.Compiler.SemanticTreeConvertersController.SemanticTreeConverters) + lbComponents.Items.Add("Converter: " + BuildComponentString(conv)); + + }*/ + + } + + ListViewItem MakeItem(Assembly a) + { + return MakeItem("Assembly", Path.GetFileName(a.ManifestModule.FullyQualifiedName), a.GetName().Version.ToString(), AssemblyCopyright(a)); + } + + ListViewItem MakeItem(params string[] names) + { + ListViewItem li = new ListViewItem(); + li.Text = names[0]; + for (int i = 1; i < names.Length; i++) + li.SubItems.Add(names[i]); + return li; + } + + private string BuildComponentString(object Component) + { + return string.Format("{0}",Component); + } + + private string GetAssamlyFileName(object obj) + { + return Path.GetFileName(Assembly.GetAssembly(obj.GetType()).ManifestModule.FullyQualifiedName); + } + private void AboutBox_FormClosing(object sender, FormClosingEventArgs e) + { + } + + private void lbComponents_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void groupBox1_Enter(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + Close(); + } + + private void label11_Click(object sender, EventArgs e) + { + + } + + private void label2_Click(object sender, EventArgs e) + { + + } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start(PascalABCCompiler.StringResources.Get("!PASCALABCNET_SITE_LINK")); + } + + private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start(PascalABCCompiler.StringResources.Get("!PASCALABCNET_FORUM_LINK")); + } + + private void label12_Click(object sender, EventArgs e) + { + + } + + private void button2_Click(object sender, EventArgs e) + { + } + + private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start(PascalABCCompiler.StringResources.Get("!PASCALABCNET_DEVELOPERS_LINK")); + } + } +} diff --git a/VisualPascalABCNETLinux/AboutBox.resx b/VisualPascalABCNETLinux/AboutBox.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/AboutBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/AutoInsertCode/AutoInsertCode.cs b/VisualPascalABCNETLinux/AutoInsertCode/AutoInsertCode.cs new file mode 100644 index 000000000..c412de063 --- /dev/null +++ b/VisualPascalABCNETLinux/AutoInsertCode/AutoInsertCode.cs @@ -0,0 +1,289 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor; +using System.Text.RegularExpressions; + +namespace VisualPascalABC +{ + public partial class Form1 + { + string Spaces(int n) => new string(' ', n); + string GetLine(int lineNum) + { + var ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + var doc = ta.Document; + if (lineNum < doc.TotalNumberOfLines) + return TextUtilities.GetLineAsString(doc, lineNum); + else return null; + } + + void GetCurNextLines(out string Current, out string Next, out string Prev) // Next - следующая непустая строка + { + var ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + Current = GetLine(ta.Caret.Line); + + var i = ta.Caret.Line + 1; + do + { + Next = GetLine(i); + i++; + } while (Next != null && Next.Trim() == ""); + + Prev = null; + if (ta.Caret.Line == 0) + return; + var j = ta.Caret.Line; + do + { + j--; + Prev = GetLine(j); + } while (j > 0 && Prev.Trim() == ""); + if (Prev.Trim() == "") + Prev = null; + } + + int Indent(string s) + { + return Array.FindIndex(s.ToCharArray(), c => c != ' '); + } + + int CurrentOffset() + { + var editor = VisualPascalABCProgram.MainForm.CurrentCodeFileDocument.TextEditor; + var ta = editor.ActiveTextAreaControl.TextArea; + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + return editor.ActiveTextAreaControl.TextArea.Document.PositionToOffset(tl_beg); + } + private bool TextArea_KeyEventHandler(char ch) + { + if (!tsAutoInsertCode.Checked) + return false; + try + { + var editor = VisualPascalABCProgram.MainForm.CurrentCodeFileDocument.TextEditor; + var ta = editor.ActiveTextAreaControl.TextArea; + var doc = ta.Document; + + /*if (ch == ' ') + { + var caret1 = editor.ActiveTextAreaControl.Caret; + int start1 = TextUtilities.FindPrevWordStart(editor.Document, caret1.Offset); + var Text1 = editor.Document.GetText(start1, caret1.Offset - start1).TrimEnd(); + + if (Text1.ToLower().StartsWith("for") || Text1.ToLower().StartsWith("foreach")) + { + var curline = TextUtilities.GetLineAsString(editor.Document, caret1.Line); + var len = curline.TrimEnd().Length; + if (ta.Caret.Column == len) + { + doc.Replace(CurrentOffset(), curline.Length - len, " var"); + ta.Caret.Column = ta.Caret.Column + 4; + } + } + return false; + }*/ + /*if (ch == '(') + { + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + doc.Insert(offset, ")"); + return false; + }*/ + if (ch != '\n') + return false; + var caret = editor.ActiveTextAreaControl.Caret; + int start = TextUtilities.FindPrevWordStart(editor.Document, caret.Offset); + // Нужно, чтобы в Text было последнее слово в строке !!! Исключение - когда в следующей надо сделать просто сдвиг + var Text = editor.Document.GetText(start, caret.Offset - start).TrimEnd(); + var TextToLower = Text.ToLower(); + //var curStrEnd = TextUtilities.GetLineAsString(editor.Document, caret.Line).Substring(caret.Column); + + if (TextToLower == "begin") + { + string cur, next, prev; + GetCurNextLines(out cur, out next, out prev); + // Ничего не надо делать если begin - не последнее слово в строке + var curStrEnd = cur.Substring(caret.Column); + if (!string.IsNullOrWhiteSpace(curStrEnd)) + return false; + // анализ предыдущей + var icur = Indent(cur); + if (cur.Trim().ToLower() == "begin" && (next == null || Indent(next) < icur || Indent(next) == icur && !next.TrimStart().ToLower().StartsWith("end"))) // значит, это единственное слово begin в строке + { + // Проанализируем предыдущий оператор по первому слову + var pst = prev?.TrimStart().ToLower(); + if (pst != null) + //if (pst.StartsWith("if") || pst.StartsWith("for") || pst.StartsWith("loop") || pst.StartsWith("with") || pst.StartsWith("on") || pst.StartsWith("while") || pst.StartsWith("else") || pst.StartsWith("foreach")) // потом улучшу - для нескольких выборов + if (Regex.IsMatch(pst, "^(if|else|for|loop|while|foreach|with|on)")) + { + // Надо удалить в текущей строке пробелы чтобы выровнять begin по if + var iprev = Indent(prev); + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + + var cls = doc.GetLineSegment(ta.Caret.Line); + + // надо удалить всю строчку с begin и сформировать новую + doc.Replace(cls.Offset, cls.Length , Spaces(iprev)+"begin"); + ta.Caret.Column = iprev + 5; + icur = iprev; + } + } + + ta.InsertString("\n" + Spaces(icur + 2)); + if (next == null || Indent(next) < icur || Indent(next) == icur && !next.TrimStart().ToLower().StartsWith("end")) + { + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + var send = "\n" + Spaces(icur) + "end"; + if (next == null && (prev == null || !(prev.TrimStart().ToLower().StartsWith("procedure") || prev.TrimStart().ToLower().StartsWith("function")))) + send += "."; + else send += ";"; + doc.Insert(offset, send); + } + return true; + } + + else if (TextToLower == "repeat") // repeat .. until + { + string cur, next, prev; + GetCurNextLines(out cur, out next, out prev); + if (!string.IsNullOrWhiteSpace(cur.Substring(caret.Column))) + return false; + var icur = Indent(cur); + ta.InsertString("\n" + Spaces(icur + 2)); + if (next == null || Indent(next) < icur || Indent(next) == icur && !next.TrimStart().ToLower().StartsWith("until")) + { + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + var send = "\n" + Spaces(icur) + "until ;"; + doc.Insert(offset, send); + } + return true; + } + + else if (Regex.IsMatch(TextToLower,"class|record")) // class .. end, record .. end + { + string cur, next, prev; + GetCurNextLines(out cur, out next, out prev); + if (!string.IsNullOrWhiteSpace(cur.Substring(caret.Column))) + return false; + var icur = Indent(cur); + ta.InsertString("\n" + Spaces(icur + 2)); + if (next == null || Indent(next) < icur || Indent(next) == icur && !next.TrimStart().ToLower().StartsWith("until")) + { + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + var send = "\n" + Spaces(icur) + "end;"; + doc.Insert(offset, send); + } + return true; + } + + else if (TextToLower == "of") + { + string cur, next, prev; + GetCurNextLines(out cur, out next, out prev); + if (!string.IsNullOrWhiteSpace(cur.Substring(caret.Column))) + return false; + var icur = Indent(cur); + ta.InsertString("\n" + Spaces(icur + 2)); + if (cur.TrimStart().ToLower().StartsWith("case") && next == null || Indent(next) < icur || Indent(next) == icur && !next.TrimStart().ToLower().StartsWith("end")) + { + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + var send = "\n" + Spaces(icur) + "end;"; + doc.Insert(offset, send); + } + return true; + } + + else if (TextToLower == "with") + { + string cur, next, prev; + GetCurNextLines(out cur, out next, out prev); + if (!string.IsNullOrWhiteSpace(cur.Substring(caret.Column))) + return false; + var icur = Indent(cur); + ta.InsertString("\n" + Spaces(icur + 2)); + if (cur.TrimStart().ToLower().StartsWith("match") && next == null || Indent(next) < icur || Indent(next) == icur && !next.TrimStart().ToLower().StartsWith("end")) + { + var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line); + int offset = doc.PositionToOffset(tl_beg); + var send = "\n" + Spaces(icur) + "end;"; + doc.Insert(offset, send); + } + return true; + } + + else if (Regex.IsMatch(TextToLower, "then|else|do|try|except|finally|var")) + { + if (ta.Caret.Line > 0 && TextToLower == "else") + { + var prevSeg = doc.GetLineSegment(ta.Caret.Line - 1); + var prev = GetLine(ta.Caret.Line - 1).TrimEnd(); + + if (prev[prev.Length-1] == ';') + { + doc.Replace(prevSeg.Offset + prevSeg.Length - 1, 1, ""); + } + } + + var cur = GetLine(ta.Caret.Line); + var icur = Indent(cur); + ta.InsertString("\n" + Spaces(icur + 2)); + + return true; + } + + else + { + string cur, next, prev; + GetCurNextLines(out cur, out next, out prev); + if (ta.Caret.Column >= cur.Length) + { + var prevTrimEnd = prev.TrimEnd(); + // если prev заканчивается на then, а cur не начинается с begin, то отступ назад + if ((prevTrimEnd.EndsWith("then",StringComparison.InvariantCultureIgnoreCase) || + prevTrimEnd.EndsWith("else", StringComparison.InvariantCultureIgnoreCase) || + prevTrimEnd.EndsWith("do", StringComparison.InvariantCultureIgnoreCase)) + && + !(cur.TrimStart().StartsWith("begin", StringComparison.InvariantCultureIgnoreCase))) + { + var iprev = Indent(prev); + ta.InsertString("\n" + Spaces(iprev)); + return true; + } + + /* if (Regex.IsMatch(curline, @"^\s*\w+\s*:=", RegexOptions.IgnoreCase)) // пока тут добавление ; после присваивания. Плохо перед else! И плохо если выражение продолжается на следующей строке! Убираем. + { + if (curline.Length > 0) + { + var last = curline[curline.Length - 1]; + if (!char.IsLetterOrDigit(last) && last != ']' && last != ')') + return false; + } + + var curlinenew = Regex.Replace(curline, @"(\s*)(\S+)(\s*):=(\s*)([^;]+)(\s*)(;?)$", @"$1$2 := $5;", RegexOptions.IgnoreCase); + while (curlinenew.EndsWith(";;")) + curlinenew = curlinenew.Remove(curlinenew.Length - 1); + doc.Replace(seg.Offset, curline.Length, curlinenew); + ta.Caret.Column = curlinenew.Length; + return false; + } */ + } + } + return false; + } + catch (Exception e) + { + + } + return false; + } + } +} diff --git a/VisualPascalABCNETLinux/CodeFileDocumentTextEditorControl.cs b/VisualPascalABCNETLinux/CodeFileDocumentTextEditorControl.cs new file mode 100644 index 000000000..07588210f --- /dev/null +++ b/VisualPascalABCNETLinux/CodeFileDocumentTextEditorControl.cs @@ -0,0 +1,11 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + +} diff --git a/VisualPascalABCNETLinux/CompileOptionsSet.cs b/VisualPascalABCNETLinux/CompileOptionsSet.cs new file mode 100644 index 000000000..40ac4aaa0 --- /dev/null +++ b/VisualPascalABCNETLinux/CompileOptionsSet.cs @@ -0,0 +1,14 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC +{ + public class CompileOptionsSet + { + object OutputFileType ; + bool DebugInfoGen = true; + } +} diff --git a/VisualPascalABCNETLinux/CompilerForm.Designer.cs b/VisualPascalABCNETLinux/CompilerForm.Designer.cs new file mode 100644 index 000000000..a3a3f02a3 --- /dev/null +++ b/VisualPascalABCNETLinux/CompilerForm.Designer.cs @@ -0,0 +1,60 @@ +namespace VisualPascalABC +{ + partial class CompilerForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(12, 12); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(304, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Перезапустить компилятор"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // CompilerForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(328, 149); + this.Controls.Add(this.button1); + this.Name = "CompilerForm"; + this.Text = "Компилятор"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/CompilerForm.cs b/VisualPascalABCNETLinux/CompilerForm.cs new file mode 100644 index 000000000..28be49eb0 --- /dev/null +++ b/VisualPascalABCNETLinux/CompilerForm.cs @@ -0,0 +1,25 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class CompilerForm : Form + { + public CompilerForm() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + (Owner as Form1).Reset(); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/CompilerForm.resx b/VisualPascalABCNETLinux/CompilerForm.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/VisualPascalABCNETLinux/CompilerForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Config/AssemblyInfo.cs b/VisualPascalABCNETLinux/Config/AssemblyInfo.cs new file mode 100644 index 000000000..e86e78194 --- /dev/null +++ b/VisualPascalABCNETLinux/Config/AssemblyInfo.cs @@ -0,0 +1,8 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("PascalABC.NET")] +[assembly: AssemblyDescription("PascalABC.NET Compiler GUI")] +[assembly: AssemblyConfiguration("")] \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DS/Classes.cs b/VisualPascalABCNETLinux/DS/Classes.cs new file mode 100644 index 000000000..22452143d --- /dev/null +++ b/VisualPascalABCNETLinux/DS/Classes.cs @@ -0,0 +1,37 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + + public class Form1StringResources + { + public static readonly string Prefix = "VP_MF_"; + public static string Get(string key) + { + return PascalABCCompiler.StringResources.Get(Prefix + key); + } + public static void SetTextForAllControls(Control c) + { + PascalABCCompiler.StringResources.SetTextForAllObjects(c, Prefix); + } + } + public class RuntimeExceptionsStringResources + { + public static readonly string Prefix = "RUNTIME_EXCEPTION"; + public static string Get(string key) + { + string res=PascalABCCompiler.StringResources.Get(Prefix + key); + if (res != Prefix + key) + return res; + return key; + } + } + + + +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/CodeCompletionListView.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/CodeCompletionListView.cs new file mode 100644 index 000000000..5dc8de552 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/CodeCompletionListView.cs @@ -0,0 +1,497 @@ +// +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using ICSharpCode.TextEditor; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public class UserDefaultCompletionData : ICompletionData + { + string text; + string description; + int imageIndex; + bool isExtension; + + + public bool IsOnOverrideWindow=false; + + public bool FirstInsert = false; + + public bool IsExtension + { + get { return isExtension; } + set { isExtension = value; } + } + + public int ImageIndex { + get { + return imageIndex; + } + } + + public string Text { + get { + return text; + } + set { + text = value; + } + } + + public string Description { + get { + return description; + } + set + { + description = value; + } + } + + double priority; + + public double Priority { + get { + return priority; + } + set { + priority = value; + } + } + + public virtual bool InsertAction(TextArea textArea, char ch) + { + textArea.InsertString(text); + return false; + } + + public UserDefaultCompletionData(string text, string description, int imageIndex, bool is_in_override_window, bool is_extension=false) + { + this.text = text; + this.description = description; + if (this.description != null) + this.description = this.description.Replace("!#",""); + this.imageIndex = imageIndex; + this.IsOnOverrideWindow = is_in_override_window; + this.isExtension = is_extension; + } + + public int CompareTo(object obj) + { + if (obj == null || !(obj is UserDefaultCompletionData)) { + return -1; + } + return string.Compare(text,((UserDefaultCompletionData)obj).Text,true); + } + } + + /// + /// Description of CodeCompletionListView. + /// + public class PABCNETCodeCompletionListView: System.Windows.Forms.UserControl + { + ICompletionData[] completionData; + int firstItem = 0; + int selectedItem = -1; + ImageList imageList; + //Dictionary cache = new Dictionary(); + Hashtable cache = new Hashtable(); + + public bool FirstInsert = false; + + public ImageList ImageList { + get { + return imageList; + } + set { + imageList = value; + } + } + + public int FirstItem { + get { + return firstItem; + } + set { + if (firstItem != value) { + firstItem = value; + OnFirstItemChanged(EventArgs.Empty); + } + } + } + + public ICompletionData SelectedCompletionData { + get { + if (selectedItem < 0) { + return null; + } + return completionData[selectedItem]; + } + } + + public int ItemHeight { + get { + return Math.Max(imageList.ImageSize.Height, (int)(Font.Height * 1.1)); + } + } + + public int MaxVisibleItem { + get { + return Height / ItemHeight; + } + } + + private ICompletionData[] SortByGroup(ICompletionData[] compData) + { + UserDefaultCompletionData ddd = null; + List consts = new List(); + List meths = new List(); + List extension_meths = new List(); + List props = new List(); + List fields = new List(); + List vars = new List(); + List events = new List(); + List others = new List(); + List res = new List(); + foreach (ICompletionData data in compData) + { + if (data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberLocal) vars.Add(data); + else if (data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberConstant) consts.Add(data); + else if (data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberMethod || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberInternalMethod || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberPrivateMethod || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberProtectedMethod) + { + if (!data.Description.Contains("(" + PascalABCCompiler.StringResources.Get("CODE_COMPLETION_EXTENSION") + ")")) + meths.Add(data); + else + extension_meths.Add(data); + } + else if (data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberProperty || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberInternalProperty || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberPrivateProperty || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberProtectedProperty) + props.Add(data); + else if (data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberField || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberInternalField || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberPrivateField || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberProtectedField) + fields.Add(data); + else if (data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberEvent || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberInternalEvent || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberPrivateEvent || + data.ImageIndex == VisualPascalABC.CodeCompletionProvider.ImagesProvider.IconNumberProtectedEvent) + events.Add(data); + + else + others.Add(data); + + } + meths.Sort(); + extension_meths.Sort(); + props.Sort(); + fields.Sort(); + vars.Sort(); + consts.Sort(); + events.Sort(); + others.Sort(); + res.AddRange(vars); + res.AddRange(consts); + res.AddRange(fields); + res.AddRange(props); + res.AddRange(meths); + + res.AddRange(events); + res.AddRange(others); + res.AddRange(extension_meths); + return res.ToArray(); + } + + public PABCNETCodeCompletionListView(ICompletionData[] completionData, bool is_by_dot) + { + if (VisualPascalABC.VisualPABCSingleton.MainForm.UserOptions.ShowCompletionInfoByGroup && is_by_dot) + completionData = SortByGroup(completionData); + else + Array.Sort(completionData); + this.completionData = completionData; + for (int i=0; i= completionData.Length - MaxVisibleItem) + this.FirstItem = completionData.Length - MaxVisibleItem; + else + this.FirstItem = firstItem; + if (this.FirstItem != oldFirstItem) { + Invalidate(); + } + } + + public void CalcWidth() + { + int len = Width; + Graphics g = Graphics.FromHwnd(this.Handle); + for (int i=0; i +// +// +// +// $Revision: 2533 $ +// + +using System; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using ICSharpCode.TextEditor.Document; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public class PABCNETCodeCompletionWindow : AbstractCompletionWindow + { + ICompletionData[] completionData; + PABCNETCodeCompletionListView codeCompletionListView; + VScrollBar vScrollBar = new VScrollBar(); + ICompletionDataProvider dataProvider; + IDocument document; + private bool _is_overrided_meths = false; + Control editorControl; + + public bool is_overrided_meths + { + get + { + return _is_overrided_meths; + } + set + { + _is_overrided_meths = value; + if (value && completionData != null) + CalcFormWidth(); + } + } + + int startOffset; + int endOffset; + DeclarationWindow declarationViewWindow = null; + Rectangle workingScreen; + Point lastCursorScreenPosition; + + public static PABCNETCodeCompletionWindow ShowCompletionWindow(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar, bool visibleKeyPressed, bool is_by_dot,PascalABCCompiler.Parsers.KeywordKind keyw) + { + ICompletionData[] completionData = (completionDataProvider as VisualPascalABC.CodeCompletionProvider).GenerateCompletionDataWithKeyword(fileName, control.ActiveTextAreaControl.TextArea, firstChar, keyw); + if (completionData == null || completionData.Length == 0) { + return null; + } + PABCNETCodeCompletionWindow codeCompletionWindow = new PABCNETCodeCompletionWindow(completionDataProvider, completionData, parent, control, visibleKeyPressed, is_by_dot); + codeCompletionWindow.ShowCompletionWindow(); + return codeCompletionWindow; + } + + public static PABCNETCodeCompletionWindow ShowOverridableMethodsCompletionWindows(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider) + { + ICompletionData[] completionData = (completionDataProvider as VisualPascalABC.CodeCompletionProvider).GenerateCompletionDataForOverridableMethods(fileName, control.ActiveTextAreaControl.TextArea); + if (completionData == null || completionData.Length == 0) { + return null; + } + PABCNETCodeCompletionWindow codeCompletionWindow = new PABCNETCodeCompletionWindow(completionDataProvider, completionData, parent, control, false, false); + codeCompletionWindow.is_overrided_meths = true; + codeCompletionWindow.ShowCompletionWindow(); + return codeCompletionWindow; + } + + public void CalcFormWidth() + { + this.codeCompletionListView.CalcWidth(); + } + + public static PABCNETCodeCompletionWindow ShowCompletionWindowWithFirstChar(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar, PascalABCCompiler.Parsers.KeywordKind keyw) + { + ICompletionData[] completionData = (completionDataProvider as VisualPascalABC.CodeCompletionProvider).GenerateCompletionDataByFirstChar(fileName, control.ActiveTextAreaControl.TextArea, firstChar, keyw); + if (completionData == null || completionData.Length == 0) { + return null; + } + (completionDataProvider as VisualPascalABC.CodeCompletionProvider).preSelection = firstChar.ToString(); + PABCNETCodeCompletionWindow codeCompletionWindow = new PABCNETCodeCompletionWindow(completionDataProvider, completionData, parent, control, true, false); + codeCompletionWindow.ShowCompletionWindow(); + return codeCompletionWindow; + } + + PABCNETCodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, Form parentForm, TextEditorControl control,bool visibleKeyPressed, bool is_by_dot) : base(parentForm, control) + { + editorControl = control; + this.dataProvider = completionDataProvider; + this.completionData = completionData; + this.document = control.Document; + workingScreen = Screen.GetWorkingArea(Location); + lastCursorScreenPosition = control.ActiveTextAreaControl.Caret.ScreenPosition; + startOffset = control.ActiveTextAreaControl.Caret.Offset + (visibleKeyPressed ? 1 : 0); + endOffset = startOffset; + if (completionDataProvider.PreSelection != null) { + + startOffset -= completionDataProvider.PreSelection.Length; //+ 1; + if (visibleKeyPressed) endOffset--; + //endOffset--; + (completionDataProvider as VisualPascalABC.CodeCompletionProvider).preSelection = null; + } + + codeCompletionListView = new PABCNETCodeCompletionListView(completionData, is_by_dot); + codeCompletionListView.ImageList = completionDataProvider.ImageList; + codeCompletionListView.Dock = DockStyle.Fill; + codeCompletionListView.SelectedItemChanged += new EventHandler(CodeCompletionListViewSelectedItemChanged); + codeCompletionListView.DoubleClick += new EventHandler(CodeCompletionListViewDoubleClick); + codeCompletionListView.Click += new EventHandler(CodeCompletionListViewClick); + codeCompletionListView.Font = new Font(VisualPascalABC.Constants.CompletionWindowCodeCompletionListViewFontName,codeCompletionListView.Font.Size); + Controls.Add(codeCompletionListView); + + int MaxListLength = VisualPascalABC.Constants.CompletionWindowMaxListLength; + if (completionData.Length > MaxListLength) { + vScrollBar.Dock = DockStyle.Right; + vScrollBar.Minimum = 0; + vScrollBar.Maximum = completionData.Length - 1; + vScrollBar.SmallChange = 1; + vScrollBar.LargeChange = MaxListLength; + codeCompletionListView.FirstItemChanged += new EventHandler(CodeCompletionListViewFirstItemChanged); + Controls.Add(vScrollBar); + } + this.drawingSize = new Size(//codeCompletionListView.ItemHeight * 10, + VisualPascalABC.Constants.CompletionWindowWidth, + codeCompletionListView.ItemHeight * Math.Min(MaxListLength, completionData.Length) + 2); + SetLocation(); + + if (declarationViewWindow == null) { + declarationViewWindow = new DeclarationWindow(parentForm); + declarationViewWindow.in_completion_list = true; + declarationViewWindow.Font = new Font(VisualPascalABC.Constants.CompletionWindowDeclarationViewWindowFontName, declarationViewWindow.Font.Size); + } + SetDeclarationViewLocation(); + //DS закоментил, это желтый квадрат при старте + //declarationViewWindow.ShowDeclarationViewWindow(); + declarationViewWindow.MouseMove += ControlMouseMove; + control.Focus(); + CodeCompletionListViewSelectedItemChanged(this, EventArgs.Empty); + + if ((completionDataProvider as VisualPascalABC.CodeCompletionProvider).DefaultCompletionElement != null) { + if ((completionDataProvider as VisualPascalABC.CodeCompletionProvider).ByFirstChar) + codeCompletionListView.FirstInsert = true; + codeCompletionListView.SelectIndexByCompletionData((completionDataProvider as VisualPascalABC.CodeCompletionProvider).DefaultCompletionElement); + } + + if (completionDataProvider.PreSelection != null) { + CaretOffsetChanged(this, EventArgs.Empty); + } + + vScrollBar.ValueChanged += VScrollBarValueChanged; + document.DocumentAboutToBeChanged += DocumentAboutToBeChanged; + } + + bool inScrollUpdate; + + void CodeCompletionListViewFirstItemChanged(object sender, EventArgs e) + { + if (inScrollUpdate) return; + inScrollUpdate = true; + vScrollBar.Value = Math.Min(vScrollBar.Maximum, codeCompletionListView.FirstItem); + inScrollUpdate = false; + } + + void VScrollBarValueChanged(object sender, EventArgs e) + { + if (inScrollUpdate) return; + inScrollUpdate = true; + codeCompletionListView.FirstItem = vScrollBar.Value; + codeCompletionListView.Refresh(); + control.ActiveTextAreaControl.TextArea.Focus(); + inScrollUpdate = false; + } + + void SetDeclarationViewLocation() + { + + // This method uses the side with more free space + int leftSpace = Bounds.Left - workingScreen.Left; + int rightSpace = workingScreen.Right - Bounds.Right; + Point pos; + // The declaration view window has better line break when used on + // the right side, so prefer the right side to the left. + //MessageBox.Show((declarationViewWindow == null).ToString()); + /*if (declarationViewWindow == null) + { + declarationViewWindow = new DeclarationWindow(VisualPascalABC.VisualPABCSingleton.MainForm); + declarationViewWindow.in_completion_list = true; + declarationViewWindow.Font = new Font(VisualPascalABC.Constants.CompletionWindowDeclarationViewWindowFontName, declarationViewWindow.Font.Size); + }*/ + if (rightSpace * 2 > leftSpace) + pos = new Point(Bounds.Right+2, Bounds.Top); + else + pos = new Point(Bounds.Left - declarationViewWindow.Width+2, Bounds.Top); + if (declarationViewWindow.Location != pos) { + declarationViewWindow.Location = pos; + } + } + + protected override void SetLocation() + { + base.SetLocation(); + if (declarationViewWindow != null) { + SetDeclarationViewLocation(); + } + } + + public void HandleMouseWheel(MouseEventArgs e) + { + int MAX_DELTA = 120; // basically it's constant now, but could be changed later by MS + int multiplier = e.Delta / MAX_DELTA; + multiplier *= System.Windows.Forms.SystemInformation.MouseWheelScrollLines * vScrollBar.SmallChange; + + int newValue; + if (System.Windows.Forms.SystemInformation.MouseWheelScrollLines > 0) { + newValue = this.vScrollBar.Value - (control.TextEditorProperties.MouseWheelScrollDown ? 1 : -1) * multiplier; + } else { + newValue = this.vScrollBar.Value - (control.TextEditorProperties.MouseWheelScrollDown ? 1 : -1) * multiplier; + } + vScrollBar.Value = Math.Max(vScrollBar.Minimum, Math.Min(vScrollBar.Maximum - vScrollBar.LargeChange + 1, newValue)); + } + + void CodeCompletionListViewSelectedItemChanged(object sender, EventArgs e) + { + ICompletionData data = codeCompletionListView.SelectedCompletionData; + if (data != null && !(data as UserDefaultCompletionData).IsOnOverrideWindow && data.Description != null && data.Description.Length > 0) { + SetDeclarationViewLocation(); + declarationViewWindow.Description = data.Description; + } else { + if (declarationViewWindow != null) + declarationViewWindow.Description = null; + } + } + + public override bool ProcessKeyEvent(char ch) + { + switch (dataProvider.ProcessKey(ch)) { + case CompletionDataProviderKeyResult.BeforeStartKey: + // increment start+end, then process as normal char + ++startOffset; + ++endOffset; + return base.ProcessKeyEvent(ch); + case CompletionDataProviderKeyResult.NormalKey: + // just process normally + + return base.ProcessKeyEvent(ch); + case CompletionDataProviderKeyResult.InsertionKey: + return InsertSelectedItem(ch); + default: + throw new InvalidOperationException("Invalid return value of dataProvider.ProcessKey"); + } + } + + void DocumentAboutToBeChanged(object sender, DocumentEventArgs e) + { + // => startOffset test required so that this startOffset/endOffset are not incremented again + // for BeforeStartKey characters + if (e.Offset >= startOffset && e.Offset <= endOffset) { + if (e.Length > 0) { // length of removed region + endOffset -= e.Length; + } + if (!string.IsNullOrEmpty(e.Text)) { + endOffset += e.Text.Length; + } + } + } + + void fiexerrorTextAreaInvalidate() + { + //Исправление глюка с остающимся курсором если нажать ескейп. + //В новой версии редактора должны исправить, надо убрать это. + Rectangle r = new Rectangle(lastCursorScreenPosition, new Size(control.ActiveTextAreaControl.TextArea.Font.Height, control.ActiveTextAreaControl.TextArea.Font.Height + 3)); + control.ActiveTextAreaControl.TextArea.Invalidate(r); + } + + + protected override void CaretOffsetChanged(object sender, EventArgs e) + { + int offset = control.ActiveTextAreaControl.Caret.Offset; + if (offset == startOffset) { + return; + } + if (offset < startOffset || offset > endOffset) { + Close(); + fiexerrorTextAreaInvalidate(); + editorControl.Focus(); + } else { + codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset, offset - startOffset)); + } + lastCursorScreenPosition = control.ActiveTextAreaControl.TextArea.Caret.ScreenPosition; + } + + protected override bool ProcessTextAreaKey(Keys keyData) + { + if (!Visible) { + return false; + } + + switch (keyData) { + case Keys.Home: + codeCompletionListView.SelectIndex(0); + return true; + case Keys.End: + codeCompletionListView.SelectIndex(completionData.Length-1); + return true; + case Keys.PageDown: + codeCompletionListView.PageDown(); + return true; + case Keys.PageUp: + codeCompletionListView.PageUp(); + return true; + case Keys.Down: + codeCompletionListView.SelectNextItem(); + editorControl.Focus(); + return true; + case Keys.Up: + codeCompletionListView.SelectPrevItem(); + editorControl.Focus(); + return true; + case Keys.Tab: + case Keys.Return: + InsertSelectedItem('\0'); + editorControl.Focus(); + return true; + case Keys.Escape: + fiexerrorTextAreaInvalidate(); + break; + } + var v = base.ProcessTextAreaKey(keyData); + if (keyData == Keys.Escape) + editorControl.Focus(); + return v; + } + + void CodeCompletionListViewDoubleClick(object sender, EventArgs e) + { + InsertSelectedItem('\0'); + editorControl.Focus(); + } + + void CodeCompletionListViewClick(object sender, EventArgs e) + { + control.ActiveTextAreaControl.TextArea.Focus(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) { + document.DocumentAboutToBeChanged -= DocumentAboutToBeChanged; + if (codeCompletionListView != null) { + codeCompletionListView.Dispose(); + codeCompletionListView = null; + } + if (declarationViewWindow != null) { + declarationViewWindow.Dispose(); + declarationViewWindow = null; + } + } + base.Dispose(disposing); + } + + public void SelectIndex(int num) + { + if (codeCompletionListView != null) + codeCompletionListView.SelectIndex(num); + } + + bool InsertSelectedItem(char ch) + { + document.DocumentAboutToBeChanged -= DocumentAboutToBeChanged; + ICompletionData data = codeCompletionListView.SelectedCompletionData; + if (VisualPascalABC.VisualPABCSingleton.MainForm.UserOptions.EnableSmartIntellisense) + { + VisualPascalABC.CompletionDataDispatcher.AddLastUsedItem(data); + VisualPascalABC.CompletionDataDispatcher.BindMember(data); + } + + bool result = false; + if (data != null) { + control.BeginUpdate(); + + try { + if (endOffset - startOffset > 0) { + control.Document.Remove(startOffset, endOffset - startOffset); + } + Debug.Assert(startOffset <= document.TextLength); + result = dataProvider.InsertAction(data, control.ActiveTextAreaControl.TextArea, startOffset, ch); + } finally { + control.EndUpdate(); + } + } + Close(); + return result; + } + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/DeclarationWindow.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/DeclarationWindow.cs new file mode 100644 index 000000000..a6d0fa2de --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/DeclarationWindow.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using ICSharpCode.TextEditor; + +namespace ICSharpCode.TextEditor.Gui.CompletionWindow +{ + public class DeclarationWindow : DeclarationViewWindow + { + public bool in_completion_list; + + public DeclarationWindow(Form parent):base(parent) + { + + } + + private bool has_tags() + { + return Description.Contains("") || Description.Contains(""); + } + + protected override void OnPaint(PaintEventArgs pe) + { + //pe.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; + if (Description != null && Description.Length > 0) { + if (!in_completion_list) + ICSharpCode.TextEditor.Util.TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, null, Description,-1,false); + else + { + if (has_tags()) + { + string tmp = Description; + int return_ind = tmp.IndexOf(""); + int params_ind = tmp.IndexOf(""); + if (return_ind != -1 && params_ind != -1) + tmp = tmp.Substring(0,Math.Min(return_ind,params_ind)).Trim(' ','\n','\t','\r'); + else + if (return_ind == -1) + tmp = tmp.Substring(0,params_ind).Trim(' ','\n','\t','\r'); + else + tmp = tmp.Substring(0,return_ind).Trim(' ','\n','\t','\r'); + Description = tmp; + return; + } + else + base.OnPaint(pe); + + } + } + else + base.OnPaint(pe); + } + } +} + diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/InsightWindow.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/InsightWindow.cs new file mode 100644 index 000000000..91732b54b --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/InsightWindow.cs @@ -0,0 +1,259 @@ +// +// +// +// +// $Revision: 2681 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Util; + +namespace ICSharpCode.TextEditor.Gui.InsightWindow +{ + public class PABCNETInsightWindow : AbstractCompletionWindow + { + public PABCNETInsightWindow(Form parentForm, TextEditorControl control) : base(parentForm, control) + { + SetStyle(ControlStyles.UserPaint, true); + //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + } + + public void ShowInsightWindow() + { + if (!Visible) { + if (insightDataProviderStack.Count > 0) { + ShowCompletionWindow(); + } + } else { + Refresh(); + } + } + + #region Event handling routines + protected override bool ProcessTextAreaKey(Keys keyData) + { + if (!Visible) { + return false; + } + switch (keyData) { + case Keys.Down: + if (DataProvider != null && DataProvider.InsightDataCount > 0) { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + Refresh(); + } + if (DataProvider != null && DataProvider.InsightDataCount > 1) + return true; + else return false; + case Keys.Up: + if (DataProvider != null && DataProvider.InsightDataCount > 0) { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + Refresh(); + } + if (DataProvider != null && DataProvider.InsightDataCount > 1) + return true; + else return false; + case Keys.Escape: + fixerrorTextAreaInvalidate(); + break; + } + return base.ProcessTextAreaKey(keyData); + } + + private Point lastCursorScreenPosition; + + internal Point GetCusorCoord() + { + TextLocation caretPos = control.ActiveTextAreaControl.Caret.Position; + //lastCursorScreenPosition = control.ActiveTextAreaControl.TextArea.Caret.ScreenPosition; + int y = (int)((1 + caretPos.Y) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight) + - control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1 + + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y; + + int xpos = control.ActiveTextAreaControl.TextArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X); + int ypos = (control.ActiveTextAreaControl.Document.GetVisibleLine(caretPos.Y) + 1) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight + - control.ActiveTextAreaControl.TextArea.VirtualTop.Y; + int rulerHeight = control.TextEditorProperties.ShowHorizontalRuler ? control.ActiveTextAreaControl.TextArea.TextView.FontHeight : 0; + + Point p = control.ActiveTextAreaControl.PointToScreen(new Point(xpos, ypos + rulerHeight)); + return p; + } + + protected override void CaretOffsetChanged(object sender, EventArgs e) + { + // move the window under the caret (don't change the x position) + TextLocation caretPos = control.ActiveTextAreaControl.Caret.Position; + //lastCursorScreenPosition = control.ActiveTextAreaControl.TextArea.Caret.ScreenPosition; + int y = (int)((1 + caretPos.Y) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight) + - control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1 + + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y; + + int xpos = control.ActiveTextAreaControl.TextArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X); + int ypos = (control.ActiveTextAreaControl.Document.GetVisibleLine(caretPos.Y) + 1) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight + - control.ActiveTextAreaControl.TextArea.VirtualTop.Y; + int rulerHeight = control.TextEditorProperties.ShowHorizontalRuler ? control.ActiveTextAreaControl.TextArea.TextView.FontHeight : 0; + + Point p = control.ActiveTextAreaControl.PointToScreen(new Point(xpos, ypos + rulerHeight)); + if (p.Y != Location.Y) { + Location = p; + } + fixerrorTextAreaInvalidate(); + lastCursorScreenPosition = control.ActiveTextAreaControl.TextArea.Caret.ScreenPosition; + while (DataProvider != null && DataProvider.CaretOffsetChanged()) { + CloseCurrentDataProvider(); + } + } + + void fixerrorTextAreaInvalidate() + { + //Исправление глюка с остающимся курсором если нажать ескейп. + //В новой версии редактора должны исправить, надо убрать это. + Rectangle r = new Rectangle(lastCursorScreenPosition, new Size(control.ActiveTextAreaControl.TextArea.Font.Height, control.ActiveTextAreaControl.TextArea.Font.Height + 3)); + control.ActiveTextAreaControl.TextArea.Invalidate(r); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + control.ActiveTextAreaControl.TextArea.Focus(); + if (TipPainterTools.DrawingRectangle1.Contains(e.X, e.Y)) { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + Refresh(); + } + if (TipPainterTools.DrawingRectangle2.Contains(e.X, e.Y)) { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + Refresh(); + } + } + + #endregion + + + public void HandleMouseWheel(MouseEventArgs e) + { + if (DataProvider != null && DataProvider.InsightDataCount > 0) { + if (e.Delta > 0) { + if (control.TextEditorProperties.MouseWheelScrollDown) { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + } else { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + } + } if (e.Delta < 0) { + if (control.TextEditorProperties.MouseWheelScrollDown) { + CurrentData = (CurrentData + DataProvider.InsightDataCount - 1) % DataProvider.InsightDataCount; + } else { + CurrentData = (CurrentData + 1) % DataProvider.InsightDataCount; + } + } + Refresh(); + } + } + + #region Insight Window Drawing routines + protected override void OnPaint(PaintEventArgs pe) + { + string methodCountMessage = null, description; + if (DataProvider == null || DataProvider.InsightDataCount < 1) { + description = "Unknown Method"; + } else { + if (DataProvider.InsightDataCount > 1) { + methodCountMessage = VisualPascalABC.Tools.GetRangeDescription(CurrentData + 1, DataProvider.InsightDataCount); + } + description = DataProvider.GetInsightData(CurrentData); + } + //pe.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; + int num_param = (DataProvider as VisualPascalABC.DefaultInsightDataProvider).num_param; + drawingSize = TipPainterTools.GetDrawingSizeHelpTipFromCombinedDescription(this, + pe.Graphics, + Font, + methodCountMessage, + description,num_param,true); + if (drawingSize != Size) { + SetLocation(); + } else { + TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, methodCountMessage, description, num_param,true); + } + lastCursorScreenPosition = control.ActiveTextAreaControl.TextArea.Caret.ScreenPosition; + } + + protected override void OnPaintBackground(PaintEventArgs pe) + { + pe.Graphics.FillRectangle(SystemBrushes.Info, pe.ClipRectangle); + } + #endregion + + #region InsightDataProvider handling + Stack insightDataProviderStack = new Stack(); + + int CurrentData { + get { + return insightDataProviderStack.Peek().currentData; + } + set { + insightDataProviderStack.Peek().currentData = value; + } + } + + public int GetCurrentData() + { + return CurrentData; + } + + IInsightDataProvider DataProvider { + get { + if (insightDataProviderStack.Count == 0) { + return null; + } + return insightDataProviderStack.Peek().dataProvider; + } + } + + public void AddInsightDataProvider(IInsightDataProvider provider, string fileName) + { + provider.SetupDataProvider(fileName, control.ActiveTextAreaControl.TextArea); + if (provider.InsightDataCount > 0) { + insightDataProviderStack.Push(new InsightDataProviderStackElement(provider)); + } + } + + public IInsightDataProvider GetInsightProvider() + { + return insightDataProviderStack.Peek().dataProvider; + } + + void CloseCurrentDataProvider() + { + insightDataProviderStack.Pop(); + if (insightDataProviderStack.Count == 0) { + Close(); + } else { + Refresh(); + } + } + + public int InsightProviderStackLength + { + get + { + return insightDataProviderStack.Count; + } + } + + class InsightDataProviderStackElement + { + public int currentData; + public IInsightDataProvider dataProvider; + + public InsightDataProviderStackElement(IInsightDataProvider dataProvider) + { + this.currentData = Math.Max(dataProvider.DefaultIndex, 0); + this.dataProvider = dataProvider; + } + } + #endregion + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainter.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainter.cs new file mode 100644 index 000000000..afb7ddb70 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainter.cs @@ -0,0 +1,165 @@ +// +// +// +// +// $Revision: 2487 $ +// + +using System.Drawing; +using System.Drawing.Text; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Util +{ + static class TipPainter + { + const float HorizontalBorder = 2; + const float VerticalBorder = 1; + static RectangleF workingArea = RectangleF.Empty; + + //static StringFormat centerTipFormat = CreateTipStringFormat(); + + public static Size GetTipSize(Control control, Graphics graphics, Font font, string description) + { + return GetTipSize(control, graphics, new TipText (graphics, font, description)); + } + + public static Size GetTipSize(Control control, Graphics graphics, TipSection tipData) + { + Size tipSize = Size.Empty; + SizeF tipSizeF = SizeF.Empty; + + if (workingArea == RectangleF.Empty) { + Form ownerForm = control.FindForm(); + if (ownerForm.Owner != null) { + ownerForm = ownerForm.Owner; + } + + workingArea = Screen.GetWorkingArea(ownerForm); + } + + PointF screenLocation = control.PointToScreen(Point.Empty); + SizeF maxLayoutSize = new SizeF(workingArea.Right /*- screenLocation.X*/ - HorizontalBorder * 2, + workingArea.Bottom /*- screenLocation.Y*/ - VerticalBorder * 2); + + float global_max_x = workingArea.Right - HorizontalBorder * 2; + + if (maxLayoutSize.Width > 0 && maxLayoutSize.Height > 0) { + /*graphics.TextRenderingHint = + TextRenderingHint.AntiAliasGridFit;*/ + tipData.GlobalMaxX = global_max_x; + tipData.SetMaximumSize(maxLayoutSize); + //if (tipData.LeftOffset > 0) + // control.Left = control.Left - tipData.LeftOffset; + tipSizeF = tipData.GetRequiredSize(); + tipData.SetAllocatedSize(tipSizeF); + + tipSizeF += new SizeF(HorizontalBorder * 2, + VerticalBorder * 2); + tipSize = Size.Ceiling(tipSizeF); + } + if (control is ICSharpCode.TextEditor.Gui.InsightWindow.PABCNETInsightWindow) + { + Rectangle rect = Rectangle.Ceiling(workingArea); + Point pt = (control as ICSharpCode.TextEditor.Gui.InsightWindow.PABCNETInsightWindow).GetCusorCoord(); + if (pt.X + tipSize.Width > rect.Width) + { + control.Location = new Point(rect.Width-tipSize.Width,pt.Y); + } + } + else + { + Rectangle rect = Rectangle.Ceiling(workingArea); + Point pt = control.Location; + if (pt.X + tipSize.Width > rect.Width) + { + control.Location = new Point(rect.Width-tipSize.Width,pt.Y); + } + } + if (control.ClientSize != tipSize) { + control.ClientSize = tipSize; + } + + return tipSize; + } + + public static Size DrawTip(Control control, Graphics graphics, Font font, string description) + { + return DrawTip(control, graphics, new TipText (graphics, font, description)); + } + + public static Size DrawTip(Control control, Graphics graphics, TipSection tipData) + { + Size tipSize = Size.Empty; + SizeF tipSizeF = SizeF.Empty; + + PointF screenLocation = control.PointToScreen(Point.Empty); + + if (workingArea == RectangleF.Empty) { + Form ownerForm = control.FindForm(); + if (ownerForm.Owner != null) { + ownerForm = ownerForm.Owner; + } + + workingArea = Screen.GetWorkingArea(ownerForm); + } + + SizeF maxLayoutSize = new SizeF(workingArea.Right /*- screenLocation.X*/ - HorizontalBorder * 2, + workingArea.Bottom /*- screenLocation.Y*/ - VerticalBorder * 2); + if (maxLayoutSize.Width > 0 && maxLayoutSize.Height > 0) { + /*graphics.TextRenderingHint = + TextRenderingHint.AntiAliasGridFit;*/ + + tipData.SetMaximumSize(maxLayoutSize); + tipSizeF = tipData.GetRequiredSize(); + tipData.SetAllocatedSize(tipSizeF); + + tipSizeF += new SizeF(HorizontalBorder * 2, + VerticalBorder * 2); + tipSize = Size.Ceiling(tipSizeF); + } + + if (control is ICSharpCode.TextEditor.Gui.InsightWindow.PABCNETInsightWindow) + { + Rectangle rect = Rectangle.Ceiling(workingArea); + Point pt = (control as ICSharpCode.TextEditor.Gui.InsightWindow.PABCNETInsightWindow).GetCusorCoord(); + if (pt.X + tipSize.Width > rect.Width) + { + control.Location = new Point(rect.Width-tipSize.Width,pt.Y); + } + } + else + { + Rectangle rect = Rectangle.Ceiling(workingArea); + Point pt = control.Location; + if (pt.X + tipSize.Width > rect.Width) + { + if (rect.Width-tipSize.Width > 0) + control.Location = new Point(rect.Width-tipSize.Width,pt.Y); + else + control.Location = new Point(10,pt.Y); + } + } + + if (control.ClientSize != tipSize) { + control.ClientSize = tipSize; + } + + if (tipSize != Size.Empty) { + Rectangle borderRectangle = new Rectangle + (Point.Empty, tipSize - new Size(1, 1)); + + RectangleF displayRectangle = new RectangleF + (HorizontalBorder, VerticalBorder, + tipSizeF.Width - HorizontalBorder * 2, + tipSizeF.Height - VerticalBorder * 2); + + // DrawRectangle draws from Left to Left + Width. A bug? :-/ + graphics.DrawRectangle(SystemPens.WindowFrame, + borderRectangle); + tipData.Draw(new PointF(HorizontalBorder, VerticalBorder)); + } + return tipSize; + } + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainterTools.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainterTools.cs new file mode 100644 index 000000000..4fafd32b5 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipPainterTools.cs @@ -0,0 +1,536 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +namespace ICSharpCode.TextEditor.Util +{ + class TipPainterTools + { + const int SpacerSize = 4; + + private TipPainterTools() + { + + } + public static Size GetDrawingSizeHelpTipFromCombinedDescription(Control control, + Graphics graphics, + Font font, + string countMessage, + string description, + int param_num, bool addit_info) + { + string basicDescription = null; + string documentation = null; + int bold_beg = -1; + int bold_len = 0; + if (IsVisibleText(description)) + { + string[] splitDescription = description.Split(new char[] { '\n' }, 2); + + if (splitDescription.Length > 0) + { + basicDescription = splitDescription[0]; + int extensionIndex = basicDescription.IndexOf("(расширение") + 1; + if (param_num == 1) + { + bold_beg = basicDescription.IndexOf('(') + 1; + if (bold_beg != 0 && bold_beg == extensionIndex) + bold_beg = basicDescription.IndexOf('(', basicDescription.IndexOf(')') + 1) + 1; + if (bold_beg != 0) + { + int end = basicDescription.IndexOf(CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ParameterDelimiter); + int end_sk = basicDescription.IndexOf(')', bold_beg); + if (end > end_sk || end == -1) end = end_sk; + //if (end == -1) end = basicDescription.IndexOf(')'); + if (end != -1) bold_len = end - bold_beg; + } + } + else + { + int i = 1; bold_beg = 0; + while (i < param_num) + { + bold_beg = basicDescription.IndexOf(CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ParameterDelimiter, bold_beg) + 1; + if (bold_beg == 0) break; + i++; + } + if (bold_beg != 0) + { + int end = basicDescription.IndexOf(CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ParameterDelimiter, bold_beg); + int end_sk = basicDescription.IndexOf(')', bold_beg); + if (end > end_sk || end == -1) end = end_sk; + if (end != -1) bold_len = end - bold_beg; + } + } + if (splitDescription.Length > 1) + { + documentation = splitDescription[1].Trim(); + } + } + } + + return GetDrawingSizeDrawHelpTip(control, graphics, font, countMessage, basicDescription, documentation, bold_beg, bold_len, param_num, addit_info); + } + + public static Size DrawHelpTipFromCombinedDescription(Control control, + Graphics graphics, + Font font, + string countMessage, + string description, int param_num, bool addit_info) + { + string basicDescription = null; + string documentation = null; + int bold_beg = -1; + int bold_len = 0; + + if (IsVisibleText(description)) + { + string[] splitDescription = description.Split + (new char[] { '\n' }, 2); + + if (splitDescription.Length > 0) + { + basicDescription = splitDescription[0]; + int extensionIndex = basicDescription.IndexOf("(расширение") + 1; + if (param_num == 1) + { + bold_beg = basicDescription.IndexOf('(') + 1; + if (bold_beg != 0 && bold_beg == extensionIndex) + bold_beg = basicDescription.IndexOf('(', basicDescription.IndexOf(')') + 1) + 1; + if (bold_beg != 0) + { + int end = basicDescription.IndexOf(CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ParameterDelimiter); + int end_sk = basicDescription.IndexOf(')', bold_beg); + if (end > end_sk || end == -1) end = end_sk; + //if (end == -1) end = basicDescription.IndexOf(')'); + if (end != -1) bold_len = end - bold_beg; + } + } + else + { + int i = 1; bold_beg = 0; + while (i < param_num) + { + bold_beg = basicDescription.IndexOf(CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ParameterDelimiter, bold_beg) + 1; + if (bold_beg == 0) break; + i++; + } + if (bold_beg != 0) + { + int end = basicDescription.IndexOf(CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ParameterDelimiter, bold_beg); + int end_sk = basicDescription.IndexOf(')', bold_beg); + if (end > end_sk || end == -1) end = end_sk; + if (end != -1) bold_len = end - bold_beg; + } + } + if (splitDescription.Length > 1) + { + documentation = splitDescription[1].Trim(); + } + } + } + return DrawHelpTip(control, graphics, font, countMessage, + basicDescription, documentation, bold_beg, bold_len, param_num, addit_info); + } + + // btw. I know it's ugly. + public static Rectangle DrawingRectangle1; + public static Rectangle DrawingRectangle2; + + public static Size GetDrawingSizeDrawHelpTip(Control control, + Graphics graphics, Font font, + string countMessage, + string basicDescription, + string documentation, + int beg_bold, int bold_len, int param_num, bool addit_info) + { + if (IsVisibleText(countMessage) || + IsVisibleText(basicDescription) || + IsVisibleText(documentation)) + { + // Create all the TipSection objects. + CountTipText countMessageTip = new CountTipText(graphics, font, countMessage); + + TipSpacer countSpacer = new TipSpacer(graphics, new SizeF(IsVisibleText(countMessage) ? 4 : 0, 0)); + + TipText descriptionTip = new TipText(graphics, font, basicDescription); + descriptionTip.insight_wnd = control is ICSharpCode.TextEditor.Gui.InsightWindow.PABCNETInsightWindow; + descriptionTip.beg_bold = beg_bold; + descriptionTip.len_bold = bold_len; + TipText descriptionTip1 = new TipText(graphics, font, basicDescription.Substring(0, beg_bold)); + TipText descriptionTip2 = new TipText(graphics, new Font(font, FontStyle.Bold), basicDescription.Substring(beg_bold, bold_len)); + TipText descriptionTip3 = new TipText(graphics, font, basicDescription.Substring(beg_bold + bold_len)); + descriptionTip.desc1 = descriptionTip1; + descriptionTip.desc2 = descriptionTip2; + descriptionTip.desc3 = descriptionTip3; + TipSpacer docSpacer = new TipSpacer(graphics, new SizeF(0, IsVisibleText(documentation) ? 4 : 0)); + + List sections = new List(); + if (documentation != null) + { + try + { + + int params_ind = documentation.IndexOf(""); + TipText paramsTextTipHeader = null; + TipText paramsTextTip = null; + if (params_ind != -1 && addit_info) + { + paramsTextTipHeader = new TipText(graphics, new Font(font, FontStyle.Bold), PascalABCCompiler.StringResources.Get("CODE_COMPLETION_PARAMETERS")); + paramsTextTipHeader.is_head = true; + int end_param = documentation.IndexOf("", params_ind); + string params_text; + if (end_param == -1) + { + params_text = documentation.Substring(params_ind + 8).Trim(' ', '\n', '\r', '\t'); + //paramsTextTip = new TipText(graphics,font,params_text); + } + else + { + params_text = documentation.Substring(params_ind + 8, end_param - params_ind - 8).Trim(' ', '\n', '\r', '\t'); + //paramsTextTip = new TipText(graphics,font,documentation.Substring(params_ind+8,end_param-params_ind-8).Trim(' ','\n','\r','\t')); + } + List prms_list = new List(); + int ind = params_text.IndexOf("", 0); + while (ind != -1) + { + int end_ind = params_text.IndexOf("", ind + 1); + prms_list.Add(params_text.Substring(ind + 7, end_ind - ind - 7).Trim(' ', '\n', '\t', '\r')); + ind = params_text.IndexOf("", end_ind); + if (ind != -1) + { + if (ind - end_ind - 7 > 0) + prms_list.Add(params_text.Substring(end_ind + 8, ind - end_ind - 8).Trim(' ', '\n', '\t', '\r')); + else + prms_list.Add(""); + } + else + { + prms_list.Add(params_text.Substring(end_ind + 8).Trim(' ', '\n', '\t', '\r')); + } + } + + List prm_sections = new List(); + int i = 0; + while (i < prms_list.Count) + { + TipText prm_name_sect = new TipText(graphics, font, prms_list[i]); + prm_name_sect.param_name = true; + TipText desc_param_sect = new TipText(graphics, font, prms_list[i + 1]); + desc_param_sect.need_tab = true; + desc_param_sect.param_desc = true; + //TipSplitter spltr = new TipSplitter(graphics,true,prm_name_sect,desc_param_sect); + if (!string.IsNullOrEmpty(prms_list[i + 1])) + { + prm_sections.Add(prm_name_sect); + prm_sections.Add(desc_param_sect); + } + i += 2; + } + if (prm_sections.Count > 0) + { + sections.Add(new TipText(graphics, new Font(font.FontFamily, 3), " ")); + sections.Add(paramsTextTipHeader); + sections.AddRange(prm_sections); + } + } + int return_ind = documentation.IndexOf(""); + /*TipText returnTextTipHeader = null; + TipText returnTextTip = null; + if (return_ind != -1 && addit_info) + { + returnTextTipHeader = new TipText(graphics,new Font(font, FontStyle.Bold),PascalABCCompiler.StringResources.Get("CODE_COMPLETION_RETURN")); + returnTextTipHeader.is_head = true; + int end_return = documentation.IndexOf("",return_ind); + string return_text; + if (end_return == -1) + return_text = documentation.Substring(return_ind+9).Trim(' ','\n','\r','\t'); + else + return_text = documentation.Substring(return_ind+9,end_return-return_ind-9).Trim(' ','\n','\r','\t'); + + if (!string.IsNullOrEmpty(return_text)) + { + returnTextTip = new TipText(graphics,font,return_text); + sections.Add(new TipText(graphics,new Font(font.FontFamily,3)," ")); + sections.Add(returnTextTipHeader); + sections.Add(returnTextTip); + returnTextTip.need_tab = true; + } + }*/ + if (params_ind != -1 && return_ind != -1) + documentation = documentation.Substring(0, Math.Min(params_ind, return_ind)).Trim(' ', '\n', '\t', '\r'); + else + if (params_ind != -1) + documentation = documentation.Substring(0, params_ind).Trim(' ', '\n', '\t', '\r'); + else + if (return_ind != -1) + documentation = documentation.Substring(0, return_ind).Trim(' ', '\n', '\t', '\r'); + } + catch + { + + } + } + TipText docTip = new TipText(graphics, font, documentation); + //docTip.is_doc = true; + docTip.need_tab = true; + sections.Insert(0, docTip); + if (!string.IsNullOrEmpty(documentation)) + { + TipText descr_head = new TipText(graphics, new Font(font, FontStyle.Bold), PascalABCCompiler.StringResources.Get("CODE_COMPLETION_DESCRIPTION")); + descr_head.is_head = true; + sections.Insert(0, descr_head); + sections.Insert(0, new TipText(graphics, new Font(font.FontFamily, 1), " ")); + } + //docTip.is_doc = true; + docTip.need_tab = true; + TipSplitter descSplitter = new TipSplitter(graphics, true, + descriptionTip, + docSpacer + ); + // Now put them together. + /*TipSplitter descSplitter = new TipSplitter(graphics, true, + //descriptionTip, + descriptionTip1, + descriptionTip2, + descriptionTip3, + docSpacer + );*/ + descSplitter.is_desc = true; + /*TipSplitter descSplitter1 = new TipSplitter(graphics, false, + //descriptionTip, + descriptionTip1 + ); + + TipSplitter descSplitter2 = new TipSplitter(graphics, false, + //descriptionTip, + descriptionTip2 + ); + + TipSplitter descSplitter3 = new TipSplitter(graphics, false, + //descriptionTip, + descriptionTip3, + docSpacer + );*/ + + TipSplitter mainSplitter = new TipSplitter(graphics, true, + countMessageTip, + countSpacer, + descSplitter); + + sections.Insert(0, mainSplitter); + TipSplitter mainSplitter2 = new TipSplitter(graphics, false, + sections.ToArray()); + + // Show it. + Size size = TipPainter.GetTipSize(control, graphics, mainSplitter2); + DrawingRectangle1 = countMessageTip.DrawingRectangle1; + DrawingRectangle2 = countMessageTip.DrawingRectangle2; + return size; + } + return Size.Empty; + } + + public static Size DrawHelpTip(Control control, + Graphics graphics, Font font, + string countMessage, + string basicDescription, + string documentation, + int beg_bold, int bold_len, int param_num, bool addit_info) + { + if (IsVisibleText(countMessage) || + IsVisibleText(basicDescription) || + IsVisibleText(documentation)) + { + // Create all the TipSection objects. + CountTipText countMessageTip = new CountTipText(graphics, font, countMessage); + + TipSpacer countSpacer = new TipSpacer(graphics, new SizeF(IsVisibleText(countMessage) ? 4 : 0, 0)); + + TipText descriptionTip = new TipText(graphics, font, basicDescription); + descriptionTip.insight_wnd = control is ICSharpCode.TextEditor.Gui.InsightWindow.PABCNETInsightWindow; + descriptionTip.beg_bold = beg_bold; + descriptionTip.len_bold = bold_len; + TipText descriptionTip1 = new TipText(graphics, font, basicDescription.Substring(0, beg_bold)); + TipText descriptionTip2 = new TipText(graphics, new Font(font, FontStyle.Bold), basicDescription.Substring(beg_bold, bold_len)); + TipText descriptionTip3 = new TipText(graphics, font, basicDescription.Substring(beg_bold + bold_len)); + descriptionTip.desc1 = descriptionTip1; + descriptionTip.desc2 = descriptionTip2; + descriptionTip.desc3 = descriptionTip3; + TipSpacer docSpacer = new TipSpacer(graphics, new SizeF(0, IsVisibleText(documentation) ? 4 : 0)); + List sections = new List(); + if (documentation != null) + { + try + { + + int params_ind = documentation.IndexOf(""); + TipText paramsTextTipHeader = null; + TipText paramsTextTip = null; + if (params_ind != -1 && addit_info) + { + paramsTextTipHeader = new TipText(graphics, new Font(font, FontStyle.Bold), PascalABCCompiler.StringResources.Get("CODE_COMPLETION_PARAMETERS")); + paramsTextTipHeader.is_head = true; + int end_param = documentation.IndexOf("", params_ind); + string params_text; + if (end_param == -1) + { + params_text = documentation.Substring(params_ind + 8).Trim(' ', '\n', '\r', '\t'); + //paramsTextTip = new TipText(graphics,font,params_text); + } + else + { + params_text = documentation.Substring(params_ind + 8, end_param - params_ind - 8).Trim(' ', '\n', '\r', '\t'); + //paramsTextTip = new TipText(graphics,font,documentation.Substring(params_ind+8,end_param-params_ind-8).Trim(' ','\n','\r','\t')); + } + List prms_list = new List(); + int ind = params_text.IndexOf("", 0); + while (ind != -1) + { + int end_ind = params_text.IndexOf("", ind + 1); + prms_list.Add(params_text.Substring(ind + 7, end_ind - ind - 7).Trim(' ', '\n', '\t', '\r')); + ind = params_text.IndexOf("", end_ind); + if (ind != -1) + { + if (ind - end_ind - 7 > 0) + prms_list.Add(params_text.Substring(end_ind + 8, ind - end_ind - 8).Trim(' ', '\n', '\t', '\r')); + else + prms_list.Add(""); + } + else + { + prms_list.Add(params_text.Substring(end_ind + 8).Trim(' ', '\n', '\t', '\r')); + } + } + + List prm_sections = new List(); + int i = 0; + while (i < prms_list.Count) + { + TipText prm_name_sect = new TipText(graphics, font, prms_list[i]); + prm_name_sect.param_name = true; + TipText desc_param_sect = new TipText(graphics, font, prms_list[i + 1]); + desc_param_sect.need_tab = true; + desc_param_sect.param_desc = true; + //TipSplitter spltr = new TipSplitter(graphics,true,prm_name_sect,desc_param_sect); + if (!string.IsNullOrEmpty(prms_list[i + 1])) + { + prm_sections.Add(prm_name_sect); + prm_sections.Add(desc_param_sect); + } + i += 2; + } + if (prm_sections.Count > 0) + { + sections.Add(new TipText(graphics, new Font(font.FontFamily, 3), " ")); + sections.Add(paramsTextTipHeader); + sections.AddRange(prm_sections); + } + } + int return_ind = documentation.IndexOf(""); + /*TipText returnTextTipHeader = null; + TipText returnTextTip = null; + if (return_ind != -1 && addit_info) + { + returnTextTipHeader = new TipText(graphics,new Font(font, FontStyle.Bold),PascalABCCompiler.StringResources.Get("CODE_COMPLETION_RETURN")); + returnTextTipHeader.is_head = true; + int end_return = documentation.IndexOf("",return_ind); + string return_text; + if (end_return == -1) + return_text = documentation.Substring(return_ind+9).Trim(' ','\n','\r','\t'); + else + return_text = documentation.Substring(return_ind+9,end_return-return_ind-9).Trim(' ','\n','\r','\t'); + + if (!string.IsNullOrEmpty(return_text)) + { + returnTextTip = new TipText(graphics,font,return_text); + sections.Add(new TipText(graphics,new Font(font.FontFamily,3)," ")); + sections.Add(returnTextTipHeader); + sections.Add(returnTextTip); + returnTextTip.need_tab = true; + } + }*/ + if (params_ind != -1 && return_ind != -1) + documentation = documentation.Substring(0, Math.Min(params_ind, return_ind)).Trim(' ', '\n', '\t', '\r'); + else + if (params_ind != -1) + documentation = documentation.Substring(0, params_ind).Trim(' ', '\n', '\t', '\r'); + else + if (return_ind != -1) + documentation = documentation.Substring(0, return_ind).Trim(' ', '\n', '\t', '\r'); + } + catch + { + + } + } + TipText docTip = new TipText(graphics, font, documentation); + //docTip.is_doc = true; + docTip.need_tab = true; + sections.Insert(0, docTip); + if (!string.IsNullOrEmpty(documentation)) + { + TipText descr_head = new TipText(graphics, new Font(font, FontStyle.Bold), PascalABCCompiler.StringResources.Get("CODE_COMPLETION_DESCRIPTION")); + descr_head.is_head = true; + sections.Insert(0, descr_head); + sections.Insert(0, new TipText(graphics, new Font(font.FontFamily, 1), " ")); + } + TipSplitter descSplitter = new TipSplitter(graphics, true, + descriptionTip, + docSpacer + ); + // Now put them together. + /*TipSplitter descSplitter = new TipSplitter(graphics,true, + descriptionTip1, + descriptionTip2, + descriptionTip3, + docSpacer + );*/ + descSplitter.is_desc = true; + /*TipSplitter descSplitter1 = new TipSplitter(graphics, false, + //descriptionTip, + descriptionTip1 + ); + + TipSplitter descSplitter2 = new TipSplitter(graphics, false, + //descriptionTip, + descriptionTip2 + ); + + TipSplitter descSplitter3 = new TipSplitter(graphics, false, + //descriptionTip, + descriptionTip3, + docSpacer + );*/ + + TipSplitter mainSplitter = new TipSplitter(graphics, true, + countMessageTip, + countSpacer, + descSplitter); + + sections.Insert(0, mainSplitter); + TipSplitter mainSplitter2 = new TipSplitter(graphics, false, + sections.ToArray()); + // Show it. + Size size = TipPainter.DrawTip(control, graphics, mainSplitter2); + DrawingRectangle1 = countMessageTip.DrawingRectangle1; + DrawingRectangle2 = countMessageTip.DrawingRectangle2; + return size; + } + return Size.Empty; + } + + static bool IsVisibleText(string text) + { + return text != null && text.Length > 0; + } + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSection.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSection.cs new file mode 100644 index 000000000..76b9d9104 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSection.cs @@ -0,0 +1,91 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + abstract class TipSection + { + SizeF tipAllocatedSize; + Graphics tipGraphics; + SizeF tipMaxSize; + SizeF tipRequiredSize; + + public float GlobalMaxX; + public int LeftOffset; + + protected TipSection(Graphics graphics) + { + tipGraphics = graphics; + } + + public abstract void Draw(PointF location); + + public SizeF GetRequiredSize() + { + return tipRequiredSize; + } + + public void SetAllocatedSize(SizeF allocatedSize) + { + //Debug.Assert(allocatedSize.Width >= tipRequiredSize.Width && + // allocatedSize.Height >= tipRequiredSize.Height); + + tipAllocatedSize = allocatedSize; OnAllocatedSizeChanged(); + } + + public void SetMaximumSize(SizeF maximumSize) + { + tipMaxSize = maximumSize; OnMaximumSizeChanged(); + } + + protected virtual void OnAllocatedSizeChanged() + { + + } + + protected virtual void OnMaximumSizeChanged() + { + + } + + public void SetRequiredSize(SizeF requiredSize) + { + requiredSize.Width = Math.Max(0, requiredSize.Width); + requiredSize.Height = Math.Max(0, requiredSize.Height); + requiredSize.Width = Math.Min(tipMaxSize.Width, requiredSize.Width); + requiredSize.Height = Math.Min(tipMaxSize.Height, requiredSize.Height); + + tipRequiredSize = requiredSize; + } + + public Graphics Graphics { + get { + return tipGraphics; + } + } + + public SizeF AllocatedSize { + get { + return tipAllocatedSize; + } + } + + public SizeF MaximumSize { + get { + return tipMaxSize; + } + set + { + tipMaxSize = value; + } + } + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSpacer.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSpacer.cs new file mode 100644 index 000000000..1391df0a2 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSpacer.cs @@ -0,0 +1,36 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + class TipSpacer: TipSection + { + SizeF spacerSize; + + public TipSpacer(Graphics graphics, SizeF size): base(graphics) + { + spacerSize = size; + } + + public override void Draw(PointF location) + { + + } + + protected override void OnMaximumSizeChanged() + { + base.OnMaximumSizeChanged(); + + SetRequiredSize(new SizeF + (Math.Min(MaximumSize.Width, spacerSize.Width), + Math.Min(MaximumSize.Height, spacerSize.Height))); + } + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSplitter.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSplitter.cs new file mode 100644 index 000000000..25a646459 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipSplitter.cs @@ -0,0 +1,136 @@ +// +// +// +// +// $Revision: 915 $ +// + +using System; +using System.Diagnostics; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + class TipSplitter: TipSection + { + bool isHorizontal; + float [] offsets; + TipSection[] tipSections; + public bool is_desc; + + public TipSplitter(Graphics graphics, bool horizontal, params TipSection[] sections): base(graphics) + { + Debug.Assert(sections != null); + + isHorizontal = horizontal; + offsets = new float[sections.Length]; + tipSections = (TipSection[])sections.Clone(); + } + + public override void Draw(PointF location) + { + /*if (is_desc) + { + tipSections[0].Draw + (new PointF(location.X + offsets[0], location.Y)); + string s1 = (tipSections[0] as TipText).tipText; + string s2 = (tipSections[1] as TipText).tipText; + string s3 = (tipSections[2] as TipText).tipText; + SizeF sz1 = Graphics.MeasureString(s1,(tipSections[0] as TipText).tipFont,new SizeF(tipSections[0].AllocatedSize.Width,tipSections[0].AllocatedSize.Height),(tipSections[0] as TipText).GetInternalStringFormat()); + SizeF sz2 = Graphics.MeasureString(s2,(tipSections[1] as TipText).tipFont,new SizeF(tipSections[1].AllocatedSize.Width,tipSections[1].AllocatedSize.Height),(tipSections[1] as TipText).GetInternalStringFormat()); + SizeF sz3 = Graphics.MeasureString(s3,(tipSections[2] as TipText).tipFont,new SizeF(tipSections[2].AllocatedSize.Width,tipSections[2].AllocatedSize.Height),(tipSections[2] as TipText).GetInternalStringFormat()); + //if (tipSections[1].AllocatedSize.Width + tipSections[0].AllocatedSize.Width <= this.AllocatedSize.Width) + if (sz2.Height <= sz1.Height + 3) + { + tipSections[1].Draw(new PointF(location.X + offsets[1], location.Y)); + //if (tipSections[2].AllocatedSize.Width + tipSections[0].AllocatedSize.Width + tipSections[1].AllocatedSize.Width <= this.AllocatedSize.Width) + if (sz3.Height <= sz1.Height + 3) + tipSections[2].Draw(new PointF(location.X + offsets[2], location.Y)); + else + tipSections[2].Draw(new PointF(location.X, location.Y+sz1.Height)); + } + else + { + tipSections[1].SetAllocatedSize(new SizeF(AllocatedSize.Width,30)); + tipSections[1].SetRequiredSize(new SizeF(AllocatedSize.Width,30)); + tipSections[1].Draw + (new PointF(location.X, location.Y+sz1.Height)); + tipSections[2].SetAllocatedSize(new SizeF(AllocatedSize.Width,30)); + tipSections[2].SetRequiredSize(new SizeF(AllocatedSize.Width,30)); + tipSections[2].Draw + (new PointF(location.X, location.Y+sz1.Height+sz1.Height)); + } + + return; + }*/ + + if (isHorizontal) { + for (int i = 0; i < tipSections.Length; i ++) { + tipSections[i].Draw + (new PointF(location.X + offsets[i], location.Y)); + } + } else { + for (int i = 0; i < tipSections.Length; i ++) { + tipSections[i].Draw + (new PointF(location.X, location.Y + offsets[i])); + } + } + } + + protected override void OnMaximumSizeChanged() + { + base.OnMaximumSizeChanged(); + + float currentDim = 0; + float otherDim = 0; + SizeF availableArea = MaximumSize; + + for (int i = 0; i < tipSections.Length; i ++) { + TipSection section = (TipSection)tipSections[i]; + + section.GlobalMaxX = this.GlobalMaxX; + section.SetMaximumSize(availableArea); + this.LeftOffset = Math.Max(section.LeftOffset,this.LeftOffset); + SizeF requiredArea = section.GetRequiredSize(); + offsets[i] = currentDim; + + // It's best to start on pixel borders, so this will + // round up to the nearest pixel. Otherwise there are + // weird cutoff artifacts. + float pixelsUsed; + + if (isHorizontal) { + pixelsUsed = (float)Math.Ceiling(requiredArea.Width); + currentDim += pixelsUsed; + + availableArea.Width = Math.Max + (0, availableArea.Width - pixelsUsed); + + otherDim = Math.Max(otherDim, requiredArea.Height); + } else { + pixelsUsed = (float)Math.Ceiling(requiredArea.Height); + currentDim += pixelsUsed; + + availableArea.Height = Math.Max + (0, availableArea.Height - pixelsUsed); + + otherDim = Math.Max(otherDim, requiredArea.Width+8); + } + } + + foreach (TipSection section in tipSections) { + if (isHorizontal) { + section.SetAllocatedSize(new SizeF(section.GetRequiredSize().Width, otherDim)); + } else { + section.SetAllocatedSize(new SizeF(otherDim, section.GetRequiredSize().Height)); + } + } + + if (isHorizontal) { + SetRequiredSize(new SizeF(currentDim, otherDim)); + } else { + SetRequiredSize(new SizeF(otherDim, currentDim)); + } + } + } +} diff --git a/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipText.cs b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipText.cs new file mode 100644 index 000000000..4bce93fe4 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/CodeCompletionVisual/TipText.cs @@ -0,0 +1,400 @@ +// +// +// +// +// $Revision: 2561 $ +// + +using System; +using System.Drawing; + +namespace ICSharpCode.TextEditor.Util +{ + class CountTipText: TipText + { + float triHeight = 10; + float triWidth = 10; + + public CountTipText(Graphics graphics, Font font, string text) : base(graphics, font, text) + { + } + + void DrawTriangle(float x, float y, bool flipped) + { + Brush brush = BrushRegistry.GetBrush(Color.FromArgb(192, 192, 192)); + base.Graphics.FillRectangle(brush, new RectangleF(x, y, triHeight, triHeight)); + float triHeight2 = triHeight / 2; + float triHeight4 = triHeight / 4; + brush = Brushes.Black; + if (flipped) { + base.Graphics.FillPolygon(brush, new PointF[] { + new PointF(x, y + triHeight2 - triHeight4), + new PointF(x + triWidth / 2, y + triHeight2 + triHeight4), + new PointF(x + triWidth, y + triHeight2 - triHeight4), + }); + + } else { + base.Graphics.FillPolygon(brush, new PointF[] { + new PointF(x, y + triHeight2 + triHeight4), + new PointF(x + triWidth / 2, y + triHeight2 - triHeight4), + new PointF(x + triWidth, y + triHeight2 + triHeight4), + }); + } + } + + public Rectangle DrawingRectangle1; + public Rectangle DrawingRectangle2; + + public override void Draw(PointF location) + { + if (tipText != null && tipText.Length > 0) { + base.Draw(new PointF(location.X + triWidth + 4, location.Y)); + DrawingRectangle1 = new Rectangle((int)location.X + 2, + (int)location.Y + 2, + (int)(triWidth), + (int)(triHeight)); + DrawingRectangle2 = new Rectangle((int)(location.X + base.AllocatedSize.Width - triWidth - 2), + (int)location.Y + 2, + (int)(triWidth), + (int)(triHeight)); + DrawTriangle(location.X + 2, location.Y + 2, false); + DrawTriangle(location.X + base.AllocatedSize.Width - triWidth - 2, location.Y + 2, true); + } + } + + protected override void OnMaximumSizeChanged() + { + if (IsTextVisible()) { + SizeF tipSize = Graphics.MeasureString + (tipText, tipFont, MaximumSize, + GetInternalStringFormat()); + tipSize.Width += triWidth * 2 + 8; + SetRequiredSize(tipSize); + } else { + SetRequiredSize(SizeF.Empty); + } + } + + } + + class TipText: TipSection + { + protected StringAlignment horzAlign; + protected StringAlignment vertAlign; + protected Color tipColor; + public Font tipFont; + protected StringFormat tipFormat; + protected StringFormat tipHdrFormat; + public string tipText; + public int beg_bold; + public int len_bold; + public bool insight_wnd=false; + public TipText desc1; + public TipText desc2; + public TipText desc3; + public bool is_doc; + public bool param_name; + public bool param_desc; + public bool is_head; + public bool need_tab; + + public TipText(Graphics graphics, Font font, string text): + base(graphics) + { + tipFont = font; tipText = text; + if (text != null && text.Length > short.MaxValue) + throw new ArgumentException("TipText: text too long (max. is " + short.MaxValue + " characters)", "text"); + + Color = SystemColors.ControlText; + HorizontalAlignment = StringAlignment.Near; + VerticalAlignment = StringAlignment.Near; + } + + public override void Draw(PointF location) + { + if (IsTextVisible()) { + RectangleF drawRectangle = new RectangleF(location, AllocatedSize); + Font fnt = new Font(tipFont, FontStyle.Bold); + /*Graphics.DrawString(tipText.Substring(0,beg_bold), tipFont, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat()); + Graphics.DrawString(tipText.Substring(beg_bold,len_bold), fnt, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat()); + Graphics.DrawString(tipText.Substring(beg_bold+len_bold), tipFont, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat());*/ + if (this is CountTipText || is_doc) + { + Graphics.DrawString(tipText,tipFont, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat()); + } + else if (is_head) + { + Graphics.DrawString(tipText,fnt, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormatForHeader()); + } + else if (param_name) + { + drawRectangle.X += 10; + Graphics.DrawString(tipText,fnt, + BrushRegistry.GetBrush(System.Drawing.Color.Brown), + drawRectangle, + GetInternalStringFormatForHeader()); + } + else if (need_tab) + { + if (param_desc) + drawRectangle.X += 20; + else + drawRectangle.X += 10; + Graphics.DrawString(tipText,tipFont, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat()); + } + else + { + SizeF szfull = Graphics.MeasureString(tipText,tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + + SizeF sz1 = Graphics.MeasureString(tipText.Substring(0,beg_bold),tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + if (szfull.Height > sz1.Height+3) + { + Graphics.DrawString(tipText,tipFont, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat()); + return; + } + Graphics.DrawString(tipText.Substring(0,beg_bold), tipFont, + BrushRegistry.GetBrush(Color), + drawRectangle, + GetInternalStringFormat()); + SizeF sz2 = Graphics.MeasureString(tipText.Substring(beg_bold,len_bold),fnt, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + SizeF sz2_simp = Graphics.MeasureString(tipText.Substring(beg_bold,len_bold),tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + float x_coord = drawRectangle.X; + float y_coord = drawRectangle.Y; + if (sz1.Width + sz2.Width > drawRectangle.Width) + { + if (drawRectangle.Height > sz1.Height) + y_coord += sz1.Height; + } + else + { + x_coord += sz1.Width; + } + Graphics.DrawString(tipText.Substring(beg_bold,len_bold), fnt, + BrushRegistry.GetBrush(Color), + x_coord, + y_coord, + GetInternalStringFormat()); + SizeF sz3 = Graphics.MeasureString(tipText.Substring(beg_bold+len_bold),tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + if (sz1.Width + sz2.Width + sz3.Width > drawRectangle.Width) + { + if (drawRectangle.Height > sz1.Height) + { + x_coord = drawRectangle.X; + y_coord += sz2.Height; + } + } + else + { + x_coord += sz2.Width; + } + Graphics.DrawString(tipText.Substring(beg_bold+len_bold), tipFont, + BrushRegistry.GetBrush(Color), + x_coord, + y_coord, + GetInternalStringFormat()); + + } + + } + + } + + public StringFormat GetInternalStringFormat() + { + if (tipFormat == null) { + tipFormat = CreateTipStringFormat(horzAlign, vertAlign); + } + + return tipFormat; + } + + public StringFormat GetInternalStringFormatForParameter() + { + if (tipFormat == null) { + tipFormat = CreateTipStringFormatForParameter(horzAlign, vertAlign); + } + + return tipFormat; + } + + public StringFormat GetInternalStringFormatForHeader() + { + if (tipHdrFormat == null) { + tipHdrFormat = CreateTipStringFormatForHeader(horzAlign, vertAlign); + } + + return tipHdrFormat; + } + + private void SetRequiredSizeInternal(SizeF drawRectangle) + { + Font fnt = new Font(tipFont, FontStyle.Bold); + SizeF sz1 = Graphics.MeasureString(tipText.Substring(0,beg_bold),tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + SizeF sz2 = Graphics.MeasureString(tipText.Substring(beg_bold,len_bold),fnt, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + SizeF sz2_simp = Graphics.MeasureString(tipText.Substring(beg_bold,len_bold),tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + if (sz1.Width + sz2.Width >drawRectangle.Width/*-sz2_simp.Width*/) + { + if (drawRectangle.Height <= sz1.Height) + { + drawRectangle.Width = drawRectangle.Width + sz1.Width+sz2.Width-drawRectangle.Width; + } + } + else + { + //x_coord += sz1.Width; + } + SizeF sz3 = Graphics.MeasureString(tipText.Substring(beg_bold+len_bold),tipFont, new SizeF(drawRectangle.Width,drawRectangle.Height),GetInternalStringFormat()); + if (sz1.Width + sz2.Width + sz3.Width > drawRectangle.Width/*-sz2_simp.Width*/) + { + if (drawRectangle.Height <= sz1.Height) + { + drawRectangle.Width = drawRectangle.Width + sz1.Width+sz2.Width+sz3.Width-drawRectangle.Width; + } + } + SetRequiredSize(drawRectangle); + } + + protected override void OnMaximumSizeChanged() + { + base.OnMaximumSizeChanged(); + + if (IsTextVisible()) { + SizeF tmp = Graphics.MeasureString + ("a", new Font(tipFont, FontStyle.Bold), MaximumSize, + GetInternalStringFormat()); + SizeF tipSize; + if (this.len_bold > 0 /*|| need_tab*/) + tipSize = Graphics.MeasureString + (tipText, new Font(tipFont, FontStyle.Bold), MaximumSize, + GetInternalStringFormat()); + else + if (need_tab) + { + tipSize = Graphics.MeasureString + ((param_desc?" ":" ")+tipText, tipFont, MaximumSize, + GetInternalStringFormat()); + + } + else + tipSize = Graphics.MeasureString + (tipText, tipFont, MaximumSize, + GetInternalStringFormat()); + /*if (!(this is CountTipText) && !is_doc) + { + float max = MaximumSize.Width; + + while (tipSize.Height > tmp.Height+3 && max < this.GlobalMaxX-100) + { + max += 20; + tipSize = Graphics.MeasureString(tipText, new Font(tipFont, FontStyle.Bold), new SizeF(max,tipSize.Height), + GetInternalStringFormat()); + } + //if (max < this.GlobalMaxX-10) + { + LeftOffset = Convert.ToInt32(max - MaximumSize.Width); + MaximumSize = new SizeF(max,tipSize.Height); + } + }*/ + //SetRequiredSize(tipSize); + SetRequiredSizeInternal(tipSize); + } else { + SetRequiredSize(SizeF.Empty); + } + } + + StringFormat CreateTipStringFormatForHeader(StringAlignment horizontalAlignment, StringAlignment verticalAlignment) + { + StringFormat format = (StringFormat)StringFormat.GenericDefault.Clone(); + format.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.MeasureTrailingSpaces; + // note: Align Near, Line Center seemed to do something before + + format.Alignment = horizontalAlignment; + format.LineAlignment = verticalAlignment; + + return format; + } + + StringFormat CreateTipStringFormatForParameter(StringAlignment horizontalAlignment, StringAlignment verticalAlignment) + { + StringFormat format = (StringFormat)StringFormat.GenericTypographic.Clone(); + format.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.MeasureTrailingSpaces; + // note: Align Near, Line Center seemed to do something before + + format.Alignment = horizontalAlignment; + format.LineAlignment = verticalAlignment; + + return format; + } + + StringFormat CreateTipStringFormat(StringAlignment horizontalAlignment, StringAlignment verticalAlignment) + { + StringFormat format = null; + if (!insight_wnd) + format = (StringFormat)StringFormat.GenericDefault.Clone(); + else + format = (StringFormat)StringFormat.GenericTypographic.Clone(); + format.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.MeasureTrailingSpaces; + // note: Align Near, Line Center seemed to do something before + + format.Alignment = horizontalAlignment; + format.LineAlignment = verticalAlignment; + + return format; + } + + protected bool IsTextVisible() + { + return tipText != null && tipText.Length > 0; + } + + public Color Color { + get { + return tipColor; + } + set { + tipColor = value; + } + } + + public StringAlignment HorizontalAlignment { + get { + return horzAlign; + } + set { + horzAlign = value; + tipFormat = null; + } + } + + public StringAlignment VerticalAlignment { + get { + return vertAlign; + } + set { + vertAlign = value; + tipFormat = null; + } + } + } +} diff --git a/VisualPascalABCNETLinux/DS/Constants.cs b/VisualPascalABCNETLinux/DS/Constants.cs new file mode 100644 index 000000000..17d6eecc9 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/Constants.cs @@ -0,0 +1,70 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System.IO; +namespace VisualPascalABC +{ + public static class Constants + { + public static string SystemDirectoryIdent = "%PABCSYSTEM%"; + public static string WorkingDirectoryIdent = "%WORKINGDIRECTORY%"; + public static string OutputDirectoryIdent = "%OUTPUTDIRECTORY%"; + public static string LibSourceDirectoryIdent = "%LIBSOURCEDIRECTORY%"; + + //public static string DefaultWorkingDirectory = SystemDirectoryIdent + @"\WorkDirectory"; + public static string DefaultWorkingDirectory = + !Tools.IsUnix() ? + (System.IO.Path.GetPathRoot(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Windows)) + "PABCWork.NET") : + System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "/" + "PABCWork.NET"; + public static string DefaultOutputDirectory = DefaultWorkingDirectory + @"\Output"; + + public static string DefaultLibSourceDirectory = SystemDirectoryIdent + @"\LibSource"; + + public static string HelpFileName = "%PABCSYSTEM%\\PascalABCNET.chm"; + public static string DotNetHelpFileName = "%PABCSYSTEM%\\Documentation_NET40.chm"; + public static string HelpExamplesFileName = "%PABCSYSTEM%\\PascalABCNETExamples.chm"; + public static string HelpExamplesMapFileName = "%PABCSYSTEM%\\HelpExamples.ini"; + public static string HelpExamplesDirectory = DefaultWorkingDirectory+"\\Samples"; + public static string HelpTutorialExamplesDirectory = DefaultWorkingDirectory + "\\Samples\\!Tutorial"; + + + public static int CompletionWindowWidth = 200; + public static int CompletionWindowMaxListLength = 10; + public static string CompletionWindowDeclarationViewWindowFontName = "Tahoma"; + public static string CompletionWindowCodeCompletionListViewFontName = "Tahoma"; + public static string CompletionInsightWindowFontName = "Tahoma"; + public static string ProjectExtension = ".pabcproj"; + public static bool FileNamesCaseSensetive = false; + + static Constants() + { + if (Tools.IsUnix()) + { + DefaultWorkingDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "/" + "PABCWork.NET"; + HelpFileName = "%PABCSYSTEM%/PascalABCNET.chm"; + DotNetHelpFileName = "%PABCSYSTEM%/Documentation_NET40.chm"; + HelpExamplesFileName = "%PABCSYSTEM%/PascalABCNETExamples.chm"; + HelpExamplesMapFileName = "%PABCSYSTEM%/HelpExamples.ini"; + HelpExamplesDirectory = DefaultWorkingDirectory + "/Samples"; + HelpTutorialExamplesDirectory = DefaultWorkingDirectory + "/Samples/!Tutorial"; + DefaultOutputDirectory = DefaultWorkingDirectory + @"/Output"; + DefaultLibSourceDirectory = SystemDirectoryIdent + @"/LibSource"; + } + else + { + string PABCWorkIniFile = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName) + @"\pabcworknet.ini"; + //System.Windows.Forms.MessageBox.Show(PABCWorkIniFile); + if (File.Exists(PABCWorkIniFile)) + { + var d = File.ReadAllText(PABCWorkIniFile); + if (Directory.Exists(d)) + { + DefaultWorkingDirectory = d; + HelpExamplesDirectory = DefaultWorkingDirectory + @"\Samples"; + HelpTutorialExamplesDirectory = DefaultWorkingDirectory + @"\Samples\!Tutorial"; + DefaultOutputDirectory = DefaultWorkingDirectory + @"\Output"; + } + } + } + } + } +} diff --git a/VisualPascalABCNETLinux/DS/FoldingStrategy.cs b/VisualPascalABCNETLinux/DS/FoldingStrategy.cs new file mode 100644 index 000000000..60e090f0f --- /dev/null +++ b/VisualPascalABCNETLinux/DS/FoldingStrategy.cs @@ -0,0 +1,46 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; + +namespace ICSharpCode.TextEditor.Document +{ + /// + /// A simple folding strategy which calculates the folding level + /// using the indent level of the line. + /// + /* public class TestFoldingStrategy : IFoldingStrategy + { + public List GenerateFoldMarkers(IDocument document, string fileName, object parseInformation) + { + List l = new List(); + Stack offsetStack = new Stack(); + Stack textStack = new Stack(); + int level = 0; + l.Add(new FoldMarker(document,1,0,10,0)); +// foreach (LineSegment segment in document.LineSegmentCollection) { + // } + return l; + } + + int GetLevel(IDocument document, int offset) + { + int level = 0; + int spaces = 0; + for (int i = offset; i < document.TextLength; ++i) + { + char c = document.GetCharAt(i); + if (c == '\t' || (c == ' ' && ++spaces == 4)) + { + spaces = 0; + ++level; + } + else + { + break; + } + } + return level; + } + }*/ +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DS/NavigationManager.cs b/VisualPascalABCNETLinux/DS/NavigationManager.cs new file mode 100644 index 000000000..2baa4a95c --- /dev/null +++ b/VisualPascalABCNETLinux/DS/NavigationManager.cs @@ -0,0 +1,96 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using PascalABCCompiler; + +namespace VisualPascalABC +{ + public class NavigationManager + { + Dictionary lines_to_locations = new Dictionary(); + List locations = new List(); + int navigatePosition = -1; + VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction; + public NavigationManager(VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction) + { + this.ExecuteSourceLocationAction = ExecuteSourceLocationAction; + } + bool changed_loaction = false; + public void LocationChanged(int LineNum, int ColumnNum, string FileName) + { + SourceLocation sl = null; + /*if (lines_to_locations.TryGetValue(LineNum, out sl)) + if (sl.FileName == FileName) + { + sl.BeginPosition.Column = sl.EndPosition.Column = ColumnNum; + locations.Remove(sl); + locations.Add(sl); + return; + }*/ + if (locations.Count > 0) + { + sl = locations[navigatePosition]; + if (sl.FileName == FileName && Math.Abs(sl.BeginPosition.Line-LineNum)<2) + { + sl.BeginPosition.Column = sl.EndPosition.Column = ColumnNum; + sl.BeginPosition.Line = sl.EndPosition.Line = LineNum; + return; + } + } + sl = new SourceLocation(FileName, LineNum, ColumnNum, LineNum, ColumnNum); + if (locations.Count == 0) + { + locations.Add(sl); + navigatePosition = 0; + } + else + { + locations.Insert(navigatePosition+1, sl); + navigatePosition++; + } + stateChanged(); + } + public delegate void NavigationManagerStateChanged(NavigationManager sender); + public event NavigationManagerStateChanged StateChanged; + public bool CanNavigateForward + { + get + { + return locations.Count>0 && navigatePosition < locations.Count - 1; + } + } + public bool CanNavigateBackward + { + get + { + return navigatePosition > 0; + } + } + public void NavigateForward() + { + if (CanNavigateForward) + { + navigatePosition++; + ExecuteSourceLocationAction(locations[navigatePosition], VisualPascalABCPlugins.SourceLocationAction.NavigationGoto); + } + stateChanged(); + } + public void NavigateBackward() + { + if (CanNavigateBackward) + { + navigatePosition--; + ExecuteSourceLocationAction(locations[navigatePosition], VisualPascalABCPlugins.SourceLocationAction.NavigationGoto); + } + stateChanged(); + } + void stateChanged() + { + if (StateChanged != null) + StateChanged(this); + } + } +} diff --git a/VisualPascalABCNETLinux/DS/ObjectLocalisator.cs b/VisualPascalABCNETLinux/DS/ObjectLocalisator.cs new file mode 100644 index 000000000..07d387aca --- /dev/null +++ b/VisualPascalABCNETLinux/DS/ObjectLocalisator.cs @@ -0,0 +1,27 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC +{ + class ObjectLocalisator + { + private object vaule; + private string str; + public ObjectLocalisator(object val, string str) + { + vaule = val; + this.str = PascalABCCompiler.StringResources.Get(str); + } + public object Value + { + get { return vaule; } + } + public override string ToString() + { + return str; + } + } +} diff --git a/VisualPascalABCNETLinux/DS/PluginsController/PluginsController.cs b/VisualPascalABCNETLinux/DS/PluginsController/PluginsController.cs new file mode 100644 index 000000000..8634468bf --- /dev/null +++ b/VisualPascalABCNETLinux/DS/PluginsController/PluginsController.cs @@ -0,0 +1,199 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace VisualPascalABCPlugins +{ + public class PluginLoadingError : Exception + { + public Exception Error; + public string FileName; + public PluginLoadingError(string FileName, Exception e) + :base(FileName) + { + Error = e; + this.FileName = FileName; + } + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("VPPC_PLUGIN_{0}_LOADING_ERROR_{1}"), Path.GetFileName(FileName),Error); + } + } + public class PluginsController + { + private IWorkbench workbench; + private List plugins = new List(); + public List Plugins + { + get { return plugins; } + } + private List errorList = new List(); + public List ErrorList + { + get { return errorList; } + } + public System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem = null; + public System.Windows.Forms.ToolStrip ToolStrip = null; + public IVisualEnvironmentCompiler VisualEnvironmentCompiler = null; + public PluginsController(IVisualEnvironmentCompiler VisualEnvironmentCompiler) + { + this.VisualEnvironmentCompiler = VisualEnvironmentCompiler; + } + public PluginsController(IVisualEnvironmentCompiler VisualEnvironmentCompiler,System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem, System.Windows.Forms.ToolStrip ToolStrip, IWorkbench workbench) + { + this.ToolStripMenuItem = ToolStripMenuItem; + this.ToolStrip = ToolStrip; + this.VisualEnvironmentCompiler = VisualEnvironmentCompiler; + this.workbench = workbench; + } + + bool AddMenuSeparator = false; + bool AddToolBarSeparator = false; + delegate void AddInGuiDelegate(IVisualPascalABCPlugin Plugin); + private void AddInGUI(IVisualPascalABCPlugin Plugin) + { + if (ToolStripMenuItem == null) return; + List MenuItems=new List(),ToolBarItems=new List(); + Plugin.GetGUI(MenuItems, ToolBarItems); + if (MenuItems.Count > 1 && (ToolStripMenuItem.DropDownItems.Count > 0 && (ToolStripMenuItem.DropDownItems[ToolStripMenuItem.DropDownItems.Count - 1].Tag is IPluginGUIItem))) + { + ToolStripMenuItem.DropDownItems.Add(new System.Windows.Forms.ToolStripSeparator()); + AddMenuSeparator = false; + } + if (MenuItems.Count > 0) + { + if (AddMenuSeparator) + { + AddMenuSeparator = false; + ToolStripMenuItem.DropDownItems.Add(new System.Windows.Forms.ToolStripSeparator()); + } + foreach (IPluginGUIItem Item in MenuItems) + { + System.Windows.Forms.ToolStripMenuItem menuItem = new System.Windows.Forms.ToolStripMenuItem(); + menuItem.Image = Item.Image; + menuItem.ImageTransparentColor = Item.ImageTransparentColor; + menuItem.Text = Item.Text; + //menuItem.ToolTipText = Item.Hint; + menuItem.Tag = Item; + menuItem.ShortcutKeys = Item.ShortcutKeys; + if (Item.ShortcutKeyDisplayString != null) + menuItem.ShortcutKeyDisplayString = Item.ShortcutKeyDisplayString; + menuItem.Click += new EventHandler(item_Click); + ToolStripMenuItem.DropDownItems.Add(menuItem); + PascalABCCompiler.StringResources.SetTextForObject(menuItem, ""); + } + } + if (MenuItems.Count > 1) + AddMenuSeparator = true; + if (ToolStrip.Items.Count > 0 && !(ToolStrip.Items[ToolStrip.Items.Count - 1] is System.Windows.Forms.ToolStripSeparator) && ToolBarItems.Count > 1 && ((ToolStrip.Items[ToolStrip.Items.Count - 1].Tag is IPluginGUIItem))) + { + ToolStrip.Items.Add(new System.Windows.Forms.ToolStripSeparator()); + AddToolBarSeparator = false; + } + if (ToolBarItems.Count > 0) + { + if (AddToolBarSeparator) + { + AddToolBarSeparator = false; + ToolStrip.Items.Add(new System.Windows.Forms.ToolStripSeparator()); + } + foreach (IPluginGUIItem Item in ToolBarItems) + { + System.Windows.Forms.ToolStripButton button = null; + button = new System.Windows.Forms.ToolStripButton(); + button.Image = Item.Image; + button.ImageTransparentColor = Item.ImageTransparentColor; + //button.Text = Item.Text; + button.ToolTipText = Item.Hint; + button.Click += new EventHandler(button_Click); + button.Tag = Item; + ToolStrip.Items.Add(button); + PascalABCCompiler.StringResources.SetTextForObject(button, ""); + } + } + if (ToolBarItems.Count > 1) + AddToolBarSeparator = true; + //ToolStrip.Refresh(); + if (ToolStripMenuItem.Visible == false) + ToolStripMenuItem.Visible = true; + } + void button_Click(object sender, EventArgs e) + { + ((IPluginGUIItem)((System.Windows.Forms.ToolStripButton)sender).Tag).Execute(); + } + + void item_Click(object sender, EventArgs e) + { + ((IPluginGUIItem)((System.Windows.Forms.ToolStripItem)sender).Tag).Execute(); + } + public void AddPlugins() + { + AddPlugins(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)); + } + public void AddPlugins(string DirectoryName) + { + DirectoryInfo di = new DirectoryInfo(DirectoryName); + FileInfo[] dllfiles = di.GetFiles("*.dll"); + System.Reflection.Assembly assembly = null; + VisualPascalABCPlugins.IVisualPascalABCPlugin Plugin; + foreach (FileInfo fi in dllfiles) + { + switch (fi.Name.ToLower()) + { + case "avalondock.dll": + case "codecompletion.dll": + case "compiler.dll": + case "compilertools.dll": + case "debuggercore.dll": + case "netgenerator.dll": + case "treeconverter.dll": + case "pascalabcparser.dll": + case "syntaxtree.dll": + case "semantictree.dll": + case "weifenluo.winformsui.docking.dll": + case "pluginssupport.dll": + case "localization.dll": + continue; + } + if (fi.Name.StartsWith("NETXP.", StringComparison.InvariantCultureIgnoreCase) || fi.Name.StartsWith("Mono.", StringComparison.InvariantCultureIgnoreCase) || fi.Name.StartsWith("ICSharpCode.", StringComparison.InvariantCultureIgnoreCase)) + continue; + try + { + assembly = System.Reflection.Assembly.LoadFile(fi.FullName); + try + { + Type[] types = assembly.GetTypes(); + + foreach (Type type in types) + { + if (type.Name.IndexOf("VisualPascalABCPlugin") >= 0 && type.IsClass) + { + Object obj = Activator.CreateInstance(type, workbench); + if (obj is VisualPascalABCPlugins.IVisualPascalABCPlugin) + { + Plugin = obj as VisualPascalABCPlugins.IVisualPascalABCPlugin; + Plugins.Add(Plugin); + VisualEnvironmentCompiler.BeginInvoke(new AddInGuiDelegate(AddInGUI), Plugin); + } + } + } + + } + catch (Exception e) + { + ErrorList.Add(new PluginLoadingError(fi.FullName, e)); + } + + } + catch (Exception e) + { + //если dll не нетовская + } + } + + } + } +} diff --git a/VisualPascalABCNETLinux/DS/RunManager/EventedEventWaitHandleList.cs b/VisualPascalABCNETLinux/DS/RunManager/EventedEventWaitHandleList.cs new file mode 100644 index 000000000..229134237 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/RunManager/EventedEventWaitHandleList.cs @@ -0,0 +1,62 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace VisualPascalABC +{ + public class EventedEventWaitHandleList + { + public delegate void SignalDelegate(string id); + SignalDelegate Signal; + Dictionary Threads = new Dictionary(); + + class ThreadObject + { + public string id; + public SignalDelegate Signal; + public EventWaitHandle EventWaitHandle; + public Thread thread; + } + + void ThreadExecute(object obj) + { + ThreadObject to = (ThreadObject)obj; + while (to.EventWaitHandle != null) + { + to.EventWaitHandle.WaitOne(); + if (to.EventWaitHandle != null) + Signal(to.id); + } + + } + + public EventedEventWaitHandleList(SignalDelegate Signal) + { + this.Signal = Signal; + } + + public void Add(string id) + { + ThreadObject to = new ThreadObject(); + to.thread = new Thread(new ParameterizedThreadStart(ThreadExecute)); + to.id = id; + to.Signal = Signal; + to.EventWaitHandle = new EventWaitHandle(false, System.Threading.EventResetMode.AutoReset, id); + to.thread.Start(to); + Threads.Add(id, to); + } + public void Remove(string id) + { + ThreadObject to = Threads[id]; + EventWaitHandle e = to.EventWaitHandle; + to.EventWaitHandle = null; + e.Set(); + e.Close(); + to.thread.Join(); + Threads.Remove(id); + } + } +} diff --git a/VisualPascalABCNETLinux/DS/RunManager/RunManager.cs b/VisualPascalABCNETLinux/DS/RunManager/RunManager.cs new file mode 100644 index 000000000..ef4294b9f --- /dev/null +++ b/VisualPascalABCNETLinux/DS/RunManager/RunManager.cs @@ -0,0 +1,412 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using PascalABCCompiler.Errors; +using System.IO; +using System.Diagnostics; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public class RunManager + { + Hashtable StartedProcesses = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + Hashtable StartedFiles = new Hashtable(); + PascalABCCompiler.EventedStreamReaderList EventedStreamReaderList; + //EventedEventWaitHandleList ReadSignalList; + //Encoding InputEncoding = Encoding.GetEncoding(866); + Encoding InputEncoding = Encoding.UTF8; + + string OutputStreamId = "OUT"; + string ErrorStreamId = "ERR"; + const int idStreamLength = 3; + public enum StreamType { Output, Error }; + + string RuntimeExceptionDelimer1 = "[EXCEPTION]"; + string RuntimeExceptionDelimer2 = "[MESSAGE]"; + string RuntimeExceptionDelimer3 = "[STACK]"; + string RuntimeExceptionDelimer4 = "[END]"; + string RuntimeExceptionAtIdent = " at "; + string RuntimeExceptionLineIdent = ":line "; + string RuntimeExceptionInIdent = " in "; + string RuntimeCommandReadlnSignal = "[READLNSIGNAL]"; + string RuntimeCommandCodePage = "[CODEPAGE"; + + public int Count + { + get { return StartedProcesses.Count; } + } + + public delegate void TextRecivedDelegate(string fileName, StreamType streamType, string text); + public event TextRecivedDelegate OutputStringReceived; + + public delegate void ReadStringRequestDelegate(string ForId); + ReadStringRequestDelegate ReadStringRequest; + + void StringRecived(string id, string Data) + { + System.Threading.Thread.Sleep(50); + string streamId = id.Substring(0, idStreamLength); + id = id.Substring(idStreamLength); + StreamType streamType = StreamType.Output; + if (streamId == ErrorStreamId) + streamType = StreamType.Error; + if (streamType == StreamType.Error && IsSpecialMessage(id, Data)) + return; + if (OutputStringReceived != null) + OutputStringReceived(id, streamType, Data); + } + + string waitSpecialMessageText = ""; + bool IsSpecialMessage(string id, string data) + { + bool res = false; + try + { + if (data == RuntimeCommandReadlnSignal) + { + ReadStringRequest(id); + return true; + } + if (data.IndexOf(RuntimeCommandCodePage)==0) + { + int t = data.IndexOf(']'); + int encodingNum = Convert.ToInt32(data.Substring(RuntimeCommandCodePage.Length, t - RuntimeCommandCodePage.Length)); + Encoding NewEncoding = Encoding.GetEncoding(encodingNum); + Encoding OldEncoding = EventedStreamReaderList.GetEncoding(OutputStreamId + id); + EventedStreamReaderList.SetEncoding(OutputStreamId + id, NewEncoding); + EventedStreamReaderList.SetEncoding(ErrorStreamId + id, NewEncoding); + if (data.Length > t + 1) + { + data = data.Substring(t + 1); + data = NewEncoding.GetString(OldEncoding.GetBytes(data)); + if (data == RuntimeCommandReadlnSignal) + { + ReadStringRequest(id); + return true; + } + res = true; + } + else + return true; + } + if (data == '\n'.ToString()) + { + return true; + } + if (data.IndexOf(StackOverflowExceptionText) >= 0) + { + RunnerManagerUnhanledRuntimeException(id, StackOverflowExceptionType, StackOverflowExceptionText, null, new List()); + return true; + } + if ((waitSpecialMessageText != "" || (data.Length >= RuntimeExceptionDelimer1.Length && data.Substring(0, RuntimeExceptionDelimer1.Length) == RuntimeExceptionDelimer1)) && RunnerManagerUnhanledRuntimeException != null) + { + if (data.IndexOf(RuntimeExceptionDelimer4) < 0) + { + waitSpecialMessageText += data; + return true; + } + if (waitSpecialMessageText != "") + data = waitSpecialMessageText + data; + int Section1Begin = RuntimeExceptionDelimer1.Length; + int Section1Length = data.IndexOf(RuntimeExceptionDelimer2) - Section1Begin; + int Section2Begin = Section1Begin + Section1Length + RuntimeExceptionDelimer2.Length; + int Section2Length = data.IndexOf(RuntimeExceptionDelimer3) - Section2Begin; + int Section3Begin = Section2Begin + Section2Length + RuntimeExceptionDelimer3.Length; + int Section3Length = data.IndexOf(RuntimeExceptionDelimer4) - Section3Begin; + string ExceptionType = data.Substring(Section1Begin, Section1Length); + string ExceptionMessage = data.Substring(Section2Begin, Section2Length); + string StackTraceData = data.Substring(Section3Begin, Section3Length); + List StackTrace = new List(); + string[] delimer = new string[1]; + delimer[0] = Environment.NewLine; + string[] StackItemsData = StackTraceData.Split(delimer, StringSplitOptions.RemoveEmptyEntries); + + try + { + foreach (string StackItemData in StackItemsData) + { + StackTraceItem StackTraceItem = new StackTraceItem(); + string str = StackItemData.TrimStart(' '); + int beg = str.IndexOf(' '); + int end = str.IndexOf(") "); + if (end == -1) + end = str.IndexOf(")"); + if (end == -1) + end = str.Length-1; + StackTraceItem.FunctionName = str.Substring(beg + 1, end - beg); + if (end + 1 < str.Length) + { + str = str.Substring(end + 1); + str = str.TrimStart(' '); + beg = str.IndexOf(' '); + end = str.IndexOf(':'); + end = str.IndexOf(':', end + 1); + if (end == -1) + continue; + StackTraceItem.SourceFileName = str.Substring(beg + 1, end - beg-1); + beg = str.IndexOf(' ',end); + if (beg > 0) + { + string slnum = str.Substring(beg + 1).Replace(".", ""); + StackTraceItem.LineNumber = Convert.ToInt32(slnum); + if (StackTraceItem.LineNumber >= 16777214) + { + StackTraceItem.LineNumber = 0; + StackTraceItem.SourceFileName = null; + } + } + } + StackTrace.Add(StackTraceItem); + } + } + catch (Exception e) + { + StackTraceItem StackTraceItem = new StackTraceItem(); + StackTraceItem.FunctionName = "Исключение при формировании стека исключений. Проверьте код RunManager.cs"; + StackTrace.Add(StackTraceItem); + //e = e; + } + + RunnerManagerUnhanledRuntimeException(id, ExceptionType, ExceptionMessage, StackTraceData, StackTrace); + waitSpecialMessageText = ""; + return true; + } + } + catch (Exception e) + { + //OutputStringReceived(id, StreamType.Output,e.ToString()); + } + return res; + } + + string StackOverflowExceptionText; + string StackOverflowExceptionType; + public RunManager(ReadStringRequestDelegate ReadStringRequest) + { + this.ReadStringRequest = ReadStringRequest; + EventedStreamReaderList = new PascalABCCompiler.EventedStreamReaderList(StringRecived); + StackOverflowExceptionText = PascalABCCompiler.StringResources.Get("!STACK_OVERFLOW_EXCEPTION_TEXT"); + StackOverflowExceptionType = "StackOverflowException"; + //ReadSignalList = new EventedEventWaitHandleList(ReadSignal); + /* + string name_format = ".\\" + Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName) + "{0}"; + string name; + while (MessageQueue == null) + { + name = string.Format(name_format, i); + if (!System.Messaging.MessageQueue.Exists(name)) + MessageQueue = new System.Messaging.MessageQueue(name); + i++; + } + */ + } + + public event RunnerManagerActionDelegate Exited; + public event RunnerManagerActionDelegate Starting; + + public class StackTraceItem + { + public string SourceFileName; + public int LineNumber; + public string FunctionName; + } + + public delegate void RunnerManagerUnhanledRuntimeExceptionDelegate(string id, string ExceptionType, string ExceptionMessage, string StackTraceData, List StackTrace); + public event RunnerManagerUnhanledRuntimeExceptionDelegate RunnerManagerUnhanledRuntimeException; + + + + public bool IsRun(string fileName) + { + return StartedProcesses[fileName] != null; + } + + public bool IsRun() + { + return StartedProcesses.Count != 0; + } + public void KillAll() + { + Utils.ProcessRunner[] process = new Utils.ProcessRunner[StartedProcesses.Values.Count]; + StartedProcesses.Values.CopyTo(process, 0); + foreach (Utils.ProcessRunner pr in process) + { + pr.Kill(); + PRunner_ProcessExited(pr,null); + } + } + + public void SendText(string FileName, string Text) + { + //messageServer.SendText(FileName, Text); + } + + /*private void MessageQueueReceive_Callback(IAsyncResult ar) + { + if (ar.IsCompleted) + { + System.Messaging.Message msg = MessageQueue.EndReceive(ar); + string s = msg.Body as string; + int delimerPos = s.IndexOf(':'); + string id = s.Substring(0, delimerPos - 1); + string cmd = s.Substring(delimerPos); + if (OutputLineReceived != null) + OutputLineReceived(id, cmd); + } + if (StartedFiles.Count > 0) + MessageQueue.BeginReceive(TimeSpan.FromSeconds(10), null, MessageQueueReceive_Callback); + else + MessageQueueBeginReceive = false; + }*/ + + //bool MessageQueueBeginReceive = false; + //Dictionary ReadSignalNames = new Dictionary(); + + public Dictionary TempBatFiles = new Dictionary(); + + + public void Run(string fileName,string args,bool redirectIO,bool redirectErrors, bool RunWithPause, string WorkingDirectory, bool attachDebugger, bool fictive_attach) + { + Utils.ProcessRunner PRunner = new Utils.ProcessRunner(); + PRunner.ProcessExited += new EventHandler(PRunner_ProcessExited); + //PRunner.OutputLineReceived += new Utils.LineReceivedEventHandler(PRunner_OutputLineReceived); + PRunner.WorkingDirectory = WorkingDirectory; + StartedProcesses.Add(fileName, PRunner); + StartedFiles.Add(PRunner, fileName); + string ReadSignalName=null; + + try + { + PRunner.Start(fileName, args, redirectIO, redirectErrors, RunWithPause, attachDebugger, fictive_attach); + if (Starting != null) + Starting(fileName); + if ((PRunner.TempBatFile != null) && !TempBatFiles.ContainsKey(fileName)) + TempBatFiles.Add(fileName, PRunner.TempBatFile); + if (redirectIO) + { + EventedStreamReaderList.Add(PRunner.process.StandardOutput, OutputStreamId + fileName, InputEncoding); + PRunner.process.StandardInput.AutoFlush = true; + } + if (redirectErrors) + { + EventedStreamReaderList.Add(PRunner.process.StandardError, ErrorStreamId + fileName, InputEncoding); + } + } + catch(Exception e) + { +#if DEBUG + File.AppendAllText("logRun.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine); +#endif + if (!WorkbenchServiceFactory.Workbench.UserOptions.AlwaysAttachDebuggerAtStart) + WorkbenchServiceFactory.Workbench.DebuggerManager.NullProcessHandleIfNeed(fileName); + RemoveFromTables(fileName); + if (Exited != null) + Exited(fileName); + throw; // Это не перехватывается и приводит к вылету оболочки - SSM 22/04/19 + } + } + + private void Write_Callback(IAsyncResult ar) + { + StreamObject so = (StreamObject)ar.AsyncState; + so.stream.EndWrite(ar); + so.stream.Flush(); + } + class StreamObject + { + public Stream stream; + public string text; + public string id; + } + public void WritelnStringToProcess(string id, string data) + { + Utils.ProcessRunner pr = StartedProcesses[id] as Utils.ProcessRunner; + + if (pr == null) + { + string files = ""; + foreach (string key in StartedProcesses.Keys) + { + files += key + " "; + } + throw new Exception("pr = null: " + id + " Count = " + StartedProcesses.Count + " Files " + files); + } + if (pr.process == null) + throw new Exception("pr.process = null"); + if (pr.process.StandardInput == null) + throw new Exception("pr.process.StandardInput = null"); + if (pr.process.StandardInput.BaseStream == null) + throw new Exception("pr.process.StandardInput.BaseStream = null"); + + byte[] buffer = InputEncoding.GetBytes(data + pr.process.StandardInput.NewLine); + StreamObject so=new StreamObject(); + so.stream = pr.process.StandardInput.BaseStream; + so.text = data + Environment.NewLine; + so.id = id; + pr.process.StandardInput.BaseStream.BeginWrite(buffer, 0, buffer.Length, Write_Callback, so); + } + + public void Run(string fileName, bool redirectIO, string ModeName, bool RunWithPause, string WorkingDirectory, bool attachDebugger, bool fictive_attach) + { + if (ModeName == null) + ModeName = string.Empty; + Run(fileName, ModeName, redirectIO, redirectIO, RunWithPause, WorkingDirectory, attachDebugger, fictive_attach); + } + + public void Run(string fileName, bool redirectIO, string ModeName, bool RunWithPause, string WorkingDirectory, string CommandLineArguments, bool attachDebugger, bool fictive_attach) + { + if (ModeName == null) + ModeName = string.Empty; + Run(fileName, ModeName+(string.IsNullOrEmpty(CommandLineArguments)?"":" "+CommandLineArguments), redirectIO, redirectIO, RunWithPause, WorkingDirectory, attachDebugger, fictive_attach); + } + + void PRunner_ProcessExited(object sender, EventArgs e) + { + string fileName = (string)StartedFiles[sender]; + if (fileName == null) return;//TODO: это ошибочная ситуация + if (!WorkbenchServiceFactory.Workbench.UserOptions.AlwaysAttachDebuggerAtStart) + WorkbenchServiceFactory.Workbench.DebuggerManager.NullProcessHandleIfNeed(fileName); + EventedStreamReaderList.Remove(fileName); + RemoveFromTables(fileName); + if (Exited != null) + Exited(fileName); + } + + void RemoveFromTables(string FileName) + { + if (StartedProcesses[FileName] != null)//TODO: это ошибочная ситуация + { + EventedStreamReaderList.Remove(FileName); + StartedFiles.Remove(StartedProcesses[FileName]); + StartedProcesses.Remove(FileName); + } + } + public void Stop(string fileName) + { + EventedStreamReaderList.Remove(fileName); + if (Path.GetExtension((StartedProcesses[fileName] as Utils.ProcessRunner).process.StartInfo.FileName) == ".bat") + { + Process[] ps = Process.GetProcessesByName(Path.GetFileNameWithoutExtension(fileName)); + foreach (Process p in ps) + if (Tools.FileNameToLower(p.Modules[0].FileName) == Tools.FileNameToLower(fileName)) + { + p.Kill(); + p.Close(); + p.Dispose(); + break; + } + } + (StartedProcesses[fileName] as Utils.ProcessRunner).Kill(); + if (!WorkbenchServiceFactory.Workbench.UserOptions.AlwaysAttachDebuggerAtStart) + WorkbenchServiceFactory.Workbench.DebuggerManager.NullProcessHandleIfNeed(fileName); + RemoveFromTables(fileName); + if (Exited != null) + Exited(fileName); + + } + } +} diff --git a/VisualPascalABCNETLinux/DS/RuntimeException.cs b/VisualPascalABCNETLinux/DS/RuntimeException.cs new file mode 100644 index 000000000..c586e9a33 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/RuntimeException.cs @@ -0,0 +1,51 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC +{ + class RuntimeException: PascalABCCompiler.Errors.LocatedError + { + string message; + public RuntimeException(string Message, string FileName, int ColNumber, int LineNumber) + { + this.fileName = FileName; + this.message = Message; + sourceLocation = new PascalABCCompiler.SourceLocation(fileName, LineNumber, ColNumber, LineNumber, ColNumber); + } + public override string Message + { + get + { + return ToString(); + } + } + public override string ToString() + { + return message; + } + + } + class ExceptionInStartEXE : PascalABCCompiler.Errors.LocatedError + { + public ExceptionInStartEXE(string FileName) + { + this.fileName = FileName; + sourceLocation = null; + } + public override string Message + { + get + { + return ToString(); + } + } + public override string ToString() + { + return string.Format(Form1StringResources.Get("EXCEPTION_IN_START_EXE{0}"), fileName); + } + + } +} diff --git a/VisualPascalABCNETLinux/DS/SymbolsViwer.cs b/VisualPascalABCNETLinux/DS/SymbolsViwer.cs new file mode 100644 index 000000000..0c20fa13f --- /dev/null +++ b/VisualPascalABCNETLinux/DS/SymbolsViwer.cs @@ -0,0 +1,143 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using VisualPascalABC; +using PascalABCCompiler; +using System.Text.RegularExpressions; +namespace VisualPascalABC +{ + public class SymbolsViewerSymbol + { + SourceLocation sl; + int imageIndex; + public SymbolsViewerSymbol(SourceLocation sl, int imageIndex) + { + this.sl = sl ; + this.imageIndex = imageIndex; + } + public SourceLocation SourceLocation + { + get + { + return sl; + } + } + public int ImageIndex + { + get + { + return imageIndex; + } + } + } + public class SymbolsViwer + { + public string OutputFormat = "{0} - ({1},{2}): {3}"; + ListView listView; + ImageList imageList; + public bool showInThread; + VisualPascalABCPlugins.InvokeDegegate beginInvoke; + PascalABCCompiler.SourceFilesProviderDelegate sourceFilesProvider; + VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction; + public SymbolsViwer(ListView listView, ImageList imageList, bool showInThread, VisualPascalABCPlugins.InvokeDegegate beginInvoke, + PascalABCCompiler.SourceFilesProviderDelegate sourceFilesProvider, VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction) + { + this.listView = listView; + this.imageList = imageList; + this.showInThread = showInThread; + this.beginInvoke = beginInvoke; + this.sourceFilesProvider = sourceFilesProvider; + this.ExecuteSourceLocationAction = ExecuteSourceLocationAction; + listView.MouseDoubleClick += new MouseEventHandler(listView_MouseDoubleClick); + } + + void listView_MouseDoubleClick(object sender, MouseEventArgs e) + { + if (listView.SelectedItems.Count > 0) + { + SymbolsViewerSymbol sym = listView.SelectedItems[0].Tag as SymbolsViewerSymbol; + if(sym.SourceLocation!=null) + ExecuteSourceLocationAction(sym.SourceLocation, VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + } + + string GetTextLineFromNumber(int lineNum, string Text) + { + int i=0,b=0,e=-1; + do + { + b = e + 1; + e = Text.IndexOf('\n', b); + if (i == lineNum) + if (e >= 0) + return Text.Substring(b, e - b - 1); + else + return Text.Substring(b, Text.Length - b - 1); + i++; + } + while (e != -1); + /*MatchCollection mc = Regex.Matches(Text, ".*\n", RegexOptions.Compiled); + if (lineNum < mc.Count) + return mc[lineNum].Value.Replace(Environment.NewLine, "");*/ + return ""; + } + + List symbolList; + delegate void lviAddDelegate(List ListViewItems); + void add_items_to_list(List ListViewItems) + { + listView.Items.AddRange(ListViewItems.ToArray()); + } + void show(object state) + { + List ListViewItems = new List(); + foreach (SymbolsViewerSymbol sym in symbolList) + { + string text = (string)sourceFilesProvider(sym.SourceLocation.FileName, PascalABCCompiler.SourceFileOperation.GetText); + if (text == null) + continue; + string txt = string.Format(OutputFormat, sym.SourceLocation.FileName, sym.SourceLocation.BeginPosition.Line, sym.SourceLocation.BeginPosition.Column, GetTextLineFromNumber(sym.SourceLocation.BeginPosition.Line - 1, text)); + txt = txt.Replace('\t', ' '); + ListViewItem lvi = new ListViewItem(); + lvi.Tag = sym; + lvi.ImageIndex = sym.ImageIndex; + lvi.SubItems.Add(txt); + ListViewItems.Add(lvi); + } + beginInvoke(new lviAddDelegate(add_items_to_list), ListViewItems); + if (listView.Items.Count > 0) + listView.Items[0].Selected = true; + symbolList = null; + } + + delegate void Invoke_with_param(object obj); + + private void SetSmallImageListInternal(object obj) + { + listView.SmallImageList = obj as ImageList; + } + + public void Show(List symbolList) + { + this.symbolList = symbolList; + listView.Items.Clear(); + //listView.SmallImageList = imageList; + listView.Invoke(new Invoke_with_param(SetSmallImageListInternal),imageList); + if (showInThread) + { + if (!System.Threading.ThreadPool.QueueUserWorkItem(show)) + show(null); + } + else + show(null); + } + public void Clear() + { + listView.Clear(); + } + + } +} diff --git a/VisualPascalABCNETLinux/DS/Tools.cs b/VisualPascalABCNETLinux/DS/Tools.cs new file mode 100644 index 000000000..7893a8bdf --- /dev/null +++ b/VisualPascalABCNETLinux/DS/Tools.cs @@ -0,0 +1,112 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Runtime.InteropServices; +using Microsoft.Win32; + +namespace VisualPascalABC +{ + public class Tools + { + public static string GetTextFromClipboard() + { + IDataObject dataObject = Clipboard.GetDataObject(); + if (dataObject.GetDataPresent(DataFormats.Text)) + { + // Yes it is, so display it in a text box. + return (string)dataObject.GetData(DataFormats.Text); + } + return ""; + } + + public static bool CopyTextToClipboard(string stringToCopy) + { + if (stringToCopy.Length > 0) + { + DataObject dataObject = new DataObject(); + dataObject.SetData(DataFormats.UnicodeText, true, stringToCopy); + // Work around ExternalException bug. (SD2-426) + // Best reproducable inside Virtual PC. + try + { + Clipboard.SetDataObject(dataObject, true, 10, 50); + } + catch (ExternalException) + { + Application.DoEvents(); + try + { + Clipboard.SetDataObject(dataObject, true, 10, 50); + } + catch (ExternalException) { } + } + return true; + } + else + { + return false; + } + } + + public static string MakeFilter(string Filter, string Name, string[] Extensions) + { + string sf = PascalABCCompiler.FormatTools.ExtensionsToString(Extensions, "*", ";"); + sf = string.Format(VECStringResources.Get("DIALOGS_FILTER_PART_{0}{1}|{1}|"), Name, sf); + if (sf.IndexOf(".pas") >= 0) + return sf + Filter; + else + return Filter + sf; + + } + + public static string MakeProjectFilter(string Filter, string Name, string[] Extensions) + { + string sf = PascalABCCompiler.FormatTools.ExtensionsToString(Extensions, "*", ";"); + sf = string.Format(VECStringResources.Get("DIALOGS_PROJECT_FILTER_PART_{0}{1}|{1}|"), Name, sf); + if (sf.IndexOf(".pabcproj") >= 0) + return sf + Filter; + else + return Filter + sf; + + } + + public static string MakeAllFilter(string AllFilter, string Name, string[] Extensions) + { + string sf = PascalABCCompiler.FormatTools.ExtensionsToString(Extensions, "*", ";"); + sf += ";"; + if (sf.IndexOf(".pas;") >= 0) + return sf + AllFilter; + else + return AllFilter + sf; + } + public static string FinishMakeFilter(string Filter, string AllFilter) + { + if (AllFilter != "") + AllFilter = AllFilter.Substring(0, AllFilter.Length - 1); + if (Filter != "") + Filter = string.Format(VECStringResources.Get("DIALOGS_FILTER_PARTALL_{0}|{0}|{1}"), AllFilter, Filter); + return Filter + VECStringResources.Get("DIALOGS_FILTER_ALLFILES") + " (*.*)|*.*"; + } + + public static string FileNameToLower(string FileName) + { + if (!Constants.FileNamesCaseSensetive) + return FileName.ToLower(); + return FileName; + } + + public static string GetRangeDescription(int selectedItem, int itemCount) + { + return string.Format(PascalABCCompiler.StringResources.Get("CODE_COMPLETION_{0}_FROM_{1}"), selectedItem, itemCount); + } + + public static bool IsUnix() + { + return System.Environment.OSVersion.Platform == System.PlatformID.Unix || System.Environment.OSVersion.Platform == System.PlatformID.MacOSX; + } + } +} diff --git a/VisualPascalABCNETLinux/DS/Utils/OutputReader.cs b/VisualPascalABCNETLinux/DS/Utils/OutputReader.cs new file mode 100644 index 000000000..38332fa44 --- /dev/null +++ b/VisualPascalABCNETLinux/DS/Utils/OutputReader.cs @@ -0,0 +1,93 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Threading; + +namespace VisualPascalABC.Utils +{ + /// + /// A threaded or + /// reader. + /// + public class OutputReader + { + StreamReader reader; + string output = String.Empty; + Thread thread; + + public event LineReceivedEventHandler LineReceived; + + public OutputReader(StreamReader reader) + { + this.reader = reader; + } + + /// + /// Starts reading the output stream. + /// + public void Start() + { + thread = new Thread(new ThreadStart(ReadOutput)); + thread.Start(); + } + + /// + /// Gets the text output read from the reader. + /// + public string Output { + get { + return output; + } + } + + /// + /// Waits for the reader to finish. + /// + public void WaitForFinish() + { + if (thread != null) { + thread.Join(); + } + } + + /// + /// Raises the event. + /// + /// + protected void OnLineReceived(string line) + { + if (LineReceived != null) { + LineReceived(this, new LineReceivedEventArgs(line)); + } + } + + /// + /// Reads the output stream on a different thread. + /// + void ReadOutput() + { + output = String.Empty; + StringBuilder outputBuilder = new StringBuilder(); + + bool endOfStream = false; + while(!endOfStream) + { + //reader. + string line = reader.ReadLine(); + + if (line != null) { + outputBuilder.Append(line); + outputBuilder.Append(Environment.NewLine); + OnLineReceived(line); + } else { + endOfStream = true; + } + } + + output = outputBuilder.ToString(); + } + } +} diff --git a/VisualPascalABCNETLinux/DS/Utils/ProcessRunner.cs b/VisualPascalABCNETLinux/DS/Utils/ProcessRunner.cs new file mode 100644 index 000000000..f4646f63d --- /dev/null +++ b/VisualPascalABCNETLinux/DS/Utils/ProcessRunner.cs @@ -0,0 +1,361 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace VisualPascalABC.Utils +{ + public delegate void LineReceivedEventHandler(object sender, LineReceivedEventArgs e); + + /// + /// The arguments for the event. + /// + public class LineReceivedEventArgs : EventArgs + { + string line = String.Empty; + + public LineReceivedEventArgs(string line) + { + this.line = line; + } + + public string Line + { + get + { + return line; + } + } + } + + /// + /// Runs a process that sends output to standard output and to + /// standard error. + /// + [Serializable] + public class ProcessRunner : IDisposable + { + public Process process; + string standardOutput = String.Empty; + string workingDirectory = String.Empty; + OutputReader standardOutputReader; + OutputReader standardErrorReader; + bool RedirectIO; + + + + //AppDomain Domain; + string DomainID = "PascalABCNETRunner"; + + /// + /// Triggered when the process has exited. + /// + public event EventHandler ProcessExited; + + /// + /// Triggered when a line of text is read from the standard output. + /// + public event LineReceivedEventHandler OutputLineReceived; + + /// + /// Triggered when a line of text is read from the standard error. + /// + public event LineReceivedEventHandler ErrorLineReceived; + + /// + /// Creates a new instance of the . + /// + public ProcessRunner() + { + //Domain = AppDomain.CreateDomain(DomainID); + //Domain.UnhandledException += new UnhandledExceptionEventHandler(Domain_UnhandledException); + } + + void Domain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + Console.WriteLine("x"); + } + + /// + /// Gets or sets the process's working directory. + /// + public string WorkingDirectory { + get { + return workingDirectory; + } + + set { + workingDirectory = value; + } + } + + /// + /// Gets the standard output returned from the process. + /// + public string StandardOutput { + get { + string output = String.Empty; + if (standardOutputReader != null) { + output = standardOutputReader.Output; + } + return output; + } + } + + /// + /// Gets the standard error output returned from the process. + /// + public string StandardError { + get { + string output = String.Empty; + if (standardErrorReader != null) { + output = standardErrorReader.Output; + } + return output; + } + } + + /// + /// Releases resources held by the + /// + public void Dispose() + { + } + + /// + /// Gets the process exit code. + /// + public int ExitCode { + get { + int exitCode = 0; + if (process != null) { + exitCode = process.ExitCode; + } + return exitCode; + } + } + + /// + /// Waits for the process to exit. + /// + public void WaitForExit() + { + WaitForExit(Int32.MaxValue); + } + + /// + /// Waits for the process to exit. + /// + /// A timeout in milliseconds. + /// if the associated process has + /// exited; otherwise, + public bool WaitForExit(int timeout) + { + if (process == null) { + throw new Exception("NoProcessRunning"); + } + + bool exited = process.WaitForExit(timeout); + + if (exited) { + standardOutputReader.WaitForFinish(); + standardErrorReader.WaitForFinish(); + } + + return exited; + } + + public bool IsRunning { + get { + bool isRunning = false; + + if (process != null) { + isRunning = !process.HasExited; + } + + return isRunning; + } + } + + string GenerateBatFileForRunWithPause(string command, string arguments) + { + string AppPatch = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath); + string PauseExe = AppPatch + @"\Pause.exe"; + if (!File.Exists(PauseExe) || !Directory.Exists(AppPatch+@"\Temp")) + return null; + string BatNameTempl = AppPatch + @"\Temp\" + Path.ChangeExtension(Path.GetFileNameWithoutExtension(command)+"{0}", ".bat"); + string BatName = string.Format(BatNameTempl, ""); + int i=0; + while (File.Exists(BatName)) + BatName = string.Format(BatNameTempl, i++); + try + { + TextWriter batFile = File.CreateText(BatName); + batFile.WriteLine("@echo off"); + batFile.Write("\"" + command + "\""); + if (arguments != string.Empty) + batFile.Write(" " + arguments); + batFile.WriteLine(); + batFile.WriteLine("\"" + PauseExe + "\""); + batFile.Close(); + return BatName; + } + catch (Exception) + { + return null; + } + //return null; + } + public string TempBatFile = null; + public void Start(string command, string arguments, bool redirectIO, bool redirectErrors, bool RunWithPause, bool attachDebugger, bool fictive_attach) + { + RedirectIO=redirectIO; + process = new Process(); + string BatFile = null; + process.StartInfo.ErrorDialog = false; + if (RunWithPause && (BatFile = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath),"ProgrammRunner.exe")/*GenerateBatFileForRunWithPause(command, arguments)*/) != null) + { + TempBatFile = BatFile; + //process.StartInfo.UseShellExecute = false; + process.StartInfo.FileName = BatFile; + process.StartInfo.WorkingDirectory = workingDirectory; + process.StartInfo.Arguments = command.Replace(" ","\" \"") + " " + PascalABCCompiler.StringResourcesLanguage.CurrentLCID + " " + arguments; + } + else + { + process.StartInfo.UseShellExecute = false; + #if (DEBUG) + if (VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.StandartCompiler.InternalDebug.RunOnMono && !(attachDebugger && !fictive_attach)) + { + string mono_path = @"C:\Program Files\Mono-2.0.1\bin";//Environment.GetEnvironmentVariable("MONO_PATH", EnvironmentVariableTarget.Machine); + process.StartInfo.FileName = Path.Combine(mono_path,"mono.exe"); + process.StartInfo.WorkingDirectory = workingDirectory; + process.StartInfo.Arguments = command+" "+arguments; + } + else + #endif + { + process.StartInfo.FileName = command; + process.StartInfo.WorkingDirectory = workingDirectory; + process.StartInfo.Arguments = arguments; + } + } + //process.StartInfo.Domain = Domain.FriendlyName; + if (RedirectIO) + { + process.StartInfo.CreateNoWindow = true; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardInput = true; + process.StartInfo.StandardOutputEncoding = System.Text.Encoding.UTF8; + } + if (redirectErrors) + { + process.StartInfo.RedirectStandardError = true; + process.StartInfo.StandardErrorEncoding = System.Text.Encoding.UTF8; + } + if (ProcessExited != null) + { + process.EnableRaisingEvents = true; + process.Exited += new EventHandler(OnProcessExited); + } + process.Start(); + //ssyy + process.PriorityClass = ProcessPriorityClass.BelowNormal; + //\ssyy + if (attachDebugger) + { + WorkbenchServiceFactory.DebuggerManager.Attach((uint)process.Id,command,!fictive_attach,false); + } + if (redirectIO) + process.StandardInput.WriteLine("GO"); + + } + + + void process_ErrorDataReceived(object sender, DataReceivedEventArgs e) + { + throw new Exception("The method or operation is not implemented."); + } + + /// + /// Kills the running process. + /// + public void Kill() + { + if (process != null) + { + if (!process.HasExited) + { + process.Kill(); + process.Close(); + process.Dispose(); + process = null; + /*if (RedirectOutput) + { + standardOutputReader.WaitForFinish(); + standardErrorReader.WaitForFinish(); + }*/ + } + else + { + process = null; + } + } + // Control-C does not seem to work. + //GenerateConsoleCtrlEvent((int)ConsoleEvent.ControlC, 0); + } + + /// + /// Raises the event. + /// + protected void OnProcessExited(object sender, EventArgs e) + { + if (ProcessExited != null) { + + if (RedirectIO) + { + //standardOutputReader.WaitForFinish(); + //standardErrorReader.WaitForFinish(); + } + ProcessExited(this, e); + } + } + + /// + /// Raises the event. + /// + /// The event source. + /// The line received event arguments. + protected void OnOutputLineReceived(object sender, LineReceivedEventArgs e) + { + if (OutputLineReceived != null) { + OutputLineReceived(this, e); + } + } + + /// + /// Raises the event. + /// + /// The event source. + /// The line received event arguments. + protected void OnErrorLineReceived(object sender, LineReceivedEventArgs e) + { + if (ErrorLineReceived != null) { + ErrorLineReceived(this, e); + } + } + + enum ConsoleEvent + { + ControlC = 0, + ControlBreak = 1 + }; + + [DllImport("kernel32.dll", SetLastError=true)] + static extern int GenerateConsoleCtrlEvent(int dwCtrlEvent, int dwProcessGroupId); + } +} diff --git a/VisualPascalABCNETLinux/DS/VisualEnvironmentCompiler.cs b/VisualPascalABCNETLinux/DS/VisualEnvironmentCompiler.cs new file mode 100644 index 000000000..db78d93ff --- /dev/null +++ b/VisualPascalABCNETLinux/DS/VisualEnvironmentCompiler.cs @@ -0,0 +1,549 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using System.Threading; + +namespace VisualPascalABC +{ + public class VECStringResources + { + public static string Get(string key) + { + return PascalABCCompiler.StringResources.Get("VP_VEC_"+key); + } + + } + + public class VisualEnvironmentCompiler: IVisualEnvironmentCompiler + { + // PascalABCCompiler.CompilerType defaultCompilerType = PascalABCCompiler.CompilerType.Remote; + PascalABCCompiler.CompilerType defaultCompilerType = PascalABCCompiler.CompilerType.Standart; // Для Linux + + public static Encoding DefaultFileEncoding = new System.Text.UTF8Encoding(false); + + private IWorkbench workbench; + private PascalABCCompiler.RemoteCompiler remoteCompiler; + private PascalABCCompiler.Compiler standartCompiler; + private System.Threading.Thread MainProgramThread = System.Threading.Thread.CurrentThread; + private System.Threading.Thread StartingThread; + public delegate void SetFlagDelegate(bool flag); + private SetFlagDelegate SetCompilingButtonsEnabled; + private SetFlagDelegate SetDebugButtonsEnabled; + public delegate void SetTextDelegate(string text); + private SetTextDelegate SetStateText; + private SetTextDelegate AddTextToCompilerMessages; + private bool Compilation = false; + public VisualPascalABCPlugins.PluginsController PluginsController; + private ToolStripMenuItem PluginsMenuItem; + private ToolStrip PluginsToolStrip; + public bool compilerLoaded=false; + InvokeDegegate beginInvoke; + public InvokeDegegate BeginInvoke + { + get + { + return beginInvoke; + } + } + public delegate void ExecuteSourceLocationActionDelegate(PascalABCCompiler.SourceLocation SourceLocation, SourceLocationAction Action); + private ExecuteSourceLocationActionDelegate ExecuteSLAction; + public delegate object ExecuteVisualEnvironmentCompilerActionDelegate(VisualEnvironmentCompilerAction Action, object obj); + private ExecuteVisualEnvironmentCompilerActionDelegate ExecuteVECAction; + private bool StartingCompleted = false; + public PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager; + private RunManager RunnerManager; + private DebugHelper DebugHelper; + private CodeCompletionParserController CodeCompletionParserController; + public UserOptions UserOptions; + private System.Collections.Hashtable StandartDirectories; + Dictionary OpenDocuments; + + public VisualEnvironmentCompiler(InvokeDegegate beginInvoke, + SetFlagDelegate setCompilingButtonsEnabled, SetFlagDelegate setCompilingDebugEnabled, SetTextDelegate setStateText, + SetTextDelegate addTextToCompilerMessages, ToolStripMenuItem pluginsMenuItem, + ToolStrip pluginsToolStrip, ExecuteSourceLocationActionDelegate ExecuteSLAction, + ExecuteVisualEnvironmentCompilerActionDelegate ExecuteVECAction, + PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager, RunManager RunnerManager, DebugHelper DebugHelper,UserOptions UserOptions,System.Collections.Hashtable StandartDirectories, + Dictionary OpenDocuments, IWorkbench workbench) + { + this.StandartDirectories = StandartDirectories; + this.ErrorsManager = ErrorsManager; + this.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(onChangeVisualEnvironmentState); + SetCompilingButtonsEnabled = setCompilingButtonsEnabled; + SetDebugButtonsEnabled = setCompilingDebugEnabled; + SetStateText = setStateText; + AddTextToCompilerMessages = addTextToCompilerMessages; + this.beginInvoke = beginInvoke; + this.ExecuteSLAction=ExecuteSLAction; + this.ExecuteVECAction = ExecuteVECAction; + PluginsMenuItem = pluginsMenuItem; + PluginsToolStrip = pluginsToolStrip; + PluginsController = new VisualPascalABCPlugins.PluginsController(this, PluginsMenuItem, PluginsToolStrip, workbench); + this.RunnerManager = RunnerManager; + this.DebugHelper = DebugHelper; + DebugHelper.Starting += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Starting); + DebugHelper.Exited += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Exited); + RunnerManager.Starting += new RunnerManagerActionDelegate(RunnerManager_Starting); + RunnerManager.Exited += new RunnerManagerActionDelegate(RunnerManager_Exited); + this.CodeCompletionParserController = WorkbenchServiceFactory.CodeCompletionParserController; + this.CodeCompletionParserController.visualEnvironmentCompiler = this; + this.UserOptions = UserOptions; + this.OpenDocuments = OpenDocuments; + } + + void RunnerManager_Exited(string fileName) + { + ChangeVisualEnvironmentState(VisualEnvironmentState.ProcessExited, fileName); + } + + void RunnerManager_Starting(string fileName) + { + ChangeVisualEnvironmentState(VisualEnvironmentState.ProcessStarting, fileName); + } + + void DebugHelper_Exited(string FileName) + { + ChangeVisualEnvironmentState(VisualEnvironmentState.ProcessExited, FileName); + } + + void DebugHelper_Starting(string FileName) + { + ChangeVisualEnvironmentState(VisualEnvironmentState.ProcessStartingDebug, FileName); + } + + + public bool Starting() + { + return StartingThread.ThreadState == System.Threading.ThreadState.Running; + } + public bool Started + { + get { return StartingThread.ThreadState != System.Threading.ThreadState.Running; } + } + public void AbortStaring() + { + //для того чтобы отмена прошла быстрее увеличиваем приоритет потока + StartingThread.Priority = System.Threading.ThreadPriority.AboveNormal; + //даем команду на завершение и ждем завершения + StartingThread.Join(); + } + + private void CreateCompiler() + { + standartCompiler = new PascalABCCompiler.Compiler(SourceFilesProvider, OnChangeCompilerState); + CodeCompletion.CodeCompletionController.comp = new PascalABCCompiler.Compiler((PascalABCCompiler.Compiler)standartCompiler, SourceFilesProvider, OnChangeCompilerState); + if (ProjectFactory.Instance.CurrentProject != null) + { + CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = ProjectFactory.Instance.CurrentProject; + ProjectFactory.Instance.Dirty = true; + } + CodeCompletion.CodeCompletionController.ParsersController = standartCompiler.ParsersController; + CodeCompletion.CodeCompletionController.StandartDirectories = StandartDirectories; + + this.CodeCompletionParserController.Init(); + if (defaultCompilerType == PascalABCCompiler.CompilerType.Remote && !Tools.IsUnix()) + LoadRemoteCompiler(); + else + defaultCompilerType = PascalABCCompiler.CompilerType.Standart; + } + + public void LoadRemoteCompiler() + { + remoteCompiler = new PascalABCCompiler.RemoteCompiler(PascalABCCompiler.ConsoleCompilerConstants.MaxProcessMemoryMB, OnChangeCompilerState, SourceFilesProvider); + } + + public void RunStartingThread() + { + StartingThread = new System.Threading.Thread(new System.Threading.ThreadStart(CreateCompiler)); + StartingThread.Priority = System.Threading.ThreadPriority.BelowNormal; + ChangeVisualEnvironmentState(VisualEnvironmentState.StartCompilerLoading, StartingThread); + StartingThread.Start(); + } + + public string GetFilterForDialogs() + { + if (standartCompiler == null) + return null; + string Filter = "", AllFilter = ""; + foreach (PascalABCCompiler.SupportedSourceFile ssf in standartCompiler.SupportedSourceFiles) + { + Filter = Tools.MakeFilter(Filter, ssf.LanguageName, ssf.Extensions); + AllFilter = Tools.MakeAllFilter(AllFilter, ssf.LanguageName, ssf.Extensions); + } + Filter += "Программы на C# (*.cs)|*.cs|"; + AllFilter += "*.cs;"; + return Tools.FinishMakeFilter(Filter, AllFilter); + } + + public string GetProjectFilterForDialogs() + { + if (standartCompiler == null) + return null; + string Filter = "", AllFilter = ""; + foreach (PascalABCCompiler.SupportedSourceFile ssf in standartCompiler.SupportedProjectFiles) + { + Filter = Tools.MakeProjectFilter(Filter, ssf.LanguageName, ssf.Extensions); + AllFilter = Tools.MakeAllFilter(AllFilter, ssf.LanguageName, ssf.Extensions); + } + return Tools.FinishMakeFilter(Filter, AllFilter); + } + + public string GetAssemblyFilterForDialogs() + { + if (standartCompiler == null) + return null; + string Filter = ""; + string AllFilter = ""; + Filter = Tools.MakeFilter(Filter, VECStringResources.Get("ASSEMBLIES"), new string[1]{".dll"}); + AllFilter = Tools.MakeAllFilter(AllFilter, VECStringResources.Get("ASSEMBLIES"), new string[1]{".dll"}); + return Tools.FinishMakeFilter(Filter, AllFilter); + } + + private bool CurrentThreadIsMainThread() + { + return MainProgramThread == System.Threading.Thread.CurrentThread; + } + + DateTime compilationStartTime; + public string Compile(PascalABCCompiler.CompilerOptions CompilerOptions) + { + compilationStartTime = DateTime.Now; + Compiler.CompilerOptions = CompilerOptions; + string fn=Compiler.Compile(); + return fn; + } + + public void StartCompile(PascalABCCompiler.CompilerOptions CompilerOptions) + { + compilationStartTime = DateTime.Now; + Compiler.CompilerOptions = CompilerOptions; + Compiler.StartCompile(); + } + + void onChangeVisualEnvironmentState(VisualEnvironmentState State, object obj) + { + + } + + + public object SourceFilesProvider(string FileName, PascalABCCompiler.SourceFileOperation FileOperation) + { + + + CodeFileDocumentControl tp = null; + ICSharpCode.TextEditor.TextEditorControl ed = null; + if (OpenDocuments.TryGetValue(Tools.FileNameToLower(FileName), out tp)) + ed = tp.TextEditor; + + + switch (FileOperation) + { + case PascalABCCompiler.SourceFileOperation.GetText: + if (tp != null) + return ed.Document.TextContent; + if (!File.Exists(FileName)) + return null; + /*TextReader tr = new StreamReader(FileName, System.Text.Encoding.GetEncoding(1251)); + string Text = tr.ReadToEnd(); + tr.Close();*/ + string Text = PascalABCCompiler.FileReader.ReadFileContent(FileName, null); + return Text; + case PascalABCCompiler.SourceFileOperation.Exists: + if (tp != null) + return true; + return File.Exists(FileName); + case PascalABCCompiler.SourceFileOperation.GetLastWriteTime: + if (tp != null) + return tp.ModifyDateTime; + return File.GetLastWriteTime(FileName); + case PascalABCCompiler.SourceFileOperation.FileEncoding: + return DefaultFileEncoding; + } + return null; + } + + private delegate void ChangeCompilerStateDelegate(PascalABCCompiler.ICompiler sender, PascalABCCompiler.CompilerState State, string FileName); + private void OnChangeCompilerState(PascalABCCompiler.ICompiler sender, PascalABCCompiler.CompilerState State, string FileName) + { + if (CurrentThreadIsMainThread()) + OnChangeCompilerStateEx(sender, State, FileName); + else + BeginInvoke(new ChangeCompilerStateDelegate(OnChangeCompilerStateEx), sender, State, FileName); + } + + private void CompileTestProgram(object state) + { + string fileName = @"C:\PABCWork.NET\Samples\test.pas"; + if (File.Exists(fileName)) + { + PascalABCCompiler.CompilerOptions co = new PascalABCCompiler.CompilerOptions(); + co.SourceFileName = fileName; + Compile(co); + } + } + + private void LoadPlugins(object state) + { + AddTextToCompilerMessages(VECStringResources.Get("LOAD_PLUGINS") + Environment.NewLine); + PluginsController.AddPlugins(); + if (PluginsController.Plugins.Count == 0) + AddTextToCompilerMessages(VECStringResources.Get("PLUGINS_NOTFOUND") + Environment.NewLine); + else + foreach (VisualPascalABCPlugins.IVisualPascalABCPlugin Plugin in PluginsController.Plugins) + AddTextToCompilerMessages(Plugin.Name+" v"+Plugin.Version + Environment.NewLine); + if (PluginsController.ErrorList.Count > 0) + { + AddTextToCompilerMessages(VECStringResources.Get("PLUGINS_LOADING_ERRORS") + Environment.NewLine); + foreach (VisualPascalABCPlugins.PluginLoadingError Error in PluginsController.ErrorList) + AddTextToCompilerMessages(Error.ToString() + Environment.NewLine); + } + + //VisualPABCSingleton.MainForm.codeCompletionParserController.ParseAllFiles(); + } + + void AddCompilerTextToCompilerMessages(PascalABCCompiler.ICompiler sender, string text) + { + if (sender.CompilerType == PascalABCCompiler.CompilerType.Standart) + AddTextToCompilerMessages(VECStringResources.Get("LOCAL_COMPILER_PREFIX") + text); + else + AddTextToCompilerMessages(VECStringResources.Get("REMOTE_COMPILER_PREFIX") + text); + } + List ParsedFiles = new List(); + private void OnChangeCompilerStateEx(PascalABCCompiler.ICompiler sender, PascalABCCompiler.CompilerState State, string FullFileName) + { + + string RusName = null; + string FileName = null; + if (FullFileName != null) + FileName = Path.GetFileName(FullFileName); + switch (State) + { + case PascalABCCompiler.CompilerState.CompilationStarting: + RusName = VECStringResources.Get("STATE_START_COMPILING_ASSEMBLY{0}"); + SetCompilingButtonsEnabled(false); + ParsedFiles.Clear(); + break; + case PascalABCCompiler.CompilerState.BeginCompileFile: RusName = VECStringResources.Get("STATE_BEGINCOMPILEFILE{0}"); break; + case PascalABCCompiler.CompilerState.CompileInterface: RusName = VECStringResources.Get("STATE_COMPILEINTERFACE{0}"); break; + case PascalABCCompiler.CompilerState.CompileImplementation: RusName = VECStringResources.Get("STATE_COMPILEIMPLEMENTATION{0}"); break; + case PascalABCCompiler.CompilerState.EndCompileFile: RusName = VECStringResources.Get("STATE_ENDCOMPILEFILE{0}"); break; + case PascalABCCompiler.CompilerState.CodeGeneration: RusName = VECStringResources.Get("STATE_CODEGENERATION{0}"); break; + case PascalABCCompiler.CompilerState.ReadDLL: RusName = VECStringResources.Get("STATE_READDLL{0}"); break; + case PascalABCCompiler.CompilerState.SavePCUFile: RusName = VECStringResources.Get("STATE_SAVEPCUFILE{0}"); break; + case PascalABCCompiler.CompilerState.ReadPCUFile: RusName = VECStringResources.Get("STATE_READPCUFILE{0}"); break; + case PascalABCCompiler.CompilerState.PCUReadingError: RusName = VECStringResources.Get("STATE_PCUREADINGERROR{0}"); break; + case PascalABCCompiler.CompilerState.PCUWritingError: RusName = VECStringResources.Get("STATE_PCUWRITINGERROR{0}"); break; + case PascalABCCompiler.CompilerState.SemanticTreeConversion: RusName = VECStringResources.Get("STATE_SEMANTICTREECONVERSION{0}"); break; + case PascalABCCompiler.CompilerState.SemanticTreeConverterConnected: RusName = VECStringResources.Get("STATE_SEMANTICTREECONVERTERCONNECTED{0}"); break; + case PascalABCCompiler.CompilerState.SyntaxTreeConversion: RusName = VECStringResources.Get("STATE_SYNTAXTREECONVERSION{0}"); break; + case PascalABCCompiler.CompilerState.SyntaxTreeConverterConnected: RusName = VECStringResources.Get("STATE_SYNTAXTREECONVERTERCONNECTED{0}"); break; + case PascalABCCompiler.CompilerState.ParserConnected: + FileName = Path.GetFileName(FileName); + if(sender.CompilerType== PascalABCCompiler.CompilerType.Standart) + RusName = string.Format(VECStringResources.Get("PARSER_CONNECTED{0}{1}"), sender.ParsersController.LastParser, FileName); + else + RusName = string.Format(VECStringResources.Get("PARSER_CONNECTED{0}"), FileName); + FileName = null; + break; + case PascalABCCompiler.CompilerState.Ready: + RusName = VECStringResources.Get("STATE_READY"); + if (!StartingCompleted) + { + switch (sender.CompilerType) + { + case PascalABCCompiler.CompilerType.Standart: + standartCompiler = (PascalABCCompiler.Compiler)sender; + break; + case PascalABCCompiler.CompilerType.Remote: + remoteCompiler = (PascalABCCompiler.RemoteCompiler)sender; + break; + } + if (!(defaultCompilerType == PascalABCCompiler.CompilerType.Remote) || (standartCompiler.State == PascalABCCompiler.CompilerState.Ready && (remoteCompiler != null && remoteCompiler.State == PascalABCCompiler.CompilerState.Ready))) + StartingCompleted = true; + AddCompilerTextToCompilerMessages(sender, VECStringResources.Get("SUPPORTED_LANGUAGES") + Environment.NewLine); + foreach (PascalABCCompiler.SupportedSourceFile ssf in standartCompiler.SupportedSourceFiles) + AddCompilerTextToCompilerMessages(sender, string.Format(VECStringResources.Get("CM_LANGUAGE_{0}"), ssf) + Environment.NewLine); + if (StartingCompleted) + { + ChangeVisualEnvironmentState(VisualEnvironmentState.FinishCompilerLoading, standartCompiler); + compilerLoaded = true; + VisualPABCSingleton.MainForm.StartTimer(); + /*if (!ThreadPool.QueueUserWorkItem(new WaitCallback(CompileTestProgram))) + CompileTestProgram(null);*/ + // SSM 20/06/22 Linux - запретил плагины + //if (!ThreadPool.QueueUserWorkItem(new WaitCallback(LoadPlugins))) + // LoadPlugins(null); + + SetCompilingButtonsEnabled(true); + SetDebugButtonsEnabled(true); + } + } + else + { + if (Compiler == sender) + { + SetCompilingButtonsEnabled(true); + } + } + break; + case PascalABCCompiler.CompilerState.Reloading: + if (Compiler == sender) + SetCompilingButtonsEnabled(false); + RusName = VECStringResources.Get("STATE_RELOADING"); + break; + case PascalABCCompiler.CompilerState.CompilationFinished: + RusName = VECStringResources.Get("STATE_COMPILATIONFINISHED{0}"); + if (Compiler.ErrorsList.Count == 0) + { + SaveSourceFilesIfCompilationOk(); + AddTextToCompilerMessages(string.Format(VECStringResources.Get("CM_OK_{0}MS") + Environment.NewLine, (DateTime.Now - compilationStartTime).TotalMilliseconds) + Environment.NewLine); + } + else + { + List ErrorsList = ErrorsManager.CreateErrorsList(Compiler.ErrorsList); + AddTextToCompilerMessages(string.Format(VECStringResources.Get("CM_{0}_ERROS") + Environment.NewLine, ErrorsList.Count)); + foreach (PascalABCCompiler.Errors.Error Err in ErrorsList) + AddTextToCompilerMessages(Err.ToString() + Environment.NewLine); + } + + break; + default: + //RusName = State.ToString(); + break; + } + if (RusName != null) + { + if (FileName != null) + RusName = string.Format(RusName, FileName); + else RusName = string.Format(RusName, ""); + RusName += Environment.NewLine; + AddCompilerTextToCompilerMessages(sender, RusName); + } + + RusName = null; + switch (State) + { + case PascalABCCompiler.CompilerState.BeginParsingFile: + ParsedFiles.Add(FullFileName); + break; + case PascalABCCompiler.CompilerState.BeginCompileFile: RusName = VECStringResources.Get("STATETEXT_BEGINCOMPILEFILE{0}"); break; + //case PascalABCCompiler.CompilerState.ReadPCUFile: RusName = "Чтение {0}..."; break; + case PascalABCCompiler.CompilerState.CodeGeneration: RusName = VECStringResources.Get("STATETEXT_CODEGENERATION{0}"); break; + //case PascalABCCompiler.CompilerState.ReadDLL: + //case PascalABCCompiler.CompilerState.ReadPCUFile: RusName = "Чтение {0}..."; break; + case PascalABCCompiler.CompilerState.Ready: + if (Compiler != null) + { + List ErrorsList = ErrorsManager.CreateErrorsList(Compiler.ErrorsList); + if (ErrorsList.Count > 0) + { + RusName = string.Format(VECStringResources.Get("STATETEXT_{0}_ERROS"), ErrorsList.Count); + } + else + if (Compilation) + { + if (Compiler.Warnings.Count > 0) + RusName = string.Format(VECStringResources.Get("STATETEXT_COMPILATION_SUCCESS_{0}LINES_{1}WARNINGS"), Compiler.LinesCompiled, Compiler.Warnings.Count); + else + RusName = string.Format(VECStringResources.Get("STATETEXT_COMPILATION_SUCCESS_{0}LINES"), Compiler.LinesCompiled); + } + else + RusName = VECStringResources.Get("STATETEXT_READY"); + } + else + RusName = VECStringResources.Get("STATETEXT_READY"); + break; + case PascalABCCompiler.CompilerState.Reloading: RusName = VECStringResources.Get("STATETEXT_RELOADING"); break; + } + if (RusName != null) + { + if (FileName != null) + RusName = string.Format(RusName, FileName); + SetStateText(RusName); + + + } + if (!Compilation && State == PascalABCCompiler.CompilerState.CompilationStarting) + Compilation = true; + if (Compilation && State == PascalABCCompiler.CompilerState.Ready) + Compilation = false; + } + + + void SaveSourceFilesIfCompilationOk() + { + if (!UserOptions.SaveSourceFilesIfComilationOk) + return; + foreach (string name in ParsedFiles) + ExecuteAction(VisualEnvironmentCompilerAction.SaveFile, name); + } + + #region IVisualEnvironmentCompiler Members + + public event ChangeVisualEnvironmentStateDelegate ChangeVisualEnvironmentState; + + public PascalABCCompiler.ICompiler Compiler + { + get + { + if (defaultCompilerType == PascalABCCompiler.CompilerType.Remote) + return remoteCompiler; + return standartCompiler; + } + } + public PascalABCCompiler.Compiler StandartCompiler + { + get + { + return standartCompiler; + } + } + public PascalABCCompiler.RemoteCompiler RemoteCompiler + { + get + { + return remoteCompiler; + } + } + + public void ExecuteSourceLocationAction(PascalABCCompiler.SourceLocation SourceLocation,SourceLocationAction Action) + { + ExecuteSLAction(SourceLocation,Action); + } + + public object ExecuteAction(VisualEnvironmentCompilerAction Action, object obj) + { + return ExecuteVECAction(Action, obj); + } + + public PascalABCCompiler.CompilerType DefaultCompilerType + { + get + { + return defaultCompilerType; + } + set + { + //MessageBox.Show("SetRemoteCompiler"); + if (defaultCompilerType == value) + return; + defaultCompilerType=value; + if (defaultCompilerType == PascalABCCompiler.CompilerType.Remote && remoteCompiler == null) + { + //MessageBox.Show("LoadRemoteCompiler"); + LoadRemoteCompiler(); + } + } + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/DockContent/Avalon/CodeFileDocumentTextEditorControl.cs b/VisualPascalABCNETLinux/DockContent/Avalon/CodeFileDocumentTextEditorControl.cs new file mode 100644 index 000000000..6ccc0bd93 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/Avalon/CodeFileDocumentTextEditorControl.cs @@ -0,0 +1,145 @@ +/*using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.Drawing; +using ICSharpCode.AvalonEdit; +using ICSharpCode.AvalonEdit.Folding; + +namespace VisualPascalABC.Avalon +{ + public class CodeFileDocumentTextEditorControl : ICSharpCode.AvalonEdit.TextEditor + { + internal Form1 MainForm; + internal QuickClassBrowserPanel quickClassBrowserPanel; + FoldingManager foldingManager; + + internal Panel TextAreaPanel + { + get { return textAreaPanel; } + } + private Panel intellisensePanel; + public CodeFileDocumentTextEditorControl() + { + editactions[Keys.Space | Keys.Control] = new CodeCompletionAllNamesAction(); + editactions[Keys.Space | Keys.Shift] = new CodeCompletionNamesOnlyInModuleAction(); + editactions[Keys.Enter | Keys.Control] = new GotoAction(); + editactions[Keys.LButton | Keys.Control] = new GotoAction(); + editactions[Keys.C | Keys.Shift | Keys.Control] = new ClassOrMethodRealizationAction(); + editactions[Keys.Space | Keys.Shift | Keys.Control] = new VirtualMethodsAction(); + editactions[Keys.I | Keys.Shift | Keys.Control] = new GenerateMethodImplementationHeadersAction(); + editactions[Keys.F5 | Keys.Control] = new AddToWatchAction(); + editactions[Keys.F | Keys.Shift | Keys.Control] = new CodeFormattingAction(); + editactions[Keys.Control | Keys.Y] = new ICSharpCode.TextEditor.Actions.DeleteLine(); + editactions[Keys.Escape] = new HideBottomTabs(); + quickClassBrowserPanel = new QuickClassBrowserPanel(this); + quickClassBrowserPanel.VisibleChanged += new EventHandler(quickClassBrowserPanel_VisibleChanged); + if (VisualPABCSingleton.MainForm != null) + { + quickClassBrowserPanel.Visible = VisualPABCSingleton.MainForm.UserOptions.ShowQuickClassBrowserPanel; + } + intellisensePanel = new Panel(); + quickClassBrowserPanel_VisibleChanged(null, null); + intellisensePanel.Dock = DockStyle.Top; + intellisensePanel.Controls.Add(quickClassBrowserPanel); + intellisensePanel.Paint += new PaintEventHandler(separatorPanel_Paint); + this.foldingManager.FoldingStrategy = new ParserFoldingStrategy(); + Controls.Add(intellisensePanel); + TextArea.Caret.PositionChanged += docPositionChanged; + this.TextArea.AllowDrop = true; + this.TextArea.DragEnter += textEditorDragEnter; + this.TextArea.DragDrop += textEditorDragDrop; + foldingManager = FoldingManager.Install(this.TextArea); + } + + public void MarkForImmediateWindow() + { + editactions[Keys.Space | Keys.Control] = null; + editactions[Keys.Space | Keys.Shift] = null; + editactions[Keys.Enter | Keys.Control] = null; + editactions[Keys.LButton | Keys.ControlKey] = null; + editactions[Keys.C | Keys.Shift | Keys.Control] = null; + editactions[Keys.Space | Keys.Shift | Keys.Control] = null; + editactions[Keys.I | Keys.Shift | Keys.Control] = null; + editactions[Keys.F5 | Keys.Control] = null; + editactions[Keys.Control | Keys.Y] = null; + editactions[Keys.Escape] = null; + quickClassBrowserPanel = null; + TextArea.Caret.PositionChanged -= docPositionChanged; + this.TextArea.DragEnter -= textEditorDragEnter; + this.TextArea.DragDrop -= textEditorDragDrop; + //this.Font = new Font(new FontFamily(Constants.CompletionWindowCodeCompletionListViewFontName),8.5f); + editactions[Keys.Enter] = new ImmediateEvaluateAction(); + } + + //internal int DownSeparatorHeight = 3; + internal int DownSeparatorHeight = 2; + + delegate void invoke_delegate(); + + private void textEditorDragEnter(object sender, System.Windows.Forms.DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) + e.Effect = DragDropEffects.Copy; + else + e.Effect = DragDropEffects.None; + } + + private void textEditorDragDrop(object sender, System.Windows.Forms.DragEventArgs e) + { + string[] file_name = e.Data.GetData(DataFormats.FileDrop) as string[]; + if (file_name != null && file_name.Length > 0) + { + if (string.Compare(System.IO.Path.GetExtension(file_name[0]), Constants.ProjectExtension, true) == 0) + VisualPABCSingleton.ProjectService.OpenProject(file_name[0]); + else + VisualPABCSingleton.FileService.OpenFile(file_name[0], null); + } + } + + private void refresh_Folding() + { + //TextArea.Refresh(ActiveTextAreaControl.TextArea.FoldMargin); + } + + public void UpdateFolding() + { + CodeCompletionParserController.open_files[this.FileName] = true; + } + + public void UpdateFolding(object parseInfo, string fileName) + { + try + { + if (EnableFolding && fileName == this.FileName) + { + foldingManager.UpdateFoldings(fileName, parseInfo); + refresh_Folding(); + } + } + catch + { + + } + } + + void quickClassBrowserPanel_VisibleChanged(object sender, EventArgs e) + { + if (quickClassBrowserPanel.Visible) + intellisensePanel.Size = new Size(1, quickClassBrowserPanel.Height + DownSeparatorHeight); + else + intellisensePanel.Size = new Size(1, DownSeparatorHeight); + } + + void separatorPanel_Paint(object sender, PaintEventArgs e) + { + //e.Graphics.DrawLine(new Pen(SystemColors.ControlDark, 0.1F), 0, intellisensePanel.Height - 3, intellisensePanel.Width, intellisensePanel.Height - 3); + e.Graphics.DrawLine(new Pen(SystemColors.ControlDark, 0.1F), 0, intellisensePanel.Height - 1, intellisensePanel.Width, intellisensePanel.Height - 1); + } + void docPositionChanged(object sender, EventArgs e) + { + ErrorLineBookmark.Remove(); + RuntimeErrorBookmark.Remove(); + } + } +}*/ diff --git a/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.Designer.cs b/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.Designer.cs new file mode 100644 index 000000000..e195c572a --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.Designer.cs @@ -0,0 +1,51 @@ +namespace VisualPascalABC +{ + partial class BottomDockContentForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // BottomDockContentForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 273); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.HideOnClose = true; + this.Name = "BottomDockContentForm"; + this.TabText = "BottomDockContentForm"; + this.Text = "BottomDockContentForm"; + this.Activated += new System.EventHandler(this.BottomDockContentForm_Activated); + this.VisibleChanged += new System.EventHandler(this.BottomDockContentForm_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.cs b/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.cs new file mode 100644 index 000000000..765dfe130 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.cs @@ -0,0 +1,40 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + + +namespace VisualPascalABC +{ + public partial class BottomDockContentForm : DockContent + { + protected Form1 MainForm; + public BottomDockContentForm() + { + } + public BottomDockContentForm(Form1 MainForm) + { + this.MainForm = MainForm; + InitializeComponent(); + HideOnClose = true; + DockAreas |= DockAreas.DockBottom; + MainForm.BottomDockContent.Add(this); + } + + private void BottomDockContentForm_VisibleChanged(object sender, EventArgs e) + { + MainForm.UpdateOutputWindowVisibleButtons(); + } + + private void BottomDockContentForm_Activated(object sender, EventArgs e) + { + MainForm.BottomActiveContent = this; + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.resx b/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.resx new file mode 100644 index 000000000..d58980a38 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/BottomDockContentForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/CodeFileDocument.Designer.cs b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.Designer.cs new file mode 100644 index 000000000..4c1068b16 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.Designer.cs @@ -0,0 +1,102 @@ +namespace VisualPascalABC +{ + partial class CodeFileDocumentControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CodeFileDocumentControl)); + this.basePanel = new System.Windows.Forms.Panel(); + this.editorPanel = new System.Windows.Forms.Panel(); + this.TextEditor = new VisualPascalABC.CodeFileDocumentTextEditorControl(); + this.basePanel.SuspendLayout(); + this.editorPanel.SuspendLayout(); + this.SuspendLayout(); + // + // basePanel + // + this.basePanel.BackColor = System.Drawing.SystemColors.ButtonShadow; + this.basePanel.Controls.Add(this.editorPanel); + this.basePanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.basePanel.Location = new System.Drawing.Point(0, 1); + this.basePanel.Margin = new System.Windows.Forms.Padding(4); + this.basePanel.Name = "basePanel"; + this.basePanel.Size = new System.Drawing.Size(657, 586); + this.basePanel.TabIndex = 0; + // + // editorPanel + // + this.editorPanel.BackColor = System.Drawing.SystemColors.Control; + this.editorPanel.Controls.Add(this.TextEditor); + this.editorPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.editorPanel.Location = new System.Drawing.Point(0, 0); + this.editorPanel.Margin = new System.Windows.Forms.Padding(4); + this.editorPanel.Name = "editorPanel"; + this.editorPanel.Size = new System.Drawing.Size(657, 586); + this.editorPanel.TabIndex = 5; + // + // TextEditor + // + this.TextEditor.CaretColumn = 0; + this.TextEditor.CaretLine = 0; + this.TextEditor.Dock = System.Windows.Forms.DockStyle.Fill; + this.TextEditor.Location = new System.Drawing.Point(0, 0); + this.TextEditor.Margin = new System.Windows.Forms.Padding(4); + this.TextEditor.Name = "TextEditor"; + this.TextEditor.Size = new System.Drawing.Size(657, 586); + this.TextEditor.TabIndent = 4; + this.TextEditor.TabIndex = 0; + // + // CodeFileDocumentControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(657, 587); + this.Controls.Add(this.basePanel); + this.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document; + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4); + this.Name = "CodeFileDocumentControl"; + this.Padding = new System.Windows.Forms.Padding(0, 1, 0, 0); + this.ShowIcon = false; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CodeFileDocumentControl_FormClosing); + this.Shown += new System.EventHandler(this.CodeFileDocumentControl_Activated); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.CodeFileDocumentControl_Paint); + this.basePanel.ResumeLayout(false); + this.editorPanel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel basePanel; + private System.Windows.Forms.Panel editorPanel; + public CodeFileDocumentTextEditorControl TextEditor; + } +} diff --git a/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs new file mode 100644 index 000000000..e465b9fc7 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.cs @@ -0,0 +1,822 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using System.IO; +using WeifenLuo.WinFormsUI.Docking; +using System.Reflection; +using System.Runtime.Serialization.Formatters.Binary; + +//using ICSharpCode.FormsDesigner.Services; +//using ICSharpCode.FormsDesigner; +//using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; + +namespace VisualPascalABC +{ + public partial class CodeFileDocumentControl : DockContent, VisualPascalABCPlugins.ICodeFileDocument + { + const string xml_extension = "xml"; + + Form1 MainForm=null; + string _file_name; + public string FileName + { + get + { + return _file_name; + } + set + { + _file_name = value; + TextEditor.FileName = value; + } + } + internal bool FromMetadata = false; + internal bool DocumentChanged = false; + internal bool Run = false; + internal bool DocumentSavedToDisk = false; + + public event EventHandler PositionChanged; + + public CodeFileDocumentControl(Form1 MainForm) + { + this.MainForm = MainForm; + InitializeComponent(); + TextEditor.MainForm = MainForm; + try + { + if (MainForm.UserOptions.CurrentFontFamily == null) + TextEditor.Font = new Font(TextEditor.Font.FontFamily, MainForm.UserOptions.EditorFontSize); + else + TextEditor.Font = new Font(new FontFamily(MainForm.UserOptions.CurrentFontFamily), MainForm.UserOptions.EditorFontSize); + } + catch + { + + } + //TextEditor.Dock = System.Windows.Forms.DockStyle.Fill; + TextEditor.ShowEOLMarkers = false; + TextEditor.ShowSpaces = false; + TextEditor.ShowTabs = false; + TextEditor.ShowInvalidLines = false; + TextEditor.IsIconBarVisible = true; + TextEditor.ShowLineNumbers = MainForm.UserOptions.ShowLineNums; + TextEditor.EnableFolding = MainForm.UserOptions.EnableFolding; // SSM 4.09.08 + +// TextEditor.EnableFolding = MainForm.UserOptions.ShowLineNums; + TextEditor.ShowMatchingBracket = MainForm.UserOptions.ShowMathBraket; + TextEditor.ActiveTextAreaControl.TextArea.MouseClick += new MouseEventHandler(edit_MouseClick); + TextEditor.Document.DocumentChanged += new ICSharpCode.TextEditor.Document.DocumentEventHandler(Document_DocumentChanged); + TextEditor.ActiveTextAreaControl.SelectionManager.SelectionChanged += new EventHandler(SelectionManager_SelectionChanged); + TextEditor.ActiveTextAreaControl.TextArea.Caret.PositionChanged += new EventHandler(Caret_PositionChanged); + TextEditor.ContextMenuStrip = MainForm.cmEditor; + //TextEditor.Tag = this; + TextEditor.TextEditorProperties.IndentStyle = ICSharpCode.TextEditor.Document.IndentStyle.Smart; + TextEditor.TextEditorProperties.ConvertTabsToSpaces = true; + TextEditor.TextEditorProperties.TabIndent = MainForm.UserOptions.TabIndent; + TextEditor.TextEditorProperties.IndentationSize = MainForm.UserOptions.TabIndent; + //TextEditor.Encoding = System.Text.Encoding.Default; + TextEditor.Encoding = System.Text.Encoding.GetEncoding(1251); + //this.Dock = DockStyle.Fill; + } + + public string EXEFileName + { + get + { + if (ProjectFactory.Instance.ProjectLoaded) + return Path.ChangeExtension(ProjectFactory.Instance.CurrentProject.Path,".exe"); + return Path.ChangeExtension(FileName, ".exe"); + } + } + + void edit_MouseClick(object sender, MouseEventArgs e) + { + this.TextEditor.ContextMenuStrip = MainForm.cmEditor; + MainForm.NavigationLocationChanged(); + } + + public float FontSize + { + get + { + return TextEditor.Font.Size; + } + set + { + TextEditor.Font = new Font(TextEditor.Font.FontFamily, value); + } + } + + public void LoadFromFile(string FileName) + { + TextEditor.LoadFile(FileName); + } + + //меняем стратегию подсведки в соответсвии с расширением файла + public void SetHighlightingStrategyForFile(string ForFile) + { + TextEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingManager.Manager.FindHighlighterForFile(ForFile); + } + + + void SelectionManager_SelectionChanged(object sender, EventArgs e) + { + MainForm.SynEdit_SelectionChanged(sender); + } + + string VisualPascalABCPlugins.ICodeFileDocument.FileName + { + get + { + return this.FileName; + } + } + + ICSharpCode.TextEditor.TextEditorControl VisualPascalABCPlugins.ICodeFileDocument.TextEditor + { + get + { + return TextEditor; + } + } + + public Point CaretPosition + { + get + { + return new Point(TextEditor.CaretColumn + 1, TextEditor.CaretLine + 1); + } + set + { + //TextEditor.ActiveTextAreaControl as SharpDevelopTextAreaControl; + TextEditor.SetFocus(); + TextEditor.CaretLine = value.Y - 1; + TextEditor.CaretColumn = value.X - 1; + } + } + public int LinesCount + { + get + { + return TextEditor.ActiveTextAreaControl.Document.LineSegmentCollection.Count; + } + } + + void Caret_PositionChanged(object sender, EventArgs e) + { + MainForm.UpdateLineColPosition(); + } + + public void SetHighlighting(string filename) + { + TextEditor.SetHighlighting(filename); + } + + public void Document_DocumentChanged(object sender, ICSharpCode.TextEditor.Document.DocumentEventArgs e) + { + MainForm.SynEdit_ChangeText(sender, this); + lastChanges = DateTime.Now; + } + + public void Cut() + { + ICSharpCode.TextEditor.Actions.Cut cut = new ICSharpCode.TextEditor.Actions.Cut(); + cut.Execute(TextEditor.ActiveTextAreaControl.TextArea); + //ConvertCurrentClipboardData(); + } + + private void ConvertCurrentClipboardData() + { + IDataObject dataObject = Clipboard.GetDataObject(); + string[] formats = dataObject.GetFormats(); + IDataObject dataNew = new DataObject(); + foreach (string format in formats) + { + object data = dataObject.GetData(format); + if (data is string) + dataNew.SetData(format, ConvertToWin1251((string)data)); + } + Clipboard.Clear(); + Clipboard.SetDataObject(dataNew); + } + + private object ConvertToWin1251(string str) + { + //return str.Replace("абс", "\'e0\'e1\'f1"); + return str; + } + + + public void Copy() + { + ICSharpCode.TextEditor.Actions.Copy copy = new ICSharpCode.TextEditor.Actions.Copy(); + copy.Execute(TextEditor.ActiveTextAreaControl.TextArea); + //ConvertCurrentClipboardData(); + } + + public void Paste(bool canInsertInInputBox) + { + if (MainForm.OutputWindow != null && MainForm.OutputWindow.InputTextBox != null && + MainForm.OutputWindow.InputTextBox.Focused && canInsertInInputBox) + { + MainForm.OutputWindow.InputTextBox.Paste(); + return; + } + ICSharpCode.TextEditor.Actions.Paste paste = new ICSharpCode.TextEditor.Actions.Paste(); + paste.Execute(TextEditor.ActiveTextAreaControl.TextArea); + } + + public void SetText(string text) + { + TextEditor.ActiveTextAreaControl.Document.Remove(0, TextEditor.ActiveTextAreaControl.Document.TextLength); + TextEditor.ActiveTextAreaControl.Document.Insert(0, text); + //TextEditor.ActiveTextAreaControl.Document.TextContent = text; + TextEditor.ActiveTextAreaControl.Document.CommitUpdate(); + } + + public void SelectAll() + { + (new ICSharpCode.TextEditor.Actions.SelectWholeDocument()).Execute(TextEditor.ActiveTextAreaControl.TextArea); + } + + public void DeselectAll() + { + (new ICSharpCode.TextEditor.Actions.ClearAllSelections()).Execute(TextEditor.ActiveTextAreaControl.TextArea); + } + + public void Delete() + { + (new ICSharpCode.TextEditor.Actions.Delete()).Execute(TextEditor.ActiveTextAreaControl.TextArea); + } + + public bool CanUndo + { + get { return TextEditor.Document.UndoStack.CanUndo; } + } + public bool CanRedo + { + get { return TextEditor.Document.UndoStack.CanRedo; } + } + public bool TextSelected + { + get { return TextEditor.ActiveTextAreaControl.SelectionManager.SelectedText != string.Empty; } + } + public string SelectedText + { + get { return TextEditor.ActiveTextAreaControl.SelectionManager.SelectedText; } + } + private DateTime lastChanges; + + public DateTime ModifyDateTime + { + get + { + if (this.DocumentChanged) + return lastChanges; + if (File.Exists(this.FileName)) + return File.GetLastWriteTime(this.FileName); + return DateTime.Now; + + } + } + + public static bool AcceptAllBookmarks(ICSharpCode.TextEditor.Document.Bookmark mark) + { + return true; + } + + public void ToggleBookmark() + { + (new ICSharpCode.TextEditor.Actions.ToggleBookmark()).Execute(TextEditor.ActiveTextAreaControl.TextArea); + } + public void CenterView() + { + TextEditor.ActiveTextAreaControl.Update(); + TextEditor.ActiveTextAreaControl.CenterViewOn(TextEditor.ActiveTextAreaControl.Caret.Line, 0); + } + public void NextBookmark() + { + (new ICSharpCode.TextEditor.Actions.GotoNextBookmark(AcceptAllBookmarks)).Execute(TextEditor.ActiveTextAreaControl.TextArea); + CenterView(); + } + public void PrevBookmark() + { + (new ICSharpCode.TextEditor.Actions.GotoPrevBookmark(AcceptAllBookmarks)).Execute(TextEditor.ActiveTextAreaControl.TextArea); + CenterView(); + } + public void ClearAllBookmarks() + { + (new ICSharpCode.TextEditor.Actions.ClearAllBookmarks(AcceptAllBookmarks)).Execute(TextEditor.ActiveTextAreaControl.TextArea); + } + + private void CodeFileDocumentControl_FormClosing(object sender, FormClosingEventArgs e) + { + e.Cancel = true; + if (MainForm.OpenDocuments.Count == 1 && e.CloseReason == CloseReason.UserClosing) + return; + if (e.CloseReason == CloseReason.MdiFormClosing) + return; + MainForm.CloseFile(this); + } + + private void CodeFileDocumentControl_Activated(object sender, EventArgs e) + { + //if (Designer != null) + // FormsDesignerViewContent.PropertyPad.SetActiveContainer(Designer.PropertyContainer); + MainForm._currentCodeFileDocument = this; + if (FileName != null) + MainForm.ChangedSelectedTab(); + else + MainForm.SetFocusToEditor(); + } + + //ssyy + public TabControl DesignerAndCodeTabs = null; + public TabPage TextPage = null; + public TabPage DesignerPage = null; + //internal FormsDesignerViewContent Designer = null; + //string XMLCode = null; + public string FormName = "Form1"; + public bool FirstCodeGeneration = false; + + //ssyy взводит кнопки "сохраниить" и "сохранить всё" + public void SetDocumentChanged() + { + DocumentChanged = true; + MainForm.UpdateSaveButtonsEnabled(); + } + + public void AddDesigner(string FormFileName) + { + FirstCodeGeneration = FormFileName == null; + if (DesignerAndCodeTabs != null) return; + DesignerAndCodeTabs = new TabControl(); + DesignerAndCodeTabs.Visible = false; + Controls.Add(DesignerAndCodeTabs); + DesignerAndCodeTabs.Dock = DockStyle.Fill; + DesignerAndCodeTabs.TabPages.Add(PascalABCCompiler.StringResources.Get("VP_MF_M_FORM_TAB")); + DesignerAndCodeTabs.TabPages.Add(PascalABCCompiler.StringResources.Get("VP_MF_M_PROGRAM_TAB")); + DesignerPage = DesignerAndCodeTabs.TabPages[0]; + TextPage = DesignerAndCodeTabs.TabPages[1]; + Controls.Remove(basePanel); + TextPage.Controls.Add(basePanel); + //MainForm.AddToolBox(); + MainForm.AddPropertiesWindow(); + //Designer = new FormsDesignerViewContent(this); + //Designer.LoadDesigner(FormFileName); + DesignerAndCodeTabs.SelectedIndexChanged += tabControl_SelectedIndexChanged; + //Designer.Modify += SetDocumentChanged; + //Control designerSurface = Designer.DesignSurface.View as Control; + //designerSurface.Dock = DockStyle.Fill; + //DesignerPage.Controls.Add(designerSurface); + //FormsDesignerViewContent.PropertyPad.SetActiveContainer(Designer.PropertyContainer); + DesignerAndCodeTabs.Show(); + //MainForm.UpdateDesignerIsActive(); + //MainForm.UpdateUndoRedoEnabled(); //roman// + } + + /*public void GenerateDesignerCode(EventDescription ev) + { + if (ev != null) + { + Designer.IsDirty = true; + } + if (Designer.IsDirty) //roman// + { + Designer.ResetGeneratedCode(); + /*Designer.loader.file_name = Path.GetFileNameWithoutExtension(_file_name); + Designer.loader.form_name = FormName; + Designer.loader.Flush(); + Designer.DesignSurface.Flush(); + string code = Designer.GeneratedCode; + if (code != null) + { + string gen_code = code; + string new_code = BuildCode(TextEditor.Text, gen_code, ev); + if (new_code != null) + { + TextEditor.Text = new_code; + } + //XMLCode = Designer.generatedCode.XMLCode; + } + } + }*/ + + /*public void GenerateMainProgram(string MainUnitName, string MainFormName) + { + TextEditor.Text = String.Format(string_consts.main_designer_program, MainUnitName, MainFormName); + } + + public void SaveFormFile(string PasFileName) + { + if (Designer == null || Designer.CodeCompileUnit == null) return; + try + { + string FormFileName = Path.ChangeExtension(PasFileName, string_consts.xml_form_extention); + FileStream fs = new FileStream(FormFileName, FileMode.Create); + BinaryFormatter formatter = new BinaryFormatter(); + formatter.Serialize(fs, Designer.CodeCompileUnit); + fs.Close(); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Error saving form file", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + }*/ + + public void tabControl_SelectedIndexChanged(object sender, System.EventArgs e) + { + // If the tab is changing, that means we'd better let the loader know it needs + // to flush changes that have been made and update the code windows. + // + //MainForm.UpdateDesignerIsActive(); + //GenerateDesignerCode(null); + //roman// + MainForm.UpdateUndoRedoEnabled(); + } + + public static string BuildName(List names) + { + if (names == null || names.Count == 0) + return null; + string rez = names[0].name; + for (int i = 1; i < names.Count; ++i) + { + rez += "." + names[i].name; + } + return rez; + } + + /*public string BuildCode(string existing_text, string generated_text, EventDescription event_description) + { + if (FirstCodeGeneration) + { + FirstCodeGeneration = false; + string form_name = (Designer.Host.RootComponent as Control).Name; + if (form_name == "Form1") + { + + } + string beg = string.Format(string_consts.begin_unit, + Path.GetFileNameWithoutExtension(_file_name), (Designer.Host.RootComponent as Control).Name); + existing_text = beg + generated_text + string_consts.end_unit; + TextEditor.Text = existing_text; + if (event_description == null) + { + return existing_text; //beg + generated_text + SampleDesignerHost.string_consts.end_unit; + } + } + //StringBuilder sb = new StringBuilder(existing_text); //TextEditor.Text); + string[] sep = new string[1]{string_consts.nr}; + string[] lines = existing_text.Split(sep, StringSplitOptions.None); + int count = lines.Length; + int s_num = 0; + string trimed; + //int end_region_num; + while (s_num < count) + { + trimed = lines[s_num].TrimStart(' ','\t'); + if (trimed.StartsWith(string_consts.begin_designer_region, StringComparison.InvariantCultureIgnoreCase)) + { + break; + } + s_num++; + } + if (s_num == count) + { + MessageDesignerCodeGenerationFailed(); + return null; + } + int e_num = s_num + 1; + while (e_num < count) + { + trimed = lines[e_num].TrimStart(' ', '\t'); + if (trimed.StartsWith(string_consts.end_designer_region, StringComparison.InvariantCultureIgnoreCase)) + { + break; + } + e_num++; + } + if (e_num == count) + { + MessageDesignerCodeGenerationFailed(); + return null; + } + List Errors = new List(); + List Warnings = new List(); + //PascalABCCompiler.SyntaxTree.syntax_tree_node sn = + // MainForm.VisualEnvironmentCompiler.Compiler.ParsersController.Compile( + // FileName, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal); + PascalABCCompiler.SyntaxTree.compilation_unit sn = + CodeCompletion.CodeCompletionController.ParsersController.GetCompilationUnit( + VisualPABCSingleton.MainForm._currentCodeFileDocument.FileName, + existing_text, //VisualPascalABC.Form1.Form1_object._currentCodeFileDocument.TextEditor.Text, + Errors, + Warnings); + PascalABCCompiler.SyntaxTree.unit_module um = sn as PascalABCCompiler.SyntaxTree.unit_module; + bool good_syntax = um != null; + PascalABCCompiler.SyntaxTree.type_declaration form_decl = null; + if (good_syntax) + { + good_syntax = um.implementation_part != null && + um.interface_part != null && + um.interface_part.interface_definitions != null && + um.interface_part.interface_definitions.defs != null && + um.interface_part.interface_definitions.defs.Count > 0; + } + if (good_syntax) + { + foreach (PascalABCCompiler.SyntaxTree.declaration decl in um.interface_part.interface_definitions.defs) + { + PascalABCCompiler.SyntaxTree.type_declarations tdecls = decl as PascalABCCompiler.SyntaxTree.type_declarations; + if (tdecls != null) + { + foreach (PascalABCCompiler.SyntaxTree.type_declaration tdecl in tdecls.types_decl) + { + if (tdecl.source_context.begin_position.line_num - 1 < s_num && + tdecl.source_context.end_position.line_num - 1 > e_num) + { + form_decl = tdecl; + } + } + } + } + } + PascalABCCompiler.SyntaxTree.class_definition form_def = null; + if (form_decl != null) + { + form_def = form_decl.type_def as PascalABCCompiler.SyntaxTree.class_definition; + } + if (form_decl == null || form_def == null || form_def.body == null) + { + MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_CODE_GENERATION_UNSUCCEFULL"), + PascalABCCompiler.StringResources.Get("VP_MF_FORM_DESIGNER"), + MessageBoxButtons.OK, MessageBoxIcon.Warning); + return null; + } + else + { + string old_form_name = form_decl.type_name.name; + string new_form_name = (Designer.Host.RootComponent as Control).Name; + bool implementation_not_null = + um.implementation_part.implementation_definitions != null && + um.implementation_part.implementation_definitions.defs != null && + um.implementation_part.implementation_definitions.defs.Count > 0; + if (new_form_name != old_form_name) + { + ReplaceName(form_decl.type_name, new_form_name, lines); + if (implementation_not_null) + { + foreach (PascalABCCompiler.SyntaxTree.declaration decl in + um.implementation_part.implementation_definitions.defs) + { + PascalABCCompiler.SyntaxTree.procedure_definition pd = decl as PascalABCCompiler.SyntaxTree.procedure_definition; + if (pd != null) + { + if (pd.proc_header.name.class_name != null && + string.Compare(pd.proc_header.name.class_name.name, old_form_name, true) == 0) + { + ReplaceName(pd.proc_header.name.class_name, new_form_name, lines); + } + } + } + } + } + if (event_description != null) + { + MethodInfo mi = event_description.e.EventType.GetMethod( + PascalABCCompiler.TreeConverter.compiler_string_consts.invoke_method_name); + ParameterInfo[] pinfos = mi.GetParameters(); + bool handler_found = false; + + event_description.editor = TextEditor; + System.Text.RegularExpressions.MatchCollection matches = + System.Text.RegularExpressions.Regex.Matches(generated_text, string_consts.nr); + //строка, на которой последнее описание из секции реализаций + PascalABCCompiler.SyntaxTree.file_position last_defs_pos = null; + if (implementation_not_null) + { + last_defs_pos = um.implementation_part.implementation_definitions.defs[ + um.implementation_part.implementation_definitions.defs.Count - 1 + ].source_context.end_position; + + //Ищем описание обработчика + foreach (PascalABCCompiler.SyntaxTree.declaration decl in + um.implementation_part.implementation_definitions.defs) + { + PascalABCCompiler.SyntaxTree.procedure_definition pd = decl as PascalABCCompiler.SyntaxTree.procedure_definition; + if (pd == null) + { + continue; + } + if (pd.proc_header.name == null || pd.proc_header.name.class_name == null || //roman// + String.Compare(pd.proc_header.name.class_name.name, new_form_name, true) != 0 || + String.Compare(pd.proc_header.name.meth_name.name, event_description.EventName, true) != 0) + { + continue; + } + List syn_pars = + pd.proc_header.parameters.params_list; + bool should_continue = false; + int par_count = syn_pars.Count; + if (par_count != pinfos.Length) + { + continue; + } + for (int i = 0; i < par_count; ++i) + { + if (syn_pars[i].idents.idents.Count != 1) + { + should_continue = true; + break; + } + PascalABCCompiler.SyntaxTree.named_type_reference ntr = + syn_pars[i].vars_type as PascalABCCompiler.SyntaxTree.named_type_reference; + if (ntr == null || syn_pars[i].param_kind != PascalABCCompiler.SyntaxTree.parametr_kind.none) + { + should_continue = true; + break; + } + string syn_name = BuildName(ntr.names); + if (String.Compare(syn_name, pinfos[i].ParameterType.Name) != 0 && + String.Compare(syn_name, pinfos[i].ParameterType.FullName) != 0) + { + should_continue = true; + break; + } + } + if (should_continue) + { + continue; + } + handler_found = true; + event_description.line_num = pd.proc_body.source_context.begin_position.line_num + + matches.Count + s_num - e_num + 2; + //last_defs_pos.line_num + s_num - e_num + matches.Count + 7; + event_description.column_num = pd.proc_body.source_context.begin_position.column_num; + } + } + else + { + last_defs_pos = um.implementation_part.source_context.end_position; + } + if (!handler_found) + { + string new_event = event_description.EventName; + if (pinfos.Length != 0) + { + new_event += "("; + new_event += pinfos[0].Name + ": " + pinfos[0].ParameterType.FullName.Replace("System.Windows.Forms.","").Replace("System.",""); + for (int i = 1; i < pinfos.Length; ++i) + { + new_event += "; "; + new_event += pinfos[i].Name + ": " + pinfos[i].ParameterType.FullName.Replace("System.Windows.Forms.", "").Replace("System.", ""); + } + new_event += ")"; + } + new_event += ";"; + string new_event_header = new_event; + new_event = string_consts.nr + string_consts.nr + "procedure " + new_form_name + "." + new_event; + new_event += string_consts.nr + "begin" + + string_consts.nr + " " + string_consts.nr + + "end;"; + event_description.column_num = 3; + event_description.line_num = last_defs_pos.line_num + s_num - e_num + matches.Count + 7; + lines[last_defs_pos.line_num - 1] = lines[last_defs_pos.line_num - 1].Insert(last_defs_pos.column_num, new_event); + //Добавляем заголовок события + //int last_form_member_line = form_def.body.class_def_blocks[form_def.body.class_def_blocks.Count - 1].source_context.end_position.line_num - 1; + lines[s_num] = string_consts.event_handler_header_trim + + "procedure " + new_event_header + + string_consts.nr + lines[s_num]; + } + } + } + //generated_text = SampleDesignerHost.string_consts.tab + "private" + + // SampleDesignerHost.string_consts.nr + generated_text; + string s1 = string.Join(string_consts.nr, lines, 0, s_num + 1); + string s2 = string.Join(string_consts.nr, lines, e_num, lines.Length - e_num); + return s1 + string_consts.nr + string_consts.tab + + "internal" + string_consts.nr + + string_consts.tab2 + generated_text + s2; + }*/ + + public void ReplaceName(PascalABCCompiler.SyntaxTree.ident id, string new_name, string[] lines) + { + PascalABCCompiler.SyntaxTree.SourceContext sc = id.source_context; + int type_name_num = sc.begin_position.line_num - 1; + int bcol = sc.begin_position.column_num; + int ecol = sc.end_position.column_num; + string s = lines[type_name_num].Remove(bcol - 1, ecol - bcol + 1); + lines[type_name_num] = s.Insert(bcol - 1, new_name); + } + + public void MessageDesignerCodeGenerationFailed() + { + MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_CAN_NOT_GENERATE_CODE"), + PascalABCCompiler.StringResources.Get("VP_MF_FORM_DESIGNER"), + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + + #region ICodeFileDocument Member + + + string VisualPascalABCPlugins.ICodeFileDocument.EXEFileName + { + get { + return this.EXEFileName; + } + } + + int VisualPascalABCPlugins.ICodeFileDocument.LinesCount + { + get { + return this.LinesCount; + } + } + + string VisualPascalABCPlugins.ICodeFileDocument.Text + { + get + { + return this.Text; + } + set + { + this.Text = value; + } + } + + bool VisualPascalABCPlugins.ICodeFileDocument.FromMetadata + { + get { + return this.FromMetadata; + } + } + + bool VisualPascalABCPlugins.ICodeFileDocument.DocumentChanged + { + get { + return this.DocumentChanged; + } + } + + string VisualPascalABCPlugins.ICodeFileDocument.ToolTipText + { + get + { + return this.ToolTipText; + } + set + { + this.ToolTipText = value; + } + } + + bool VisualPascalABCPlugins.ICodeFileDocument.Run + { + get { + return this.Run; + } + set + { + this.Run = value; + } + } + + + + #endregion + + private void CodeFileDocumentControl_Paint(object sender, PaintEventArgs e) + { + MainForm._currentCodeFileDocument = this; + if (FileName != null) + MainForm.ChangedSelectedTab(); + else + MainForm.SetFocusToEditor(); + } + } + + public class HideBottomTabs : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public HideBottomTabs() + { + } + public override void Execute(ICSharpCode.TextEditor.TextArea textArea) + { + var MainForm = (textArea.MotherTextEditorControl as CodeFileDocumentTextEditorControl).MainForm; + MainForm.HideBottomPanel(); + // (textArea.MotherTextEditorControl as CodeFileDocumentTextEditorControl).MainForm.BottomTabsVisible = false; + } + } + +} diff --git a/VisualPascalABCNETLinux/DockContent/CodeFileDocument.resx b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.resx new file mode 100644 index 000000000..fef479e97 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CodeFileDocument.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAABSW13/KDU5/yg1Of8oNTn/KDU5/yg1Of8oNTn/KDU5/yg1Of8oNTn/KDU5/yg1 + Of8oNTn/KDU5/wAAAAAAAAAAfIyQ/7LGyv+yxsr///////////////////////////////////////// + /////////////yg1Of8AAAAAAAAAAHyMkP+yxsr/ssbK//////////////////////////////////// + //////////////////8oNTn/AAAAAAAAAAB8jJD/ssbK/7LGyv//////AAAA/wAAAP8AAAD///////// + ////////////////////////KDU5/wAAAAAAAAAAfIyQ/7LGyv+yxsr///////////////////////// + /////////////////////////////yg1Of8AAAAAAAAAAHyMkP+yxsr/ssbK/////////////////6ys + rP+srKz/rKys/6ysrP+srKz///////////8oNTn/AAAAAAAAAAB8jJD/ssbK/7LGyv////////////// + ////////////////////////////////////////KDU5/wAAAAAAAAAAfIyQ/7LGyv+yxsr///////// + /////////yQA//8kAP//JAD//////6ysrP+srKz//////yg1Of8AAAAAAAAAAHyMkP+yxsr/ssbK//// + //////////////////////////////////////////////////8oNTn/AAAAAAAAAAB8jJD/ssbK/7LG + yv//////AAAA/wAAAP8AAAD/AAAA//////+srKz/rKys/6ysrP//////KDU5/wAAAAAAAAAAfIyQ/7LG + yv+yxsr//////////////////////////////////////////////////////yg1Of8AAAAAAAAAAHyM + kP+yxsr/ssbK//////////////////////////////////////////////////////8oNTn/AAAAAAAA + AAB8jJD/fIyQ/3yMkP98jJD/fIyQ/3yMkP98jJD/fIyQ/3yMkP98jJD/fIyQ/3yMkP98jJD/KDU5/wAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAP//AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIAB + AACAAQAA//8AAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.cs b/VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.cs new file mode 100644 index 000000000..bb1601c41 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.cs @@ -0,0 +1,265 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.Drawing; +using ICSharpCode.TextEditor.Document; + +namespace VisualPascalABC +{ + public class CodeFileDocumentTextEditorControl : ICSharpCode.TextEditor.TextEditorControl, VisualPascalABCPlugins.ITextEditorControl + { + internal Form1 MainForm; + internal QuickClassBrowserPanel quickClassBrowserPanel; + internal Panel TextAreaPanel + { + get { return textAreaPanel; } + } + private Panel intellisensePanel; + public CodeFileDocumentTextEditorControl() + { + editactions[Keys.Space | Keys.Control] = new CodeCompletionAllNamesAction(); + editactions[Keys.Space | Keys.Shift] = new CodeCompletionNamesOnlyInModuleAction(); + editactions[Keys.Enter | Keys.Control] = new GotoAction(); + editactions[Keys.LButton | Keys.Control] = new GotoAction(); + editactions[Keys.C | Keys.Shift | Keys.Control] = new ClassOrMethodRealizationAction(); + editactions[Keys.Space | Keys.Shift | Keys.Control] = new VirtualMethodsAction(); + editactions[Keys.I | Keys.Shift | Keys.Control] = new GenerateMethodImplementationHeadersAction(); + editactions[Keys.F5 | Keys.Control] = new AddToWatchAction(); + editactions[Keys.F | Keys.Shift | Keys.Control] = new CodeFormattingAction(); + editactions[Keys.Control | Keys.Y] = new ICSharpCode.TextEditor.Actions.DeleteLine(); + editactions[Keys.Escape] = new HideBottomTabs(); + quickClassBrowserPanel = new QuickClassBrowserPanel(this); + quickClassBrowserPanel.VisibleChanged += new EventHandler(quickClassBrowserPanel_VisibleChanged); + if (VisualPABCSingleton.MainForm != null) + { + quickClassBrowserPanel.Visible = VisualPABCSingleton.MainForm.UserOptions.ShowQuickClassBrowserPanel; + } + intellisensePanel = new Panel(); + quickClassBrowserPanel_VisibleChanged(null, null); + intellisensePanel.Dock = DockStyle.Top; + intellisensePanel.Controls.Add(quickClassBrowserPanel); + intellisensePanel.Paint += new PaintEventHandler(separatorPanel_Paint); + Document.FoldingManager.FoldingStrategy = new ParserFoldingStrategy(); + Controls.Add(intellisensePanel); + ActiveTextAreaControl.TextArea.Caret.PositionChanged += docPositionChanged; + this.ActiveTextAreaControl.TextArea.AllowDrop = true; + this.ActiveTextAreaControl.TextArea.DragEnter += textEditorDragEnter; + this.ActiveTextAreaControl.TextArea.DragDrop += textEditorDragDrop; + this.ActiveTextAreaControl.Document.LineDeleted += Document_LineDeleted; + } + + private void Document_LineDeleted(object sender, LineEventArgs e) + { + /*for (int i = 0; i < e.LineSegment.Words.Count; i++) + { + if (e.LineSegment.Words[i].SyntaxColor != null && e.LineSegment.Words[i].SyntaxColor.Color.Name == "Green") + { + e.Document.HighlightingStrategy.MarkTokens(e.Document); + e.Document.RequestUpdate(new ICSharpCode.TextEditor.TextAreaUpdate(ICSharpCode.TextEditor.TextAreaUpdateType.WholeTextArea)); + e.Document.CommitUpdate(); + return; + } + }*/ + } + + public void MarkForImmediateWindow() + { + editactions[Keys.Space | Keys.Control] = null; + editactions[Keys.Space | Keys.Shift] = null; + editactions[Keys.Enter | Keys.Control] = null; + editactions[Keys.LButton | Keys.ControlKey] = null; + editactions[Keys.C | Keys.Shift | Keys.Control] = null; + editactions[Keys.Space | Keys.Shift | Keys.Control] = null; + editactions[Keys.I | Keys.Shift | Keys.Control] = null; + editactions[Keys.F5 | Keys.Control] = null; + editactions[Keys.Control | Keys.Y] = null; + editactions[Keys.Escape] = null; + quickClassBrowserPanel = null; + ActiveTextAreaControl.TextArea.Caret.PositionChanged -= docPositionChanged; + this.ActiveTextAreaControl.TextArea.DragEnter -= textEditorDragEnter; + this.ActiveTextAreaControl.TextArea.DragDrop -= textEditorDragDrop; + //this.Font = new Font(new FontFamily(Constants.CompletionWindowCodeCompletionListViewFontName),8.5f); + editactions[Keys.Enter] = new ImmediateEvaluateAction(); + } + + //internal int DownSeparatorHeight = 3; + internal int DownSeparatorHeight = 2; + + delegate void invoke_delegate(); + + private void textEditorDragEnter(object sender, System.Windows.Forms.DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) + e.Effect = DragDropEffects.Copy; + else + e.Effect = DragDropEffects.None; + } + + private void textEditorDragDrop(object sender, System.Windows.Forms.DragEventArgs e) + { + string[] file_name = e.Data.GetData(DataFormats.FileDrop) as string[]; + if (file_name != null && file_name.Length>0) + { + if (string.Compare(System.IO.Path.GetExtension(file_name[0]),Constants.ProjectExtension,true)==0) + WorkbenchServiceFactory.ProjectService.OpenProject(file_name[0]); + else + WorkbenchServiceFactory.FileService.OpenFile(file_name[0], null); + } + } + + private void refresh_Folding() + { + ActiveTextAreaControl.TextArea.Refresh(ActiveTextAreaControl.TextArea.FoldMargin); + } + + public void UpdateFolding() + { + CodeCompletionParserController.open_files[this.FileName] = true; + } + + public void CollapseRegions() + { + foreach (FoldMarker marker in Document.FoldingManager.FoldMarker) + { + if (marker is RegionFoldMarker && !marker.IsFolded) + marker.IsFolded = true; + } + refresh_Folding(); + ActiveTextAreaControl.TextArea.Refresh(); + refresh_Folding(); + } + + public void UpdateFolding(object parseInfo, string fileName) + { + try + { + if (EnableFolding && fileName == this.FileName) + { + Document.FoldingManager.UpdateFoldings(fileName, parseInfo); + ActiveTextAreaControl.TextArea.Invoke(new invoke_delegate(refresh_Folding)); + } + } + catch + { + + } + } + + void quickClassBrowserPanel_VisibleChanged(object sender, EventArgs e) + { + if(quickClassBrowserPanel.Visible) + intellisensePanel.Size = new Size(1, quickClassBrowserPanel.Height + DownSeparatorHeight); + else + intellisensePanel.Size = new Size(1, DownSeparatorHeight); + } + + void separatorPanel_Paint(object sender, PaintEventArgs e) + { + //e.Graphics.DrawLine(new Pen(SystemColors.ControlDark, 0.1F), 0, intellisensePanel.Height - 3, intellisensePanel.Width, intellisensePanel.Height - 3); + e.Graphics.DrawLine(new Pen(SystemColors.ControlDark, 0.1F), 0, intellisensePanel.Height - 1, intellisensePanel.Width, intellisensePanel.Height - 1); + } + void docPositionChanged(object sender, EventArgs e) + { + ErrorLineBookmark.Remove(); + RuntimeErrorBookmark.Remove(); + } + + public void SetFocus() + { + this.ActiveTextAreaControl.TextArea.Focus(); + } + + public int CaretLine + { + get + { + return this.ActiveTextAreaControl.Caret.Line; + } + set + { + this.ActiveTextAreaControl.Caret.Line = value; + } + } + + public int CaretColumn + { + get + { + return this.ActiveTextAreaControl.Caret.Column; + } + set + { + this.ActiveTextAreaControl.Caret.Column = value; + } + } + + public void AddToolTipRequestHandler(ICSharpCode.TextEditor.ToolTipRequestEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.ToolTipRequest += handler; + } + + public void AddMouseMoveHandler(MouseEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.MouseMove += handler; + } + + public void AddKeyDownHandler(KeyEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.KeyDown += handler; + } + + public void AddMouseWheelHandler(MouseEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.MouseWheel += handler; + } + + public void AddMouseDownHandler(MouseEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.MouseDown += handler; + } + + public void RemoveToolTipRequestHandler(ICSharpCode.TextEditor.ToolTipRequestEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.ToolTipRequest -= handler; + } + + public void RemoveMouseMoveHandler(MouseEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.MouseMove -= handler; + } + + public void RemoveKeyDownHandler(KeyEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.KeyDown -= handler; + } + + public void RemoveMouseWheelHandler(MouseEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.MouseWheel -= handler; + } + + public void RemoveMouseDownHandler(MouseEventHandler handler) + { + this.ActiveTextAreaControl.TextArea.MouseDown -= handler; + } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // textAreaPanel + // + this.textAreaPanel.Size = new System.Drawing.Size(121, 118); + // + // CodeFileDocumentTextEditorControl + // + this.Name = "CodeFileDocumentTextEditorControl"; + this.Size = new System.Drawing.Size(121, 118); + this.ResumeLayout(false); + + } + } +} diff --git a/VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.resx b/VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CodeFileDocumentTextEditorControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.Designer.cs b/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.Designer.cs new file mode 100644 index 000000000..8cf90ac8c --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.Designer.cs @@ -0,0 +1,71 @@ +namespace VisualPascalABC +{ + partial class CompilerConsoleWindowForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CompilerConsoleWindowForm)); + this.CompilerConsole = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // CompilerConsole + // + this.CompilerConsole.BackColor = System.Drawing.Color.White; + this.CompilerConsole.Dock = System.Windows.Forms.DockStyle.Fill; + this.CompilerConsole.Font = new System.Drawing.Font("Courier New", 8.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.CompilerConsole.Location = new System.Drawing.Point(0, 0); + this.CompilerConsole.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.CompilerConsole.Multiline = true; + this.CompilerConsole.Name = "CompilerConsole"; + this.CompilerConsole.ReadOnly = true; + this.CompilerConsole.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.CompilerConsole.Size = new System.Drawing.Size(584, 525); + this.CompilerConsole.TabIndex = 1; + // + // CompilerConsoleWindowForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(584, 525); + this.Controls.Add(this.CompilerConsole); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.HideOnClose = true; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.Name = "CompilerConsoleWindowForm"; + this.TabText = "TP_COMPILERMESSAGES"; + this.Text = "TP_COMPILERMESSAGES"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox CompilerConsole; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.cs b/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.cs new file mode 100644 index 000000000..28cc17c04 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.cs @@ -0,0 +1,47 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class CompilerConsoleWindowForm : BottomDockContentForm, VisualPascalABCPlugins.ICompilerConsoleWindow + { + public CompilerConsoleWindowForm(Form1 MainForm) + :base(MainForm) + { + InitializeComponent(); + } + public void CompilerConsoleScrolToEnd() + { + CompilerConsole.SelectionStart = CompilerConsole.Text.Length; + CompilerConsole.ScrollToCaret(); + } + public void AppendTextToConsoleCompiler(object text) + { + CompilerConsole.AppendText(text as string); + } + + public void AddTextToCompilerMessages(string text) + { + //CompilerConsole.Invoke(new ParameterizedThreadStart(this.AppendTextToConsoleCompiler),new object[1]{text}); + AppendTextToConsoleCompiler(text); + CompilerConsoleScrolToEnd(); + //this.CompilerConsole.g + } + delegate void _noparamsdegeate(); + public void ClearConsole() + { + if (Visible) + this.BeginInvoke(new _noparamsdegeate(CompilerConsole.Clear)); + else + CompilerConsole.Clear(); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.resx b/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.resx new file mode 100644 index 000000000..4d58cea70 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/CompilerConsoleWindowForm.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADAqKD/YEgw/2BIMP9gSDD/YEgw/2BIMP9gSDD/YEgw/2BIMP9gSDD/YEgw/2BI + MP9gSDD/AAAAAAAAAAAAAAAAwKig///w8P/w2ND/4NDA/+DIwP/gwLD/4MCw/+DAsP/gwLD/4Liw/+C4 + oP/guKD/YEgw/wAAAAAAAAAAAAAAAMCooP//8PD///Dw///w4P//8OD//+jg///o4P//6OD//+jg///o + 0P//4ND/4Lig/2BIMP8AAAAAAAAAAAAAAADAqKD///jw///w8P/AqJD///Dg/8CYkP+wkID/sJCA/7CI + cP+wiHD//+jQ/+C4sP9gSDD/AAAAAAAAAAAAAAAAwLCg///48P//+PD///Dw///w8P//8OD///Dg///o + 4P//6OD//+jg///o4P/gwLD/YEgw/wAAAAAAAAAAAAAAAMCwoP//+PD///jw/9DAsP//+PD/0Liw/9Cw + oP/QsKD/wKiQ/8CgkP+wiHD/4MCw/2BIMP8AAAAAAAAAAAAAAADAsKD///jw///48P//+PD///jw///w + 8P//8PD///Dg///w4P//6OD//+jg/+DAsP9gSDD/AAAAAAAAAAAAAAAAwLCg///48P//+PD/0MCw///4 + 8P/QuLD/0LCg/9CwoP/AqJD/wKCQ/7CQgP/gwLD/YEgw/wAAAAAAAAAAAAAAANCwoP////////jw///4 + 8P//+PD///jw///48P//8PD///Dw///w4P//8OD/4Miw/2BIMP8AAAAAAAAAAAAAAADQsKD///////// + ///QwLD///jw/9C4sP/QsKD/0LCg/8CokP/AoJD//+jg/+DIwP9gSDD/AAAAAAAAAAAAAAAA0Lig//// + ///////////////48P//+PD///jw///48P//+PD///Dw///o4P/w2ND/cFBA/wAAAAAAAAAAAAAAANC4 + oP////////////////////////jw///48P//+PD///jw///48P//8PD/8ODQ/2BQQP8AAAAAAAAAAAAA + AADQuKD/0Lig/9C4oP/QsKD/0LCg/8CwoP/AsKD/wLCg/8CwoP/AqKD/wKig/8CooP/AqKD/AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMAB + AAD//wAA//8AAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.Designer.cs b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.Designer.cs new file mode 100644 index 000000000..6da31c697 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.Designer.cs @@ -0,0 +1,69 @@ +namespace VisualPascalABC +{ + partial class DebugVariablesListWindowForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugVariablesListWindowForm)); + this.watchList = new AdvancedDataGridView.TreeGridView(); + ((System.ComponentModel.ISupportInitialize)(this.watchList)).BeginInit(); + this.SuspendLayout(); + // + // watchList + // + this.watchList.Dock = System.Windows.Forms.DockStyle.Fill; + this.watchList.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.watchList.ImageList = null; + this.watchList.Location = new System.Drawing.Point(0, 0); + this.watchList.Name = "watchList"; + this.watchList.Size = new System.Drawing.Size(292, 273); + this.watchList.TabIndex = 0; + // + // DebugVariablesListWindowForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 273); + this.Controls.Add(this.watchList); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.HideOnClose = true; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "DebugVariablesListWindowForm"; + this.TabText = "TP_VARLIST"; + this.Text = "TP_VARLIST"; + ((System.ComponentModel.ISupportInitialize)(this.watchList)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + internal AdvancedDataGridView.TreeGridView watchList; + + + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs new file mode 100644 index 000000000..416d4bcf2 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs @@ -0,0 +1,259 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class DebugVariablesListWindowForm : BottomDockContentForm + { + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn4; + private AdvancedDataGridView.TreeGridColumn WColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn5; + + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn6Empty; + + public DebugVariablesListWindowForm(Form1 MainForm) + :base(MainForm) + { + InitializeComponent(); + localVarsWindow = this; + + this.WColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.WColumn1 = new AdvancedDataGridView.TreeGridColumn(); + this.WColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.WColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.WColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.WColumn6Empty = new System.Windows.Forms.DataGridViewTextBoxColumn(); + + this.watchList.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.watchList.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders; + this.watchList.BackgroundColor = System.Drawing.Color.White; + this.watchList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.watchList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.WColumn1, + this.WColumn3, + this.WColumn2, + this.WColumn6Empty + }); + this.watchList.Dock = System.Windows.Forms.DockStyle.Fill; + this.watchList.GridColor = System.Drawing.SystemColors.Control; + this.watchList.Location = new System.Drawing.Point(1, 1); + this.watchList.MultiSelect = false; + this.watchList.Font = new Font("Tahoma", 8); + this.watchList.BorderStyle = BorderStyle.None; + this.watchList.ReadOnly = true; + this.watchList.RowHeadersVisible = false; + this.watchList.RowTemplate.Height = 24; + this.watchList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.watchList.Size = new System.Drawing.Size(782, 121); + this.watchList.TabIndex = 0; + //this.watchList.CellValueChanged += RefreshWatchDel;//delegate(object sender, DataGridViewCellEventArgs e) { RefreshWatch(); }; + //this.watchList.CellEndEdit += delegate(object sender, DataGridViewCellEventArgs e) { RefreshRow(e.RowIndex); }; + //this.watchList.CellClick += CellClickDel; + //this.watchList.CellDoubleClick += CellDblClickDel; + this.watchList._imageList = CodeCompletionProvider.ImagesProvider.ImageList; + this.watchList.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.watchList.ShowLines = true; + //this.watchList.Nodes.Add(new AdvancedDataGridView.TreeGridNode()); + //this.dataGridView1.ClientSizeChanged += new System.EventHandler(this.dataGridView1_ClientSizeChanged); + //this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); + //this.dataGridView1.SizeChanged += new System.EventHandler(this.dataGridView1_SizeChanged); + //this.dataGridView1.Paint += new System.Windows.Forms.PaintEventHandler(this.dataGridView1_Paint); + //this.dataGridView1.Resize += new System.EventHandler(this.dataGridView1_Resize); + + + this.WColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.WColumn4.FillWeight = 20F; + this.WColumn4.Frozen = true; + this.WColumn4.HeaderText = "ER_NUM"; + this.WColumn4.Name = "WColumn4"; + this.WColumn4.ReadOnly = true; + this.WColumn4.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.WColumn4.Width = 25; + // + // Column1 + // + this.WColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.WColumn1.FillWeight = 20F; + this.WColumn1.Frozen = false; + this.WColumn1.HeaderText = "CLMN_VAR"; + this.WColumn1.Name = "WColumn1"; + this.WColumn1.ReadOnly = false; + this.WColumn1.Width = 250; + // + // Column2 + // + this.WColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.WColumn2.FillWeight = 221.0297F; + this.WColumn2.Frozen = false; + this.WColumn2.HeaderText = "WT_TYPE"; + this.WColumn2.Name = "WColumn2"; + this.WColumn2.ReadOnly = true; + this.WColumn2.Width = 200; + // + // Column3 + // + this.WColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.WColumn3.FillWeight = 101.5228F; + this.WColumn3.Frozen = false; + this.WColumn3.HeaderText = "WT_VALUE"; + this.WColumn3.Name = "WColumn3"; + this.WColumn3.ReadOnly = true; + + // + // Column6Empty + // + this.WColumn6Empty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.WColumn6Empty.FillWeight = 101.5228F; + this.WColumn6Empty.Frozen = false; + this.WColumn6Empty.HeaderText = ""; + this.WColumn6Empty.Name = "Empty"; + this.WColumn6Empty.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.WColumn6Empty.ReadOnly = true; + + // + // Column5 + // + this.WColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.WColumn5.HeaderText = "ER_PATH"; + this.WColumn5.Name = "WColumn5"; + this.WColumn5.ReadOnly = true; + this.WColumn5.Width = 200; + + this.watchList.AllowUserToAddRows = false; + this.watchList.AllowUserToDeleteRows = false; + this.watchList.AllowUserToResizeColumns = true; + this.watchList.AllowUserToResizeRows = false; + } + + public static DebugVariablesListWindowForm LocalVarsWindow + { + get + { + return localVarsWindow; + } + } + + private static DebugVariablesListWindowForm localVarsWindow; + + public void RefreshList() + { + this.RefreshWatchInThread(); + } + + private string WrapPrimValue(object val) + { + if (val is string || val is char) return "'" + val.ToString() + "'"; + return val.ToString(); + } + + public void ClearAllSubTrees() + { + for (int i = 0; i < this.watchList.Rows.Count; i++) + { + if (this.watchList.Rows[i].Cells[0].Value != null) + { + ClearRow(i); + } + } + this.watchList.Nodes.Clear(); + this.watchList.Rows.Clear(); + } + + public void ClearRow(int i) + { + AdvancedDataGridView.TreeGridNode node = this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode; + if (node.IsExpanded) + node.Collapse(); + node.populated = false; + node.IsExpanded = false; + node.InExpanding = false; + node.HasChildren = false; + node._grid = null; + node.Nodes.Clear(); + this.watchList.InvalidateRow(i); + } + + public void RefreshRow(int i) + { + if (this.watchList.Rows[i].Cells[0].Value != null) + { + if ((this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).UserRow) + { + RetValue rv = WorkbenchServiceFactory.DebuggerManager.Evaluate(this.watchList.Rows[i].Cells[0].Value as string); + if (rv.syn_err) + { + this.watchList.Rows[i].Cells[1].Value = PascalABCCompiler.StringResources.Get("EXPR_VALUE_SYNTAX_ERROR_IN_EXPR"); + this.watchList.Rows[i].Cells[2].Value = null;//PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE"); + } + else + if (rv.obj_val != null) + { + try + { + ValueItem vi = new ValueItem(rv.obj_val, this.watchList.Rows[i].Cells[0].Value as string, WorkbenchServiceFactory.DebuggerManager.evaluator.declaringType); + (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; + (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = vi; + this.watchList.Rows[i].Cells[1].Value = WorkbenchServiceFactory.DebuggerManager.MakeValueView(rv.obj_val);//rv.obj_val.AsString; + this.watchList.Rows[i].Cells[2].Value = DebugUtils.WrapTypeName(rv.obj_val.Type); + this.watchList.InvalidateCell(0, i); + } + catch (System.Exception e) + { + this.watchList.Rows[i].Cells[1].Value = PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_VALUE"); + this.watchList.Rows[i].Cells[2].Value = PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE"); + // FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string,PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_VALUE"),PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE")); + // fi.imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberEvalError; + // (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; + // (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; + } + } + else if (rv.prim_val != null) + { + FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string, WrapPrimValue(rv.prim_val), DebugUtils.WrapTypeName(rv.prim_val.GetType())); + this.watchList.Rows[i].Cells[1].Value = fi.Text; + this.watchList.Rows[i].Cells[2].Value = fi.Type; + (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; + (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; + } + else + { + this.watchList.Rows[i].Cells[1].Value = PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_VALUE"); + this.watchList.Rows[i].Cells[2].Value = PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE"); + // FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string,PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_VALUE"),PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE")); + // fi.imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberEvalError; + // (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; + // (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; + this.ClearRow(i); + } + } + else + { + + } + } + else + { + this.watchList.Rows[i].Cells[1].Value = null; + this.watchList.Rows[i].Cells[2].Value = null; + } + } + + private void RefreshWatchInThread() + { + for (int i = 0; i < this.watchList.Rows.Count; i++) + { + RefreshRow(i); + } + } + } +} diff --git a/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.resx b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.resx new file mode 100644 index 000000000..9a2043df4 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAE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NWJ//78u3/+u7p//nq5P/Rwbb/Y0k1/wAAAAAAAAAAzLan//// + //////////////////////7//vz8//76+f/99/X/+/Tx//vx7f/67uj/+erj/2NJNf8AAAAAAAAAAOqq + i//qqov/6qqL/+mlhP/pn3r/55du/+aOYv/lhlb/431K/+N2QP/icjn/4nI5/+JyOf/IYi//AAAAAAAA + AADqqov//8Ki//7An//9vZr//LmW//u1kP/6sIv/+auE//inff/2onf/9Z1x//WZav/zlWX/zWUx/wAA + AAAAAAAA6qqL/+qqi//qqov/6qqL/+qmhv/poX//6Jt2/+eUbP/mjmL/5YdY/+SBTv/ke0b/43Y+/+Jy + Of8AAAAA//8AAP3/AAD4/wAAgAEAAIABAAAAAQAAAAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIAB + AACAAQAAgAEAAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.Designer.cs b/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.Designer.cs new file mode 100644 index 000000000..b65bd8dd7 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.Designer.cs @@ -0,0 +1,122 @@ +namespace VisualPascalABC +{ + partial class DebugWatchListWindowForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugWatchListWindowForm)); + this.watchList = new AdvancedDataGridView.TreeGridView(); + this.cntxtWatch = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mADDEXPRToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mDELETEEXPRToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mCLEARALLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mSELECTALLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.watchList)).BeginInit(); + this.cntxtWatch.SuspendLayout(); + this.SuspendLayout(); + // + // watchList + // + this.watchList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.watchList.ContextMenuStrip = this.cntxtWatch; + this.watchList.Dock = System.Windows.Forms.DockStyle.Fill; + this.watchList.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.watchList.ImageList = null; + this.watchList.Location = new System.Drawing.Point(0, 0); + this.watchList.Name = "watchList"; + this.watchList.Size = new System.Drawing.Size(292, 273); + this.watchList.TabIndex = 0; + // + // cntxtWatch + // + this.cntxtWatch.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mADDEXPRToolStripMenuItem, + this.mDELETEEXPRToolStripMenuItem, + this.mCLEARALLToolStripMenuItem, + this.mSELECTALLToolStripMenuItem}); + this.cntxtWatch.Name = "cntxtWatch"; + this.cntxtWatch.Size = new System.Drawing.Size(161, 92); + // + // mADDEXPRToolStripMenuItem + // + this.mADDEXPRToolStripMenuItem.Name = "mADDEXPRToolStripMenuItem"; + this.mADDEXPRToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.mADDEXPRToolStripMenuItem.Text = "M_ADD_EXPR"; + this.mADDEXPRToolStripMenuItem.Click += new System.EventHandler(this.mADDEXPRToolStripMenuItem_Click); + // + // mDELETEEXPRToolStripMenuItem + // + this.mDELETEEXPRToolStripMenuItem.Name = "mDELETEEXPRToolStripMenuItem"; + this.mDELETEEXPRToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.mDELETEEXPRToolStripMenuItem.Text = "M_DELETE_EXPR"; + this.mDELETEEXPRToolStripMenuItem.Click += new System.EventHandler(this.mDELETEEXPRToolStripMenuItem_Click); + // + // mCLEARALLToolStripMenuItem + // + this.mCLEARALLToolStripMenuItem.Name = "mCLEARALLToolStripMenuItem"; + this.mCLEARALLToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.mCLEARALLToolStripMenuItem.Text = "M_CLEAR_ALL"; + this.mCLEARALLToolStripMenuItem.Click += new System.EventHandler(this.mCLEARALLToolStripMenuItem_Click); + // + // mSELECTALLToolStripMenuItem + // + this.mSELECTALLToolStripMenuItem.Name = "mSELECTALLToolStripMenuItem"; + this.mSELECTALLToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.mSELECTALLToolStripMenuItem.Text = "M_SELECT_ALL"; + this.mSELECTALLToolStripMenuItem.Click += new System.EventHandler(this.mSELECTALLToolStripMenuItem_Click); + // + // DebugWatchListWindowForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 273); + this.Controls.Add(this.watchList); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.HideOnClose = true; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "DebugWatchListWindowForm"; + this.TabText = "TP_WATCHLIST"; + this.Text = "TP_WATCHLIST"; + this.Load += new System.EventHandler(this.DebugWathListWindowForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.watchList)).EndInit(); + this.cntxtWatch.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + internal AdvancedDataGridView.TreeGridView watchList; + private System.Windows.Forms.ContextMenuStrip cntxtWatch; + private System.Windows.Forms.ToolStripMenuItem mADDEXPRToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mDELETEEXPRToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mCLEARALLToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mSELECTALLToolStripMenuItem; + + } +} diff --git a/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs b/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs new file mode 100644 index 000000000..26933ab60 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs @@ -0,0 +1,483 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class DebugWatchListWindowForm : BottomDockContentForm + { +// private System.Windows.Forms.DataGridViewTextBoxColumn WColumn4; +// private System.Windows.Forms.DataGridViewTextBoxColumn WColumn1; +// private System.Windows.Forms.DataGridViewTextBoxColumn WColumn2; +// private System.Windows.Forms.DataGridViewTextBoxColumn WColumn3; +// private System.Windows.Forms.DataGridViewTextBoxColumn WColumn5; + + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn4; + private AdvancedDataGridView.TreeGridColumn WColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn5; + + private System.Windows.Forms.DataGridViewTextBoxColumn WColumn6Empty; + + private System.Threading.Thread th; + public void RefreshWatch() + { + //if (!dbgHelper.IsRunning) return; + /*if (th != null && th.ThreadState == System.Threading.ThreadState.Running) + { + System.Threading.Thread.Sleep(50); + if (th.ThreadState == System.Threading.ThreadState.Running) th.Suspend(); + }*/ +// if (th == null || th.ThreadState != System.Threading.ThreadState.Running) +// { +// th = new System.Threading.Thread(new System.Threading.ThreadStart(RefreshWatchInThread)); +// th.Start(); +// } + RefreshWatchInThread(); + } + + private string WrapPrimValue(object val) + { + if (val is string || val is char) return "'" + val.ToString() + "'"; + return val.ToString(); + } + + public void ClearAllSubTrees() + { + for (int i = 0; i < this.watchList.Rows.Count; i++) + { + if (this.watchList.Rows[i].Cells[0].Value != null) + { + ClearRow(i); + } + } + } + + public void ClearRow(int i) + { + AdvancedDataGridView.TreeGridNode node = this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode; + if (node.IsExpanded) + node.Collapse(); + node.populated = false; + node.IsExpanded = false; + node.InExpanding = false; + node.HasChildren = false; + node._grid= null; + node.Nodes.Clear(); + this.watchList.InvalidateRow(i); + } + + public void SetUndefinedValue(int i) + { + if (this.watchList.Rows[i].Cells[0].Value != null) + { + this.ClearRow(i); + //FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string,PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_VALUE"),PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE")); + FixedItem fi = new FixedItem(this.watchList.Rows[i].Cells[0].Value as string,"",""); + //fi.imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberEvalError; + this.watchList.Rows[i].Cells[1].Value = fi.Text; + this.watchList.Rows[i].Cells[2].Value = fi.Type; + (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; + (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; + this.watchList.InvalidateCell(0,i); + } + } + + public string[] GetExpressions() + { + List exprs = new List(); + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAA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2 + p//////////////////////////+//78/P/++vn//ff1//v08f/78e3/+u7o//nq4/9jSTX/AAAAAAAA + AADqqov/6qqL/+qqi//ppYT/6Z96/+eXbv/mjmL/5YZW/+N9Sv/jdkD/4nI5/+JyOf/icjn/yGIv/wAA + AAAAAAAA6qqL///Cov/+wJ///b2a//y5lv/7tZD/+rCL//mrhP/4p33/9qJ3//Wdcf/1mWr/85Vl/81l + Mf8AAAAAAAAAAOqqi//qqov/6qqL/+qqi//qpob/6aF//+ibdv/nlGz/5o5i/+WHWP/kgU7/5HtG/+N2 + Pv/icjn///8AAAYHAAAABwAAAAAAAAAAAAAAAAAAgAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAA + AADAAAAAwAAAAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.Designer.cs b/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.Designer.cs new file mode 100644 index 000000000..e1b59e7b0 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.Designer.cs @@ -0,0 +1,66 @@ +namespace VisualPascalABC +{ + partial class DisassemblyWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.DisassemblyEditor = new VisualPascalABC.CodeFileDocumentTextEditorControl(); + this.SuspendLayout(); + // + // DisassemblyEditor + // + this.DisassemblyEditor.CaretColumn = 0; + this.DisassemblyEditor.CaretLine = 0; + this.DisassemblyEditor.ConvertTabsToSpaces = true; + this.DisassemblyEditor.Dock = System.Windows.Forms.DockStyle.Fill; + this.DisassemblyEditor.Location = new System.Drawing.Point(0, 0); + this.DisassemblyEditor.Name = "DisassemblyEditor"; + this.DisassemblyEditor.ShowLineNumbers = false; + this.DisassemblyEditor.ShowVRuler = false; + this.DisassemblyEditor.Size = new System.Drawing.Size(472, 271); + this.DisassemblyEditor.TabIndent = 4; + this.DisassemblyEditor.TabIndex = 0; + // + // DisassemblyWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(472, 271); + this.Controls.Add(this.DisassemblyEditor); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.Name = "DisassemblyWindow"; + this.TabText = "TP_DISASSEMBLY"; + this.Text = "TP_DISASSEMBLY"; + this.ResumeLayout(false); + + } + + #endregion + + private VisualPascalABC.CodeFileDocumentTextEditorControl DisassemblyEditor; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.cs b/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.cs new file mode 100644 index 000000000..a9f2d6737 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using VisualPascalABCPlugins; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor; + +namespace VisualPascalABC +{ + public partial class DisassemblyWindow : BottomDockContentForm, IDisassemblyWindow + { + public DisassemblyWindow(Form1 MainForm):base(MainForm) + { + InitializeComponent(); + DisassemblyEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingManager.Manager.FindHighlighterForFile("prog.pas"); + } + + public void SetDisassembledCode(string code) + { + DisassemblyEditor.Document.TextContent = code; + //DisassemblyEditor.Refresh(); + } + + public void ClearWindow() + { + SetDisassembledCode(""); + } + + public void ShowDisassembly() + { + var tp = WorkbenchServiceFactory.DebuggerManager.GetNativeCodeOfSelectedFunction(); + SetDisassembledCode(tp.Item1); + } + + bool IDisassemblyWindow.IsVisible + { + get + { + return !this.IsHidden; + } + } + } + + +} diff --git a/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.resx b/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/DisassemblyWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.Designer.cs b/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.Designer.cs new file mode 100644 index 000000000..535132e28 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.Designer.cs @@ -0,0 +1,174 @@ +namespace VisualPascalABC +{ + partial class ErrorsListWindowForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorsListWindowForm)); + this.lvErrorsList = new System.Windows.Forms.ListView(); + this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader11 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.tPCOPYToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ilvlErrorList = new System.Windows.Forms.ImageList(this.components); + this.ilvlErrorList32 = new System.Windows.Forms.ImageList(this.components); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // lvErrorsList + // + this.lvErrorsList.AutoArrange = false; + this.lvErrorsList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader6, + this.columnHeader7, + this.columnHeader8, + this.columnHeader9, + this.columnHeader10, + this.columnHeader11}); + this.lvErrorsList.ContextMenuStrip = this.contextMenuStrip1; + this.lvErrorsList.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvErrorsList.Font = new System.Drawing.Font("Tahoma", 9.5F); + this.lvErrorsList.FullRowSelect = true; + this.lvErrorsList.GridLines = true; + this.lvErrorsList.HideSelection = false; + this.lvErrorsList.Location = new System.Drawing.Point(0, 0); + this.lvErrorsList.Margin = new System.Windows.Forms.Padding(6); + this.lvErrorsList.MultiSelect = false; + this.lvErrorsList.Name = "lvErrorsList"; + this.lvErrorsList.RightToLeftLayout = true; + this.lvErrorsList.ShowItemToolTips = true; + this.lvErrorsList.Size = new System.Drawing.Size(1574, 525); + this.lvErrorsList.SmallImageList = this.ilvlErrorList; + this.lvErrorsList.TabIndex = 1; + this.lvErrorsList.TileSize = new System.Drawing.Size(1, 1); + this.lvErrorsList.UseCompatibleStateImageBehavior = false; + this.lvErrorsList.View = System.Windows.Forms.View.Details; + this.lvErrorsList.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvErrorsList_KeyDown); + this.lvErrorsList.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvErrorsList_MouseDoubleClick); + this.lvErrorsList.Resize += new System.EventHandler(this.lvErrorsList_Resize); + // + // columnHeader6 + // + this.columnHeader6.Text = ""; + this.columnHeader6.Width = 23; + // + // columnHeader7 + // + this.columnHeader7.Text = "ER_NUM"; + this.columnHeader7.Width = 25; + // + // columnHeader8 + // + this.columnHeader8.Text = "ER_LINE"; + this.columnHeader8.Width = 70; + // + // columnHeader9 + // + this.columnHeader9.Text = "ER_DESCRIPTION"; + this.columnHeader9.Width = 300; + // + // columnHeader10 + // + this.columnHeader10.Text = "ER_FILE"; + this.columnHeader10.Width = 150; + // + // columnHeader11 + // + this.columnHeader11.Text = "ER_PATH"; + this.columnHeader11.Width = 200; + // + // contextMenuStrip1 + // + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tPCOPYToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(185, 42); + // + // tPCOPYToolStripMenuItem + // + this.tPCOPYToolStripMenuItem.Name = "tPCOPYToolStripMenuItem"; + this.tPCOPYToolStripMenuItem.Size = new System.Drawing.Size(184, 38); + this.tPCOPYToolStripMenuItem.Text = "ER_COPY"; + this.tPCOPYToolStripMenuItem.Click += new System.EventHandler(this.tPCOPYToolStripMenuItem_Click); + // + // ilvlErrorList + // + this.ilvlErrorList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilvlErrorList.ImageStream"))); + this.ilvlErrorList.TransparentColor = System.Drawing.Color.Transparent; + this.ilvlErrorList.Images.SetKeyName(0, "Icons.16x16.Warning.png"); + this.ilvlErrorList.Images.SetKeyName(1, "Icons.16x16.Error.png"); + this.ilvlErrorList.Images.SetKeyName(2, "Icons.16x16.RuntimeError.png"); + // + // ilvlErrorList32 + // + this.ilvlErrorList32.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilvlErrorList32.ImageStream"))); + this.ilvlErrorList32.TransparentColor = System.Drawing.Color.Transparent; + this.ilvlErrorList32.Images.SetKeyName(0, "Icons.16x16.Warning.png"); + this.ilvlErrorList32.Images.SetKeyName(1, "Icons.32x32.Error.png"); + this.ilvlErrorList32.Images.SetKeyName(2, "Icons.16x16.RuntimeError.png"); + // + // ErrorsListWindowForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1574, 525); + this.Controls.Add(this.lvErrorsList); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(6); + this.Name = "ErrorsListWindowForm"; + this.ShowIcon = false; + this.TabText = "TP_ERRORSLIST"; + this.Text = "TP_ERRORSLIST"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ErrorsListWindowForm_FormClosing); + this.VisibleChanged += new System.EventHandler(this.ErrorsListWindowForm_VisibleChanged); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ColumnHeader columnHeader6; + public System.Windows.Forms.ColumnHeader columnHeader7; + private System.Windows.Forms.ColumnHeader columnHeader8; + private System.Windows.Forms.ColumnHeader columnHeader9; + private System.Windows.Forms.ColumnHeader columnHeader10; + private System.Windows.Forms.ColumnHeader columnHeader11; + internal System.Windows.Forms.ListView lvErrorsList; + private System.Windows.Forms.ImageList ilvlErrorList; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem tPCOPYToolStripMenuItem; + private System.Windows.Forms.ImageList ilvlErrorList32; + } +} diff --git a/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.cs b/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.cs new file mode 100644 index 000000000..e62a87333 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.cs @@ -0,0 +1,193 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using System.IO; + +namespace VisualPascalABC +{ + public partial class ErrorsListWindowForm : BottomDockContentForm, VisualPascalABCPlugins.IErrorListWindow + { + private int ErrorListPict = 0; + private int ErrorListNumCol = 1; + private int ErrorListLineCol = 2; + private int ErrorListDescrCol = 3; + private int ErrorListFileCol = 4; + private int ErrorListPathCol = 5; + + public ErrorsListWindowForm() : base() + { + InitializeComponent(); + } + + public ErrorsListWindowForm(Form1 MainForm) + : base(MainForm) + { + InitializeComponent(); + Form1StringResources.SetTextForAllControls(this.contextMenuStrip1); + var sc = ScreenScale.Calc(); + + if (sc != 1.0) + { + columnHeader6.Width = Convert.ToInt32(columnHeader6.Width * sc); + columnHeader7.Width = Convert.ToInt32(columnHeader7.Width * sc); + columnHeader8.Width = Convert.ToInt32(columnHeader8.Width * sc); + columnHeader9.Width = Convert.ToInt32(columnHeader9.Width * sc); + columnHeader10.Width = Convert.ToInt32(columnHeader10.Width * 0.9 * sc); + columnHeader11.Width = Convert.ToInt32(columnHeader11.Width * sc); + } + if (sc >= 1.99) + this.lvErrorsList.SmallImageList = this.ilvlErrorList32; + } + + private void ErrorsListWindowForm_VisibleChanged(object sender, EventArgs e) + { + } + + private void ErrorsListWindowForm_FormClosing(object sender, FormClosingEventArgs e) + { + e.Cancel = true; + Pane = null; + MainForm.UpdateOutputWindowVisibleButtons(); + + } + internal void Resized() + { + lvErrorsList.Columns[ErrorListDescrCol].Width = lvErrorsList.ClientSize.Width - + (lvErrorsList.Columns[ErrorListPict].Width + + lvErrorsList.Columns[ErrorListNumCol].Width + + lvErrorsList.Columns[ErrorListLineCol].Width + + lvErrorsList.Columns[ErrorListFileCol].Width + + lvErrorsList.Columns[ErrorListPathCol].Width + 1); + } + private void lvErrorsList_Resize(object sender, EventArgs e) + { + Resized(); + } + + delegate void ShowErrorsDelegate(List errors, bool ChangeViewTab); + public void ShowErrorsSync(List errors, bool ChangeViewTab) + { + BeginInvoke(new ShowErrorsDelegate(ShowErrors), errors, ChangeViewTab); + } + + public void ShowErrors(List errors, bool ChangeViewTab) + { + //MessageBox.Show("dsfh"); + if (ChangeViewTab) + { + MainForm.BottomTabsVisible = true; + + MainForm.SelectContent(this, true); + } + PascalABCCompiler.Errors.LocatedError er; + int i = lvErrorsList.Items.Count; + //ivan + //dataGridView1.Rows.Clear(); + //dataGridView1.Rows.Add(8); + //\ivan + List ErrorsList = errors; + foreach (PascalABCCompiler.Errors.Error Err in ErrorsList) + { + lvErrorsList.Items.Add(""); + if (Err is PascalABCCompiler.Errors.CompilerWarning) + lvErrorsList.Items[i].ImageIndex = 0; + else + if (Err is RuntimeException) + lvErrorsList.Items[i].ImageIndex = 2; + else + lvErrorsList.Items[i].ImageIndex = 1; + lvErrorsList.Items[i].SubItems.Add("");//num + lvErrorsList.Items[i].SubItems.Add("");//linenum + lvErrorsList.Items[i].SubItems.Add("");//descr + lvErrorsList.Items[i].SubItems.Add("");//file + lvErrorsList.Items[i].SubItems.Add("");//patch + lvErrorsList.Items[i].SubItems[ErrorListNumCol].Text = (i + 1).ToString(); + if (Err is PascalABCCompiler.Errors.LocatedError) + { + er = Err as PascalABCCompiler.Errors.LocatedError; + lvErrorsList.Items[i].SubItems[ErrorListDescrCol].Text = er.Message; + if ((Err as PascalABCCompiler.Errors.LocatedError).SourceLocation != null) + { + lvErrorsList.Items[i].Tag = (Err as PascalABCCompiler.Errors.LocatedError).SourceLocation; + lvErrorsList.Items[i].SubItems[ErrorListFileCol].Text = Path.GetFileName(er.SourceLocation.FileName); + lvErrorsList.Items[i].SubItems[ErrorListPathCol].Text = Path.GetDirectoryName(er.SourceLocation.FileName); + lvErrorsList.Items[i].SubItems[ErrorListLineCol].Text = er.SourceLocation.BeginPosition.Line.ToString(); + } + } + else if (Err is PascalABCCompiler.Errors.CompilerInternalError) + { + lvErrorsList.Items[i].SubItems[ErrorListDescrCol].Text = (Err as PascalABCCompiler.Errors.CompilerInternalError).ToString(); + } + else + lvErrorsList.Items[i].SubItems[ErrorListDescrCol].Text = Err.Message; + i++; + } + if (ErrorsList.Count > 0 && !(ErrorsList[0] is PascalABCCompiler.Errors.CompilerWarning)) + { + MainForm.BottomTabsVisible = true; + + if ((er = ErrorsList[0] as PascalABCCompiler.Errors.LocatedError) != null) + if (er.SourceLocation != null) + { + if (ErrorsList[0] is VisualPascalABC.RuntimeException) + MainForm.ExecuteErrorPos(er.SourceLocation, 2); + else // ImageIndex==2 - ошибка выполнения + MainForm.ExecuteErrorPos(er.SourceLocation, 1); + //OpenFile(er.SourceLocation.FileName); + //(tabControl1.SelectedTab.ag as CodeFileDocumentControl).TextEditor.CaretPosition(er.SourceLocation.BeginPosition.Line,er.SourceLocation.BeginPosition.Column); + } + } + else + MainForm.SetFocusToEditor(); + } + + private void lvErrorsList_MouseDoubleClick(object sender, MouseEventArgs e) + { + Point clickPoint = lvErrorsList.PointToClient(Cursor.Position); + ListViewItem item = lvErrorsList.GetItemAt(clickPoint.X, clickPoint.Y); + if (item != null) + { + if (item.Tag != null) + MainForm.ExecuteErrorPos((PascalABCCompiler.SourceLocation)item.Tag, item.ImageIndex); + } + } + + private void lvErrorsList_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.Enter && lvErrorsList.SelectedItems.Count > 0) + { + ListViewItem item = lvErrorsList.SelectedItems[0]; + if (item != null) + { + if (item.Tag != null) + MainForm.ExecuteErrorPos((PascalABCCompiler.SourceLocation)item.Tag, item.ImageIndex); + } + } + } + + private void tPCOPYToolStripMenuItem_Click(object sender, EventArgs e) + { + if (lvErrorsList.SelectedItems.Count > 0) + { + StringBuilder sb = new StringBuilder(); + sb.Append(lvErrorsList.SelectedItems[0].SubItems[ErrorListFileCol].Text + "(" + lvErrorsList.SelectedItems[0].SubItems[ErrorListLineCol].Text + ") : "); + sb.Append(lvErrorsList.SelectedItems[0].SubItems[ErrorListDescrCol].Text); + Clipboard.SetText(sb.ToString()); + } + } + + public void ClearErrorList() + { + lvErrorsList.Items.Clear(); + WorkbenchServiceFactory.BuildService.ErrorsList.Clear(); + } + + } +} diff --git a/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.resx b/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.resx new file mode 100644 index 000000000..ec054adc7 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/ErrorsListWindowForm.resx @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 188, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwM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A/9/Guf/bwLL/TGbT/ztq/P94lvv//////3iV + 9f//////VHrw/wA69P8qR6j/AAAAAMOwov/78+7/+u/p//ns5f/459//9+Ta/1Fs1/9Cb/z/V4H//5St + +v//////gJ34/x1S+v8CP/7/DDGp/wAAAADDsKL//Pb0//zz8P/78Ov/+u3m//jo4P9NbeH/VX35/4qm + /v//////gJ35//////9miPb/CUT8/zZTsP8AAAAAxrOl//36+P/99/X//PTx//vx7f/67ef/m6jo/0tt + 4v//////nbT+/0Jv/f+Jpfz//////w480v94jcz/AAAAAMq1qP///f3//vv6//359v/89vL/+/Pu/93a + 7P9+k+X/S23i/2OI+f88a/v/MGD5/yNO1P9GaM//w8zY/wAAAADNuar////////+/v/+/Pv//fn3//z3 + 9P/88+//2tns/4qe6v98jtr/dobP/3eCwv9jaZn/yNHc/wAAAAAAAAAA0Lyt//////////////7///79 + /P/9+vn//ff1//z08P/78ev/+ezn//jp4f/exLb/inNh/wAAAAAAAAAAAAAAANO/sP////////////// + //////////39//36+f/9+Pb//PXx//vx7f/67uj/4sq+/6SShP8AAAAAAAAAAAAAAADWwbL///////// + //+Gpq//ao+b/2yNm/9pgpD/ZX6L/3OHlP+ap63//PLu/+XRxv+sm4//AAAAAAAAAAAAAAAA2MO0//// + ////////j6+7/5va4/+d5/L/hdrp/2rI3/9ZnrT/dYiQ//z39P/p183/qZqN/wAAAAAAAAAAAAAAANnG + uP////////////////+Hrbj/pcvL/5+inP9/yNn/U3OC///9/P/++vj//Pf2/4t3Z/8AAAAAAAAAAAAA + AADh5uj/2sa6/9fCtP/TwbT/eqq5/6np8P+h6fT/kNXi/01sfP/Dr6D/wK2e/7+rm//GzdH/AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANPf4/+Mt8f/gai3/3SXqP/P19r/AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA/wEAAP4AAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAQAAgAMAAIADAACAAwAAgAMAAIAD + AACAAwAA+D8AAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.Designer.cs b/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.Designer.cs new file mode 100644 index 000000000..3801ca26c --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.Designer.cs @@ -0,0 +1,86 @@ +namespace VisualPascalABC +{ + partial class FindSymbolsResultWindowForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindSymbolsResultWindowForm)); + this.lvFindSymbolResults = new System.Windows.Forms.ListView(); + this.columnHeader12 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader13 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // lvFindSymbolResults + // + this.lvFindSymbolResults.AutoArrange = false; + this.lvFindSymbolResults.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader12, + this.columnHeader13}); + this.lvFindSymbolResults.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvFindSymbolResults.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.lvFindSymbolResults.FullRowSelect = true; + this.lvFindSymbolResults.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.lvFindSymbolResults.HideSelection = false; + this.lvFindSymbolResults.Location = new System.Drawing.Point(0, 0); + this.lvFindSymbolResults.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.lvFindSymbolResults.MultiSelect = false; + this.lvFindSymbolResults.Name = "lvFindSymbolResults"; + this.lvFindSymbolResults.ShowItemToolTips = true; + this.lvFindSymbolResults.Size = new System.Drawing.Size(584, 525); + this.lvFindSymbolResults.TabIndex = 1; + this.lvFindSymbolResults.UseCompatibleStateImageBehavior = false; + this.lvFindSymbolResults.View = System.Windows.Forms.View.Details; + this.lvFindSymbolResults.Resize += new System.EventHandler(this.lvFindSymbolResults_Resize); + // + // columnHeader12 + // + this.columnHeader12.Width = 20; + // + // FindSymbolsResultWindowForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(584, 525); + this.Controls.Add(this.lvFindSymbolResults); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.HideOnClose = true; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.Name = "FindSymbolsResultWindowForm"; + this.TabText = "TP_FIND_SYMBOL_RESULTS"; + this.Text = "TP_FIND_SYMBOL_RESULTS"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView lvFindSymbolResults; + private System.Windows.Forms.ColumnHeader columnHeader12; + private System.Windows.Forms.ColumnHeader columnHeader13; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.cs b/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.cs new file mode 100644 index 000000000..362ca4016 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.cs @@ -0,0 +1,89 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using System.Threading; + +namespace VisualPascalABC +{ + public partial class FindSymbolsResultWindowForm : BottomDockContentForm + { + public SymbolsViwer FindSymbolResults; + + public FindSymbolsResultWindowForm(Form1 MainForm) + :base(MainForm) + { + InitializeComponent(); + MainForm.OnEnvorimentEvent += new Form1.EnvorimentEventDelegate(MainForm_OnEnvorimentEvent); + } + + void MainForm_OnEnvorimentEvent(Form1.EnvorimentEvent EnvorimentEvent) + { + switch (EnvorimentEvent) + { + case Form1.EnvorimentEvent.VisualEnvironmentCompilerCreated: + FindSymbolResults = new SymbolsViwer(lvFindSymbolResults, CodeCompletionProvider.ImagesProvider.ImageList, true, BeginInvoke, MainForm.VisualEnvironmentCompiler.SourceFilesProvider, MainForm.ExecuteSourceLocationAction); + break; + } + } + + internal void Resized() + { + lvFindSymbolResults.Columns[1].Width = lvFindSymbolResults.ClientSize.Width - lvFindSymbolResults.Columns[0].Width - 20; + } + private void lvFindSymbolResults_Resize(object sender, EventArgs e) + { + Resized(); + + } + ICSharpCode.TextEditor.TextArea __textarea; + int __syms_count; + private delegate void proc(); + private void __gaFindReferencesEnd() + { + MainForm.BottomTabsVisible = true; + MainForm.SelectContent(this, true); + MainForm.FindAllReferncesEnabled = true; + if (__syms_count > 0) + MainForm.SetStateText(string.Format(PascalABCCompiler.StringResources.Get("VP_VEC_STATETEXT_FINDREFERNCES_RESULT{0}"), __syms_count)); + else + MainForm.SetStateText(PascalABCCompiler.StringResources.Get("VP_VEC_STATETEXT_NOTFOUND")); + } + private void __gaFindReferences(object state) + { + //GotoAction ga = new GotoAction(); + List syms = CodeCompletionActionsManager.FindReferences(__textarea); + __syms_count = syms.Count; + FindSymbolResults.Show(syms); + BeginInvoke(new proc(__gaFindReferencesEnd)); + } + + public void ShowFindResults(List syms) + { + MainForm.BottomTabsVisible = true; + MainForm.SelectContent(this, true); + FindSymbolResults.Show(syms); + } + public void FindAllReferences() + { + if (!Visible) + { + if (!MainForm.BottomTabsVisible) + MainForm.BottomTabsVisible = true; + MainForm.ShowContent(this, false); + } + MainForm.FindAllReferncesEnabled = false; + MainForm.SetStateText(PascalABCCompiler.StringResources.Get("VP_VEC_STATETEXT_FINDREFERNCES")); + lvFindSymbolResults.Items.Clear(); + __textarea = MainForm.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + if (!ThreadPool.QueueUserWorkItem(__gaFindReferences)) + __gaFindReferences(null); + } + } +} diff --git a/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.resx b/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.resx new file mode 100644 index 000000000..8b2ac04fc --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/FindSymbolsResultWindow.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA + AAB2d3b/Wlpa/1JRUf+0trf/5+rs/7G0tf92d3b/Wlpa/1JRUf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAdnZ2/2pqav9SUlL/gIGC/+fq7P9+gIH/dnZ2/2pqav9SUlL/AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAHZ2dv+7u7v/UVFR/z08PP/n6uz/PTw8/3Z2dv+7u7v/UVFR/wAAAAAAAAAAAAAAAAAA + AAC52OT/AAAAAAAAAAB2dnb/5ubm/1JSUv89PD3/AAAA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AAAAAAAAAAAAAAA + AAAAAAAAAH8AAAB/AAAAewAAAHEAAAAAAAAAAAAAgAAAAMABAADgAwAA4AMAAOADAADgAwAA4AMAAPwf + AAD+PwAA/38AAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/ImmediateWindow.Designer.cs b/VisualPascalABCNETLinux/DockContent/ImmediateWindow.Designer.cs new file mode 100644 index 000000000..815011a26 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/ImmediateWindow.Designer.cs @@ -0,0 +1,73 @@ +/* + * Erstellt mit SharpDevelop. + * Benutzer: Pavel + * Datum: 06.05.2009 + * Zeit: 12:34 + * + * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern. + */ +namespace VisualPascalABC +{ + partial class ImmediateWindow + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImmediateWindow)); + this.ImmediateConsole = new VisualPascalABC.CodeFileDocumentTextEditorControl(); + this.SuspendLayout(); + // + // ImmediateConsole + // + this.ImmediateConsole.CaretColumn = 0; + this.ImmediateConsole.CaretLine = 0; + this.ImmediateConsole.ConvertTabsToSpaces = true; + this.ImmediateConsole.Dock = System.Windows.Forms.DockStyle.Fill; + this.ImmediateConsole.Location = new System.Drawing.Point(0, 0); + this.ImmediateConsole.Name = "ImmediateConsole"; + this.ImmediateConsole.ShowVRuler = false; + this.ImmediateConsole.Size = new System.Drawing.Size(472, 271); + this.ImmediateConsole.TabIndent = 4; + this.ImmediateConsole.TabIndex = 0; + // + // ImmediateWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(472, 271); + this.Controls.Add(this.ImmediateConsole); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ImmediateWindow"; + this.TabText = "TP_IMMEDIATE_WINDOW"; + this.Text = "TP_IMMEDIATE_WINDOW"; + this.ResumeLayout(false); + + } + private VisualPascalABC.CodeFileDocumentTextEditorControl ImmediateConsole; + + } +} diff --git a/VisualPascalABCNETLinux/DockContent/ImmediateWindow.cs b/VisualPascalABCNETLinux/DockContent/ImmediateWindow.cs new file mode 100644 index 000000000..cf1ebde79 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/ImmediateWindow.cs @@ -0,0 +1,30 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + /// + /// Description of ImmediateWindow. + /// + public partial class ImmediateWindow : BottomDockContentForm + { + public ImmediateWindow(Form1 MainForm):base(MainForm) + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + ImmediateConsole.ShowHRuler = false; + ImmediateConsole.ShowLineNumbers = false; + ImmediateConsole.MarkForImmediateWindow(); + ImmediateConsole.ShowLineNumbers = true; + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + } +} diff --git a/VisualPascalABCNETLinux/DockContent/ImmediateWindow.resx b/VisualPascalABCNETLinux/DockContent/ImmediateWindow.resx new file mode 100644 index 000000000..78b53f3a7 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/ImmediateWindow.resx @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAP8ABwf/AGBIMAAaGfAAJCT/ANBoMABCPvYAQ0H7ANBwQADQeEAA0IBQAICAcADggGAA4IhgAOCQ + YADgkHAA8JhgAOCYcADwmHAA8KBwALCgkADgoIAAwKiQAPCogAD/qIAAsKigAMCooADwqJAAwLCgAP+w + kADQsKAA/7iQANC4oAD/wKAA8MiwAPDIwADw0MAA8NjQAP/g0ADw4OAA/+jgAP/w4AD/8PAA//jwAP/4 + /wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAA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AADAAwAAwAMAAMADAADAAwAA//8AAP//AAA= + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/OutputWindowForm.Designer.cs b/VisualPascalABCNETLinux/DockContent/OutputWindowForm.Designer.cs new file mode 100644 index 000000000..06cac6800 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/OutputWindowForm.Designer.cs @@ -0,0 +1,265 @@ +namespace VisualPascalABC +{ + partial class OutputWindowForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OutputWindowForm)); + this.panel2 = new System.Windows.Forms.Panel(); + this.panel6 = new System.Windows.Forms.Panel(); + this.outputTextBox = new System.Windows.Forms.RichTextBox(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mCOPYToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mSELECTALLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.InputPanel = new System.Windows.Forms.Panel(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel5 = new System.Windows.Forms.Panel(); + this.InputTextBox = new System.Windows.Forms.TextBox(); + this.panel1 = new System.Windows.Forms.Panel(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.panel3 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.panel2.SuspendLayout(); + this.panel6.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.InputPanel.SuspendLayout(); + this.panel4.SuspendLayout(); + this.panel5.SuspendLayout(); + this.panel1.SuspendLayout(); + this.panel3.SuspendLayout(); + this.SuspendLayout(); + // + // panel2 + // + this.panel2.Controls.Add(this.panel6); + this.panel2.Controls.Add(this.InputPanel); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(916, 310); + this.panel2.TabIndex = 13; + // + // panel6 + // + this.panel6.BackColor = System.Drawing.Color.Red; + this.panel6.Controls.Add(this.outputTextBox); + this.panel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel6.Location = new System.Drawing.Point(0, 0); + this.panel6.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(916, 264); + this.panel6.TabIndex = 13; + // + // outputTextBox + // + this.outputTextBox.BackColor = System.Drawing.Color.White; + this.outputTextBox.ContextMenuStrip = this.contextMenuStrip1; + this.outputTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.outputTextBox.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.outputTextBox.Location = new System.Drawing.Point(0, 0); + this.outputTextBox.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.outputTextBox.Name = "outputTextBox"; + this.outputTextBox.ReadOnly = true; + this.outputTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; + this.outputTextBox.Size = new System.Drawing.Size(916, 264); + this.outputTextBox.TabIndex = 12; + this.outputTextBox.Text = ""; + // + // contextMenuStrip1 + // + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mCOPYToolStripMenuItem, + this.mSELECTALLToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(246, 80); + // + // mCOPYToolStripMenuItem + // + this.mCOPYToolStripMenuItem.Name = "mCOPYToolStripMenuItem"; + this.mCOPYToolStripMenuItem.Size = new System.Drawing.Size(245, 38); + this.mCOPYToolStripMenuItem.Text = "M_COPY"; + this.mCOPYToolStripMenuItem.Click += new System.EventHandler(this.mCOPYToolStripMenuItem_Click); + // + // mSELECTALLToolStripMenuItem + // + this.mSELECTALLToolStripMenuItem.Name = "mSELECTALLToolStripMenuItem"; + this.mSELECTALLToolStripMenuItem.Size = new System.Drawing.Size(245, 38); + this.mSELECTALLToolStripMenuItem.Text = "M_SELECT_ALL"; + this.mSELECTALLToolStripMenuItem.Click += new System.EventHandler(this.mSELECTALLToolStripMenuItem_Click); + // + // InputPanel + // + this.InputPanel.Controls.Add(this.panel4); + this.InputPanel.Controls.Add(this.panel3); + this.InputPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this.InputPanel.Location = new System.Drawing.Point(0, 264); + this.InputPanel.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.InputPanel.Name = "InputPanel"; + this.InputPanel.Size = new System.Drawing.Size(916, 46); + this.InputPanel.TabIndex = 12; + this.InputPanel.Visible = false; + // + // panel4 + // + this.panel4.Controls.Add(this.panel5); + this.panel4.Controls.Add(this.panel1); + this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel4.Location = new System.Drawing.Point(162, 0); + this.panel4.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(754, 46); + this.panel4.TabIndex = 1; + // + // panel5 + // + this.panel5.Controls.Add(this.InputTextBox); + this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel5.Location = new System.Drawing.Point(0, 0); + this.panel5.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(400, 46); + this.panel5.TabIndex = 2; + // + // InputTextBox + // + this.InputTextBox.Dock = System.Windows.Forms.DockStyle.Top; + this.InputTextBox.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.InputTextBox.Location = new System.Drawing.Point(0, 0); + this.InputTextBox.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.InputTextBox.Multiline = true; + this.InputTextBox.Name = "InputTextBox"; + this.InputTextBox.Size = new System.Drawing.Size(400, 39); + this.InputTextBox.TabIndex = 1; + this.InputTextBox.TextChanged += new System.EventHandler(this.InputTextBox_TextChanged); + this.InputTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.InputTextBox_KeyDown); + this.InputTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.InputTextBox_KeyPress); + // + // panel1 + // + this.panel1.Controls.Add(this.button2); + this.panel1.Controls.Add(this.button1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Right; + this.panel1.Location = new System.Drawing.Point(400, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(354, 46); + this.panel1.TabIndex = 1; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(188, 0); + this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(148, 40); + this.button2.TabIndex = 2; + this.button2.Text = "M_STOP"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(20, 0); + this.button1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(150, 40); + this.button1.TabIndex = 0; + this.button1.Text = "INPUT_OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // panel3 + // + this.panel3.Controls.Add(this.label1); + this.panel3.Dock = System.Windows.Forms.DockStyle.Left; + this.panel3.Location = new System.Drawing.Point(0, 0); + this.panel3.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(162, 46); + this.panel3.TabIndex = 0; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 10); + this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(74, 25); + this.label1.TabIndex = 0; + this.label1.Text = "INPUT"; + // + // OutputWindowForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(916, 310); + this.Controls.Add(this.panel2); + this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.Document))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6); + this.Name = "OutputWindowForm"; + this.TabText = "TP_OUTPUTWINDOW"; + this.Text = "TP_OUTPUTWINDOW"; + this.Activated += new System.EventHandler(this.OutputWindowForm_Activated); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OutputWindowForm_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OutputWindowForm_FormClosed); + this.VisibleChanged += new System.EventHandler(this.OutputWindowForm_VisibleChanged); + this.panel2.ResumeLayout(false); + this.panel6.ResumeLayout(false); + this.contextMenuStrip1.ResumeLayout(false); + this.InputPanel.ResumeLayout(false); + this.panel4.ResumeLayout(false); + this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); + this.panel1.ResumeLayout(false); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + this.ResumeLayout(false); + + } + #endregion + + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Panel panel6; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Label label1; + internal System.Windows.Forms.RichTextBox outputTextBox; + internal System.Windows.Forms.Panel InputPanel; + internal System.Windows.Forms.TextBox InputTextBox; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem mCOPYToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mSELECTALLToolStripMenuItem; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/OutputWindowForm.cs b/VisualPascalABCNETLinux/DockContent/OutputWindowForm.cs new file mode 100644 index 000000000..ea8eed398 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/OutputWindowForm.cs @@ -0,0 +1,196 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class OutputWindowForm : BottomDockContentForm, VisualPascalABCPlugins.IOutputWindow + { + public OutputWindowForm(Form1 MainForm) + :base(MainForm) + { + InitializeComponent(); + Form1StringResources.SetTextForAllControls(this.contextMenuStrip1); + } + + private void OutputWindowForm_FormClosing(object sender, FormClosingEventArgs e) + { + e.Cancel = true; + Pane = null; + MainForm.UpdateOutputWindowVisibleButtons(); + } + + private void OutputWindowForm_FormClosed(object sender, FormClosedEventArgs e) + { + + } + + private void OutputWindowForm_VisibleChanged(object sender, EventArgs e) + { + + } + + private void OutputTextBox_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) + { + if (e.Control && e.KeyCode == Keys.C) + outputTextBox.Copy(); + } + + private void InputTextBox_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) + { + if (e.Control && e.KeyCode == Keys.C) + InputTextBox.Copy(); + } + + private void button1_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.SendInputTextToProcess(); + } + + bool addThisChar = false; + + private void InputTextBox_KeyDown(object sender, KeyEventArgs e) + { + switch (e.KeyData) + { + case Keys.Enter: + WorkbenchServiceFactory.RunService.SendInputTextToProcess(); + break; + } + if (!e.Alt && !e.Control) + addThisChar = true; + } + + private void InputTextBox_KeyPress(object sender, KeyPressEventArgs e) + { + if (!addThisChar) + e.KeyChar = '\0'; + addThisChar = false; + } + public void OutputTextBoxScrolToEnd() + { + outputTextBox.SelectionStart = outputTextBox.Text.Length; + outputTextBox.ScrollToCaret(); + } + public void InputTextBoxCursorToEnd() + { + InputTextBox.SelectionStart = InputTextBox.Text.Length; + InputTextBox.Focus(); + } + + public bool InputPanelVisible + { + get + { + return InputPanel.Visible; + } + set + { + if (value && !InputPanel.Visible) + { + InputPanel.Visible = true; + MainForm.BottomTabsVisible = true; + MainForm.SelectContent(this, false); + OutputTextBoxScrolToEnd(); + InputTextBox.Focus(); + MainForm.BottomTabsVisibleChekerEnabled = false; + return; + } + if (!value && InputPanel.Visible) + { + InputPanel.Visible = false; + InputTextBox.Text = ""; + MainForm.lastInputText = ""; + InputTextBox.Focus(); + MainForm.BottomTabsVisibleChekerEnabled = true; + return; + } + } + } + + private void InputTextBox_TextChanged(object sender, EventArgs e) + { + if (!InputPanelVisible) + return; + if (InputTextBox.Lines.Length > 1) + InputTextBox.Text = InputTextBox.Lines[0]; + string ltext = MainForm.lastInputText; + string text = InputTextBox.Text; + if ((text.Length > 0) && (ltext == text.Substring(0, text.Length - 1))) + { + outputTextBox.AppendText(text[text.Length - 1].ToString()); + OutputTextBoxScrolToEnd(); + MainForm.lastInputText = text; + if (MainForm.OutputBoxStack.Contains(outputTextBox)) + { + foreach (RichTextBox tb in MainForm.OutputBoxStack) + if (tb != outputTextBox) + { + tb.AppendText(text[text.Length - 1].ToString()); + tb.SelectionStart = tb.Text.Length; + tb.ScrollToCaret(); + } + } + } + else + { + outputTextBox.Text = outputTextBox.Text.Substring(0, outputTextBox.Text.Length - ltext.Length) + InputTextBox.Text; + OutputTextBoxScrolToEnd(); + MainForm.lastInputText = text; + if (MainForm.OutputBoxStack.Contains(outputTextBox)) + { + foreach (RichTextBox tb in MainForm.OutputBoxStack) + if (tb != outputTextBox) + { + tb.Text = outputTextBox.Text; + tb.SelectionStart = tb.Text.Length; + tb.ScrollToCaret(); + } + } + } + } + + private void OutputWindowForm_Activated(object sender, EventArgs e) + { + MainForm.BottomActiveContent = this; + } + + private void button2_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Stop(); + } + + public void ClearTextBox() + { + this.outputTextBox.Clear(); + } + + string VisualPascalABCPlugins.IOutputWindow.InputTextBoxText + { + get { return InputTextBox.Text; } + set { InputTextBox.Text = value; } + } + + public void AppendTextToOutputBox(string Text) + { + this.outputTextBox.AppendText(Text); + } + + private void mCOPYToolStripMenuItem_Click(object sender, EventArgs e) + { + this.outputTextBox.Copy(); + } + + private void mSELECTALLToolStripMenuItem_Click(object sender, EventArgs e) + { + this.outputTextBox.SelectAll(); + } + } +} diff --git a/VisualPascalABCNETLinux/DockContent/OutputWindowForm.resx b/VisualPascalABCNETLinux/DockContent/OutputWindowForm.resx new file mode 100644 index 000000000..43d68260b --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/OutputWindowForm.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAACwoJD/YEgw/2BIMP9gSDD/YEgw/2BIMP9gSDD/YEgw/2BIMP9gSDD/YEgw/2BI + MP8AAAAAAAAAAAAAAAAAAAAAsKCQ///48P/w4OD/8ODg//DY0P/w2ND/8NDA//DQwP/wyMD/8Miw//DI + sP9gSDD/AAAAAAAAAAAAAAAAAAAAALCgkP//////sKig/7CooP+wqKD/sKig/7CooP+wqKD/sKig///g + 0P/wyLD/YEgw/wAAAAAAAAAAAAAAAAAAAACwoJD/////////////+P////jw///48P//8PD//+jg///o + 4P//4ND/8MjA/2BIMP8AAAAAAAAAAAAAAAAAAAAAsKCQ//////+wqKD/sKig/7CooP+wqKD/sKig/7Co + oP+wqKD/sKig//DQwP9gSDD/AAAAAAAAAAAAAAAAAAAAAMCokP/////////////////////////////4 + 8P//+PD///Dw///w4P/w2ND/YEgw/wAAAAAAAAAAAAAAAAAAAADAqKD//////4CAcP+AgHD/gIBw/4CA + cP+AgHD/gIBw/4CAcP//8PD/8NjQ/2BIMP8AAAAAAAAAAAAAAAAAAAAAwLCg//////////////////// + ////////////////////+P////jw//Dg4P9gSDD/AAAAAAAAAAAAAAAAAAAAANCwoP//////sKig/7Co + oP+wqKD/sKig/7CooP+wqKD/sKig/7CooP/w4OD/YEgw/wAAAAAAAAAAAAAAAAAAAADQuKD///////// + //////////////////////////////////////////j//2BIMP8AAAAAAAAAAAAAAAAAAAAA8KiQ//Co + kP/wqID/4KCA/+CYcP/gkHD/4JBg/+CAYP/QgFD/0HhA/9BwQP/QaDD/AAAAAAAAAAAAAAAAAAAAAPCo + kP//wKD//8Cg///AoP//uJD//7CQ//+ogP/woHD/8Jhw//CYYP/wmGD/0Ggw/wAAAAAAAAAAAAAAAAAA + AADwqJD/8KiQ//CogP/goID/4Jhw/+CQcP/gkGD/4Ihg/9CAUP/QeED/0HBA/9BoMP8AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMAD + AAD//wAA//8AAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/DockContent/WebBrowserControl.Designer.cs b/VisualPascalABCNETLinux/DockContent/WebBrowserControl.Designer.cs new file mode 100644 index 000000000..b24eb1447 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/WebBrowserControl.Designer.cs @@ -0,0 +1,116 @@ +namespace VisualPascalABC +{ + partial class WebBrowserControl + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.tbUrl = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.btnPrev = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // webBrowser1 + // + this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; + this.webBrowser1.Location = new System.Drawing.Point(3, 29); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.ScriptErrorsSuppressed = true; + this.webBrowser1.Size = new System.Drawing.Size(635, 516); + this.webBrowser1.TabIndex = 0; + this.webBrowser1.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted); + this.webBrowser1.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.webBrowser1_Navigated); + this.webBrowser1.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.webBrowser1_Navigating); + // + // tbUrl + // + this.tbUrl.Dock = System.Windows.Forms.DockStyle.Fill; + this.tbUrl.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbUrl.Location = new System.Drawing.Point(3, 3); + this.tbUrl.Name = "tbUrl"; + this.tbUrl.Size = new System.Drawing.Size(635, 23); + this.tbUrl.TabIndex = 1; + this.tbUrl.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + this.tbUrl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbUrl_KeyDown); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.webBrowser1, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.tbUrl, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(641, 548); + this.tableLayoutPanel1.TabIndex = 2; + // + // btnPrev + // + this.btnPrev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnPrev.BackColor = System.Drawing.Color.White; + this.btnPrev.BackgroundImage = global::VisualPascalABC.Properties.Resources.browserNavigBack_Image; + this.btnPrev.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.btnPrev.FlatAppearance.BorderColor = System.Drawing.Color.Silver; + this.btnPrev.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnPrev.Location = new System.Drawing.Point(604, 3); + this.btnPrev.Name = "btnPrev"; + this.btnPrev.Size = new System.Drawing.Size(34, 23); + this.btnPrev.TabIndex = 3; + this.btnPrev.UseVisualStyleBackColor = false; + this.btnPrev.Click += new System.EventHandler(this.btnPrev_Click); + // + // WebBrowserControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(641, 548); + this.Controls.Add(this.btnPrev); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "WebBrowserControl"; + this.Activated += new System.EventHandler(this.WebBrowserControl_Activated); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WebBrowserControl_FormClosing); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.TextBox tbUrl; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button btnPrev; + } +} diff --git a/VisualPascalABCNETLinux/DockContent/WebBrowserControl.cs b/VisualPascalABCNETLinux/DockContent/WebBrowserControl.cs new file mode 100644 index 000000000..b91fd8024 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/WebBrowserControl.cs @@ -0,0 +1,92 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class WebBrowserControl : DockContent + { + public WebBrowserControl() + { + InitializeComponent(); + } + + public void OpenPage(string title, string url) + { + this.TabText = title; + webBrowser1.Navigate(new Uri(url)); + } + + private void WebBrowserControl_Activated(object sender, EventArgs e) + { + VisualPABCSingleton.MainForm.BottomTabsVisible = false; + VisualPABCSingleton.MainForm.BrowserTabSelected = true; + VisualPABCSingleton.MainForm.CurrentWebBrowserControl = this; + VisualPABCSingleton.MainForm.LastSelectedTab = VisualPABCSingleton.MainForm.CurrentCodeFileDocument; + } + + private void WebBrowserControl_FormClosing(object sender, FormClosingEventArgs e) + { + VisualPABCSingleton.MainForm.CloseBrowserTab(this.TabText); + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + + } + + private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) + { + + } + + private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) + { + this.tbUrl.Text = this.webBrowser1.Url.AbsoluteUri; + + } + + private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) + { + this.webBrowser1.Document.Focus(); + var footer = this.webBrowser1.Document.GetElementById("ux-footer"); + if (footer != null) + footer.Style += ";display:none;"; + } + + private void tbUrl_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + string url = this.tbUrl.Text; + if (url != "") + { + if (!url.StartsWith("http://") && !url.StartsWith("https://")) + url = "http://" + url; + try + { + this.webBrowser1.Navigate(new Uri(url)); + } + catch + { + + } + } + } + } + + private void btnPrev_Click(object sender, EventArgs e) + { + if (this.webBrowser1.CanGoBack) + this.webBrowser1.GoBack(); + } + } +} diff --git a/VisualPascalABCNETLinux/DockContent/WebBrowserControl.resx b/VisualPascalABCNETLinux/DockContent/WebBrowserControl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/DockContent/WebBrowserControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/FSWatcherService.cs b/VisualPascalABCNETLinux/FSWatcherService.cs new file mode 100644 index 000000000..dc200c400 --- /dev/null +++ b/VisualPascalABCNETLinux/FSWatcherService.cs @@ -0,0 +1,65 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace VisualPascalABC +{ + class FSWatcherService + { + Dictionary watchers = new Dictionary(); + public void AddWatcher(string FileName) + { + try + { + string s = FileName.ToLower(); + if (!watchers.ContainsKey(s)) + watchers[s] = new FileChangeWatcher(FileName); + } + catch + { + + } + } + + public void DisableWatcher(string FileName) + { + string s = FileName.ToLower(); + FileChangeWatcher fcw = null; + if (watchers.TryGetValue(s, out fcw)) + { + fcw.Enabled = false; + } + } + + public void EnableWatcher(string FileName) + { + string s = FileName.ToLower(); + FileChangeWatcher fcw = null; + if (watchers.TryGetValue(s, out fcw)) + { + fcw.Enabled = true; + } + } + + public void RemoveWatcher(string FileName) + { + try + { + string s = FileName.ToLower(); + FileChangeWatcher fcw = null; + if (watchers.TryGetValue(s, out fcw)) + { + fcw.Dispose(); + watchers.Remove(s); + } + } + catch + { + + } + } + } +} diff --git a/VisualPascalABCNETLinux/FileMonitoring.cs b/VisualPascalABCNETLinux/FileMonitoring.cs new file mode 100644 index 000000000..43d29f1bd --- /dev/null +++ b/VisualPascalABCNETLinux/FileMonitoring.cs @@ -0,0 +1,133 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public class FileChangeWatcher : IDisposable + { + FileSystemWatcher watcher; + string fileName; + Hashtable activeWatchers = new Hashtable(); + bool wasChangedExternally = false; + + public FileChangeWatcher(string path) + { + VisualPABCSingleton.MainForm.Activated += MainForm_Activated; + fileName = path; + activeWatchers.Add(this, this); + SetWatcher(); + } + + public void Dispose() + { + activeWatchers.Remove(this); + VisualPABCSingleton.MainForm.Activated -= MainForm_Activated; + if (watcher != null) + { + watcher.Dispose(); + watcher = null; + } + } + + bool enabled = true; + + public bool Enabled + { + get { return enabled; } + set + { + enabled = value; + SetWatcher(); + } + } + + void SetWatcher() + { + if (watcher != null) + { + watcher.EnableRaisingEvents = false; + } + + if (!enabled) + return; + try + { + if (watcher == null) + { + watcher = new FileSystemWatcher(); + watcher.SynchronizingObject = VisualPABCSingleton.MainForm; + watcher.Changed += OnFileChangedEvent; + watcher.Created += OnFileChangedEvent; + watcher.Renamed += OnFileChangedEvent; + } + watcher.Path = Path.GetDirectoryName(fileName); + watcher.Filter = Path.GetFileName(fileName); + watcher.EnableRaisingEvents = true; + } + catch (PlatformNotSupportedException) + { + if (watcher != null) + { + watcher.Dispose(); + } + watcher = null; + } + + } + + void OnFileChangedEvent(object sender, FileSystemEventArgs e) + { + if (!wasChangedExternally) + { + wasChangedExternally = true; + } + } + + void MainForm_Activated(object sender, EventArgs e) + { + try + { + if (wasChangedExternally) + { + wasChangedExternally = false; + + string mes = null; + if (!File.Exists(fileName)) + { + mes = Form1StringResources.Get("FILE_NOT_EXIST_MESSAGE"); + if (MessageBox.Show(fileName + "\n\n" + mes, Form1StringResources.Get("CHANGED_FILE"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + WorkbenchServiceFactory.FileService.SetFileAsChanged(fileName); + } + else + { + WorkbenchServiceFactory.FileService.CloseFile(fileName); + } + return; + } + + mes = Form1StringResources.Get("FILE_CHANGED_MESSAGE"); + if (MessageBox.Show(fileName + "\n\n" + mes, Form1StringResources.Get("CHANGED_FILE"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + WorkbenchServiceFactory.FileService.ReloadFile(fileName); + } + else + { + WorkbenchServiceFactory.FileService.SetFileAsChanged(fileName); + } + } + } + catch (Exception ex) + { + + } + } + + } +} + diff --git a/VisualPascalABCNETLinux/FontCombo.cs b/VisualPascalABCNETLinux/FontCombo.cs new file mode 100644 index 000000000..067a42fa3 --- /dev/null +++ b/VisualPascalABCNETLinux/FontCombo.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public class FontComboBox : ComboBox + { + Font nfont; + bool both = false; + int maxwid = 0; + string samplestr = " - Hello World"; + Image ttimg; + bool populated = false; + + public FontComboBox() + { + MaxDropDownItems = 20; + IntegralHeight = false; + Sorted = false; + DropDownStyle = ComboBoxStyle.DropDownList; + DrawMode = DrawMode.OwnerDrawVariable; + } + + public void Populate(bool b, Font curFont) + { + if (populated) + { + SelectedItem = curFont.FontFamily.Name; + return; + } + both = b; + int ind = 0; + foreach (FontFamily ff in FontFamily.Families) + { + if (ff.IsStyleAvailable(FontStyle.Regular)) + { + if (ff.Name == curFont.FontFamily.Name) + ind = Items.Count; + Items.Add(ff.Name); + } + } + if (Items.Count > 0) + SelectedIndex = ind; + //ttimg = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Method.png")); + populated = true; + } + + protected override void OnMeasureItem(System.Windows.Forms.MeasureItemEventArgs e) + { + if (e.Index > -1) + { + int w = 0; + string fontstring = Items[e.Index].ToString(); + Graphics g = CreateGraphics(); + e.ItemHeight = (int)g.MeasureString(fontstring, new Font(fontstring, 10)).Height; + w = (int)g.MeasureString(fontstring, new Font(fontstring, 10)).Width; + if (both) + { + int h1 = (int)g.MeasureString(samplestr, new Font(fontstring, 10)).Height; + int h2 = (int)g.MeasureString(Items[e.Index].ToString(), new Font("Arial", 10)).Height; + int w1 = (int)g.MeasureString(samplestr, new Font(fontstring, 10)).Width; + int w2 = (int)g.MeasureString(Items[e.Index].ToString(), new Font("Arial", 10)).Width; + if (h1 > h2) + h2 = h1; + e.ItemHeight = h2; + w = w1 + w2; + } + //w += ttimg.Width*2; + if (w > maxwid) + maxwid = w; + var ss = ScreenScale.Calc(); + if (e.ItemHeight > Convert.ToInt32(20 * ss)) + e.ItemHeight = Convert.ToInt32(20 * ss); + } + + + + base.OnMeasureItem(e); + } + + protected override void OnDrawItem(System.Windows.Forms.DrawItemEventArgs e) + { + if (e.Index > -1) + { + string fontstring = Items[e.Index].ToString(); + nfont = new Font(fontstring, 10); + Font afont = new Font("Arial", 10); + + if (both) + { + Graphics g = CreateGraphics(); + int w = (int)g.MeasureString(fontstring, afont).Width; + + if ((e.State & DrawItemState.Focus) == 0) + { + e.Graphics.FillRectangle(new SolidBrush(SystemColors.Window), + e.Bounds.X/*+ttimg.Width*/, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); + e.Graphics.DrawString(fontstring, afont, new SolidBrush(SystemColors.WindowText), + e.Bounds.X/*+ttimg.Width*2*/, e.Bounds.Y); + e.Graphics.DrawString(samplestr, nfont, new SolidBrush(SystemColors.WindowText), + e.Bounds.X + w/*ttimg.Width*2*/, e.Bounds.Y); + } + else + { + e.Graphics.FillRectangle(new SolidBrush(SystemColors.Highlight), + e.Bounds.X/*+ttimg.Width*/, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); + e.Graphics.DrawString(fontstring, afont, new SolidBrush(SystemColors.HighlightText), + e.Bounds.X/*+ttimg.Width*2*/, e.Bounds.Y); + e.Graphics.DrawString(samplestr, nfont, new SolidBrush(SystemColors.HighlightText), + e.Bounds.X + w/*+ttimg.Width*2*/, e.Bounds.Y); + } + } + else + { + + if ((e.State & DrawItemState.Focus) == 0) + { + e.Graphics.FillRectangle(new SolidBrush(SystemColors.Window), + e.Bounds.X/*+ttimg.Width*/, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); + e.Graphics.DrawString(fontstring, nfont, new SolidBrush(SystemColors.WindowText), + e.Bounds.X/*+ttimg.Width*2*/, e.Bounds.Y); + + } + else + { + e.Graphics.FillRectangle(new SolidBrush(SystemColors.Highlight), + e.Bounds.X/*+ttimg.Width*/, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); + e.Graphics.DrawString(fontstring, nfont, new SolidBrush(SystemColors.HighlightText), + e.Bounds.X/*+ttimg.Width*2*/, e.Bounds.Y); + } + + } + + //e.Graphics.DrawImage(ttimg, new Point(e.Bounds.X, e.Bounds.Y)); + } + base.OnDrawItem(e); + } + + protected override void OnDropDown(System.EventArgs e) + { + this.DropDownWidth = maxwid + 30; + } + + } +} + + diff --git a/VisualPascalABCNETLinux/Form1.Designer.cs b/VisualPascalABCNETLinux/Form1.Designer.cs new file mode 100644 index 000000000..f3ed9beec --- /dev/null +++ b/VisualPascalABCNETLinux/Form1.Designer.cs @@ -0,0 +1,2703 @@ +namespace VisualPascalABC +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.mrFile = new System.Windows.Forms.ToolStripMenuItem(); + this.miNew = new System.Windows.Forms.ToolStripMenuItem(); + this.miNewProject = new System.Windows.Forms.ToolStripMenuItem(); + this.miNewAdv = new System.Windows.Forms.ToolStripMenuItem(); + this.miUnitWithForm = new System.Windows.Forms.ToolStripMenuItem(); + this.miFormProgram = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator(); + this.miOpen = new System.Windows.Forms.ToolStripMenuItem(); + this.miOpenProject = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripSeparator(); + this.miSave = new System.Windows.Forms.ToolStripMenuItem(); + this.miSaveAs = new System.Windows.Forms.ToolStripMenuItem(); + this.miSaveAll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator(); + this.miClose = new System.Windows.Forms.ToolStripMenuItem(); + this.miCloseProject = new System.Windows.Forms.ToolStripMenuItem(); + this.miCloseAllButThis = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.miPrint = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); + this.miRecentFiles = new System.Windows.Forms.ToolStripMenuItem(); + this.miRecentProjects = new System.Windows.Forms.ToolStripMenuItem(); + this.miExit = new System.Windows.Forms.ToolStripMenuItem(); + this.mrEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.miUndo = new System.Windows.Forms.ToolStripMenuItem(); + this.miRedo = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); + this.miCut = new System.Windows.Forms.ToolStripMenuItem(); + this.miCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.miPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.miDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); + this.miFind = new System.Windows.Forms.ToolStripMenuItem(); + this.miFindNext = new System.Windows.Forms.ToolStripMenuItem(); + this.miReplace = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoLine = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.tsSelectAll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); + this.mGOTONEXTBOOKMARKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mGOTOPREVBOOKMARKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mCLEARBOOKMARKSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mrView = new System.Windows.Forms.ToolStripMenuItem(); + this.miClearOutput = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.miOutputWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowOutputWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowErrorsListWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowCompilerConsoleWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowFindSymbolsResultWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowDebugVariablesListWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowDebugWatchListWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsDisassembly = new System.Windows.Forms.ToolStripMenuItem(); + this.tsImmediateWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator(); + this.tsViewIntellisensePanel = new System.Windows.Forms.ToolStripMenuItem(); + this.miProjectExplorer = new System.Windows.Forms.ToolStripMenuItem(); + this.miToolBox = new System.Windows.Forms.ToolStripMenuItem(); + this.miProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); + this.miNavigBack = new System.Windows.Forms.ToolStripMenuItem(); + this.miNavigForw = new System.Windows.Forms.ToolStripMenuItem(); + this.mRPROJECTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mADDFILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mADDEXISTFILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mADDFORMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); + this.mADDREFERENCEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mPROPERTIESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mrProgram = new System.Windows.Forms.ToolStripMenuItem(); + this.miRun = new System.Windows.Forms.ToolStripMenuItem(); + this.miRunNoDebug = new System.Windows.Forms.ToolStripMenuItem(); + this.mRUNPARAMETERSToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.miStop = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); + this.miBuild = new System.Windows.Forms.ToolStripMenuItem(); + this.miRebuild = new System.Windows.Forms.ToolStripMenuItem(); + this.miAddExpr = new System.Windows.Forms.ToolStripMenuItem(); + this.mrDesigner = new System.Windows.Forms.ToolStripMenuItem(); + this.miShowGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miSnapToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlign = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignLefts = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignRights = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignTops = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignBottoms = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignMiddles = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignCenters = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miCenter = new System.Windows.Forms.ToolStripMenuItem(); + this.miCenterHorizontally = new System.Windows.Forms.ToolStripMenuItem(); + this.miCenterVertically = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeTo = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToControl = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToControlWidth = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToControlHeight = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miZOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.miBringToFront = new System.Windows.Forms.ToolStripMenuItem(); + this.miSendToBack = new System.Windows.Forms.ToolStripMenuItem(); + this.miTabOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.mrService = new System.Windows.Forms.ToolStripMenuItem(); + this.mOPTIONSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tssmIntellisence = new System.Windows.Forms.ToolStripSeparator(); + this.mAUTOINSERTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoDefinition = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.tsFindAllReferences = new System.Windows.Forms.ToolStripMenuItem(); + this.miGenerateRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.mFORMATToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mUNITTESTSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.miPlugins = new System.Windows.Forms.ToolStripMenuItem(); + this.mrHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.tsHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.mDOTNETHELPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mMAINFEATURESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.miCheckUpdates = new System.Windows.Forms.ToolStripMenuItem(); + this.miAbout = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.tbNew = new System.Windows.Forms.ToolStripButton(); + this.tbOpen = new System.Windows.Forms.ToolStripButton(); + this.tbSave = new System.Windows.Forms.ToolStripButton(); + this.tbSaveAll = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.tsCut = new System.Windows.Forms.ToolStripButton(); + this.tsCopy = new System.Windows.Forms.ToolStripButton(); + this.tsPaste = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.tsUndo = new System.Windows.Forms.ToolStripButton(); + this.tsRedo = new System.Windows.Forms.ToolStripButton(); + this.tsNavigBack = new System.Windows.Forms.ToolStripButton(); + this.tsNavigForw = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.StartButton = new System.Windows.Forms.ToolStripButton(); + this.StartNoDebugButton = new System.Windows.Forms.ToolStripButton(); + this.stopButton = new System.Windows.Forms.ToolStripButton(); + this.CompileButton = new System.Windows.Forms.ToolStripButton(); + this.ReCompileButton = new System.Windows.Forms.ToolStripButton(); + this.tssRunStopSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.tsOutputWindow = new System.Windows.Forms.ToolStripButton(); + this.tsAutoInsertCode = new System.Windows.Forms.ToolStripButton(); + this.tsFormat = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.tstaSelect = new System.Windows.Forms.ToolStripDropDownButton(); + this.tsatConsoleApplication = new System.Windows.Forms.ToolStripMenuItem(); + this.tsatWindowsApplication = new System.Windows.Forms.ToolStripMenuItem(); + this.tsatDll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripButton16 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton17 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton19 = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.slLine = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel(); + this.slCol = new System.Windows.Forms.ToolStripStatusLabel(); + this.HealthLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.printDialog1 = new System.Windows.Forms.PrintDialog(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.fontDialog1 = new System.Windows.Forms.FontDialog(); + this.cmClose = new System.Windows.Forms.ToolStripMenuItem(); + this.cmCloseAllButThis = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmSave = new System.Windows.Forms.ToolStripMenuItem(); + this.cmSetActive = new System.Windows.Forms.ToolStripMenuItem(); + this.cmEditor = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmGotoDefinition = new System.Windows.Forms.ToolStripMenuItem(); + this.cmGotoRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.cmFindAllReferences = new System.Windows.Forms.ToolStripMenuItem(); + this.cmGenerateRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.cmFormat = new System.Windows.Forms.ToolStripMenuItem(); + this.cmCollapseRegions = new System.Windows.Forms.ToolStripMenuItem(); + this.mNEWASPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cmsCodeCompletion = new System.Windows.Forms.ToolStripSeparator(); + this.cmCut = new System.Windows.Forms.ToolStripMenuItem(); + this.cmCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.cmPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.cmRun = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); + this.cntxt_miAddExpr = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); + this.cmHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.cmSamples = new System.Windows.Forms.ToolStripMenuItem(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.MainDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); + this.toolStripPanel = new System.Windows.Forms.Panel(); + this.cmBreakpointCondition = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mDELETEBREAKPOINTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mBREAKPOINTCONDITIONToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.openProjectDialog = new System.Windows.Forms.OpenFileDialog(); + this.mRUNPARAMETERSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cm_Designer = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmViewCode = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCut = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlign = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignLefts = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignRights = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignTops = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignBottoms = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignMiddles = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignCenters = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCenter = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCenterHorizontally = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCenterVertically = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeTo = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToControl = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToControlWidth = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToControlHeight = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiZOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiBringToFront = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSendToBack = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiTabOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.BottomDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); + this.MPanel = new System.Windows.Forms.Panel(); + this.BPanel = new System.Windows.Forms.Panel(); + this.AllPanel = new System.Windows.Forms.Panel(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.vS2005Theme1 = new WeifenLuo.WinFormsUI.Docking.VS2005Theme(); + this.menuStrip1.SuspendLayout(); + this.toolStrip1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.cmEditor.SuspendLayout(); + this.toolStripPanel.SuspendLayout(); + this.cmBreakpointCondition.SuspendLayout(); + this.cm_Designer.SuspendLayout(); + this.MPanel.SuspendLayout(); + this.BPanel.SuspendLayout(); + this.AllPanel.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.BackColor = System.Drawing.SystemColors.Control; + this.menuStrip1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mrFile, + this.mrEdit, + this.mrView, + this.mRPROJECTToolStripMenuItem, + this.mrProgram, + this.mrDesigner, + this.mrService, + this.miPlugins, + this.mrHelp}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; + this.menuStrip1.Size = new System.Drawing.Size(876, 24); + this.menuStrip1.TabIndex = 3; + this.menuStrip1.Text = "menuStrip1"; + // + // mrFile + // + this.mrFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miNew, + this.miNewProject, + this.miNewAdv, + this.toolStripMenuItem9, + this.miOpen, + this.miOpenProject, + this.toolStripMenuItem10, + this.miSave, + this.miSaveAs, + this.miSaveAll, + this.toolStripMenuItem11, + this.miClose, + this.miCloseProject, + this.miCloseAllButThis, + this.toolStripMenuItem2, + this.miPrint, + this.toolStripSeparator14, + this.miRecentFiles, + this.miRecentProjects, + this.miExit}); + this.mrFile.Name = "mrFile"; + this.mrFile.Size = new System.Drawing.Size(61, 20); + this.mrFile.Text = "MR_FILE"; + // + // miNew + // + this.miNew.Image = ((System.Drawing.Image)(resources.GetObject("miNew.Image"))); + this.miNew.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miNew.Name = "miNew"; + this.miNew.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.miNew.Size = new System.Drawing.Size(194, 22); + this.miNew.Text = "M_NEW"; + this.miNew.Click += new System.EventHandler(this.miNew_Click); + // + // miNewProject + // + this.miNewProject.Name = "miNewProject"; + this.miNewProject.Size = new System.Drawing.Size(194, 22); + this.miNewProject.Text = "M_NEW_PROJECT"; + this.miNewProject.Visible = false; + this.miNewProject.Click += new System.EventHandler(this.miNewProject_Click); + // + // miNewAdv + // + this.miNewAdv.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miUnitWithForm, + this.miFormProgram}); + this.miNewAdv.Name = "miNewAdv"; + this.miNewAdv.Size = new System.Drawing.Size(194, 22); + this.miNewAdv.Text = "M_NEW_ADV"; + this.miNewAdv.Visible = false; + // + // miUnitWithForm + // + this.miUnitWithForm.Name = "miUnitWithForm"; + this.miUnitWithForm.Size = new System.Drawing.Size(180, 22); + this.miUnitWithForm.Text = "M_UNIT_WITH_FORM"; + this.miUnitWithForm.Click += new System.EventHandler(this.miUnitWithForm_Click); + // + // miFormProgram + // + this.miFormProgram.Name = "miFormProgram"; + this.miFormProgram.Size = new System.Drawing.Size(180, 22); + this.miFormProgram.Text = "M_FORM_PROGRAM"; + // + // toolStripMenuItem9 + // + this.toolStripMenuItem9.Name = "toolStripMenuItem9"; + this.toolStripMenuItem9.Size = new System.Drawing.Size(191, 6); + // + // miOpen + // + this.miOpen.Image = ((System.Drawing.Image)(resources.GetObject("miOpen.Image"))); + this.miOpen.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miOpen.Name = "miOpen"; + this.miOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.miOpen.Size = new System.Drawing.Size(194, 22); + this.miOpen.Text = "M_OPEN"; + this.miOpen.Click += new System.EventHandler(this.OpenToolStripMenuItem1_Click_1); + // + // miOpenProject + // + this.miOpenProject.Name = "miOpenProject"; + this.miOpenProject.Size = new System.Drawing.Size(194, 22); + this.miOpenProject.Text = "M_OPEN_PROJECT"; + this.miOpenProject.Visible = false; + this.miOpenProject.Click += new System.EventHandler(this.miOpenProject_Click); + // + // toolStripMenuItem10 + // + this.toolStripMenuItem10.Name = "toolStripMenuItem10"; + this.toolStripMenuItem10.Size = new System.Drawing.Size(191, 6); + // + // miSave + // + this.miSave.Enabled = false; + this.miSave.Image = ((System.Drawing.Image)(resources.GetObject("miSave.Image"))); + this.miSave.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miSave.Name = "miSave"; + this.miSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.miSave.Size = new System.Drawing.Size(194, 22); + this.miSave.Text = "M_SAVE"; + this.miSave.Click += new System.EventHandler(this.miSave_Click); + // + // miSaveAs + // + this.miSaveAs.Name = "miSaveAs"; + this.miSaveAs.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.S))); + this.miSaveAs.Size = new System.Drawing.Size(194, 22); + this.miSaveAs.Text = "M_SAVEAS"; + this.miSaveAs.Click += new System.EventHandler(this.miSaveAs_Click); + // + // miSaveAll + // + this.miSaveAll.Enabled = false; + this.miSaveAll.Image = ((System.Drawing.Image)(resources.GetObject("miSaveAll.Image"))); + this.miSaveAll.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miSaveAll.Name = "miSaveAll"; + this.miSaveAll.Size = new System.Drawing.Size(194, 22); + this.miSaveAll.Text = "M_SAVEALL"; + this.miSaveAll.Click += new System.EventHandler(this.miSaveAll_Click_1); + // + // toolStripMenuItem11 + // + this.toolStripMenuItem11.Name = "toolStripMenuItem11"; + this.toolStripMenuItem11.Size = new System.Drawing.Size(191, 6); + // + // miClose + // + this.miClose.Enabled = false; + this.miClose.Name = "miClose"; + this.miClose.Size = new System.Drawing.Size(194, 22); + this.miClose.Text = "M_CLOSE"; + this.miClose.Click += new System.EventHandler(this.miClose_Click); + // + // miCloseProject + // + this.miCloseProject.Name = "miCloseProject"; + this.miCloseProject.Size = new System.Drawing.Size(194, 22); + this.miCloseProject.Text = "M_CLOSE_PROJECT"; + this.miCloseProject.Visible = false; + this.miCloseProject.Click += new System.EventHandler(this.miCloseProject_Click); + // + // miCloseAllButThis + // + this.miCloseAllButThis.Enabled = false; + this.miCloseAllButThis.Name = "miCloseAllButThis"; + this.miCloseAllButThis.Size = new System.Drawing.Size(194, 22); + this.miCloseAllButThis.Text = "M_CLOSEALLBUTTHIS"; + this.miCloseAllButThis.Click += new System.EventHandler(this.miCloseNonActive_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(191, 6); + // + // miPrint + // + this.miPrint.Image = ((System.Drawing.Image)(resources.GetObject("miPrint.Image"))); + this.miPrint.Name = "miPrint"; + this.miPrint.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.miPrint.Size = new System.Drawing.Size(194, 22); + this.miPrint.Text = "M_PRINT"; + this.miPrint.Click += new System.EventHandler(this.miPrint_Click); + // + // toolStripSeparator14 + // + this.toolStripSeparator14.Name = "toolStripSeparator14"; + this.toolStripSeparator14.Size = new System.Drawing.Size(191, 6); + // + // miRecentFiles + // + this.miRecentFiles.Name = "miRecentFiles"; + this.miRecentFiles.Size = new System.Drawing.Size(194, 22); + this.miRecentFiles.Text = "M_RECENTFILES"; + // + // miRecentProjects + // + this.miRecentProjects.Name = "miRecentProjects"; + this.miRecentProjects.Size = new System.Drawing.Size(194, 22); + this.miRecentProjects.Text = "M_RECENTPROJECTS"; + this.miRecentProjects.Visible = false; + // + // miExit + // + this.miExit.Image = ((System.Drawing.Image)(resources.GetObject("miExit.Image"))); + this.miExit.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miExit.Name = "miExit"; + this.miExit.Size = new System.Drawing.Size(194, 22); + this.miExit.Text = "M_EXIT"; + this.miExit.Click += new System.EventHandler(this.ExitToolStripMenuItem_Click); + // + // mrEdit + // + this.mrEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miUndo, + this.miRedo, + this.toolStripMenuItem3, + this.miCut, + this.miCopy, + this.miPaste, + this.miDelete, + this.toolStripMenuItem4, + this.miFind, + this.miFindNext, + this.miReplace, + this.tsGotoLine, + this.toolStripSeparator8, + this.tsSelectAll, + this.toolStripSeparator9, + this.toolStripMenuItem7}); + this.mrEdit.Name = "mrEdit"; + this.mrEdit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.mrEdit.Size = new System.Drawing.Size(63, 20); + this.mrEdit.Text = "MR_EDIT"; + // + // miUndo + // + this.miUndo.Image = ((System.Drawing.Image)(resources.GetObject("miUndo.Image"))); + this.miUndo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miUndo.Name = "miUndo"; + this.miUndo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.miUndo.Size = new System.Drawing.Size(186, 22); + this.miUndo.Text = "M_UNDO"; + this.miUndo.Click += new System.EventHandler(this.UndoToolStripMenuItem_Click); + // + // miRedo + // + this.miRedo.Image = ((System.Drawing.Image)(resources.GetObject("miRedo.Image"))); + this.miRedo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miRedo.Name = "miRedo"; + this.miRedo.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.Z))); + this.miRedo.Size = new System.Drawing.Size(186, 22); + this.miRedo.Text = "M_REDO"; + this.miRedo.Click += new System.EventHandler(this.RedoToolStripMenuItem_Click); + // + // toolStripMenuItem3 + // + this.toolStripMenuItem3.Name = "toolStripMenuItem3"; + this.toolStripMenuItem3.Size = new System.Drawing.Size(183, 6); + // + // miCut + // + this.miCut.Image = ((System.Drawing.Image)(resources.GetObject("miCut.Image"))); + this.miCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miCut.Name = "miCut"; + this.miCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.miCut.Size = new System.Drawing.Size(186, 22); + this.miCut.Text = "M_CUT"; + this.miCut.Click += new System.EventHandler(this.miCurt_Click); + // + // miCopy + // + this.miCopy.Image = ((System.Drawing.Image)(resources.GetObject("miCopy.Image"))); + this.miCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miCopy.Name = "miCopy"; + this.miCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.miCopy.Size = new System.Drawing.Size(186, 22); + this.miCopy.Text = "M_COPY"; + this.miCopy.Click += new System.EventHandler(this.miCopy_Click); + // + // miPaste + // + this.miPaste.Image = ((System.Drawing.Image)(resources.GetObject("miPaste.Image"))); + this.miPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miPaste.Name = "miPaste"; + this.miPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.miPaste.Size = new System.Drawing.Size(186, 22); + this.miPaste.Text = "M_PASTE"; + this.miPaste.Click += new System.EventHandler(this.miPaste_Click); + // + // miDelete + // + this.miDelete.Enabled = false; + this.miDelete.Image = ((System.Drawing.Image)(resources.GetObject("miDelete.Image"))); + this.miDelete.ImageTransparentColor = System.Drawing.Color.White; + this.miDelete.Name = "miDelete"; + this.miDelete.Size = new System.Drawing.Size(186, 22); + this.miDelete.Text = "M_DELETE"; + this.miDelete.Visible = false; + this.miDelete.Click += new System.EventHandler(this.miDelete_Click); + // + // toolStripMenuItem4 + // + this.toolStripMenuItem4.Name = "toolStripMenuItem4"; + this.toolStripMenuItem4.Size = new System.Drawing.Size(183, 6); + // + // miFind + // + this.miFind.Image = ((System.Drawing.Image)(resources.GetObject("miFind.Image"))); + this.miFind.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miFind.Name = "miFind"; + this.miFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); + this.miFind.Size = new System.Drawing.Size(186, 22); + this.miFind.Text = "M_FIND"; + this.miFind.Click += new System.EventHandler(this.miFind_Click); + // + // miFindNext + // + this.miFindNext.Image = ((System.Drawing.Image)(resources.GetObject("miFindNext.Image"))); + this.miFindNext.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miFindNext.Name = "miFindNext"; + this.miFindNext.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.miFindNext.Size = new System.Drawing.Size(186, 22); + this.miFindNext.Text = "M_FINDNEXT"; + this.miFindNext.Click += new System.EventHandler(this.miFindNext_Click); + // + // miReplace + // + this.miReplace.Image = ((System.Drawing.Image)(resources.GetObject("miReplace.Image"))); + this.miReplace.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miReplace.Name = "miReplace"; + this.miReplace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); + this.miReplace.Size = new System.Drawing.Size(186, 22); + this.miReplace.Text = "M_REPLACE"; + this.miReplace.Click += new System.EventHandler(this.miReplace_Click); + // + // tsGotoLine + // + this.tsGotoLine.Name = "tsGotoLine"; + this.tsGotoLine.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); + this.tsGotoLine.Size = new System.Drawing.Size(186, 22); + this.tsGotoLine.Text = "M_GOTO_LINE"; + this.tsGotoLine.Click += new System.EventHandler(this.tsGotoLine_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(183, 6); + // + // tsSelectAll + // + this.tsSelectAll.Name = "tsSelectAll"; + this.tsSelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.tsSelectAll.Size = new System.Drawing.Size(186, 22); + this.tsSelectAll.Text = "M_SELECT_ALL"; + this.tsSelectAll.Click += new System.EventHandler(this.tsSelectAll_Click); + // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(183, 6); + // + // toolStripMenuItem7 + // + this.toolStripMenuItem7.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem8, + this.mGOTONEXTBOOKMARKToolStripMenuItem, + this.mGOTOPREVBOOKMARKToolStripMenuItem, + this.mCLEARBOOKMARKSToolStripMenuItem}); + this.toolStripMenuItem7.Name = "toolStripMenuItem7"; + this.toolStripMenuItem7.Size = new System.Drawing.Size(186, 22); + this.toolStripMenuItem7.Text = "M_BOOKMARS"; + // + // toolStripMenuItem8 + // + this.toolStripMenuItem8.Image = ((System.Drawing.Image)(resources.GetObject("toolStripMenuItem8.Image"))); + this.toolStripMenuItem8.Name = "toolStripMenuItem8"; + this.toolStripMenuItem8.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F2))); + this.toolStripMenuItem8.Size = new System.Drawing.Size(238, 22); + this.toolStripMenuItem8.Text = "M_TOGGLEBOOKMARK"; + this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click); + // + // mGOTONEXTBOOKMARKToolStripMenuItem + // + this.mGOTONEXTBOOKMARKToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mGOTONEXTBOOKMARKToolStripMenuItem.Image"))); + this.mGOTONEXTBOOKMARKToolStripMenuItem.Name = "mGOTONEXTBOOKMARKToolStripMenuItem"; + this.mGOTONEXTBOOKMARKToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; + this.mGOTONEXTBOOKMARKToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + this.mGOTONEXTBOOKMARKToolStripMenuItem.Text = "M_GOTONEXTBOOKMARK"; + this.mGOTONEXTBOOKMARKToolStripMenuItem.Click += new System.EventHandler(this.mGOTONEXTBOOKMARKToolStripMenuItem_Click); + // + // mGOTOPREVBOOKMARKToolStripMenuItem + // + this.mGOTOPREVBOOKMARKToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mGOTOPREVBOOKMARKToolStripMenuItem.Image"))); + this.mGOTOPREVBOOKMARKToolStripMenuItem.Name = "mGOTOPREVBOOKMARKToolStripMenuItem"; + this.mGOTOPREVBOOKMARKToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F2))); + this.mGOTOPREVBOOKMARKToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + this.mGOTOPREVBOOKMARKToolStripMenuItem.Text = "M_GOTOPREVBOOKMARK"; + this.mGOTOPREVBOOKMARKToolStripMenuItem.Click += new System.EventHandler(this.mGOTOPREVBOOKMARKToolStripMenuItem_Click); + // + // mCLEARBOOKMARKSToolStripMenuItem + // + this.mCLEARBOOKMARKSToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mCLEARBOOKMARKSToolStripMenuItem.Image"))); + this.mCLEARBOOKMARKSToolStripMenuItem.Name = "mCLEARBOOKMARKSToolStripMenuItem"; + this.mCLEARBOOKMARKSToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + this.mCLEARBOOKMARKSToolStripMenuItem.Text = "M_CLEARBOOKMARKS"; + this.mCLEARBOOKMARKSToolStripMenuItem.Click += new System.EventHandler(this.mCLEARBOOKMARKSToolStripMenuItem_Click); + // + // mrView + // + this.mrView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miClearOutput, + this.toolStripSeparator10, + this.miOutputWindow, + this.tsShowOutputWindow, + this.tsShowErrorsListWindow, + this.tsShowCompilerConsoleWindow, + this.tsShowFindSymbolsResultWindow, + this.tsShowDebugVariablesListWindow, + this.tsShowDebugWatchListWindow, + this.tsDisassembly, + this.tsImmediateWindow, + this.toolStripMenuItem12, + this.tsViewIntellisensePanel, + this.miProjectExplorer, + this.miToolBox, + this.miProperties, + this.toolStripSeparator11, + this.miNavigBack, + this.miNavigForw}); + this.mrView.Name = "mrView"; + this.mrView.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.mrView.Size = new System.Drawing.Size(66, 20); + this.mrView.Text = "MR_VIEW"; + // + // miClearOutput + // + this.miClearOutput.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miClearOutput.Name = "miClearOutput"; + this.miClearOutput.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete))); + this.miClearOutput.Size = new System.Drawing.Size(216, 22); + this.miClearOutput.Text = "M_CLEAROUTPUT"; + this.miClearOutput.Click += new System.EventHandler(this.miClearOutputWindow_Click); + // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(213, 6); + // + // miOutputWindow + // + this.miOutputWindow.Checked = true; + this.miOutputWindow.CheckOnClick = true; + this.miOutputWindow.CheckState = System.Windows.Forms.CheckState.Checked; + this.miOutputWindow.Image = ((System.Drawing.Image)(resources.GetObject("miOutputWindow.Image"))); + this.miOutputWindow.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miOutputWindow.Name = "miOutputWindow"; + this.miOutputWindow.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.miOutputWindow.Size = new System.Drawing.Size(216, 22); + this.miOutputWindow.Text = "M_BOTTOMPANEL"; + this.miOutputWindow.Click += new System.EventHandler(this.miOutputWindow_Click); + // + // tsShowOutputWindow + // + this.tsShowOutputWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsShowOutputWindow.Image"))); + this.tsShowOutputWindow.Name = "tsShowOutputWindow"; + this.tsShowOutputWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowOutputWindow.Text = "M_OUTPUTWINDOW"; + this.tsShowOutputWindow.Click += new System.EventHandler(this.tsShowOutputWindow_Click); + // + // tsShowErrorsListWindow + // + this.tsShowErrorsListWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsShowErrorsListWindow.Image"))); + this.tsShowErrorsListWindow.Name = "tsShowErrorsListWindow"; + this.tsShowErrorsListWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowErrorsListWindow.Text = "TP_ERRORSLIST"; + this.tsShowErrorsListWindow.Click += new System.EventHandler(this.tsShowErrorsListWindow_Click); + // + // tsShowCompilerConsoleWindow + // + this.tsShowCompilerConsoleWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsShowCompilerConsoleWindow.Image"))); + this.tsShowCompilerConsoleWindow.Name = "tsShowCompilerConsoleWindow"; + this.tsShowCompilerConsoleWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowCompilerConsoleWindow.Text = "TP_COMPILERMESSAGES"; + this.tsShowCompilerConsoleWindow.Click += new System.EventHandler(this.tsShowCompilerConsoleWindow_Click); + // + // tsShowFindSymbolsResultWindow + // + this.tsShowFindSymbolsResultWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsShowFindSymbolsResultWindow.Image"))); + this.tsShowFindSymbolsResultWindow.Name = "tsShowFindSymbolsResultWindow"; + this.tsShowFindSymbolsResultWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowFindSymbolsResultWindow.Text = "TP_FIND_SYMBOL_RESULTS"; + this.tsShowFindSymbolsResultWindow.Click += new System.EventHandler(this.tsShowFindSymbolsResultWindow_Click); + // + // tsShowDebugVariablesListWindow + // + this.tsShowDebugVariablesListWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsShowDebugVariablesListWindow.Image"))); + this.tsShowDebugVariablesListWindow.Name = "tsShowDebugVariablesListWindow"; + this.tsShowDebugVariablesListWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowDebugVariablesListWindow.Text = "TP_VARLIST"; + this.tsShowDebugVariablesListWindow.Click += new System.EventHandler(this.tsShowDebugVariablesListWindow_Click); + // + // tsShowDebugWatchListWindow + // + this.tsShowDebugWatchListWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsShowDebugWatchListWindow.Image"))); + this.tsShowDebugWatchListWindow.Name = "tsShowDebugWatchListWindow"; + this.tsShowDebugWatchListWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowDebugWatchListWindow.Text = "TP_WATCHLIST"; + this.tsShowDebugWatchListWindow.Click += new System.EventHandler(this.tsShowDebugWatchListWindow_Click); + // + // tsDisassembly + // + this.tsDisassembly.Image = ((System.Drawing.Image)(resources.GetObject("tsDisassembly.Image"))); + this.tsDisassembly.Name = "tsDisassembly"; + this.tsDisassembly.Size = new System.Drawing.Size(216, 22); + this.tsDisassembly.Text = "TP_DISASSEMBLY"; + this.tsDisassembly.Visible = false; + this.tsDisassembly.Click += new System.EventHandler(this.tsDisassembly_Click); + // + // tsImmediateWindow + // + this.tsImmediateWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsImmediateWindow.Image"))); + this.tsImmediateWindow.Name = "tsImmediateWindow"; + this.tsImmediateWindow.Size = new System.Drawing.Size(216, 22); + this.tsImmediateWindow.Text = "TP_IMMEDIATE_WINDOW"; + this.tsImmediateWindow.Click += new System.EventHandler(this.TsImmediateWindowClick); + // + // toolStripMenuItem12 + // + this.toolStripMenuItem12.Name = "toolStripMenuItem12"; + this.toolStripMenuItem12.Size = new System.Drawing.Size(213, 6); + // + // tsViewIntellisensePanel + // + this.tsViewIntellisensePanel.CheckOnClick = true; + this.tsViewIntellisensePanel.Name = "tsViewIntellisensePanel"; + this.tsViewIntellisensePanel.Size = new System.Drawing.Size(216, 22); + this.tsViewIntellisensePanel.Text = "M_INTELLISENSEPANEL"; + this.tsViewIntellisensePanel.CheckedChanged += new System.EventHandler(this.tsViewIntellisensePanel_CheckedChanged); + // + // miProjectExplorer + // + this.miProjectExplorer.Name = "miProjectExplorer"; + this.miProjectExplorer.Size = new System.Drawing.Size(216, 22); + this.miProjectExplorer.Text = "M_PROJECTEXPLORER"; + this.miProjectExplorer.Visible = false; + this.miProjectExplorer.Click += new System.EventHandler(this.miProjectExplorer_Click); + // + // miToolBox + // + this.miToolBox.Name = "miToolBox"; + this.miToolBox.Size = new System.Drawing.Size(216, 22); + this.miToolBox.Text = "M_TOOLBOX"; + this.miToolBox.Visible = false; + this.miToolBox.Click += new System.EventHandler(this.miToolBox_Click); + // + // miProperties + // + this.miProperties.Name = "miProperties"; + this.miProperties.Size = new System.Drawing.Size(216, 22); + this.miProperties.Text = "M_PROPERTIES"; + this.miProperties.Visible = false; + this.miProperties.Click += new System.EventHandler(this.miProperties_Click); + // + // toolStripSeparator11 + // + this.toolStripSeparator11.Name = "toolStripSeparator11"; + this.toolStripSeparator11.Size = new System.Drawing.Size(213, 6); + // + // miNavigBack + // + this.miNavigBack.Image = ((System.Drawing.Image)(resources.GetObject("miNavigBack.Image"))); + this.miNavigBack.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miNavigBack.Name = "miNavigBack"; + this.miNavigBack.ShortcutKeyDisplayString = "Ctrl+-"; + this.miNavigBack.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus))); + this.miNavigBack.Size = new System.Drawing.Size(216, 22); + this.miNavigBack.Text = "M_NAVIGBACK"; + this.miNavigBack.Click += new System.EventHandler(this.tsNavigBack_Click); + // + // miNavigForw + // + this.miNavigForw.Image = ((System.Drawing.Image)(resources.GetObject("miNavigForw.Image"))); + this.miNavigForw.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miNavigForw.Name = "miNavigForw"; + this.miNavigForw.ShortcutKeyDisplayString = "Ctrl+Shift+-"; + this.miNavigForw.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.OemMinus))); + this.miNavigForw.Size = new System.Drawing.Size(216, 22); + this.miNavigForw.Text = "M_NAVIGFORW"; + this.miNavigForw.Click += new System.EventHandler(this.tsNavigForw_Click); + // + // mRPROJECTToolStripMenuItem + // + this.mRPROJECTToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mADDFILEToolStripMenuItem, + this.mADDEXISTFILEToolStripMenuItem, + this.mADDFORMToolStripMenuItem, + this.toolStripMenuItem6, + this.mADDREFERENCEToolStripMenuItem, + this.mPROPERTIESToolStripMenuItem}); + this.mRPROJECTToolStripMenuItem.Name = "mRPROJECTToolStripMenuItem"; + this.mRPROJECTToolStripMenuItem.Size = new System.Drawing.Size(85, 20); + this.mRPROJECTToolStripMenuItem.Text = "MR_PROJECT"; + // + // mADDFILEToolStripMenuItem + // + this.mADDFILEToolStripMenuItem.Name = "mADDFILEToolStripMenuItem"; + this.mADDFILEToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDFILEToolStripMenuItem.Text = "M_ADD_NEW_FILE"; + this.mADDFILEToolStripMenuItem.Click += new System.EventHandler(this.mADDFILEToolStripMenuItem_Click); + // + // mADDEXISTFILEToolStripMenuItem + // + this.mADDEXISTFILEToolStripMenuItem.Name = "mADDEXISTFILEToolStripMenuItem"; + this.mADDEXISTFILEToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDEXISTFILEToolStripMenuItem.Text = "M_ADD_EXIST_FILE"; + this.mADDEXISTFILEToolStripMenuItem.Click += new System.EventHandler(this.mADDEXISTFILEToolStripMenuItem_Click); + // + // mADDFORMToolStripMenuItem + // + this.mADDFORMToolStripMenuItem.Name = "mADDFORMToolStripMenuItem"; + this.mADDFORMToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDFORMToolStripMenuItem.Text = "M_ADD_FORM"; + this.mADDFORMToolStripMenuItem.Click += new System.EventHandler(this.mADDFORMToolStripMenuItem_Click); + // + // toolStripMenuItem6 + // + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size(198, 6); + // + // mADDREFERENCEToolStripMenuItem + // + this.mADDREFERENCEToolStripMenuItem.Name = "mADDREFERENCEToolStripMenuItem"; + this.mADDREFERENCEToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDREFERENCEToolStripMenuItem.Text = "M_ADD_REFERENCE"; + this.mADDREFERENCEToolStripMenuItem.Click += new System.EventHandler(this.mADDREFERENCEToolStripMenuItem_Click); + // + // mPROPERTIESToolStripMenuItem + // + this.mPROPERTIESToolStripMenuItem.Name = "mPROPERTIESToolStripMenuItem"; + this.mPROPERTIESToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mPROPERTIESToolStripMenuItem.Text = "M_PROJECT_PROPERTIES"; + this.mPROPERTIESToolStripMenuItem.Click += new System.EventHandler(this.mPROPERTIESToolStripMenuItem_Click); + // + // mrProgram + // + this.mrProgram.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miRun, + this.miRunNoDebug, + this.mRUNPARAMETERSToolStripMenuItem1, + this.miStop, + this.toolStripMenuItem13, + this.miBuild, + this.miRebuild, + this.miAddExpr}); + this.mrProgram.Name = "mrProgram"; + this.mrProgram.ShortcutKeys = System.Windows.Forms.Keys.F8; + this.mrProgram.Size = new System.Drawing.Size(90, 20); + this.mrProgram.Text = "MR_PROGRAM"; + // + // miRun + // + this.miRun.Image = ((System.Drawing.Image)(resources.GetObject("miRun.Image"))); + this.miRun.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miRun.Name = "miRun"; + this.miRun.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.miRun.Size = new System.Drawing.Size(212, 22); + this.miRun.Text = "M_RUN_DEBUG"; + this.miRun.Click += new System.EventHandler(this.StartMenuItem_Click); + // + // miRunNoDebug + // + this.miRunNoDebug.Image = ((System.Drawing.Image)(resources.GetObject("miRunNoDebug.Image"))); + this.miRunNoDebug.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miRunNoDebug.Name = "miRunNoDebug"; + this.miRunNoDebug.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F9))); + this.miRunNoDebug.Size = new System.Drawing.Size(212, 22); + this.miRunNoDebug.Text = "M_RUN_NODEBUG"; + this.miRunNoDebug.Click += new System.EventHandler(this.miRunNoDebug_Click); + // + // mRUNPARAMETERSToolStripMenuItem1 + // + this.mRUNPARAMETERSToolStripMenuItem1.Name = "mRUNPARAMETERSToolStripMenuItem1"; + this.mRUNPARAMETERSToolStripMenuItem1.Size = new System.Drawing.Size(212, 22); + this.mRUNPARAMETERSToolStripMenuItem1.Text = "M_RUN_PARAMETERS"; + this.mRUNPARAMETERSToolStripMenuItem1.Click += new System.EventHandler(this.mRUNPARAMETERSToolStripMenuItem1_Click); + // + // miStop + // + this.miStop.Image = ((System.Drawing.Image)(resources.GetObject("miStop.Image"))); + this.miStop.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miStop.Name = "miStop"; + this.miStop.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2))); + this.miStop.Size = new System.Drawing.Size(212, 22); + this.miStop.Text = "M_STOP"; + this.miStop.Click += new System.EventHandler(this.miStop_Click); + // + // toolStripMenuItem13 + // + this.toolStripMenuItem13.Name = "toolStripMenuItem13"; + this.toolStripMenuItem13.Size = new System.Drawing.Size(209, 6); + // + // miBuild + // + this.miBuild.Image = ((System.Drawing.Image)(resources.GetObject("miBuild.Image"))); + this.miBuild.ImageTransparentColor = System.Drawing.Color.Red; + this.miBuild.Name = "miBuild"; + this.miBuild.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F9))); + this.miBuild.Size = new System.Drawing.Size(212, 22); + this.miBuild.Text = "M_BUILD"; + this.miBuild.Click += new System.EventHandler(this.toolStripButton10_Click); + // + // miRebuild + // + this.miRebuild.Image = ((System.Drawing.Image)(resources.GetObject("miRebuild.Image"))); + this.miRebuild.ImageTransparentColor = System.Drawing.Color.Red; + this.miRebuild.Name = "miRebuild"; + this.miRebuild.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.F9))); + this.miRebuild.Size = new System.Drawing.Size(212, 22); + this.miRebuild.Text = "M_REBUILD"; + this.miRebuild.Click += new System.EventHandler(this.toolStripButton12_Click); + // + // miAddExpr + // + this.miAddExpr.Name = "miAddExpr"; + this.miAddExpr.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F5))); + this.miAddExpr.Size = new System.Drawing.Size(212, 22); + this.miAddExpr.Text = "M_ADD_EXPR"; + this.miAddExpr.Visible = false; + this.miAddExpr.Click += new System.EventHandler(this.miAddExpr_Click); + // + // mrDesigner + // + this.mrDesigner.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miShowGrid, + this.miSnapToGrid, + this.miAlign, + this.miCenter, + this.miSizeTo, + this.miZOrder, + this.miTabOrder}); + this.mrDesigner.Name = "mrDesigner"; + this.mrDesigner.Size = new System.Drawing.Size(90, 20); + this.mrDesigner.Text = "MR_DESIGNER"; + this.mrDesigner.Visible = false; + // + // miShowGrid + // + this.miShowGrid.Name = "miShowGrid"; + this.miShowGrid.Size = new System.Drawing.Size(165, 22); + this.miShowGrid.Text = "M_SHOW_GRID"; + this.miShowGrid.Visible = false; + this.miShowGrid.Click += new System.EventHandler(this.miShowGrid_Click); + // + // miSnapToGrid + // + this.miSnapToGrid.Name = "miSnapToGrid"; + this.miSnapToGrid.Size = new System.Drawing.Size(165, 22); + this.miSnapToGrid.Text = "M_SNAP_TO_GRID"; + this.miSnapToGrid.Visible = false; + this.miSnapToGrid.Click += new System.EventHandler(this.miSnapToGrid_Click); + // + // miAlign + // + this.miAlign.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miAlignLefts, + this.miAlignRights, + this.miAlignTops, + this.miAlignBottoms, + this.miAlignMiddles, + this.miAlignCenters, + this.miAlignToGrid}); + this.miAlign.Name = "miAlign"; + this.miAlign.Size = new System.Drawing.Size(165, 22); + this.miAlign.Text = "M_ALIGN"; + // + // miAlignLefts + // + this.miAlignLefts.Name = "miAlignLefts"; + this.miAlignLefts.Size = new System.Drawing.Size(172, 22); + this.miAlignLefts.Text = "M_ALIGN_LEFTS"; + // + // miAlignRights + // + this.miAlignRights.Name = "miAlignRights"; + this.miAlignRights.Size = new System.Drawing.Size(172, 22); + this.miAlignRights.Text = "M_ALIGN_RIGHTS"; + // + // miAlignTops + // + this.miAlignTops.Name = "miAlignTops"; + this.miAlignTops.Size = new System.Drawing.Size(172, 22); + this.miAlignTops.Text = "M_ALIGN_TOPS"; + // + // miAlignBottoms + // + this.miAlignBottoms.Name = "miAlignBottoms"; + this.miAlignBottoms.Size = new System.Drawing.Size(172, 22); + this.miAlignBottoms.Text = "M_ALIGN_BOTTOMS"; + // + // miAlignMiddles + // + this.miAlignMiddles.Name = "miAlignMiddles"; + this.miAlignMiddles.Size = new System.Drawing.Size(172, 22); + this.miAlignMiddles.Text = "M_ALIGN_MIDDLES"; + // + // miAlignCenters + // + this.miAlignCenters.Name = "miAlignCenters"; + this.miAlignCenters.Size = new System.Drawing.Size(172, 22); + this.miAlignCenters.Text = "M_ALIGN_CENTERS"; + // + // miAlignToGrid + // + this.miAlignToGrid.Name = "miAlignToGrid"; + this.miAlignToGrid.Size = new System.Drawing.Size(172, 22); + this.miAlignToGrid.Text = "M_ALIGN_TO_GRID"; + // + // miCenter + // + this.miCenter.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miCenterHorizontally, + this.miCenterVertically}); + this.miCenter.Name = "miCenter"; + this.miCenter.Size = new System.Drawing.Size(165, 22); + this.miCenter.Text = "M_CENTER"; + // + // miCenterHorizontally + // + this.miCenterHorizontally.Name = "miCenterHorizontally"; + this.miCenterHorizontally.Size = new System.Drawing.Size(209, 22); + this.miCenterHorizontally.Text = "M_CENTER_HORIZONTALLY"; + // + // miCenterVertically + // + this.miCenterVertically.Name = "miCenterVertically"; + this.miCenterVertically.Size = new System.Drawing.Size(209, 22); + this.miCenterVertically.Text = "M_CENTER_VERTICALLY"; + // + // miSizeTo + // + this.miSizeTo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miSizeToControl, + this.miSizeToControlWidth, + this.miSizeToControlHeight, + this.miSizeToGrid}); + this.miSizeTo.Name = "miSizeTo"; + this.miSizeTo.Size = new System.Drawing.Size(165, 22); + this.miSizeTo.Text = "M_SIZE_TO"; + // + // miSizeToControl + // + this.miSizeToControl.Name = "miSizeToControl"; + this.miSizeToControl.Size = new System.Drawing.Size(227, 22); + this.miSizeToControl.Text = "M_SIZE_TO_CONTROL"; + // + // miSizeToControlWidth + // + this.miSizeToControlWidth.Name = "miSizeToControlWidth"; + this.miSizeToControlWidth.Size = new System.Drawing.Size(227, 22); + this.miSizeToControlWidth.Text = "M_SIZE_TO_CONTROL_WIDTH"; + // + // miSizeToControlHeight + // + this.miSizeToControlHeight.Name = "miSizeToControlHeight"; + this.miSizeToControlHeight.Size = new System.Drawing.Size(227, 22); + this.miSizeToControlHeight.Text = "M_SIZE_TO_CONTROL_HEIGHT"; + // + // miSizeToGrid + // + this.miSizeToGrid.Name = "miSizeToGrid"; + this.miSizeToGrid.Size = new System.Drawing.Size(227, 22); + this.miSizeToGrid.Text = "M_SIZE_TO_GRID"; + // + // miZOrder + // + this.miZOrder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miBringToFront, + this.miSendToBack}); + this.miZOrder.Name = "miZOrder"; + this.miZOrder.Size = new System.Drawing.Size(165, 22); + this.miZOrder.Text = "M_Z_ORDER"; + // + // miBringToFront + // + this.miBringToFront.Name = "miBringToFront"; + this.miBringToFront.Size = new System.Drawing.Size(179, 22); + this.miBringToFront.Text = "M_BRING_TO_FRONT"; + // + // miSendToBack + // + this.miSendToBack.Name = "miSendToBack"; + this.miSendToBack.Size = new System.Drawing.Size(179, 22); + this.miSendToBack.Text = "M_SEND_TO_BACK"; + // + // miTabOrder + // + this.miTabOrder.Name = "miTabOrder"; + this.miTabOrder.Size = new System.Drawing.Size(165, 22); + this.miTabOrder.Text = "M_TAB_ORDER"; + this.miTabOrder.Click += new System.EventHandler(this.miTabOrder_Click); + // + // mrService + // + this.mrService.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mOPTIONSToolStripMenuItem, + this.tssmIntellisence, + this.mAUTOINSERTToolStripMenuItem, + this.tsGotoDefinition, + this.tsGotoRealization, + this.tsFindAllReferences, + this.miGenerateRealization, + this.mFORMATToolStripMenuItem, + this.mUNITTESTSToolStripMenuItem}); + this.mrService.Name = "mrService"; + this.mrService.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.D))); + this.mrService.Size = new System.Drawing.Size(82, 20); + this.mrService.Text = "MR_SERVICE"; + // + // mOPTIONSToolStripMenuItem + // + this.mOPTIONSToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mOPTIONSToolStripMenuItem.Image"))); + this.mOPTIONSToolStripMenuItem.Name = "mOPTIONSToolStripMenuItem"; + this.mOPTIONSToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mOPTIONSToolStripMenuItem.Text = "M_OPTIONS"; + this.mOPTIONSToolStripMenuItem.Click += new System.EventHandler(this.mOPTIONSToolStripMenuItem_Click); + // + // tssmIntellisence + // + this.tssmIntellisence.Name = "tssmIntellisence"; + this.tssmIntellisence.Size = new System.Drawing.Size(279, 6); + // + // mAUTOINSERTToolStripMenuItem + // + this.mAUTOINSERTToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mAUTOINSERTToolStripMenuItem.Image"))); + this.mAUTOINSERTToolStripMenuItem.Name = "mAUTOINSERTToolStripMenuItem"; + this.mAUTOINSERTToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mAUTOINSERTToolStripMenuItem.Text = "M_AUTOINSERT_CODE"; + this.mAUTOINSERTToolStripMenuItem.Click += new System.EventHandler(this.mAUTOINSERTToolStripMenuItem_Click); + // + // tsGotoDefinition + // + this.tsGotoDefinition.Enabled = false; + this.tsGotoDefinition.Image = ((System.Drawing.Image)(resources.GetObject("tsGotoDefinition.Image"))); + this.tsGotoDefinition.Name = "tsGotoDefinition"; + this.tsGotoDefinition.ShortcutKeyDisplayString = "Ctrl+Enter"; + this.tsGotoDefinition.Size = new System.Drawing.Size(282, 22); + this.tsGotoDefinition.Text = "M_GOTO_DEFINITION"; + // + // tsGotoRealization + // + this.tsGotoRealization.Enabled = false; + this.tsGotoRealization.Image = ((System.Drawing.Image)(resources.GetObject("tsGotoRealization.Image"))); + this.tsGotoRealization.Name = "tsGotoRealization"; + this.tsGotoRealization.Size = new System.Drawing.Size(282, 22); + this.tsGotoRealization.Text = "M_GOTO_REALIZATION"; + // + // tsFindAllReferences + // + this.tsFindAllReferences.Name = "tsFindAllReferences"; + this.tsFindAllReferences.Size = new System.Drawing.Size(282, 22); + this.tsFindAllReferences.Text = "M_FIND_ALL_REFERENCES"; + this.tsFindAllReferences.Click += new System.EventHandler(this.tsFindAllReferences_Click); + // + // miGenerateRealization + // + this.miGenerateRealization.Image = ((System.Drawing.Image)(resources.GetObject("miGenerateRealization.Image"))); + this.miGenerateRealization.Name = "miGenerateRealization"; + this.miGenerateRealization.ShortcutKeyDisplayString = ""; + this.miGenerateRealization.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.C))); + this.miGenerateRealization.Size = new System.Drawing.Size(282, 22); + this.miGenerateRealization.Text = "M_GENERATE_REALIZATION"; + // + // mFORMATToolStripMenuItem + // + this.mFORMATToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mFORMATToolStripMenuItem.Image"))); + this.mFORMATToolStripMenuItem.Name = "mFORMATToolStripMenuItem"; + this.mFORMATToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.F))); + this.mFORMATToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mFORMATToolStripMenuItem.Text = "M_FORMAT"; + this.mFORMATToolStripMenuItem.Click += new System.EventHandler(this.mFORMATToolStripMenuItem_Click); + // + // mUNITTESTSToolStripMenuItem + // + this.mUNITTESTSToolStripMenuItem.Name = "mUNITTESTSToolStripMenuItem"; + this.mUNITTESTSToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.T))); + this.mUNITTESTSToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mUNITTESTSToolStripMenuItem.Text = "M_UNIT_TESTS"; + this.mUNITTESTSToolStripMenuItem.Click += new System.EventHandler(this.mUNITTESTSToolStripMenuItem_Click); + // + // miPlugins + // + this.miPlugins.Name = "miPlugins"; + this.miPlugins.Size = new System.Drawing.Size(82, 20); + this.miPlugins.Text = "MR_PLUGINS"; + this.miPlugins.Visible = false; + // + // mrHelp + // + this.mrHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsHelp, + this.mDOTNETHELPToolStripMenuItem, + this.mMAINFEATURESToolStripMenuItem, + this.toolStripMenuItem1, + this.toolStripMenuItem5, + this.toolStripSeparator6, + this.miCheckUpdates, + this.miAbout}); + this.mrHelp.Name = "mrHelp"; + this.mrHelp.Size = new System.Drawing.Size(64, 20); + this.mrHelp.Text = "MR_HELP"; + // + // tsHelp + // + this.tsHelp.Name = "tsHelp"; + this.tsHelp.ShortcutKeyDisplayString = "F1"; + this.tsHelp.Size = new System.Drawing.Size(166, 22); + this.tsHelp.Text = "M_HELP"; + this.tsHelp.Click += new System.EventHandler(this.tsHelp_Click); + // + // mDOTNETHELPToolStripMenuItem + // + this.mDOTNETHELPToolStripMenuItem.Name = "mDOTNETHELPToolStripMenuItem"; + this.mDOTNETHELPToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.mDOTNETHELPToolStripMenuItem.Text = "M_DOTNET_HELP"; + this.mDOTNETHELPToolStripMenuItem.Click += new System.EventHandler(this.mDOTNETHELPToolStripMenuItem_Click); + // + // mMAINFEATURESToolStripMenuItem + // + this.mMAINFEATURESToolStripMenuItem.Name = "mMAINFEATURESToolStripMenuItem"; + this.mMAINFEATURESToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.mMAINFEATURESToolStripMenuItem.Text = "M_MAINFEATURES"; + this.mMAINFEATURESToolStripMenuItem.Click += new System.EventHandler(this.mMAINFEATURESToolStripMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(166, 22); + this.toolStripMenuItem1.Text = "M_OPENSAMPLES"; + this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click_1); + // + // toolStripMenuItem5 + // + this.toolStripMenuItem5.Name = "toolStripMenuItem5"; + this.toolStripMenuItem5.Size = new System.Drawing.Size(166, 22); + this.toolStripMenuItem5.Text = "M_OPENTUTORIAL"; + this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click); + // + // toolStripSeparator6 + // + this.toolStripSeparator6.Name = "toolStripSeparator6"; + this.toolStripSeparator6.Size = new System.Drawing.Size(163, 6); + // + // miCheckUpdates + // + this.miCheckUpdates.Name = "miCheckUpdates"; + this.miCheckUpdates.Size = new System.Drawing.Size(166, 22); + this.miCheckUpdates.Text = "M_CHECKUPDATES"; + this.miCheckUpdates.Click += new System.EventHandler(this.miCheckUpdates_Click); + // + // miAbout + // + this.miAbout.Name = "miAbout"; + this.miAbout.Size = new System.Drawing.Size(166, 22); + this.miAbout.Text = "M_ABOUT"; + this.miAbout.Click += new System.EventHandler(this.miAboutToolStripMenuItem_Click); + // + // toolStrip1 + // + this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tbNew, + this.tbOpen, + this.tbSave, + this.tbSaveAll, + this.toolStripSeparator1, + this.tsCut, + this.tsCopy, + this.tsPaste, + this.toolStripSeparator2, + this.tsUndo, + this.tsRedo, + this.tsNavigBack, + this.tsNavigForw, + this.toolStripSeparator3, + this.StartButton, + this.StartNoDebugButton, + this.stopButton, + this.CompileButton, + this.ReCompileButton, + this.tssRunStopSeparator, + this.tsOutputWindow, + this.tsAutoInsertCode, + this.tsFormat, + this.toolStripButton1, + this.toolStripSeparator4, + this.tstaSelect, + this.toolStripButton16, + this.toolStripButton17, + this.toolStripButton19, + this.toolStripSeparator7}); + this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(876, 23); + this.toolStrip1.Stretch = true; + this.toolStrip1.TabIndex = 2; + this.toolStrip1.Text = "toolStrip1"; + this.toolStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStrip1_ItemClicked); + // + // tbNew + // + this.tbNew.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbNew.Image = ((System.Drawing.Image)(resources.GetObject("tbNew.Image"))); + this.tbNew.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbNew.Name = "tbNew"; + this.tbNew.Size = new System.Drawing.Size(23, 20); + this.tbNew.ToolTipText = "M_NEW"; + this.tbNew.Click += new System.EventHandler(this.miNew_Click); + // + // tbOpen + // + this.tbOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbOpen.Image = ((System.Drawing.Image)(resources.GetObject("tbOpen.Image"))); + this.tbOpen.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbOpen.Name = "tbOpen"; + this.tbOpen.Size = new System.Drawing.Size(23, 20); + this.tbOpen.Text = "M_OPEN"; + this.tbOpen.Click += new System.EventHandler(this.OpenToolStripMenuItem1_Click_1); + // + // tbSave + // + this.tbSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbSave.Enabled = false; + this.tbSave.Image = ((System.Drawing.Image)(resources.GetObject("tbSave.Image"))); + this.tbSave.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbSave.Name = "tbSave"; + this.tbSave.Size = new System.Drawing.Size(23, 20); + this.tbSave.Text = "M_SAVE"; + this.tbSave.Click += new System.EventHandler(this.miSave_Click); + // + // tbSaveAll + // + this.tbSaveAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbSaveAll.Enabled = false; + this.tbSaveAll.Image = ((System.Drawing.Image)(resources.GetObject("tbSaveAll.Image"))); + this.tbSaveAll.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbSaveAll.Name = "tbSaveAll"; + this.tbSaveAll.Size = new System.Drawing.Size(23, 20); + this.tbSaveAll.ToolTipText = "M_SAVEALL"; + this.tbSaveAll.Click += new System.EventHandler(this.miSaveAll_Click_1); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 23); + // + // tsCut + // + this.tsCut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCut.Image = ((System.Drawing.Image)(resources.GetObject("tsCut.Image"))); + this.tsCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsCut.Name = "tsCut"; + this.tsCut.Size = new System.Drawing.Size(23, 20); + this.tsCut.ToolTipText = "M_CUT"; + this.tsCut.Click += new System.EventHandler(this.miCurt_Click); + // + // tsCopy + // + this.tsCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCopy.Image = ((System.Drawing.Image)(resources.GetObject("tsCopy.Image"))); + this.tsCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsCopy.Name = "tsCopy"; + this.tsCopy.Size = new System.Drawing.Size(23, 20); + this.tsCopy.Text = "Копировать(Ctrl+C)"; + this.tsCopy.ToolTipText = "M_COPY"; + this.tsCopy.Click += new System.EventHandler(this.miCopy_Click); + // + // tsPaste + // + this.tsPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsPaste.Image = ((System.Drawing.Image)(resources.GetObject("tsPaste.Image"))); + this.tsPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsPaste.Name = "tsPaste"; + this.tsPaste.Size = new System.Drawing.Size(23, 20); + this.tsPaste.Text = "Вставить(Ctrl+V)"; + this.tsPaste.ToolTipText = "M_PASTE"; + this.tsPaste.Click += new System.EventHandler(this.miPaste_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(6, 23); + // + // tsUndo + // + this.tsUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsUndo.Image = ((System.Drawing.Image)(resources.GetObject("tsUndo.Image"))); + this.tsUndo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsUndo.Name = "tsUndo"; + this.tsUndo.Size = new System.Drawing.Size(23, 20); + this.tsUndo.Text = "Отменить(Ctrl+Z)"; + this.tsUndo.ToolTipText = "M_UNDO"; + this.tsUndo.Click += new System.EventHandler(this.UndoToolStripMenuItem_Click); + // + // tsRedo + // + this.tsRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsRedo.Image = ((System.Drawing.Image)(resources.GetObject("tsRedo.Image"))); + this.tsRedo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsRedo.Name = "tsRedo"; + this.tsRedo.Size = new System.Drawing.Size(23, 20); + this.tsRedo.Text = "Восстановить(Shift+Ctrl+Z)"; + this.tsRedo.ToolTipText = "M_REDO"; + this.tsRedo.Click += new System.EventHandler(this.RedoToolStripMenuItem_Click); + // + // tsNavigBack + // + this.tsNavigBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsNavigBack.Image = ((System.Drawing.Image)(resources.GetObject("tsNavigBack.Image"))); + this.tsNavigBack.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsNavigBack.Name = "tsNavigBack"; + this.tsNavigBack.Size = new System.Drawing.Size(23, 20); + this.tsNavigBack.Text = "toolStripButton1"; + this.tsNavigBack.ToolTipText = "M_NAVIGBACK"; + this.tsNavigBack.Click += new System.EventHandler(this.tsNavigBack_Click); + // + // tsNavigForw + // + this.tsNavigForw.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsNavigForw.Image = ((System.Drawing.Image)(resources.GetObject("tsNavigForw.Image"))); + this.tsNavigForw.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsNavigForw.Name = "tsNavigForw"; + this.tsNavigForw.Size = new System.Drawing.Size(23, 20); + this.tsNavigForw.Text = "toolStripButton3"; + this.tsNavigForw.ToolTipText = "M_NAVIGFORW"; + this.tsNavigForw.Click += new System.EventHandler(this.tsNavigForw_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(6, 23); + // + // StartButton + // + this.StartButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StartButton.Enabled = false; + this.StartButton.Image = ((System.Drawing.Image)(resources.GetObject("StartButton.Image"))); + this.StartButton.ImageTransparentColor = System.Drawing.Color.Maroon; + this.StartButton.Name = "StartButton"; + this.StartButton.Size = new System.Drawing.Size(23, 20); + this.StartButton.Text = "Выполнить программу(F9)"; + this.StartButton.ToolTipText = "M_RUN_DEBUG"; + this.StartButton.Click += new System.EventHandler(this.StartMenuItem_Click); + this.StartButton.EnabledChanged += new System.EventHandler(this.StartButton_EnabledChanged); + // + // StartNoDebugButton + // + this.StartNoDebugButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StartNoDebugButton.Enabled = false; + this.StartNoDebugButton.Image = ((System.Drawing.Image)(resources.GetObject("StartNoDebugButton.Image"))); + this.StartNoDebugButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.StartNoDebugButton.Name = "StartNoDebugButton"; + this.StartNoDebugButton.Size = new System.Drawing.Size(23, 20); + this.StartNoDebugButton.ToolTipText = "M_RUN_NODEBUG"; + this.StartNoDebugButton.Visible = false; + this.StartNoDebugButton.Click += new System.EventHandler(this.miRunNoDebug_Click); + // + // stopButton + // + this.stopButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.stopButton.Enabled = false; + this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image"))); + this.stopButton.ImageTransparentColor = System.Drawing.Color.Maroon; + this.stopButton.Name = "stopButton"; + this.stopButton.Size = new System.Drawing.Size(23, 20); + this.stopButton.ToolTipText = "M_STOP"; + this.stopButton.Click += new System.EventHandler(this.miStop_Click); + // + // CompileButton + // + this.CompileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.CompileButton.Enabled = false; + this.CompileButton.Image = ((System.Drawing.Image)(resources.GetObject("CompileButton.Image"))); + this.CompileButton.ImageTransparentColor = System.Drawing.Color.Red; + this.CompileButton.Name = "CompileButton"; + this.CompileButton.Size = new System.Drawing.Size(23, 20); + this.CompileButton.Text = "Компилировать"; + this.CompileButton.ToolTipText = "M_BUILD"; + this.CompileButton.Click += new System.EventHandler(this.toolStripButton10_Click); + this.CompileButton.EnabledChanged += new System.EventHandler(this.CompileButton_EnabledChanged); + // + // ReCompileButton + // + this.ReCompileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ReCompileButton.Enabled = false; + this.ReCompileButton.Image = ((System.Drawing.Image)(resources.GetObject("ReCompileButton.Image"))); + this.ReCompileButton.ImageTransparentColor = System.Drawing.Color.Red; + this.ReCompileButton.Name = "ReCompileButton"; + this.ReCompileButton.Size = new System.Drawing.Size(23, 20); + this.ReCompileButton.Text = "Перекомпилировать"; + this.ReCompileButton.ToolTipText = "M_REBUILD"; + this.ReCompileButton.Visible = false; + this.ReCompileButton.Click += new System.EventHandler(this.toolStripButton12_Click); + this.ReCompileButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + // + // tssRunStopSeparator + // + this.tssRunStopSeparator.Name = "tssRunStopSeparator"; + this.tssRunStopSeparator.Size = new System.Drawing.Size(6, 23); + // + // tsOutputWindow + // + this.tsOutputWindow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsOutputWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsOutputWindow.Image"))); + this.tsOutputWindow.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsOutputWindow.Name = "tsOutputWindow"; + this.tsOutputWindow.Size = new System.Drawing.Size(23, 20); + this.tsOutputWindow.Text = "M_OUTPUTWINDOW"; + this.tsOutputWindow.Click += new System.EventHandler(this.miOutputWindow_Click); + // + // tsAutoInsertCode + // + this.tsAutoInsertCode.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsAutoInsertCode.Image = ((System.Drawing.Image)(resources.GetObject("tsAutoInsertCode.Image"))); + this.tsAutoInsertCode.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsAutoInsertCode.Name = "tsAutoInsertCode"; + this.tsAutoInsertCode.Size = new System.Drawing.Size(23, 20); + this.tsAutoInsertCode.Text = "M_AUTOINSERT_CODE"; + this.tsAutoInsertCode.ToolTipText = "M_AUTOINSERT_CODE"; + this.tsAutoInsertCode.Click += new System.EventHandler(this.tsAutoInsertCode_Click); + // + // tsFormat + // + this.tsFormat.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsFormat.Image = ((System.Drawing.Image)(resources.GetObject("tsFormat.Image"))); + this.tsFormat.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsFormat.Name = "tsFormat"; + this.tsFormat.Size = new System.Drawing.Size(23, 20); + this.tsFormat.Text = "M_FORMAT"; + this.tsFormat.Click += new System.EventHandler(this.tsFormat_Click); + // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(23, 20); + this.toolStripButton1.Text = "Здоровье PascalABC.NET программы"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(6, 23); + this.toolStripSeparator4.Visible = false; + // + // tstaSelect + // + this.tstaSelect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tstaSelect.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsatConsoleApplication, + this.tsatWindowsApplication, + this.tsatDll}); + this.tstaSelect.Image = ((System.Drawing.Image)(resources.GetObject("tstaSelect.Image"))); + this.tstaSelect.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tstaSelect.Name = "tstaSelect"; + this.tstaSelect.Size = new System.Drawing.Size(29, 20); + this.tstaSelect.Text = "AT_SELECT"; + this.tstaSelect.Visible = false; + // + // tsatConsoleApplication + // + this.tsatConsoleApplication.Image = ((System.Drawing.Image)(resources.GetObject("tsatConsoleApplication.Image"))); + this.tsatConsoleApplication.ImageTransparentColor = System.Drawing.Color.Red; + this.tsatConsoleApplication.Name = "tsatConsoleApplication"; + this.tsatConsoleApplication.Size = new System.Drawing.Size(149, 22); + this.tsatConsoleApplication.Text = "AT_CONSOLE"; + this.tsatConsoleApplication.Click += new System.EventHandler(this.tsat_Click); + // + // tsatWindowsApplication + // + this.tsatWindowsApplication.Image = ((System.Drawing.Image)(resources.GetObject("tsatWindowsApplication.Image"))); + this.tsatWindowsApplication.ImageTransparentColor = System.Drawing.Color.Red; + this.tsatWindowsApplication.Name = "tsatWindowsApplication"; + this.tsatWindowsApplication.Size = new System.Drawing.Size(149, 22); + this.tsatWindowsApplication.Text = "AT_WINDOWS"; + this.tsatWindowsApplication.Click += new System.EventHandler(this.tsat_Click); + // + // tsatDll + // + this.tsatDll.Image = ((System.Drawing.Image)(resources.GetObject("tsatDll.Image"))); + this.tsatDll.ImageTransparentColor = System.Drawing.Color.Red; + this.tsatDll.Name = "tsatDll"; + this.tsatDll.Size = new System.Drawing.Size(149, 22); + this.tsatDll.Text = "AT_DLL"; + this.tsatDll.Click += new System.EventHandler(this.tsat_Click); + // + // toolStripButton16 + // + this.toolStripButton16.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton16.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton16.Image"))); + this.toolStripButton16.ImageTransparentColor = System.Drawing.Color.Maroon; + this.toolStripButton16.Name = "toolStripButton16"; + this.toolStripButton16.Size = new System.Drawing.Size(23, 20); + this.toolStripButton16.Text = "Окно вывода(F5)"; + this.toolStripButton16.Visible = false; + // + // toolStripButton17 + // + this.toolStripButton17.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton17.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton17.Image"))); + this.toolStripButton17.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton17.Name = "toolStripButton17"; + this.toolStripButton17.Size = new System.Drawing.Size(23, 20); + this.toolStripButton17.Text = "Окно выполненной программы(F6)"; + this.toolStripButton17.Visible = false; + // + // toolStripButton19 + // + this.toolStripButton19.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton19.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton19.Image"))); + this.toolStripButton19.ImageTransparentColor = System.Drawing.Color.Maroon; + this.toolStripButton19.Name = "toolStripButton19"; + this.toolStripButton19.Size = new System.Drawing.Size(23, 20); + this.toolStripButton19.Text = "Очистить вывод(Ctrl+Del)"; + this.toolStripButton19.Visible = false; + this.toolStripButton19.Click += new System.EventHandler(this.toolStripButton19_Click); + // + // toolStripSeparator7 + // + this.toolStripSeparator7.Name = "toolStripSeparator7"; + this.toolStripSeparator7.Size = new System.Drawing.Size(6, 23); + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel5, + this.toolStripStatusLabel1, + this.slLine, + this.toolStripStatusLabel2, + this.slCol, + this.HealthLabel}); + this.statusStrip1.Location = new System.Drawing.Point(0, 540); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 21, 0); + this.statusStrip1.Size = new System.Drawing.Size(876, 22); + this.statusStrip1.TabIndex = 4; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel5 + // + this.toolStripStatusLabel5.Name = "toolStripStatusLabel5"; + this.toolStripStatusLabel5.Size = new System.Drawing.Size(659, 17); + this.toolStripStatusLabel5.Spring = true; + this.toolStripStatusLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(40, 17); + this.toolStripStatusLabel1.Text = "SB_LN"; + // + // slLine + // + this.slLine.Name = "slLine"; + this.slLine.Size = new System.Drawing.Size(42, 17); + this.slLine.Text = " numb"; + this.slLine.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // toolStripStatusLabel2 + // + this.toolStripStatusLabel2.Name = "toolStripStatusLabel2"; + this.toolStripStatusLabel2.Size = new System.Drawing.Size(48, 17); + this.toolStripStatusLabel2.Text = "SB_COL"; + // + // slCol + // + this.slCol.AutoSize = false; + this.slCol.AutoToolTip = true; + this.slCol.Name = "slCol"; + this.slCol.Size = new System.Drawing.Size(46, 17); + this.slCol.Text = " numb"; + this.slCol.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // HealthLabel + // + this.HealthLabel.AutoToolTip = true; + this.HealthLabel.BackColor = System.Drawing.SystemColors.Control; + this.HealthLabel.IsLink = true; + this.HealthLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; + this.HealthLabel.LinkColor = System.Drawing.Color.Black; + this.HealthLabel.Name = "HealthLabel"; + this.HealthLabel.Size = new System.Drawing.Size(19, 17); + this.HealthLabel.Text = " "; + this.HealthLabel.ToolTipText = "Здоровье PascalABC.NET программы"; + this.HealthLabel.Click += new System.EventHandler(this.HealthLabel_Click); + // + // openFileDialog1 + // + this.openFileDialog1.Multiselect = true; + this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk); + // + // saveFileDialog1 + // + this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk); + // + // printDialog1 + // + this.printDialog1.UseEXDialog = true; + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.DarkRed; + this.imageList1.Images.SetKeyName(0, ""); + this.imageList1.Images.SetKeyName(1, ""); + this.imageList1.Images.SetKeyName(2, ""); + this.imageList1.Images.SetKeyName(3, ""); + this.imageList1.Images.SetKeyName(4, ""); + this.imageList1.Images.SetKeyName(5, ""); + this.imageList1.Images.SetKeyName(6, ""); + this.imageList1.Images.SetKeyName(7, ""); + this.imageList1.Images.SetKeyName(8, ""); + this.imageList1.Images.SetKeyName(9, ""); + this.imageList1.Images.SetKeyName(10, ""); + this.imageList1.Images.SetKeyName(11, ""); + this.imageList1.Images.SetKeyName(12, ""); + this.imageList1.Images.SetKeyName(13, ""); + this.imageList1.Images.SetKeyName(14, ""); + this.imageList1.Images.SetKeyName(15, "Delete.bmp"); + // + // fontDialog1 + // + this.fontDialog1.ShowApply = true; + this.fontDialog1.ShowColor = true; + this.fontDialog1.Apply += new System.EventHandler(this.fontDialog1_Apply); + // + // cmClose + // + this.cmClose.Name = "cmClose"; + this.cmClose.Size = new System.Drawing.Size(206, 38); + this.cmClose.Text = "M_CLOSE"; + this.cmClose.Click += new System.EventHandler(this.miClose_Click); + // + // cmCloseAllButThis + // + this.cmCloseAllButThis.Name = "cmCloseAllButThis"; + this.cmCloseAllButThis.Size = new System.Drawing.Size(206, 38); + this.cmCloseAllButThis.Text = "M_CLOSEALLBUTTHIS"; + this.cmCloseAllButThis.Click += new System.EventHandler(this.miCloseNonActive_Click); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmClose, + this.cmCloseAllButThis, + this.cmSave, + this.cmSetActive}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(207, 156); + this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); + // + // cmSave + // + this.cmSave.Image = ((System.Drawing.Image)(resources.GetObject("cmSave.Image"))); + this.cmSave.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmSave.Name = "cmSave"; + this.cmSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.cmSave.Size = new System.Drawing.Size(206, 38); + this.cmSave.Text = "M_SAVE"; + this.cmSave.Click += new System.EventHandler(this.miSave_Click); + // + // cmSetActive + // + this.cmSetActive.Name = "cmSetActive"; + this.cmSetActive.Size = new System.Drawing.Size(206, 38); + this.cmSetActive.Text = "M_SET_ACTIVE"; + this.cmSetActive.ToolTipText = "M_SET_ACTIVE"; + this.cmSetActive.Click += new System.EventHandler(this.cmSetActive_Click); + // + // cmEditor + // + this.cmEditor.ImageScalingSize = new System.Drawing.Size(32, 32); + this.cmEditor.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmGotoDefinition, + this.cmGotoRealization, + this.cmFindAllReferences, + this.cmGenerateRealization, + this.cmFormat, + this.cmCollapseRegions, + this.mNEWASPToolStripMenuItem, + this.cmsCodeCompletion, + this.cmCut, + this.cmCopy, + this.cmPaste, + this.toolStripSeparator5, + this.cmRun, + this.toolStripSeparator12, + this.cntxt_miAddExpr, + this.toolStripSeparator15, + this.cmHelp, + this.cmSamples}); + this.cmEditor.Name = "cmEditor"; + this.cmEditor.Size = new System.Drawing.Size(238, 560); + this.cmEditor.Opening += new System.ComponentModel.CancelEventHandler(this.cmEditor_Opening); + // + // cmGotoDefinition + // + this.cmGotoDefinition.Enabled = false; + this.cmGotoDefinition.Image = ((System.Drawing.Image)(resources.GetObject("cmGotoDefinition.Image"))); + this.cmGotoDefinition.Name = "cmGotoDefinition"; + this.cmGotoDefinition.Size = new System.Drawing.Size(237, 38); + this.cmGotoDefinition.Text = "M_GOTO_DEFINITION"; + // + // cmGotoRealization + // + this.cmGotoRealization.Enabled = false; + this.cmGotoRealization.Image = ((System.Drawing.Image)(resources.GetObject("cmGotoRealization.Image"))); + this.cmGotoRealization.Name = "cmGotoRealization"; + this.cmGotoRealization.Size = new System.Drawing.Size(237, 38); + this.cmGotoRealization.Text = "M_GOTO_REALIZATION"; + // + // cmFindAllReferences + // + this.cmFindAllReferences.Enabled = false; + this.cmFindAllReferences.Name = "cmFindAllReferences"; + this.cmFindAllReferences.Size = new System.Drawing.Size(237, 38); + this.cmFindAllReferences.Text = "M_FIND_ALL_REFERENCES"; + this.cmFindAllReferences.Click += new System.EventHandler(this.cmFindAllReferences_Click); + // + // cmGenerateRealization + // + this.cmGenerateRealization.Image = ((System.Drawing.Image)(resources.GetObject("cmGenerateRealization.Image"))); + this.cmGenerateRealization.Name = "cmGenerateRealization"; + this.cmGenerateRealization.Size = new System.Drawing.Size(237, 38); + this.cmGenerateRealization.Text = "M_GENERATE_REALIZATION"; + this.cmGenerateRealization.Visible = false; + this.cmGenerateRealization.Click += new System.EventHandler(this.mGENERATEREALIZATIONToolStripMenuItem_Click); + // + // cmFormat + // + this.cmFormat.Image = ((System.Drawing.Image)(resources.GetObject("cmFormat.Image"))); + this.cmFormat.Name = "cmFormat"; + this.cmFormat.Size = new System.Drawing.Size(237, 38); + this.cmFormat.Text = "M_FORMAT"; + this.cmFormat.Click += new System.EventHandler(this.cmFormat_Click); + // + // cmCollapseRegions + // + this.cmCollapseRegions.Name = "cmCollapseRegions"; + this.cmCollapseRegions.Size = new System.Drawing.Size(237, 38); + this.cmCollapseRegions.Text = "M_COLLAPSE_REGIONS"; + this.cmCollapseRegions.Click += new System.EventHandler(this.cmCollapseRegions_Click); + // + // mNEWASPToolStripMenuItem + // + this.mNEWASPToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mNEWASPToolStripMenuItem.Image"))); + this.mNEWASPToolStripMenuItem.Name = "mNEWASPToolStripMenuItem"; + this.mNEWASPToolStripMenuItem.Size = new System.Drawing.Size(237, 38); + this.mNEWASPToolStripMenuItem.Text = "M_NEW_ASP"; + this.mNEWASPToolStripMenuItem.ToolTipText = "M_NEW_ASP"; + this.mNEWASPToolStripMenuItem.Click += new System.EventHandler(this.mNEWASPToolStripMenuItem_Click); + // + // cmsCodeCompletion + // + this.cmsCodeCompletion.Name = "cmsCodeCompletion"; + this.cmsCodeCompletion.Size = new System.Drawing.Size(234, 6); + // + // cmCut + // + this.cmCut.Image = ((System.Drawing.Image)(resources.GetObject("cmCut.Image"))); + this.cmCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmCut.Name = "cmCut"; + this.cmCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.cmCut.Size = new System.Drawing.Size(237, 38); + this.cmCut.Text = "M_CUT"; + this.cmCut.Click += new System.EventHandler(this.miCurt_Click); + // + // cmCopy + // + this.cmCopy.Image = ((System.Drawing.Image)(resources.GetObject("cmCopy.Image"))); + this.cmCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmCopy.Name = "cmCopy"; + this.cmCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.cmCopy.Size = new System.Drawing.Size(237, 38); + this.cmCopy.Text = "M_COPY"; + this.cmCopy.Click += new System.EventHandler(this.miCopy_Click); + // + // cmPaste + // + this.cmPaste.Image = ((System.Drawing.Image)(resources.GetObject("cmPaste.Image"))); + this.cmPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmPaste.Name = "cmPaste"; + this.cmPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.cmPaste.Size = new System.Drawing.Size(237, 38); + this.cmPaste.Text = "M_PASTE"; + this.cmPaste.Click += new System.EventHandler(this.miPaste_Click); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(234, 6); + // + // cmRun + // + this.cmRun.Image = ((System.Drawing.Image)(resources.GetObject("cmRun.Image"))); + this.cmRun.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmRun.Name = "cmRun"; + this.cmRun.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.cmRun.Size = new System.Drawing.Size(237, 38); + this.cmRun.Text = "M_RUN_DEBUG"; + this.cmRun.Click += new System.EventHandler(this.StartMenuItem_Click); + // + // toolStripSeparator12 + // + this.toolStripSeparator12.Name = "toolStripSeparator12"; + this.toolStripSeparator12.Size = new System.Drawing.Size(234, 6); + // + // cntxt_miAddExpr + // + this.cntxt_miAddExpr.Name = "cntxt_miAddExpr"; + this.cntxt_miAddExpr.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F5))); + this.cntxt_miAddExpr.Size = new System.Drawing.Size(237, 38); + this.cntxt_miAddExpr.Text = "M_ADD_EXPR"; + this.cntxt_miAddExpr.Click += new System.EventHandler(this.miAddExpr_Click); + // + // toolStripSeparator15 + // + this.toolStripSeparator15.Name = "toolStripSeparator15"; + this.toolStripSeparator15.Size = new System.Drawing.Size(234, 6); + // + // cmHelp + // + this.cmHelp.Name = "cmHelp"; + this.cmHelp.Size = new System.Drawing.Size(237, 38); + this.cmHelp.Text = "M_HELP"; + this.cmHelp.Click += new System.EventHandler(this.cmHelp_Click); + // + // cmSamples + // + this.cmSamples.Name = "cmSamples"; + this.cmSamples.Size = new System.Drawing.Size(237, 38); + this.cmSamples.Text = "M_SAMPLES"; + this.cmSamples.Click += new System.EventHandler(this.cmSamples_Click); + // + // columnHeader1 + // + this.columnHeader1.Text = ""; + this.columnHeader1.Width = 22; + // + // columnHeader2 + // + this.columnHeader2.Text = "Строка"; + this.columnHeader2.Width = 16; + // + // columnHeader3 + // + this.columnHeader3.Text = "Ошибка"; + this.columnHeader3.Width = 269; + // + // columnHeader4 + // + this.columnHeader4.Text = "Файл"; + this.columnHeader4.Width = 95; + // + // columnHeader5 + // + this.columnHeader5.Text = "Путь к файлу"; + // + // MainDockPanel + // + this.MainDockPanel.BackColor = System.Drawing.SystemColors.Control; + this.MainDockPanel.ContextMenuStrip = this.contextMenuStrip1; + this.MainDockPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.MainDockPanel.DockBottomPortion = 0.35D; + this.MainDockPanel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.MainDockPanel.Location = new System.Drawing.Point(0, 0); + this.MainDockPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.MainDockPanel.Name = "MainDockPanel"; + this.MainDockPanel.RightToLeftLayout = true; + this.MainDockPanel.Size = new System.Drawing.Size(876, 279); + this.MainDockPanel.TabIndex = 10; + // + // toolStripPanel + // + this.toolStripPanel.Controls.Add(this.toolStrip1); + this.toolStripPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.toolStripPanel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(204))); + this.toolStripPanel.Location = new System.Drawing.Point(0, 24); + this.toolStripPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.toolStripPanel.Name = "toolStripPanel"; + this.toolStripPanel.Size = new System.Drawing.Size(876, 25); + this.toolStripPanel.TabIndex = 13; + // + // cmBreakpointCondition + // + this.cmBreakpointCondition.ImageScalingSize = new System.Drawing.Size(32, 32); + this.cmBreakpointCondition.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mDELETEBREAKPOINTToolStripMenuItem, + this.mBREAKPOINTCONDITIONToolStripMenuItem1}); + this.cmBreakpointCondition.Name = "cmBreakpointCondition"; + this.cmBreakpointCondition.Size = new System.Drawing.Size(229, 48); + // + // mDELETEBREAKPOINTToolStripMenuItem + // + this.mDELETEBREAKPOINTToolStripMenuItem.Name = "mDELETEBREAKPOINTToolStripMenuItem"; + this.mDELETEBREAKPOINTToolStripMenuItem.Size = new System.Drawing.Size(228, 22); + this.mDELETEBREAKPOINTToolStripMenuItem.Text = "M_DELETE_BREAKPOINT"; + this.mDELETEBREAKPOINTToolStripMenuItem.Click += new System.EventHandler(this.mDELETEBREAKPOINTToolStripMenuItem_Click); + // + // mBREAKPOINTCONDITIONToolStripMenuItem1 + // + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Name = "mBREAKPOINTCONDITIONToolStripMenuItem1"; + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Size = new System.Drawing.Size(228, 22); + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Text = "M_BREAKPOINT_CONDITION"; + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Click += new System.EventHandler(this.mBREAKPOINTCONDITIONToolStripMenuItem1_Click); + // + // openProjectDialog + // + this.openProjectDialog.FileOk += new System.ComponentModel.CancelEventHandler(this.openProjectDialog_FileOk); + // + // mRUNPARAMETERSToolStripMenuItem + // + this.mRUNPARAMETERSToolStripMenuItem.Name = "mRUNPARAMETERSToolStripMenuItem"; + this.mRUNPARAMETERSToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.mRUNPARAMETERSToolStripMenuItem.Text = "M_RUN_PARAMETERS"; + // + // cm_Designer + // + this.cm_Designer.ImageScalingSize = new System.Drawing.Size(32, 32); + this.cm_Designer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmViewCode, + this.cmiDelete, + this.cmiCopy, + this.cmiCut, + this.cmiPaste, + this.cmiAlign, + this.cmiCenter, + this.cmiSizeTo, + this.cmiZOrder, + this.cmiTabOrder, + this.cmiProperties}); + this.cm_Designer.Name = "cm_Designer"; + this.cm_Designer.Size = new System.Drawing.Size(210, 422); + // + // cmViewCode + // + this.cmViewCode.Image = ((System.Drawing.Image)(resources.GetObject("cmViewCode.Image"))); + this.cmViewCode.Name = "cmViewCode"; + this.cmViewCode.Size = new System.Drawing.Size(209, 38); + this.cmViewCode.Text = "M_VIEW_CODE"; + this.cmViewCode.Click += new System.EventHandler(this.cmViewCode_Click); + // + // cmiDelete + // + this.cmiDelete.Image = ((System.Drawing.Image)(resources.GetObject("cmiDelete.Image"))); + this.cmiDelete.ImageTransparentColor = System.Drawing.Color.White; + this.cmiDelete.Name = "cmiDelete"; + this.cmiDelete.Size = new System.Drawing.Size(209, 38); + this.cmiDelete.Text = "M_DELETE"; + this.cmiDelete.Click += new System.EventHandler(this.cmiDelete_Click); + // + // cmiCopy + // + this.cmiCopy.Image = ((System.Drawing.Image)(resources.GetObject("cmiCopy.Image"))); + this.cmiCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmiCopy.Name = "cmiCopy"; + this.cmiCopy.Size = new System.Drawing.Size(209, 38); + this.cmiCopy.Text = "M_COPY"; + this.cmiCopy.Click += new System.EventHandler(this.cmiCopy_Click); + // + // cmiCut + // + this.cmiCut.Image = ((System.Drawing.Image)(resources.GetObject("cmiCut.Image"))); + this.cmiCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmiCut.Name = "cmiCut"; + this.cmiCut.Size = new System.Drawing.Size(209, 38); + this.cmiCut.Text = "M_CUT"; + this.cmiCut.Click += new System.EventHandler(this.cmiCut_Click); + // + // cmiPaste + // + this.cmiPaste.Image = ((System.Drawing.Image)(resources.GetObject("cmiPaste.Image"))); + this.cmiPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmiPaste.Name = "cmiPaste"; + this.cmiPaste.Size = new System.Drawing.Size(209, 38); + this.cmiPaste.Text = "M_PASTE"; + this.cmiPaste.Click += new System.EventHandler(this.cmiPaste_Click); + // + // cmiAlign + // + this.cmiAlign.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiAlignLefts, + this.cmiAlignRights, + this.cmiAlignTops, + this.cmiAlignBottoms, + this.cmiAlignMiddles, + this.cmiAlignCenters, + this.cmiAlignToGrid}); + this.cmiAlign.Name = "cmiAlign"; + this.cmiAlign.Size = new System.Drawing.Size(209, 38); + this.cmiAlign.Text = "M_ALIGN"; + // + // cmiAlignLefts + // + this.cmiAlignLefts.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignLefts.Image"))); + this.cmiAlignLefts.Name = "cmiAlignLefts"; + this.cmiAlignLefts.Size = new System.Drawing.Size(181, 22); + this.cmiAlignLefts.Text = "M_ALIGN_LEFTS"; + this.cmiAlignLefts.Click += new System.EventHandler(this.cmiAlignLefts_Click); + // + // cmiAlignRights + // + this.cmiAlignRights.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignRights.Image"))); + this.cmiAlignRights.Name = "cmiAlignRights"; + this.cmiAlignRights.Size = new System.Drawing.Size(181, 22); + this.cmiAlignRights.Text = "M_ALIGN_RIGHTS"; + this.cmiAlignRights.Click += new System.EventHandler(this.cmiAlignRights_Click); + // + // cmiAlignTops + // + this.cmiAlignTops.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignTops.Image"))); + this.cmiAlignTops.Name = "cmiAlignTops"; + this.cmiAlignTops.Size = new System.Drawing.Size(181, 22); + this.cmiAlignTops.Text = "M_ALIGN_TOPS"; + this.cmiAlignTops.Click += new System.EventHandler(this.cmiAlignTops_Click); + // + // cmiAlignBottoms + // + this.cmiAlignBottoms.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignBottoms.Image"))); + this.cmiAlignBottoms.Name = "cmiAlignBottoms"; + this.cmiAlignBottoms.Size = new System.Drawing.Size(181, 22); + this.cmiAlignBottoms.Text = "M_ALIGN_BOTTOMS"; + this.cmiAlignBottoms.Click += new System.EventHandler(this.cmiAlignBottoms_Click); + // + // cmiAlignMiddles + // + this.cmiAlignMiddles.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignMiddles.Image"))); + this.cmiAlignMiddles.Name = "cmiAlignMiddles"; + this.cmiAlignMiddles.Size = new System.Drawing.Size(181, 22); + this.cmiAlignMiddles.Text = "M_ALIGN_MIDDLES"; + this.cmiAlignMiddles.Click += new System.EventHandler(this.cmiAlignMiddles_Click); + // + // cmiAlignCenters + // + this.cmiAlignCenters.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignCenters.Image"))); + this.cmiAlignCenters.Name = "cmiAlignCenters"; + this.cmiAlignCenters.Size = new System.Drawing.Size(181, 22); + this.cmiAlignCenters.Text = "M_ALIGN_CENTERS"; + this.cmiAlignCenters.Click += new System.EventHandler(this.cmiAlignCenters_Click); + // + // cmiAlignToGrid + // + this.cmiAlignToGrid.Image = ((System.Drawing.Image)(resources.GetObject("cmiAlignToGrid.Image"))); + this.cmiAlignToGrid.Name = "cmiAlignToGrid"; + this.cmiAlignToGrid.Size = new System.Drawing.Size(181, 22); + this.cmiAlignToGrid.Text = "M_ALIGN_TO_GRID"; + this.cmiAlignToGrid.Click += new System.EventHandler(this.cmiAlignToGrid_Click); + // + // cmiCenter + // + this.cmiCenter.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiCenterHorizontally, + this.cmiCenterVertically}); + this.cmiCenter.Name = "cmiCenter"; + this.cmiCenter.Size = new System.Drawing.Size(209, 38); + this.cmiCenter.Text = "M_CENTER"; + // + // cmiCenterHorizontally + // + this.cmiCenterHorizontally.Name = "cmiCenterHorizontally"; + this.cmiCenterHorizontally.Size = new System.Drawing.Size(221, 22); + this.cmiCenterHorizontally.Text = "M_CENTER_HORIZONTALLY"; + this.cmiCenterHorizontally.Click += new System.EventHandler(this.cmiCenterHorizontally_Click); + // + // cmiCenterVertically + // + this.cmiCenterVertically.Name = "cmiCenterVertically"; + this.cmiCenterVertically.Size = new System.Drawing.Size(221, 22); + this.cmiCenterVertically.Text = "M_CENTER_VERTICALLY"; + this.cmiCenterVertically.Click += new System.EventHandler(this.cmiCenterVertically_Click); + // + // cmiSizeTo + // + this.cmiSizeTo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiSizeToControl, + this.cmiSizeToControlWidth, + this.cmiSizeToControlHeight, + this.cmiSizeToGrid}); + this.cmiSizeTo.Name = "cmiSizeTo"; + this.cmiSizeTo.Size = new System.Drawing.Size(209, 38); + this.cmiSizeTo.Text = "M_SIZE_TO"; + // + // cmiSizeToControl + // + this.cmiSizeToControl.Name = "cmiSizeToControl"; + this.cmiSizeToControl.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToControl.Text = "M_SIZE_TO_CONTROL"; + this.cmiSizeToControl.Click += new System.EventHandler(this.cmiSizeToControl_Click); + // + // cmiSizeToControlWidth + // + this.cmiSizeToControlWidth.Name = "cmiSizeToControlWidth"; + this.cmiSizeToControlWidth.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToControlWidth.Text = "M_SIZE_TO_CONTROL_WIDTH"; + this.cmiSizeToControlWidth.Click += new System.EventHandler(this.cmiSizeToControlWidth_Click); + // + // cmiSizeToControlHeight + // + this.cmiSizeToControlHeight.Name = "cmiSizeToControlHeight"; + this.cmiSizeToControlHeight.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToControlHeight.Text = "M_SIZE_TO_CONTROL_HEIGHT"; + this.cmiSizeToControlHeight.Click += new System.EventHandler(this.cmiSizeToControlHeight_Click); + // + // cmiSizeToGrid + // + this.cmiSizeToGrid.Name = "cmiSizeToGrid"; + this.cmiSizeToGrid.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToGrid.Text = "M_SIZE_TO_GRID"; + // + // cmiZOrder + // + this.cmiZOrder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiBringToFront, + this.cmiSendToBack}); + this.cmiZOrder.Name = "cmiZOrder"; + this.cmiZOrder.Size = new System.Drawing.Size(209, 38); + this.cmiZOrder.Text = "M_Z_ORDER"; + // + // cmiBringToFront + // + this.cmiBringToFront.Image = ((System.Drawing.Image)(resources.GetObject("cmiBringToFront.Image"))); + this.cmiBringToFront.Name = "cmiBringToFront"; + this.cmiBringToFront.Size = new System.Drawing.Size(185, 22); + this.cmiBringToFront.Text = "M_BRING_TO_FRONT"; + this.cmiBringToFront.Click += new System.EventHandler(this.cmiBringToFront_Click); + // + // cmiSendToBack + // + this.cmiSendToBack.Image = ((System.Drawing.Image)(resources.GetObject("cmiSendToBack.Image"))); + this.cmiSendToBack.Name = "cmiSendToBack"; + this.cmiSendToBack.Size = new System.Drawing.Size(185, 22); + this.cmiSendToBack.Text = "M_SEND_TO_BACK"; + this.cmiSendToBack.Click += new System.EventHandler(this.cmiSendToBack_Click); + // + // cmiTabOrder + // + this.cmiTabOrder.Name = "cmiTabOrder"; + this.cmiTabOrder.Size = new System.Drawing.Size(209, 38); + this.cmiTabOrder.Text = "M_TAB_ORDER"; + this.cmiTabOrder.Click += new System.EventHandler(this.cmiTabOrder_Click); + // + // cmiProperties + // + this.cmiProperties.Image = ((System.Drawing.Image)(resources.GetObject("cmiProperties.Image"))); + this.cmiProperties.Name = "cmiProperties"; + this.cmiProperties.Size = new System.Drawing.Size(209, 38); + this.cmiProperties.Text = "M_SHOW_PROPERTIES"; + this.cmiProperties.Click += new System.EventHandler(this.cmiProperties_Click); + // + // BottomDockPanel + // + this.BottomDockPanel.AutoSize = true; + this.BottomDockPanel.BackColor = System.Drawing.SystemColors.Control; + this.BottomDockPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.BottomDockPanel.DocumentTabStripLocation = WeifenLuo.WinFormsUI.Docking.DocumentTabStripLocation.Bottom; + this.BottomDockPanel.Location = new System.Drawing.Point(0, 0); + this.BottomDockPanel.Name = "BottomDockPanel"; + this.BottomDockPanel.Size = new System.Drawing.Size(876, 207); + this.BottomDockPanel.TabIndex = 15; + // + // MPanel + // + this.MPanel.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.MPanel.Controls.Add(this.MainDockPanel); + this.MPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.MPanel.Location = new System.Drawing.Point(0, 0); + this.MPanel.Name = "MPanel"; + this.MPanel.Size = new System.Drawing.Size(876, 279); + this.MPanel.TabIndex = 17; + // + // BPanel + // + this.BPanel.BackColor = System.Drawing.SystemColors.ControlDarkDark; + this.BPanel.Controls.Add(this.BottomDockPanel); + this.BPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + this.BPanel.Location = new System.Drawing.Point(0, 284); + this.BPanel.Name = "BPanel"; + this.BPanel.Size = new System.Drawing.Size(876, 207); + this.BPanel.TabIndex = 18; + // + // AllPanel + // + this.AllPanel.BackColor = System.Drawing.SystemColors.ActiveCaptionText; + this.AllPanel.Controls.Add(this.MPanel); + this.AllPanel.Controls.Add(this.splitter1); + this.AllPanel.Controls.Add(this.BPanel); + this.AllPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.AllPanel.Location = new System.Drawing.Point(0, 49); + this.AllPanel.Name = "AllPanel"; + this.AllPanel.Size = new System.Drawing.Size(876, 491); + this.AllPanel.TabIndex = 12; + // + // splitter1 + // + this.splitter1.BackColor = System.Drawing.SystemColors.Control; + this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.splitter1.Location = new System.Drawing.Point(0, 279); + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(876, 5); + this.splitter1.TabIndex = 11; + this.splitter1.TabStop = false; + // + // Form1 + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(876, 562); + this.Controls.Add(this.AllPanel); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.toolStripPanel); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.IsMdiContainer = true; + this.KeyPreview = true; + this.MainMenuStrip = this.menuStrip1; + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.MinimumSize = new System.Drawing.Size(458, 431); + this.Name = "Form1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PascalABC.NET"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed); + this.Load += new System.EventHandler(this.Form1_Load); + this.Shown += new System.EventHandler(this.Form1_Shown); + this.LocationChanged += new System.EventHandler(this.Form1_LocationChanged); + this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.cmEditor.ResumeLayout(false); + this.toolStripPanel.ResumeLayout(false); + this.toolStripPanel.PerformLayout(); + this.cmBreakpointCondition.ResumeLayout(false); + this.cm_Designer.ResumeLayout(false); + this.MPanel.ResumeLayout(false); + this.BPanel.ResumeLayout(false); + this.BPanel.PerformLayout(); + this.AllPanel.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + private System.Windows.Forms.ToolStripMenuItem tsImmediateWindow; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem12; + + #endregion + + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripButton tbNew; + private System.Windows.Forms.ToolStripButton tbOpen; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem mrFile; + private System.Windows.Forms.ToolStripMenuItem miOpen; + private System.Windows.Forms.ToolStripMenuItem miSave; + private System.Windows.Forms.ToolStripMenuItem mrEdit; + private System.Windows.Forms.ToolStripMenuItem mrView; + private System.Windows.Forms.ToolStripMenuItem mrProgram; + private System.Windows.Forms.ToolStripMenuItem mrService; + private System.Windows.Forms.ToolStripMenuItem mrHelp; + private System.Windows.Forms.ToolStripButton tbSave; + private System.Windows.Forms.ToolStripButton tbSaveAll; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripButton tsCut; + private System.Windows.Forms.ToolStripButton tsCopy; + private System.Windows.Forms.ToolStripButton tsPaste; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripButton tsUndo; + private System.Windows.Forms.ToolStripButton tsRedo; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripButton StartButton; + private System.Windows.Forms.ToolStripButton stopButton; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripButton toolStripButton16; + private System.Windows.Forms.ToolStripButton toolStripButton17; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.ToolStripMenuItem miSaveAs; + private System.Windows.Forms.ToolStripMenuItem miClose; + private System.Windows.Forms.ToolStripMenuItem miCloseAllButThis; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem miRecentFiles; + private System.Windows.Forms.ToolStripMenuItem miRecentProjects; + private System.Windows.Forms.ToolStripMenuItem miExit; + private System.Windows.Forms.ToolStripMenuItem miUndo; + private System.Windows.Forms.ToolStripMenuItem miRedo; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; + private System.Windows.Forms.ToolStripMenuItem miCut; + private System.Windows.Forms.ToolStripMenuItem miCopy; + private System.Windows.Forms.ToolStripMenuItem miPaste; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; + private System.Windows.Forms.ToolStripMenuItem miFind; + private System.Windows.Forms.ToolStripMenuItem miReplace; + private System.Windows.Forms.ToolStripMenuItem miFindNext; + private System.Windows.Forms.ToolStripMenuItem miOutputWindow; + private System.Windows.Forms.ToolStripMenuItem miClearOutput; + private System.Windows.Forms.ToolStripMenuItem miStop; + private System.Windows.Forms.ToolStripMenuItem miAbout; + private System.Windows.Forms.ToolStripButton toolStripButton19; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.ToolStripMenuItem miNew; + private System.Windows.Forms.PrintDialog printDialog1; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.ToolStripMenuItem miRun; + private System.Windows.Forms.FontDialog fontDialog1; + private System.Windows.Forms.ToolStripMenuItem cmClose; + private System.Windows.Forms.ToolStripMenuItem cmCloseAllButThis; + private System.Windows.Forms.ToolStripMenuItem cmSave; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripButton CompileButton; + private System.Windows.Forms.ToolStripButton ReCompileButton; + private System.Windows.Forms.ToolStripMenuItem miBuild; + private System.Windows.Forms.ToolStripMenuItem miRebuild; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; + public System.Windows.Forms.ToolStripStatusLabel slLine; + public System.Windows.Forms.ToolStripStatusLabel slCol; + private System.Windows.Forms.ToolStripMenuItem miPlugins; + private System.Windows.Forms.ToolStripMenuItem miSaveAll; + private System.Windows.Forms.ToolStripDropDownButton tstaSelect; + private System.Windows.Forms.ToolStripMenuItem tsatConsoleApplication; + private System.Windows.Forms.ToolStripMenuItem tsatWindowsApplication; + private System.Windows.Forms.ToolStripMenuItem tsatDll; + public System.Windows.Forms.ContextMenuStrip cmEditor; + private System.Windows.Forms.ToolStripMenuItem cmCut; + private System.Windows.Forms.ToolStripMenuItem cmCopy; + private System.Windows.Forms.ToolStripMenuItem cmPaste; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripMenuItem cmRun; + private System.Windows.Forms.ToolStripMenuItem miNavigBack; + private System.Windows.Forms.ToolStripMenuItem miNavigForw; + private System.Windows.Forms.ToolStripButton tsNavigBack; + private System.Windows.Forms.ToolStripButton tsNavigForw; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; + private System.Windows.Forms.ToolStripMenuItem cmSetActive; + private System.Windows.Forms.ToolStripSeparator tssRunStopSeparator; + private System.Windows.Forms.ToolStripButton tsOutputWindow; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem7; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8; + private System.Windows.Forms.ToolStripMenuItem mGOTONEXTBOOKMARKToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mGOTOPREVBOOKMARKToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mCLEARBOOKMARKSToolStripMenuItem; + private System.Windows.Forms.ToolStripButton StartNoDebugButton; + private System.Windows.Forms.ToolStripMenuItem miRunNoDebug; + private System.Windows.Forms.ToolStripMenuItem tsHelp; + private System.Windows.Forms.ToolStripMenuItem cmGotoDefinition; + private System.Windows.Forms.ToolStripSeparator cmsCodeCompletion; + private System.Windows.Forms.ToolStripMenuItem cmGotoRealization; + private System.Windows.Forms.ToolStripMenuItem cmFindAllReferences; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.ColumnHeader columnHeader3; + private System.Windows.Forms.ColumnHeader columnHeader4; + private System.Windows.Forms.ColumnHeader columnHeader5; + private System.Windows.Forms.ToolStripMenuItem cmGenerateRealization; + private System.Windows.Forms.ToolStripSeparator tssmIntellisence; + private System.Windows.Forms.ToolStripMenuItem tsGotoDefinition; + private System.Windows.Forms.ToolStripMenuItem tsGotoRealization; + private System.Windows.Forms.ToolStripMenuItem tsFindAllReferences; + private System.Windows.Forms.ToolStripMenuItem miGenerateRealization; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; + private System.Windows.Forms.ToolStripMenuItem tsSelectAll; + private System.Windows.Forms.ToolStripMenuItem tsGotoLine; + public WeifenLuo.WinFormsUI.Docking.DockPanel MainDockPanel; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; + private System.Windows.Forms.ToolStripMenuItem tsShowCompilerConsoleWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowDebugVariablesListWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowErrorsListWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowDebugWatchListWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowFindSymbolsResultWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowOutputWindow; + private System.Windows.Forms.ToolStripMenuItem mOPTIONSToolStripMenuItem; + private System.Windows.Forms.Panel toolStripPanel; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; + private System.Windows.Forms.ToolStripMenuItem tsViewIntellisensePanel; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; + private System.Windows.Forms.ToolStripMenuItem miAddExpr; + private System.Windows.Forms.ToolStripMenuItem cntxt_miAddExpr; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; + private System.Windows.Forms.ContextMenuStrip cmBreakpointCondition; + private System.Windows.Forms.ToolStripMenuItem mDELETEBREAKPOINTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mBREAKPOINTCONDITIONToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem miNewAdv; + private System.Windows.Forms.ToolStripMenuItem miUnitWithForm; + private System.Windows.Forms.ToolStripMenuItem miToolBox; + private System.Windows.Forms.ToolStripMenuItem miProperties; + private System.Windows.Forms.ToolStripMenuItem miFormProgram; + private System.Windows.Forms.ToolStripMenuItem mrDesigner; + private System.Windows.Forms.ToolStripMenuItem miShowGrid; + private System.Windows.Forms.ToolStripMenuItem miSnapToGrid; + private System.Windows.Forms.ToolStripMenuItem miAlign; + private System.Windows.Forms.ToolStripMenuItem miCenter; + private System.Windows.Forms.ToolStripMenuItem miSizeTo; + private System.Windows.Forms.ToolStripMenuItem miZOrder; + private System.Windows.Forms.ToolStripMenuItem miTabOrder; + private System.Windows.Forms.ToolStripMenuItem miAlignLefts; + private System.Windows.Forms.ToolStripMenuItem miAlignRights; + private System.Windows.Forms.ToolStripMenuItem miAlignTops; + private System.Windows.Forms.ToolStripMenuItem miAlignBottoms; + private System.Windows.Forms.ToolStripMenuItem miAlignMiddles; + private System.Windows.Forms.ToolStripMenuItem miAlignCenters; + private System.Windows.Forms.ToolStripMenuItem miAlignToGrid; + private System.Windows.Forms.ToolStripMenuItem miCenterHorizontally; + private System.Windows.Forms.ToolStripMenuItem miCenterVertically; + private System.Windows.Forms.ToolStripMenuItem miSizeToControl; + private System.Windows.Forms.ToolStripMenuItem miSizeToControlWidth; + private System.Windows.Forms.ToolStripMenuItem miSizeToControlHeight; + private System.Windows.Forms.ToolStripMenuItem miSizeToGrid; + private System.Windows.Forms.ToolStripMenuItem miBringToFront; + private System.Windows.Forms.ToolStripMenuItem miSendToBack; + private System.Windows.Forms.ToolStripMenuItem miDelete; + private System.Windows.Forms.ToolStripMenuItem mMAINFEATURESToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem miNewProject; + private System.Windows.Forms.ToolStripMenuItem miCloseProject; + private System.Windows.Forms.ToolStripMenuItem miOpenProject; + private System.Windows.Forms.OpenFileDialog openProjectDialog; + private System.Windows.Forms.ToolStripMenuItem mRPROJECTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mADDFORMToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mADDFILEToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6; + private System.Windows.Forms.ToolStripMenuItem mADDREFERENCEToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mPROPERTIESToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mADDEXISTFILEToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem9; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem10; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem11; + private System.Windows.Forms.ToolStripMenuItem mRUNPARAMETERSToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mRUNPARAMETERSToolStripMenuItem1; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem13; + public System.Windows.Forms.ContextMenuStrip cm_Designer; + private System.Windows.Forms.ToolStripMenuItem cmiDelete; + private System.Windows.Forms.ToolStripMenuItem cmiAlign; + private System.Windows.Forms.ToolStripMenuItem cmiCenter; + private System.Windows.Forms.ToolStripMenuItem cmiSizeTo; + private System.Windows.Forms.ToolStripMenuItem cmiZOrder; + private System.Windows.Forms.ToolStripMenuItem cmiTabOrder; + private System.Windows.Forms.ToolStripMenuItem cmiCopy; + private System.Windows.Forms.ToolStripMenuItem cmiCut; + private System.Windows.Forms.ToolStripMenuItem cmiPaste; + private System.Windows.Forms.ToolStripMenuItem cmiAlignLefts; + private System.Windows.Forms.ToolStripMenuItem cmiAlignRights; + private System.Windows.Forms.ToolStripMenuItem cmiAlignTops; + private System.Windows.Forms.ToolStripMenuItem cmiAlignBottoms; + private System.Windows.Forms.ToolStripMenuItem cmiAlignMiddles; + private System.Windows.Forms.ToolStripMenuItem cmiAlignCenters; + private System.Windows.Forms.ToolStripMenuItem cmiAlignToGrid; + private System.Windows.Forms.ToolStripMenuItem cmiCenterHorizontally; + private System.Windows.Forms.ToolStripMenuItem cmiCenterVertically; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToControl; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToControlWidth; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToControlHeight; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToGrid; + private System.Windows.Forms.ToolStripMenuItem cmiBringToFront; + private System.Windows.Forms.ToolStripMenuItem cmiSendToBack; + private System.Windows.Forms.ToolStripMenuItem mFORMATToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cmFormat; + private System.Windows.Forms.ToolStripButton tsFormat; + private System.Windows.Forms.ToolStripMenuItem mNEWASPToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mDOTNETHELPToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cmViewCode; + private System.Windows.Forms.ToolStripMenuItem cmiProperties; + private System.Windows.Forms.ToolStripMenuItem miPrint; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; + private System.Windows.Forms.ToolStripMenuItem miProjectExplorer; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; + private System.Windows.Forms.ToolStripMenuItem cmHelp; + private System.Windows.Forms.ToolStripMenuItem cmSamples; + private System.Windows.Forms.ToolStripMenuItem miCheckUpdates; + private System.Windows.Forms.ToolStripMenuItem cmCollapseRegions; + private System.Windows.Forms.ToolStripMenuItem tsDisassembly; + private System.Windows.Forms.ToolStripButton tsAutoInsertCode; + private System.Windows.Forms.ToolStripMenuItem mAUTOINSERTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mUNITTESTSToolStripMenuItem; + private System.Windows.Forms.ToolStripButton toolStripButton1; + private System.Windows.Forms.ToolStripStatusLabel HealthLabel; + private WeifenLuo.WinFormsUI.Docking.DockPanel BottomDockPanel; + private System.Windows.Forms.Panel MPanel; + private System.Windows.Forms.Panel BPanel; + private System.Windows.Forms.Panel AllPanel; + private System.Windows.Forms.Splitter splitter1; + private WeifenLuo.WinFormsUI.Docking.VS2005Theme vS2005Theme1; + } +} + diff --git a/VisualPascalABCNETLinux/Form1.Designer.cs1 b/VisualPascalABCNETLinux/Form1.Designer.cs1 new file mode 100644 index 000000000..b9b6174eb --- /dev/null +++ b/VisualPascalABCNETLinux/Form1.Designer.cs1 @@ -0,0 +1,2637 @@ +namespace VisualPascalABC +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.mrFile = new System.Windows.Forms.ToolStripMenuItem(); + this.miNew = new System.Windows.Forms.ToolStripMenuItem(); + this.miNewProject = new System.Windows.Forms.ToolStripMenuItem(); + this.miNewAdv = new System.Windows.Forms.ToolStripMenuItem(); + this.miUnitWithForm = new System.Windows.Forms.ToolStripMenuItem(); + this.miFormProgram = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator(); + this.miOpen = new System.Windows.Forms.ToolStripMenuItem(); + this.miOpenProject = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripSeparator(); + this.miSave = new System.Windows.Forms.ToolStripMenuItem(); + this.miSaveAs = new System.Windows.Forms.ToolStripMenuItem(); + this.miSaveAll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator(); + this.miClose = new System.Windows.Forms.ToolStripMenuItem(); + this.miCloseProject = new System.Windows.Forms.ToolStripMenuItem(); + this.miCloseAllButThis = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.miPrint = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); + this.miRecentFiles = new System.Windows.Forms.ToolStripMenuItem(); + this.miRecentProjects = new System.Windows.Forms.ToolStripMenuItem(); + this.miExit = new System.Windows.Forms.ToolStripMenuItem(); + this.mrEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.miUndo = new System.Windows.Forms.ToolStripMenuItem(); + this.miRedo = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); + this.miCut = new System.Windows.Forms.ToolStripMenuItem(); + this.miCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.miPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.miDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); + this.miFind = new System.Windows.Forms.ToolStripMenuItem(); + this.miFindNext = new System.Windows.Forms.ToolStripMenuItem(); + this.miReplace = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoLine = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.tsSelectAll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); + this.mGOTONEXTBOOKMARKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mGOTOPREVBOOKMARKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mCLEARBOOKMARKSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mrView = new System.Windows.Forms.ToolStripMenuItem(); + this.miClearOutput = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.miOutputWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowOutputWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowErrorsListWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowCompilerConsoleWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowFindSymbolsResultWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowDebugVariablesListWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsShowDebugWatchListWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.tsDisassembly = new System.Windows.Forms.ToolStripMenuItem(); + this.tsImmediateWindow = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator(); + this.tsViewIntellisensePanel = new System.Windows.Forms.ToolStripMenuItem(); + this.miProjectExplorer = new System.Windows.Forms.ToolStripMenuItem(); + this.miToolBox = new System.Windows.Forms.ToolStripMenuItem(); + this.miProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); + this.miNavigBack = new System.Windows.Forms.ToolStripMenuItem(); + this.miNavigForw = new System.Windows.Forms.ToolStripMenuItem(); + this.mRPROJECTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mADDFILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mADDEXISTFILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mADDFORMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); + this.mADDREFERENCEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mPROPERTIESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mrProgram = new System.Windows.Forms.ToolStripMenuItem(); + this.miRun = new System.Windows.Forms.ToolStripMenuItem(); + this.miRunNoDebug = new System.Windows.Forms.ToolStripMenuItem(); + this.mRUNPARAMETERSToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.miStop = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); + this.miBuild = new System.Windows.Forms.ToolStripMenuItem(); + this.miRebuild = new System.Windows.Forms.ToolStripMenuItem(); + this.miAddExpr = new System.Windows.Forms.ToolStripMenuItem(); + this.mrDesigner = new System.Windows.Forms.ToolStripMenuItem(); + this.miShowGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miSnapToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlign = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignLefts = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignRights = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignTops = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignBottoms = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignMiddles = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignCenters = new System.Windows.Forms.ToolStripMenuItem(); + this.miAlignToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miCenter = new System.Windows.Forms.ToolStripMenuItem(); + this.miCenterHorizontally = new System.Windows.Forms.ToolStripMenuItem(); + this.miCenterVertically = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeTo = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToControl = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToControlWidth = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToControlHeight = new System.Windows.Forms.ToolStripMenuItem(); + this.miSizeToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.miZOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.miBringToFront = new System.Windows.Forms.ToolStripMenuItem(); + this.miSendToBack = new System.Windows.Forms.ToolStripMenuItem(); + this.miTabOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.mrService = new System.Windows.Forms.ToolStripMenuItem(); + this.mOPTIONSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tssmIntellisence = new System.Windows.Forms.ToolStripSeparator(); + this.mAUTOINSERTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoDefinition = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.tsFindAllReferences = new System.Windows.Forms.ToolStripMenuItem(); + this.miGenerateRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.mFORMATToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mUNITTESTSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.miPlugins = new System.Windows.Forms.ToolStripMenuItem(); + this.mrHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.tsHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.mDOTNETHELPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mMAINFEATURESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.miCheckUpdates = new System.Windows.Forms.ToolStripMenuItem(); + this.miAbout = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.tbNew = new System.Windows.Forms.ToolStripButton(); + this.tbOpen = new System.Windows.Forms.ToolStripButton(); + this.tbSave = new System.Windows.Forms.ToolStripButton(); + this.tbSaveAll = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.tsCut = new System.Windows.Forms.ToolStripButton(); + this.tsCopy = new System.Windows.Forms.ToolStripButton(); + this.tsPaste = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.tsUndo = new System.Windows.Forms.ToolStripButton(); + this.tsRedo = new System.Windows.Forms.ToolStripButton(); + this.tsNavigBack = new System.Windows.Forms.ToolStripButton(); + this.tsNavigForw = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.StartButton = new System.Windows.Forms.ToolStripButton(); + this.StartNoDebugButton = new System.Windows.Forms.ToolStripButton(); + this.stopButton = new System.Windows.Forms.ToolStripButton(); + this.CompileButton = new System.Windows.Forms.ToolStripButton(); + this.ReCompileButton = new System.Windows.Forms.ToolStripButton(); + this.tssRunStopSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.tsOutputWindow = new System.Windows.Forms.ToolStripButton(); + this.tsAutoInsertCode = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); + this.tsFormat = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.tstaSelect = new System.Windows.Forms.ToolStripDropDownButton(); + this.tsatConsoleApplication = new System.Windows.Forms.ToolStripMenuItem(); + this.tsatWindowsApplication = new System.Windows.Forms.ToolStripMenuItem(); + this.tsatDll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripButton16 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton17 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton19 = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel5 = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.slLine = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel(); + this.slCol = new System.Windows.Forms.ToolStripStatusLabel(); + this.HealthLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.printDialog1 = new System.Windows.Forms.PrintDialog(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.fontDialog1 = new System.Windows.Forms.FontDialog(); + this.cmClose = new System.Windows.Forms.ToolStripMenuItem(); + this.cmCloseAllButThis = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmSave = new System.Windows.Forms.ToolStripMenuItem(); + this.cmSetActive = new System.Windows.Forms.ToolStripMenuItem(); + this.cmEditor = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmGotoDefinition = new System.Windows.Forms.ToolStripMenuItem(); + this.cmGotoRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.cmFindAllReferences = new System.Windows.Forms.ToolStripMenuItem(); + this.cmGenerateRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.cmFormat = new System.Windows.Forms.ToolStripMenuItem(); + this.cmCollapseRegions = new System.Windows.Forms.ToolStripMenuItem(); + this.mNEWASPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cmsCodeCompletion = new System.Windows.Forms.ToolStripSeparator(); + this.cmCut = new System.Windows.Forms.ToolStripMenuItem(); + this.cmCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.cmPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.cmRun = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); + this.cntxt_miAddExpr = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); + this.cmHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.cmSamples = new System.Windows.Forms.ToolStripMenuItem(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.MainDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); + this.toolStripPanel = new System.Windows.Forms.Panel(); + this.cmBreakpointCondition = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mDELETEBREAKPOINTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mBREAKPOINTCONDITIONToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.openProjectDialog = new System.Windows.Forms.OpenFileDialog(); + this.mRUNPARAMETERSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cm_Designer = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmViewCode = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCut = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiPaste = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlign = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignLefts = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignRights = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignTops = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignBottoms = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignMiddles = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignCenters = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiAlignToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCenter = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCenterHorizontally = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiCenterVertically = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeTo = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToControl = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToControlWidth = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToControlHeight = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSizeToGrid = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiZOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiBringToFront = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiSendToBack = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiTabOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.cmiProperties = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.toolStrip1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.cmEditor.SuspendLayout(); + this.toolStripPanel.SuspendLayout(); + this.cmBreakpointCondition.SuspendLayout(); + this.cm_Designer.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.BackColor = System.Drawing.SystemColors.Control; + this.menuStrip1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mrFile, + this.mrEdit, + this.mrView, + this.mRPROJECTToolStripMenuItem, + this.mrProgram, + this.mrDesigner, + this.mrService, + this.miPlugins, + this.mrHelp}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(876, 24); + this.menuStrip1.TabIndex = 3; + this.menuStrip1.Text = "menuStrip1"; + // + // mrFile + // + this.mrFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miNew, + this.miNewProject, + this.miNewAdv, + this.toolStripMenuItem9, + this.miOpen, + this.miOpenProject, + this.toolStripMenuItem10, + this.miSave, + this.miSaveAs, + this.miSaveAll, + this.toolStripMenuItem11, + this.miClose, + this.miCloseProject, + this.miCloseAllButThis, + this.toolStripMenuItem2, + this.miPrint, + this.toolStripSeparator14, + this.miRecentFiles, + this.miRecentProjects, + this.miExit}); + this.mrFile.Name = "mrFile"; + this.mrFile.Size = new System.Drawing.Size(61, 20); + this.mrFile.Text = "MR_FILE"; + // + // miNew + // + this.miNew.Image = global::VisualPascalABC.Properties.Resources.new_file1; + this.miNew.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miNew.Name = "miNew"; + this.miNew.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.miNew.Size = new System.Drawing.Size(194, 22); + this.miNew.Text = "M_NEW"; + this.miNew.Click += new System.EventHandler(this.miNew_Click); + // + // miNewProject + // + this.miNewProject.Name = "miNewProject"; + this.miNewProject.Size = new System.Drawing.Size(194, 22); + this.miNewProject.Text = "M_NEW_PROJECT"; + this.miNewProject.Visible = false; + this.miNewProject.Click += new System.EventHandler(this.miNewProject_Click); + // + // miNewAdv + // + this.miNewAdv.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miUnitWithForm, + this.miFormProgram}); + this.miNewAdv.Name = "miNewAdv"; + this.miNewAdv.Size = new System.Drawing.Size(194, 22); + this.miNewAdv.Text = "M_NEW_ADV"; + this.miNewAdv.Visible = false; + // + // miUnitWithForm + // + this.miUnitWithForm.Name = "miUnitWithForm"; + this.miUnitWithForm.Size = new System.Drawing.Size(180, 22); + this.miUnitWithForm.Text = "M_UNIT_WITH_FORM"; + this.miUnitWithForm.Click += new System.EventHandler(this.miUnitWithForm_Click); + // + // miFormProgram + // + this.miFormProgram.Name = "miFormProgram"; + this.miFormProgram.Size = new System.Drawing.Size(180, 22); + this.miFormProgram.Text = "M_FORM_PROGRAM"; + // + // toolStripMenuItem9 + // + this.toolStripMenuItem9.Name = "toolStripMenuItem9"; + this.toolStripMenuItem9.Size = new System.Drawing.Size(191, 6); + // + // miOpen + // + this.miOpen.Image = global::VisualPascalABC.Properties.Resources.open; + this.miOpen.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miOpen.Name = "miOpen"; + this.miOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.miOpen.Size = new System.Drawing.Size(194, 22); + this.miOpen.Text = "M_OPEN"; + this.miOpen.Click += new System.EventHandler(this.OpenToolStripMenuItem1_Click_1); + // + // miOpenProject + // + this.miOpenProject.Name = "miOpenProject"; + this.miOpenProject.Size = new System.Drawing.Size(194, 22); + this.miOpenProject.Text = "M_OPEN_PROJECT"; + this.miOpenProject.Visible = false; + this.miOpenProject.Click += new System.EventHandler(this.miOpenProject_Click); + // + // toolStripMenuItem10 + // + this.toolStripMenuItem10.Name = "toolStripMenuItem10"; + this.toolStripMenuItem10.Size = new System.Drawing.Size(191, 6); + // + // miSave + // + this.miSave.Enabled = false; + this.miSave.Image = global::VisualPascalABC.Properties.Resources.save; + this.miSave.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miSave.Name = "miSave"; + this.miSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.miSave.Size = new System.Drawing.Size(194, 22); + this.miSave.Text = "M_SAVE"; + this.miSave.Click += new System.EventHandler(this.miSave_Click); + // + // miSaveAs + // + this.miSaveAs.Name = "miSaveAs"; + this.miSaveAs.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.S))); + this.miSaveAs.Size = new System.Drawing.Size(194, 22); + this.miSaveAs.Text = "M_SAVEAS"; + this.miSaveAs.Click += new System.EventHandler(this.miSaveAs_Click); + // + // miSaveAll + // + this.miSaveAll.Enabled = false; + this.miSaveAll.Image = global::VisualPascalABC.Properties.Resources.save_all; + this.miSaveAll.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miSaveAll.Name = "miSaveAll"; + this.miSaveAll.Size = new System.Drawing.Size(194, 22); + this.miSaveAll.Text = "M_SAVEALL"; + this.miSaveAll.Click += new System.EventHandler(this.miSaveAll_Click_1); + // + // toolStripMenuItem11 + // + this.toolStripMenuItem11.Name = "toolStripMenuItem11"; + this.toolStripMenuItem11.Size = new System.Drawing.Size(191, 6); + // + // miClose + // + this.miClose.Enabled = false; + this.miClose.Name = "miClose"; + this.miClose.Size = new System.Drawing.Size(194, 22); + this.miClose.Text = "M_CLOSE"; + this.miClose.Click += new System.EventHandler(this.miClose_Click); + // + // miCloseProject + // + this.miCloseProject.Name = "miCloseProject"; + this.miCloseProject.Size = new System.Drawing.Size(194, 22); + this.miCloseProject.Text = "M_CLOSE_PROJECT"; + this.miCloseProject.Visible = false; + this.miCloseProject.Click += new System.EventHandler(this.miCloseProject_Click); + // + // miCloseAllButThis + // + this.miCloseAllButThis.Enabled = false; + this.miCloseAllButThis.Name = "miCloseAllButThis"; + this.miCloseAllButThis.Size = new System.Drawing.Size(194, 22); + this.miCloseAllButThis.Text = "M_CLOSEALLBUTTHIS"; + this.miCloseAllButThis.Click += new System.EventHandler(this.miCloseNonActive_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(191, 6); + // + // miPrint + // + this.miPrint.Image = global::VisualPascalABC.Properties.Resources.PrintHS; + this.miPrint.Name = "miPrint"; + this.miPrint.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.miPrint.Size = new System.Drawing.Size(194, 22); + this.miPrint.Text = "M_PRINT"; + this.miPrint.Click += new System.EventHandler(this.miPrint_Click); + // + // toolStripSeparator14 + // + this.toolStripSeparator14.Name = "toolStripSeparator14"; + this.toolStripSeparator14.Size = new System.Drawing.Size(191, 6); + // + // miRecentFiles + // + this.miRecentFiles.Name = "miRecentFiles"; + this.miRecentFiles.Size = new System.Drawing.Size(194, 22); + this.miRecentFiles.Text = "M_RECENTFILES"; + // + // miRecentProjects + // + this.miRecentProjects.Name = "miRecentProjects"; + this.miRecentProjects.Size = new System.Drawing.Size(194, 22); + this.miRecentProjects.Text = "M_RECENTPROJECTS"; + this.miRecentProjects.Visible = false; + // + // miExit + // + this.miExit.Image = ((System.Drawing.Image)(resources.GetObject("miExit.Image"))); + this.miExit.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miExit.Name = "miExit"; + this.miExit.Size = new System.Drawing.Size(194, 22); + this.miExit.Text = "M_EXIT"; + this.miExit.Click += new System.EventHandler(this.ExitToolStripMenuItem_Click); + // + // mrEdit + // + this.mrEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miUndo, + this.miRedo, + this.toolStripMenuItem3, + this.miCut, + this.miCopy, + this.miPaste, + this.miDelete, + this.toolStripMenuItem4, + this.miFind, + this.miFindNext, + this.miReplace, + this.tsGotoLine, + this.toolStripSeparator8, + this.tsSelectAll, + this.toolStripSeparator9, + this.toolStripMenuItem7}); + this.mrEdit.Name = "mrEdit"; + this.mrEdit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.mrEdit.Size = new System.Drawing.Size(63, 20); + this.mrEdit.Text = "MR_EDIT"; + // + // miUndo + // + this.miUndo.Image = global::VisualPascalABC.Properties.Resources.undo; + this.miUndo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miUndo.Name = "miUndo"; + this.miUndo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.miUndo.Size = new System.Drawing.Size(186, 22); + this.miUndo.Text = "M_UNDO"; + this.miUndo.Click += new System.EventHandler(this.UndoToolStripMenuItem_Click); + // + // miRedo + // + this.miRedo.Image = global::VisualPascalABC.Properties.Resources.redo; + this.miRedo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miRedo.Name = "miRedo"; + this.miRedo.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.Z))); + this.miRedo.Size = new System.Drawing.Size(186, 22); + this.miRedo.Text = "M_REDO"; + this.miRedo.Click += new System.EventHandler(this.RedoToolStripMenuItem_Click); + // + // toolStripMenuItem3 + // + this.toolStripMenuItem3.Name = "toolStripMenuItem3"; + this.toolStripMenuItem3.Size = new System.Drawing.Size(183, 6); + // + // miCut + // + this.miCut.Image = global::VisualPascalABC.Properties.Resources.cut; + this.miCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miCut.Name = "miCut"; + this.miCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.miCut.Size = new System.Drawing.Size(186, 22); + this.miCut.Text = "M_CUT"; + this.miCut.Click += new System.EventHandler(this.miCurt_Click); + // + // miCopy + // + this.miCopy.Image = global::VisualPascalABC.Properties.Resources.copy; + this.miCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miCopy.Name = "miCopy"; + this.miCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.miCopy.Size = new System.Drawing.Size(186, 22); + this.miCopy.Text = "M_COPY"; + this.miCopy.Click += new System.EventHandler(this.miCopy_Click); + // + // miPaste + // + this.miPaste.Image = global::VisualPascalABC.Properties.Resources.paste; + this.miPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miPaste.Name = "miPaste"; + this.miPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.miPaste.Size = new System.Drawing.Size(186, 22); + this.miPaste.Text = "M_PASTE"; + this.miPaste.Click += new System.EventHandler(this.miPaste_Click); + // + // miDelete + // + this.miDelete.Enabled = false; + this.miDelete.Image = global::VisualPascalABC.Properties.Resources.Delete3; + this.miDelete.ImageTransparentColor = System.Drawing.Color.White; + this.miDelete.Name = "miDelete"; + this.miDelete.Size = new System.Drawing.Size(186, 22); + this.miDelete.Text = "M_DELETE"; + this.miDelete.Visible = false; + this.miDelete.Click += new System.EventHandler(this.miDelete_Click); + // + // toolStripMenuItem4 + // + this.toolStripMenuItem4.Name = "toolStripMenuItem4"; + this.toolStripMenuItem4.Size = new System.Drawing.Size(183, 6); + // + // miFind + // + this.miFind.Image = ((System.Drawing.Image)(resources.GetObject("miFind.Image"))); + this.miFind.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miFind.Name = "miFind"; + this.miFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); + this.miFind.Size = new System.Drawing.Size(186, 22); + this.miFind.Text = "M_FIND"; + this.miFind.Click += new System.EventHandler(this.miFind_Click); + // + // miFindNext + // + this.miFindNext.Image = ((System.Drawing.Image)(resources.GetObject("miFindNext.Image"))); + this.miFindNext.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miFindNext.Name = "miFindNext"; + this.miFindNext.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.miFindNext.Size = new System.Drawing.Size(186, 22); + this.miFindNext.Text = "M_FINDNEXT"; + this.miFindNext.Click += new System.EventHandler(this.miFindNext_Click); + // + // miReplace + // + this.miReplace.Image = ((System.Drawing.Image)(resources.GetObject("miReplace.Image"))); + this.miReplace.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miReplace.Name = "miReplace"; + this.miReplace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); + this.miReplace.Size = new System.Drawing.Size(186, 22); + this.miReplace.Text = "M_REPLACE"; + this.miReplace.Click += new System.EventHandler(this.miReplace_Click); + // + // tsGotoLine + // + this.tsGotoLine.Name = "tsGotoLine"; + this.tsGotoLine.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); + this.tsGotoLine.Size = new System.Drawing.Size(186, 22); + this.tsGotoLine.Text = "M_GOTO_LINE"; + this.tsGotoLine.Click += new System.EventHandler(this.tsGotoLine_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(183, 6); + // + // tsSelectAll + // + this.tsSelectAll.Name = "tsSelectAll"; + this.tsSelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.tsSelectAll.Size = new System.Drawing.Size(186, 22); + this.tsSelectAll.Text = "M_SELECT_ALL"; + this.tsSelectAll.Click += new System.EventHandler(this.tsSelectAll_Click); + // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(183, 6); + // + // toolStripMenuItem7 + // + this.toolStripMenuItem7.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem8, + this.mGOTONEXTBOOKMARKToolStripMenuItem, + this.mGOTOPREVBOOKMARKToolStripMenuItem, + this.mCLEARBOOKMARKSToolStripMenuItem}); + this.toolStripMenuItem7.Name = "toolStripMenuItem7"; + this.toolStripMenuItem7.Size = new System.Drawing.Size(186, 22); + this.toolStripMenuItem7.Text = "M_BOOKMARS"; + // + // toolStripMenuItem8 + // + this.toolStripMenuItem8.Image = ((System.Drawing.Image)(resources.GetObject("toolStripMenuItem8.Image"))); + this.toolStripMenuItem8.Name = "toolStripMenuItem8"; + this.toolStripMenuItem8.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F2))); + this.toolStripMenuItem8.Size = new System.Drawing.Size(238, 22); + this.toolStripMenuItem8.Text = "M_TOGGLEBOOKMARK"; + this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click); + // + // mGOTONEXTBOOKMARKToolStripMenuItem + // + this.mGOTONEXTBOOKMARKToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mGOTONEXTBOOKMARKToolStripMenuItem.Image"))); + this.mGOTONEXTBOOKMARKToolStripMenuItem.Name = "mGOTONEXTBOOKMARKToolStripMenuItem"; + this.mGOTONEXTBOOKMARKToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; + this.mGOTONEXTBOOKMARKToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + this.mGOTONEXTBOOKMARKToolStripMenuItem.Text = "M_GOTONEXTBOOKMARK"; + this.mGOTONEXTBOOKMARKToolStripMenuItem.Click += new System.EventHandler(this.mGOTONEXTBOOKMARKToolStripMenuItem_Click); + // + // mGOTOPREVBOOKMARKToolStripMenuItem + // + this.mGOTOPREVBOOKMARKToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mGOTOPREVBOOKMARKToolStripMenuItem.Image"))); + this.mGOTOPREVBOOKMARKToolStripMenuItem.Name = "mGOTOPREVBOOKMARKToolStripMenuItem"; + this.mGOTOPREVBOOKMARKToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F2))); + this.mGOTOPREVBOOKMARKToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + this.mGOTOPREVBOOKMARKToolStripMenuItem.Text = "M_GOTOPREVBOOKMARK"; + this.mGOTOPREVBOOKMARKToolStripMenuItem.Click += new System.EventHandler(this.mGOTOPREVBOOKMARKToolStripMenuItem_Click); + // + // mCLEARBOOKMARKSToolStripMenuItem + // + this.mCLEARBOOKMARKSToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mCLEARBOOKMARKSToolStripMenuItem.Image"))); + this.mCLEARBOOKMARKSToolStripMenuItem.Name = "mCLEARBOOKMARKSToolStripMenuItem"; + this.mCLEARBOOKMARKSToolStripMenuItem.Size = new System.Drawing.Size(238, 22); + this.mCLEARBOOKMARKSToolStripMenuItem.Text = "M_CLEARBOOKMARKS"; + this.mCLEARBOOKMARKSToolStripMenuItem.Click += new System.EventHandler(this.mCLEARBOOKMARKSToolStripMenuItem_Click); + // + // mrView + // + this.mrView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miClearOutput, + this.toolStripSeparator10, + this.miOutputWindow, + this.tsShowOutputWindow, + this.tsShowErrorsListWindow, + this.tsShowCompilerConsoleWindow, + this.tsShowFindSymbolsResultWindow, + this.tsShowDebugVariablesListWindow, + this.tsShowDebugWatchListWindow, + this.tsDisassembly, + this.tsImmediateWindow, + this.toolStripMenuItem12, + this.tsViewIntellisensePanel, + this.miProjectExplorer, + this.miToolBox, + this.miProperties, + this.toolStripSeparator11, + this.miNavigBack, + this.miNavigForw}); + this.mrView.Name = "mrView"; + this.mrView.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.mrView.Size = new System.Drawing.Size(66, 20); + this.mrView.Text = "MR_VIEW"; + // + // miClearOutput + // + this.miClearOutput.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miClearOutput.Name = "miClearOutput"; + this.miClearOutput.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete))); + this.miClearOutput.Size = new System.Drawing.Size(216, 22); + this.miClearOutput.Text = "M_CLEAROUTPUT"; + this.miClearOutput.Click += new System.EventHandler(this.miClearOutputWindow_Click); + // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(213, 6); + // + // miOutputWindow + // + this.miOutputWindow.Checked = true; + this.miOutputWindow.CheckOnClick = true; + this.miOutputWindow.CheckState = System.Windows.Forms.CheckState.Checked; + this.miOutputWindow.Image = ((System.Drawing.Image)(resources.GetObject("miOutputWindow.Image"))); + this.miOutputWindow.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miOutputWindow.Name = "miOutputWindow"; + this.miOutputWindow.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.miOutputWindow.Size = new System.Drawing.Size(216, 22); + this.miOutputWindow.Text = "M_BOTTOMPANEL"; + this.miOutputWindow.Click += new System.EventHandler(this.miOutputWindow_Click); + // + // tsShowOutputWindow + // + this.tsShowOutputWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_Output; + this.tsShowOutputWindow.Name = "tsShowOutputWindow"; + this.tsShowOutputWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowOutputWindow.Text = "M_OUTPUTWINDOW"; + this.tsShowOutputWindow.Click += new System.EventHandler(this.tsShowOutputWindow_Click); + // + // tsShowErrorsListWindow + // + this.tsShowErrorsListWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_ErrorList; + this.tsShowErrorsListWindow.Name = "tsShowErrorsListWindow"; + this.tsShowErrorsListWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowErrorsListWindow.Text = "TP_ERRORSLIST"; + this.tsShowErrorsListWindow.Click += new System.EventHandler(this.tsShowErrorsListWindow_Click); + // + // tsShowCompilerConsoleWindow + // + this.tsShowCompilerConsoleWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_CompilerConsole; + this.tsShowCompilerConsoleWindow.Name = "tsShowCompilerConsoleWindow"; + this.tsShowCompilerConsoleWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowCompilerConsoleWindow.Text = "TP_COMPILERMESSAGES"; + this.tsShowCompilerConsoleWindow.Click += new System.EventHandler(this.tsShowCompilerConsoleWindow_Click); + // + // tsShowFindSymbolsResultWindow + // + this.tsShowFindSymbolsResultWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_FindSymbolResult; + this.tsShowFindSymbolsResultWindow.Name = "tsShowFindSymbolsResultWindow"; + this.tsShowFindSymbolsResultWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowFindSymbolsResultWindow.Text = "TP_FIND_SYMBOL_RESULTS"; + this.tsShowFindSymbolsResultWindow.Click += new System.EventHandler(this.tsShowFindSymbolsResultWindow_Click); + // + // tsShowDebugVariablesListWindow + // + this.tsShowDebugVariablesListWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_DebugVariablesList; + this.tsShowDebugVariablesListWindow.Name = "tsShowDebugVariablesListWindow"; + this.tsShowDebugVariablesListWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowDebugVariablesListWindow.Text = "TP_VARLIST"; + this.tsShowDebugVariablesListWindow.Click += new System.EventHandler(this.tsShowDebugVariablesListWindow_Click); + // + // tsShowDebugWatchListWindow + // + this.tsShowDebugWatchListWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_DebugWatches; + this.tsShowDebugWatchListWindow.Name = "tsShowDebugWatchListWindow"; + this.tsShowDebugWatchListWindow.Size = new System.Drawing.Size(216, 22); + this.tsShowDebugWatchListWindow.Text = "TP_WATCHLIST"; + this.tsShowDebugWatchListWindow.Click += new System.EventHandler(this.tsShowDebugWatchListWindow_Click); + // + // tsDisassembly + // + this.tsDisassembly.Image = ((System.Drawing.Image)(resources.GetObject("tsDisassembly.Image"))); + this.tsDisassembly.Name = "tsDisassembly"; + this.tsDisassembly.Size = new System.Drawing.Size(216, 22); + this.tsDisassembly.Text = "TP_DISASSEMBLY"; + this.tsDisassembly.Visible = false; + this.tsDisassembly.Click += new System.EventHandler(this.tsDisassembly_Click); + // + // tsImmediateWindow + // + this.tsImmediateWindow.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Window_Immediate; + this.tsImmediateWindow.Name = "tsImmediateWindow"; + this.tsImmediateWindow.Size = new System.Drawing.Size(216, 22); + this.tsImmediateWindow.Text = "TP_IMMEDIATE_WINDOW"; + this.tsImmediateWindow.Click += new System.EventHandler(this.TsImmediateWindowClick); + // + // toolStripMenuItem12 + // + this.toolStripMenuItem12.Name = "toolStripMenuItem12"; + this.toolStripMenuItem12.Size = new System.Drawing.Size(213, 6); + // + // tsViewIntellisensePanel + // + this.tsViewIntellisensePanel.CheckOnClick = true; + this.tsViewIntellisensePanel.Name = "tsViewIntellisensePanel"; + this.tsViewIntellisensePanel.Size = new System.Drawing.Size(216, 22); + this.tsViewIntellisensePanel.Text = "M_INTELLISENSEPANEL"; + this.tsViewIntellisensePanel.CheckedChanged += new System.EventHandler(this.tsViewIntellisensePanel_CheckedChanged); + // + // miProjectExplorer + // + this.miProjectExplorer.Name = "miProjectExplorer"; + this.miProjectExplorer.Size = new System.Drawing.Size(216, 22); + this.miProjectExplorer.Text = "M_PROJECTEXPLORER"; + this.miProjectExplorer.Visible = false; + this.miProjectExplorer.Click += new System.EventHandler(this.miProjectExplorer_Click); + // + // miToolBox + // + this.miToolBox.Name = "miToolBox"; + this.miToolBox.Size = new System.Drawing.Size(216, 22); + this.miToolBox.Text = "M_TOOLBOX"; + this.miToolBox.Visible = false; + this.miToolBox.Click += new System.EventHandler(this.miToolBox_Click); + // + // miProperties + // + this.miProperties.Name = "miProperties"; + this.miProperties.Size = new System.Drawing.Size(216, 22); + this.miProperties.Text = "M_PROPERTIES"; + this.miProperties.Visible = false; + this.miProperties.Click += new System.EventHandler(this.miProperties_Click); + // + // toolStripSeparator11 + // + this.toolStripSeparator11.Name = "toolStripSeparator11"; + this.toolStripSeparator11.Size = new System.Drawing.Size(213, 6); + // + // miNavigBack + // + this.miNavigBack.Image = ((System.Drawing.Image)(resources.GetObject("miNavigBack.Image"))); + this.miNavigBack.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miNavigBack.Name = "miNavigBack"; + this.miNavigBack.ShortcutKeyDisplayString = "Ctrl+-"; + this.miNavigBack.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus))); + this.miNavigBack.Size = new System.Drawing.Size(216, 22); + this.miNavigBack.Text = "M_NAVIGBACK"; + this.miNavigBack.Click += new System.EventHandler(this.tsNavigBack_Click); + // + // miNavigForw + // + this.miNavigForw.Image = ((System.Drawing.Image)(resources.GetObject("miNavigForw.Image"))); + this.miNavigForw.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miNavigForw.Name = "miNavigForw"; + this.miNavigForw.ShortcutKeyDisplayString = "Ctrl+Shift+-"; + this.miNavigForw.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.OemMinus))); + this.miNavigForw.Size = new System.Drawing.Size(216, 22); + this.miNavigForw.Text = "M_NAVIGFORW"; + this.miNavigForw.Click += new System.EventHandler(this.tsNavigForw_Click); + // + // mRPROJECTToolStripMenuItem + // + this.mRPROJECTToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mADDFILEToolStripMenuItem, + this.mADDEXISTFILEToolStripMenuItem, + this.mADDFORMToolStripMenuItem, + this.toolStripMenuItem6, + this.mADDREFERENCEToolStripMenuItem, + this.mPROPERTIESToolStripMenuItem}); + this.mRPROJECTToolStripMenuItem.Name = "mRPROJECTToolStripMenuItem"; + this.mRPROJECTToolStripMenuItem.Size = new System.Drawing.Size(85, 20); + this.mRPROJECTToolStripMenuItem.Text = "MR_PROJECT"; + // + // mADDFILEToolStripMenuItem + // + this.mADDFILEToolStripMenuItem.Name = "mADDFILEToolStripMenuItem"; + this.mADDFILEToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDFILEToolStripMenuItem.Text = "M_ADD_NEW_FILE"; + this.mADDFILEToolStripMenuItem.Click += new System.EventHandler(this.mADDFILEToolStripMenuItem_Click); + // + // mADDEXISTFILEToolStripMenuItem + // + this.mADDEXISTFILEToolStripMenuItem.Name = "mADDEXISTFILEToolStripMenuItem"; + this.mADDEXISTFILEToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDEXISTFILEToolStripMenuItem.Text = "M_ADD_EXIST_FILE"; + this.mADDEXISTFILEToolStripMenuItem.Click += new System.EventHandler(this.mADDEXISTFILEToolStripMenuItem_Click); + // + // mADDFORMToolStripMenuItem + // + this.mADDFORMToolStripMenuItem.Name = "mADDFORMToolStripMenuItem"; + this.mADDFORMToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDFORMToolStripMenuItem.Text = "M_ADD_FORM"; + this.mADDFORMToolStripMenuItem.Click += new System.EventHandler(this.mADDFORMToolStripMenuItem_Click); + // + // toolStripMenuItem6 + // + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size(198, 6); + // + // mADDREFERENCEToolStripMenuItem + // + this.mADDREFERENCEToolStripMenuItem.Name = "mADDREFERENCEToolStripMenuItem"; + this.mADDREFERENCEToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mADDREFERENCEToolStripMenuItem.Text = "M_ADD_REFERENCE"; + this.mADDREFERENCEToolStripMenuItem.Click += new System.EventHandler(this.mADDREFERENCEToolStripMenuItem_Click); + // + // mPROPERTIESToolStripMenuItem + // + this.mPROPERTIESToolStripMenuItem.Name = "mPROPERTIESToolStripMenuItem"; + this.mPROPERTIESToolStripMenuItem.Size = new System.Drawing.Size(201, 22); + this.mPROPERTIESToolStripMenuItem.Text = "M_PROJECT_PROPERTIES"; + this.mPROPERTIESToolStripMenuItem.Click += new System.EventHandler(this.mPROPERTIESToolStripMenuItem_Click); + // + // mrProgram + // + this.mrProgram.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miRun, + this.miRunNoDebug, + this.mRUNPARAMETERSToolStripMenuItem1, + this.miStop, + this.toolStripMenuItem13, + this.miBuild, + this.miRebuild, + this.miAddExpr}); + this.mrProgram.Name = "mrProgram"; + this.mrProgram.ShortcutKeys = System.Windows.Forms.Keys.F8; + this.mrProgram.Size = new System.Drawing.Size(90, 20); + this.mrProgram.Text = "MR_PROGRAM"; + // + // miRun + // + this.miRun.Image = global::VisualPascalABC.Properties.Resources.start; + this.miRun.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miRun.Name = "miRun"; + this.miRun.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.miRun.Size = new System.Drawing.Size(212, 22); + this.miRun.Text = "M_RUN_DEBUG"; + this.miRun.Click += new System.EventHandler(this.StartMenuItem_Click); + // + // miRunNoDebug + // + this.miRunNoDebug.Image = ((System.Drawing.Image)(resources.GetObject("miRunNoDebug.Image"))); + this.miRunNoDebug.ImageTransparentColor = System.Drawing.Color.Fuchsia; + this.miRunNoDebug.Name = "miRunNoDebug"; + this.miRunNoDebug.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F9))); + this.miRunNoDebug.Size = new System.Drawing.Size(212, 22); + this.miRunNoDebug.Text = "M_RUN_NODEBUG"; + this.miRunNoDebug.Click += new System.EventHandler(this.miRunNoDebug_Click); + // + // mRUNPARAMETERSToolStripMenuItem1 + // + this.mRUNPARAMETERSToolStripMenuItem1.Name = "mRUNPARAMETERSToolStripMenuItem1"; + this.mRUNPARAMETERSToolStripMenuItem1.Size = new System.Drawing.Size(212, 22); + this.mRUNPARAMETERSToolStripMenuItem1.Text = "M_RUN_PARAMETERS"; + this.mRUNPARAMETERSToolStripMenuItem1.Click += new System.EventHandler(this.mRUNPARAMETERSToolStripMenuItem1_Click); + // + // miStop + // + this.miStop.Image = global::VisualPascalABC.Properties.Resources.stop; + this.miStop.ImageTransparentColor = System.Drawing.Color.Maroon; + this.miStop.Name = "miStop"; + this.miStop.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2))); + this.miStop.Size = new System.Drawing.Size(212, 22); + this.miStop.Text = "M_STOP"; + this.miStop.Click += new System.EventHandler(this.miStop_Click); + // + // toolStripMenuItem13 + // + this.toolStripMenuItem13.Name = "toolStripMenuItem13"; + this.toolStripMenuItem13.Size = new System.Drawing.Size(209, 6); + // + // miBuild + // + this.miBuild.Image = ((System.Drawing.Image)(resources.GetObject("miBuild.Image"))); + this.miBuild.ImageTransparentColor = System.Drawing.Color.Red; + this.miBuild.Name = "miBuild"; + this.miBuild.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F9))); + this.miBuild.Size = new System.Drawing.Size(212, 22); + this.miBuild.Text = "M_BUILD"; + this.miBuild.Click += new System.EventHandler(this.toolStripButton10_Click); + // + // miRebuild + // + this.miRebuild.Image = ((System.Drawing.Image)(resources.GetObject("miRebuild.Image"))); + this.miRebuild.ImageTransparentColor = System.Drawing.Color.Red; + this.miRebuild.Name = "miRebuild"; + this.miRebuild.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.F9))); + this.miRebuild.Size = new System.Drawing.Size(212, 22); + this.miRebuild.Text = "M_REBUILD"; + this.miRebuild.Click += new System.EventHandler(this.toolStripButton12_Click); + // + // miAddExpr + // + this.miAddExpr.Name = "miAddExpr"; + this.miAddExpr.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F5))); + this.miAddExpr.Size = new System.Drawing.Size(212, 22); + this.miAddExpr.Text = "M_ADD_EXPR"; + this.miAddExpr.Visible = false; + this.miAddExpr.Click += new System.EventHandler(this.miAddExpr_Click); + // + // mrDesigner + // + this.mrDesigner.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miShowGrid, + this.miSnapToGrid, + this.miAlign, + this.miCenter, + this.miSizeTo, + this.miZOrder, + this.miTabOrder}); + this.mrDesigner.Name = "mrDesigner"; + this.mrDesigner.Size = new System.Drawing.Size(90, 20); + this.mrDesigner.Text = "MR_DESIGNER"; + this.mrDesigner.Visible = false; + // + // miShowGrid + // + this.miShowGrid.Name = "miShowGrid"; + this.miShowGrid.Size = new System.Drawing.Size(165, 22); + this.miShowGrid.Text = "M_SHOW_GRID"; + this.miShowGrid.Visible = false; + this.miShowGrid.Click += new System.EventHandler(this.miShowGrid_Click); + // + // miSnapToGrid + // + this.miSnapToGrid.Name = "miSnapToGrid"; + this.miSnapToGrid.Size = new System.Drawing.Size(165, 22); + this.miSnapToGrid.Text = "M_SNAP_TO_GRID"; + this.miSnapToGrid.Visible = false; + this.miSnapToGrid.Click += new System.EventHandler(this.miSnapToGrid_Click); + // + // miAlign + // + this.miAlign.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miAlignLefts, + this.miAlignRights, + this.miAlignTops, + this.miAlignBottoms, + this.miAlignMiddles, + this.miAlignCenters, + this.miAlignToGrid}); + this.miAlign.Name = "miAlign"; + this.miAlign.Size = new System.Drawing.Size(165, 22); + this.miAlign.Text = "M_ALIGN"; + // + // miAlignLefts + // + this.miAlignLefts.Name = "miAlignLefts"; + this.miAlignLefts.Size = new System.Drawing.Size(172, 22); + this.miAlignLefts.Text = "M_ALIGN_LEFTS"; + // + // miAlignRights + // + this.miAlignRights.Name = "miAlignRights"; + this.miAlignRights.Size = new System.Drawing.Size(172, 22); + this.miAlignRights.Text = "M_ALIGN_RIGHTS"; + // + // miAlignTops + // + this.miAlignTops.Name = "miAlignTops"; + this.miAlignTops.Size = new System.Drawing.Size(172, 22); + this.miAlignTops.Text = "M_ALIGN_TOPS"; + // + // miAlignBottoms + // + this.miAlignBottoms.Name = "miAlignBottoms"; + this.miAlignBottoms.Size = new System.Drawing.Size(172, 22); + this.miAlignBottoms.Text = "M_ALIGN_BOTTOMS"; + // + // miAlignMiddles + // + this.miAlignMiddles.Name = "miAlignMiddles"; + this.miAlignMiddles.Size = new System.Drawing.Size(172, 22); + this.miAlignMiddles.Text = "M_ALIGN_MIDDLES"; + // + // miAlignCenters + // + this.miAlignCenters.Name = "miAlignCenters"; + this.miAlignCenters.Size = new System.Drawing.Size(172, 22); + this.miAlignCenters.Text = "M_ALIGN_CENTERS"; + // + // miAlignToGrid + // + this.miAlignToGrid.Name = "miAlignToGrid"; + this.miAlignToGrid.Size = new System.Drawing.Size(172, 22); + this.miAlignToGrid.Text = "M_ALIGN_TO_GRID"; + // + // miCenter + // + this.miCenter.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miCenterHorizontally, + this.miCenterVertically}); + this.miCenter.Name = "miCenter"; + this.miCenter.Size = new System.Drawing.Size(165, 22); + this.miCenter.Text = "M_CENTER"; + // + // miCenterHorizontally + // + this.miCenterHorizontally.Name = "miCenterHorizontally"; + this.miCenterHorizontally.Size = new System.Drawing.Size(209, 22); + this.miCenterHorizontally.Text = "M_CENTER_HORIZONTALLY"; + // + // miCenterVertically + // + this.miCenterVertically.Name = "miCenterVertically"; + this.miCenterVertically.Size = new System.Drawing.Size(209, 22); + this.miCenterVertically.Text = "M_CENTER_VERTICALLY"; + // + // miSizeTo + // + this.miSizeTo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miSizeToControl, + this.miSizeToControlWidth, + this.miSizeToControlHeight, + this.miSizeToGrid}); + this.miSizeTo.Name = "miSizeTo"; + this.miSizeTo.Size = new System.Drawing.Size(165, 22); + this.miSizeTo.Text = "M_SIZE_TO"; + // + // miSizeToControl + // + this.miSizeToControl.Name = "miSizeToControl"; + this.miSizeToControl.Size = new System.Drawing.Size(227, 22); + this.miSizeToControl.Text = "M_SIZE_TO_CONTROL"; + // + // miSizeToControlWidth + // + this.miSizeToControlWidth.Name = "miSizeToControlWidth"; + this.miSizeToControlWidth.Size = new System.Drawing.Size(227, 22); + this.miSizeToControlWidth.Text = "M_SIZE_TO_CONTROL_WIDTH"; + // + // miSizeToControlHeight + // + this.miSizeToControlHeight.Name = "miSizeToControlHeight"; + this.miSizeToControlHeight.Size = new System.Drawing.Size(227, 22); + this.miSizeToControlHeight.Text = "M_SIZE_TO_CONTROL_HEIGHT"; + // + // miSizeToGrid + // + this.miSizeToGrid.Name = "miSizeToGrid"; + this.miSizeToGrid.Size = new System.Drawing.Size(227, 22); + this.miSizeToGrid.Text = "M_SIZE_TO_GRID"; + // + // miZOrder + // + this.miZOrder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miBringToFront, + this.miSendToBack}); + this.miZOrder.Name = "miZOrder"; + this.miZOrder.Size = new System.Drawing.Size(165, 22); + this.miZOrder.Text = "M_Z_ORDER"; + // + // miBringToFront + // + this.miBringToFront.Name = "miBringToFront"; + this.miBringToFront.Size = new System.Drawing.Size(179, 22); + this.miBringToFront.Text = "M_BRING_TO_FRONT"; + // + // miSendToBack + // + this.miSendToBack.Name = "miSendToBack"; + this.miSendToBack.Size = new System.Drawing.Size(179, 22); + this.miSendToBack.Text = "M_SEND_TO_BACK"; + // + // miTabOrder + // + this.miTabOrder.Name = "miTabOrder"; + this.miTabOrder.Size = new System.Drawing.Size(165, 22); + this.miTabOrder.Text = "M_TAB_ORDER"; + this.miTabOrder.Click += new System.EventHandler(this.miTabOrder_Click); + // + // mrService + // + this.mrService.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mOPTIONSToolStripMenuItem, + this.tssmIntellisence, + this.mAUTOINSERTToolStripMenuItem, + this.tsGotoDefinition, + this.tsGotoRealization, + this.tsFindAllReferences, + this.miGenerateRealization, + this.mFORMATToolStripMenuItem, + this.mUNITTESTSToolStripMenuItem}); + this.mrService.Name = "mrService"; + this.mrService.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.D))); + this.mrService.Size = new System.Drawing.Size(82, 20); + this.mrService.Text = "MR_SERVICE"; + // + // mOPTIONSToolStripMenuItem + // + this.mOPTIONSToolStripMenuItem.Image = global::VisualPascalABC.Properties.Resources.Icons_16x16_Options; + this.mOPTIONSToolStripMenuItem.Name = "mOPTIONSToolStripMenuItem"; + this.mOPTIONSToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mOPTIONSToolStripMenuItem.Text = "M_OPTIONS"; + this.mOPTIONSToolStripMenuItem.Click += new System.EventHandler(this.mOPTIONSToolStripMenuItem_Click); + // + // tssmIntellisence + // + this.tssmIntellisence.Name = "tssmIntellisence"; + this.tssmIntellisence.Size = new System.Drawing.Size(279, 6); + // + // mAUTOINSERTToolStripMenuItem + // + this.mAUTOINSERTToolStripMenuItem.Image = global::VisualPascalABC.Properties.Resources.AutoInsertCode; + this.mAUTOINSERTToolStripMenuItem.Name = "mAUTOINSERTToolStripMenuItem"; + this.mAUTOINSERTToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mAUTOINSERTToolStripMenuItem.Text = "M_AUTOINSERT_CODE"; + this.mAUTOINSERTToolStripMenuItem.Click += new System.EventHandler(this.mAUTOINSERTToolStripMenuItem_Click); + // + // tsGotoDefinition + // + this.tsGotoDefinition.Enabled = false; + this.tsGotoDefinition.Image = ((System.Drawing.Image)(resources.GetObject("tsGotoDefinition.Image"))); + this.tsGotoDefinition.Name = "tsGotoDefinition"; + this.tsGotoDefinition.ShortcutKeyDisplayString = "Ctrl+Enter"; + this.tsGotoDefinition.Size = new System.Drawing.Size(282, 22); + this.tsGotoDefinition.Text = "M_GOTO_DEFINITION"; + // + // tsGotoRealization + // + this.tsGotoRealization.Enabled = false; + this.tsGotoRealization.Image = ((System.Drawing.Image)(resources.GetObject("tsGotoRealization.Image"))); + this.tsGotoRealization.Name = "tsGotoRealization"; + this.tsGotoRealization.Size = new System.Drawing.Size(282, 22); + this.tsGotoRealization.Text = "M_GOTO_REALIZATION"; + // + // tsFindAllReferences + // + this.tsFindAllReferences.Name = "tsFindAllReferences"; + this.tsFindAllReferences.Size = new System.Drawing.Size(282, 22); + this.tsFindAllReferences.Text = "M_FIND_ALL_REFERENCES"; + this.tsFindAllReferences.Click += new System.EventHandler(this.tsFindAllReferences_Click); + // + // miGenerateRealization + // + this.miGenerateRealization.Image = ((System.Drawing.Image)(resources.GetObject("miGenerateRealization.Image"))); + this.miGenerateRealization.Name = "miGenerateRealization"; + this.miGenerateRealization.ShortcutKeyDisplayString = ""; + this.miGenerateRealization.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.C))); + this.miGenerateRealization.Size = new System.Drawing.Size(282, 22); + this.miGenerateRealization.Text = "M_GENERATE_REALIZATION"; + // + // mFORMATToolStripMenuItem + // + this.mFORMATToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mFORMATToolStripMenuItem.Image"))); + this.mFORMATToolStripMenuItem.Name = "mFORMATToolStripMenuItem"; + this.mFORMATToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.F))); + this.mFORMATToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mFORMATToolStripMenuItem.Text = "M_FORMAT"; + this.mFORMATToolStripMenuItem.Click += new System.EventHandler(this.mFORMATToolStripMenuItem_Click); + // + // mUNITTESTSToolStripMenuItem + // + this.mUNITTESTSToolStripMenuItem.Name = "mUNITTESTSToolStripMenuItem"; + this.mUNITTESTSToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.T))); + this.mUNITTESTSToolStripMenuItem.Size = new System.Drawing.Size(282, 22); + this.mUNITTESTSToolStripMenuItem.Text = "M_UNIT_TESTS"; + this.mUNITTESTSToolStripMenuItem.Click += new System.EventHandler(this.mUNITTESTSToolStripMenuItem_Click); + // + // miPlugins + // + this.miPlugins.Name = "miPlugins"; + this.miPlugins.Size = new System.Drawing.Size(82, 20); + this.miPlugins.Text = "MR_PLUGINS"; + this.miPlugins.Visible = false; + // + // mrHelp + // + this.mrHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsHelp, + this.mDOTNETHELPToolStripMenuItem, + this.mMAINFEATURESToolStripMenuItem, + this.toolStripMenuItem1, + this.toolStripMenuItem5, + this.toolStripSeparator6, + this.miCheckUpdates, + this.miAbout}); + this.mrHelp.Name = "mrHelp"; + this.mrHelp.Size = new System.Drawing.Size(64, 20); + this.mrHelp.Text = "MR_HELP"; + // + // tsHelp + // + this.tsHelp.Name = "tsHelp"; + this.tsHelp.ShortcutKeyDisplayString = "F1"; + this.tsHelp.Size = new System.Drawing.Size(166, 22); + this.tsHelp.Text = "M_HELP"; + this.tsHelp.Click += new System.EventHandler(this.tsHelp_Click); + // + // mDOTNETHELPToolStripMenuItem + // + this.mDOTNETHELPToolStripMenuItem.Name = "mDOTNETHELPToolStripMenuItem"; + this.mDOTNETHELPToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.mDOTNETHELPToolStripMenuItem.Text = "M_DOTNET_HELP"; + this.mDOTNETHELPToolStripMenuItem.Click += new System.EventHandler(this.mDOTNETHELPToolStripMenuItem_Click); + // + // mMAINFEATURESToolStripMenuItem + // + this.mMAINFEATURESToolStripMenuItem.Name = "mMAINFEATURESToolStripMenuItem"; + this.mMAINFEATURESToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.mMAINFEATURESToolStripMenuItem.Text = "M_MAINFEATURES"; + this.mMAINFEATURESToolStripMenuItem.Click += new System.EventHandler(this.mMAINFEATURESToolStripMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(166, 22); + this.toolStripMenuItem1.Text = "M_OPENSAMPLES"; + this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click_1); + // + // toolStripMenuItem5 + // + this.toolStripMenuItem5.Name = "toolStripMenuItem5"; + this.toolStripMenuItem5.Size = new System.Drawing.Size(166, 22); + this.toolStripMenuItem5.Text = "M_OPENTUTORIAL"; + this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click); + // + // toolStripSeparator6 + // + this.toolStripSeparator6.Name = "toolStripSeparator6"; + this.toolStripSeparator6.Size = new System.Drawing.Size(163, 6); + // + // miCheckUpdates + // + this.miCheckUpdates.Name = "miCheckUpdates"; + this.miCheckUpdates.Size = new System.Drawing.Size(166, 22); + this.miCheckUpdates.Text = "M_CHECKUPDATES"; + this.miCheckUpdates.Click += new System.EventHandler(this.miCheckUpdates_Click); + // + // miAbout + // + this.miAbout.Name = "miAbout"; + this.miAbout.Size = new System.Drawing.Size(166, 22); + this.miAbout.Text = "M_ABOUT"; + this.miAbout.Click += new System.EventHandler(this.miAboutToolStripMenuItem_Click); + // + // toolStrip1 + // + this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tbNew, + this.tbOpen, + this.tbSave, + this.tbSaveAll, + this.toolStripSeparator1, + this.tsCut, + this.tsCopy, + this.tsPaste, + this.toolStripSeparator2, + this.tsUndo, + this.tsRedo, + this.tsNavigBack, + this.tsNavigForw, + this.toolStripSeparator3, + this.StartButton, + this.StartNoDebugButton, + this.stopButton, + this.CompileButton, + this.ReCompileButton, + this.tssRunStopSeparator, + this.tsOutputWindow, + this.tsAutoInsertCode, + this.toolStripButton1, + this.toolStripSeparator13, + this.tsFormat, + this.toolStripSeparator4, + this.tstaSelect, + this.toolStripButton16, + this.toolStripButton17, + this.toolStripButton19, + this.toolStripSeparator7}); + this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Flow; + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(876, 23); + this.toolStrip1.Stretch = true; + this.toolStrip1.TabIndex = 2; + this.toolStrip1.Text = "toolStrip1"; + this.toolStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStrip1_ItemClicked); + // + // tbNew + // + this.tbNew.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbNew.Image = global::VisualPascalABC.Properties.Resources.new_file; + this.tbNew.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbNew.Name = "tbNew"; + this.tbNew.Size = new System.Drawing.Size(23, 20); + this.tbNew.ToolTipText = "M_NEW"; + this.tbNew.Click += new System.EventHandler(this.miNew_Click); + // + // tbOpen + // + this.tbOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbOpen.Image = ((System.Drawing.Image)(resources.GetObject("tbOpen.Image"))); + this.tbOpen.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbOpen.Name = "tbOpen"; + this.tbOpen.Size = new System.Drawing.Size(23, 20); + this.tbOpen.Text = "M_OPEN"; + this.tbOpen.Click += new System.EventHandler(this.OpenToolStripMenuItem1_Click_1); + // + // tbSave + // + this.tbSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbSave.Enabled = false; + this.tbSave.Image = ((System.Drawing.Image)(resources.GetObject("tbSave.Image"))); + this.tbSave.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbSave.Name = "tbSave"; + this.tbSave.Size = new System.Drawing.Size(23, 20); + this.tbSave.Text = "M_SAVE"; + this.tbSave.Click += new System.EventHandler(this.miSave_Click); + // + // tbSaveAll + // + this.tbSaveAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tbSaveAll.Enabled = false; + this.tbSaveAll.Image = ((System.Drawing.Image)(resources.GetObject("tbSaveAll.Image"))); + this.tbSaveAll.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tbSaveAll.Name = "tbSaveAll"; + this.tbSaveAll.Size = new System.Drawing.Size(23, 20); + this.tbSaveAll.ToolTipText = "M_SAVEALL"; + this.tbSaveAll.Click += new System.EventHandler(this.miSaveAll_Click_1); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 23); + // + // tsCut + // + this.tsCut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCut.Image = ((System.Drawing.Image)(resources.GetObject("tsCut.Image"))); + this.tsCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsCut.Name = "tsCut"; + this.tsCut.Size = new System.Drawing.Size(23, 20); + this.tsCut.ToolTipText = "M_CUT"; + this.tsCut.Click += new System.EventHandler(this.miCurt_Click); + // + // tsCopy + // + this.tsCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsCopy.Image = ((System.Drawing.Image)(resources.GetObject("tsCopy.Image"))); + this.tsCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsCopy.Name = "tsCopy"; + this.tsCopy.Size = new System.Drawing.Size(23, 20); + this.tsCopy.Text = "Копировать(Ctrl+C)"; + this.tsCopy.ToolTipText = "M_COPY"; + this.tsCopy.Click += new System.EventHandler(this.miCopy_Click); + // + // tsPaste + // + this.tsPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsPaste.Image = ((System.Drawing.Image)(resources.GetObject("tsPaste.Image"))); + this.tsPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsPaste.Name = "tsPaste"; + this.tsPaste.Size = new System.Drawing.Size(23, 20); + this.tsPaste.Text = "Вставить(Ctrl+V)"; + this.tsPaste.ToolTipText = "M_PASTE"; + this.tsPaste.Click += new System.EventHandler(this.miPaste_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(6, 23); + // + // tsUndo + // + this.tsUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsUndo.Image = ((System.Drawing.Image)(resources.GetObject("tsUndo.Image"))); + this.tsUndo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsUndo.Name = "tsUndo"; + this.tsUndo.Size = new System.Drawing.Size(23, 20); + this.tsUndo.Text = "Отменить(Ctrl+Z)"; + this.tsUndo.ToolTipText = "M_UNDO"; + this.tsUndo.Click += new System.EventHandler(this.UndoToolStripMenuItem_Click); + // + // tsRedo + // + this.tsRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsRedo.Image = ((System.Drawing.Image)(resources.GetObject("tsRedo.Image"))); + this.tsRedo.ImageTransparentColor = System.Drawing.Color.Maroon; + this.tsRedo.Name = "tsRedo"; + this.tsRedo.Size = new System.Drawing.Size(23, 20); + this.tsRedo.Text = "Восстановить(Shift+Ctrl+Z)"; + this.tsRedo.ToolTipText = "M_REDO"; + this.tsRedo.Click += new System.EventHandler(this.RedoToolStripMenuItem_Click); + // + // tsNavigBack + // + this.tsNavigBack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsNavigBack.Image = ((System.Drawing.Image)(resources.GetObject("tsNavigBack.Image"))); + this.tsNavigBack.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsNavigBack.Name = "tsNavigBack"; + this.tsNavigBack.Size = new System.Drawing.Size(23, 20); + this.tsNavigBack.Text = "toolStripButton1"; + this.tsNavigBack.ToolTipText = "M_NAVIGBACK"; + this.tsNavigBack.Click += new System.EventHandler(this.tsNavigBack_Click); + // + // tsNavigForw + // + this.tsNavigForw.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsNavigForw.Image = ((System.Drawing.Image)(resources.GetObject("tsNavigForw.Image"))); + this.tsNavigForw.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsNavigForw.Name = "tsNavigForw"; + this.tsNavigForw.Size = new System.Drawing.Size(23, 20); + this.tsNavigForw.Text = "toolStripButton3"; + this.tsNavigForw.ToolTipText = "M_NAVIGFORW"; + this.tsNavigForw.Click += new System.EventHandler(this.tsNavigForw_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(6, 23); + // + // StartButton + // + this.StartButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StartButton.Enabled = false; + this.StartButton.Image = ((System.Drawing.Image)(resources.GetObject("StartButton.Image"))); + this.StartButton.ImageTransparentColor = System.Drawing.Color.Maroon; + this.StartButton.Name = "StartButton"; + this.StartButton.Size = new System.Drawing.Size(23, 20); + this.StartButton.Text = "Выполнить программу(F9)"; + this.StartButton.ToolTipText = "M_RUN_DEBUG"; + this.StartButton.Click += new System.EventHandler(this.StartMenuItem_Click); + this.StartButton.EnabledChanged += new System.EventHandler(this.StartButton_EnabledChanged); + // + // StartNoDebugButton + // + this.StartNoDebugButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StartNoDebugButton.Enabled = false; + this.StartNoDebugButton.Image = ((System.Drawing.Image)(resources.GetObject("StartNoDebugButton.Image"))); + this.StartNoDebugButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.StartNoDebugButton.Name = "StartNoDebugButton"; + this.StartNoDebugButton.Size = new System.Drawing.Size(23, 20); + this.StartNoDebugButton.ToolTipText = "M_RUN_NODEBUG"; + this.StartNoDebugButton.Visible = false; + this.StartNoDebugButton.Click += new System.EventHandler(this.miRunNoDebug_Click); + // + // stopButton + // + this.stopButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.stopButton.Enabled = false; + this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image"))); + this.stopButton.ImageTransparentColor = System.Drawing.Color.Maroon; + this.stopButton.Name = "stopButton"; + this.stopButton.Size = new System.Drawing.Size(23, 20); + this.stopButton.ToolTipText = "M_STOP"; + this.stopButton.Click += new System.EventHandler(this.miStop_Click); + // + // CompileButton + // + this.CompileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.CompileButton.Enabled = false; + this.CompileButton.Image = ((System.Drawing.Image)(resources.GetObject("CompileButton.Image"))); + this.CompileButton.ImageTransparentColor = System.Drawing.Color.Red; + this.CompileButton.Name = "CompileButton"; + this.CompileButton.Size = new System.Drawing.Size(23, 20); + this.CompileButton.Text = "Компилировать"; + this.CompileButton.ToolTipText = "M_BUILD"; + this.CompileButton.Click += new System.EventHandler(this.toolStripButton10_Click); + this.CompileButton.EnabledChanged += new System.EventHandler(this.CompileButton_EnabledChanged); + // + // ReCompileButton + // + this.ReCompileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ReCompileButton.Enabled = false; + this.ReCompileButton.Image = ((System.Drawing.Image)(resources.GetObject("ReCompileButton.Image"))); + this.ReCompileButton.ImageTransparentColor = System.Drawing.Color.Red; + this.ReCompileButton.Name = "ReCompileButton"; + this.ReCompileButton.Size = new System.Drawing.Size(23, 20); + this.ReCompileButton.Text = "Перекомпилировать"; + this.ReCompileButton.ToolTipText = "M_REBUILD"; + this.ReCompileButton.Visible = false; + this.ReCompileButton.Click += new System.EventHandler(this.toolStripButton12_Click); + this.ReCompileButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + // + // tssRunStopSeparator + // + this.tssRunStopSeparator.Name = "tssRunStopSeparator"; + this.tssRunStopSeparator.Size = new System.Drawing.Size(6, 23); + // + // tsOutputWindow + // + this.tsOutputWindow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsOutputWindow.Image = ((System.Drawing.Image)(resources.GetObject("tsOutputWindow.Image"))); + this.tsOutputWindow.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsOutputWindow.Name = "tsOutputWindow"; + this.tsOutputWindow.Size = new System.Drawing.Size(23, 20); + this.tsOutputWindow.Text = "M_OUTPUTWINDOW"; + this.tsOutputWindow.Click += new System.EventHandler(this.miOutputWindow_Click); + // + // tsAutoInsertCode + // + this.tsAutoInsertCode.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsAutoInsertCode.Image = global::VisualPascalABC.Properties.Resources.AutoInsertCode; + this.tsAutoInsertCode.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsAutoInsertCode.Name = "tsAutoInsertCode"; + this.tsAutoInsertCode.Size = new System.Drawing.Size(23, 20); + this.tsAutoInsertCode.Text = "M_AUTOINSERT_CODE"; + this.tsAutoInsertCode.ToolTipText = "M_AUTOINSERT_CODE"; + this.tsAutoInsertCode.Click += new System.EventHandler(this.tsAutoInsertCode_Click); + // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Image = global::VisualPascalABC.Properties.Resources.ABCHealth; + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(23, 20); + this.toolStripButton1.Text = "Здоровье PascalABC.NET программы"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // toolStripSeparator13 + // + this.toolStripSeparator13.Name = "toolStripSeparator13"; + this.toolStripSeparator13.Size = new System.Drawing.Size(6, 23); + // + // tsFormat + // + this.tsFormat.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tsFormat.Image = global::VisualPascalABC.Properties.Resources.format; + this.tsFormat.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tsFormat.Name = "tsFormat"; + this.tsFormat.Size = new System.Drawing.Size(23, 20); + this.tsFormat.Text = "M_FORMAT"; + this.tsFormat.Click += new System.EventHandler(this.tsFormat_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(6, 23); + this.toolStripSeparator4.Visible = false; + // + // tstaSelect + // + this.tstaSelect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.tstaSelect.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsatConsoleApplication, + this.tsatWindowsApplication, + this.tsatDll}); + this.tstaSelect.Image = ((System.Drawing.Image)(resources.GetObject("tstaSelect.Image"))); + this.tstaSelect.ImageTransparentColor = System.Drawing.Color.Magenta; + this.tstaSelect.Name = "tstaSelect"; + this.tstaSelect.Size = new System.Drawing.Size(29, 20); + this.tstaSelect.Text = "AT_SELECT"; + this.tstaSelect.Visible = false; + // + // tsatConsoleApplication + // + this.tsatConsoleApplication.Image = ((System.Drawing.Image)(resources.GetObject("tsatConsoleApplication.Image"))); + this.tsatConsoleApplication.ImageTransparentColor = System.Drawing.Color.Red; + this.tsatConsoleApplication.Name = "tsatConsoleApplication"; + this.tsatConsoleApplication.Size = new System.Drawing.Size(149, 22); + this.tsatConsoleApplication.Text = "AT_CONSOLE"; + this.tsatConsoleApplication.Click += new System.EventHandler(this.tsat_Click); + // + // tsatWindowsApplication + // + this.tsatWindowsApplication.Image = ((System.Drawing.Image)(resources.GetObject("tsatWindowsApplication.Image"))); + this.tsatWindowsApplication.ImageTransparentColor = System.Drawing.Color.Red; + this.tsatWindowsApplication.Name = "tsatWindowsApplication"; + this.tsatWindowsApplication.Size = new System.Drawing.Size(149, 22); + this.tsatWindowsApplication.Text = "AT_WINDOWS"; + this.tsatWindowsApplication.Click += new System.EventHandler(this.tsat_Click); + // + // tsatDll + // + this.tsatDll.Image = ((System.Drawing.Image)(resources.GetObject("tsatDll.Image"))); + this.tsatDll.ImageTransparentColor = System.Drawing.Color.Red; + this.tsatDll.Name = "tsatDll"; + this.tsatDll.Size = new System.Drawing.Size(149, 22); + this.tsatDll.Text = "AT_DLL"; + this.tsatDll.Click += new System.EventHandler(this.tsat_Click); + // + // toolStripButton16 + // + this.toolStripButton16.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton16.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton16.Image"))); + this.toolStripButton16.ImageTransparentColor = System.Drawing.Color.Maroon; + this.toolStripButton16.Name = "toolStripButton16"; + this.toolStripButton16.Size = new System.Drawing.Size(23, 20); + this.toolStripButton16.Text = "Окно вывода(F5)"; + this.toolStripButton16.Visible = false; + // + // toolStripButton17 + // + this.toolStripButton17.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton17.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton17.Image"))); + this.toolStripButton17.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton17.Name = "toolStripButton17"; + this.toolStripButton17.Size = new System.Drawing.Size(23, 20); + this.toolStripButton17.Text = "Окно выполненной программы(F6)"; + this.toolStripButton17.Visible = false; + // + // toolStripButton19 + // + this.toolStripButton19.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton19.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton19.Image"))); + this.toolStripButton19.ImageTransparentColor = System.Drawing.Color.Maroon; + this.toolStripButton19.Name = "toolStripButton19"; + this.toolStripButton19.Size = new System.Drawing.Size(23, 20); + this.toolStripButton19.Text = "Очистить вывод(Ctrl+Del)"; + this.toolStripButton19.Visible = false; + this.toolStripButton19.Click += new System.EventHandler(this.toolStripButton19_Click); + // + // toolStripSeparator7 + // + this.toolStripSeparator7.Name = "toolStripSeparator7"; + this.toolStripSeparator7.Size = new System.Drawing.Size(6, 23); + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel5, + this.toolStripStatusLabel1, + this.slLine, + this.toolStripStatusLabel2, + this.slCol, + this.HealthLabel}); + this.statusStrip1.Location = new System.Drawing.Point(0, 540); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 21, 0); + this.statusStrip1.Size = new System.Drawing.Size(876, 22); + this.statusStrip1.TabIndex = 4; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel5 + // + this.toolStripStatusLabel5.Name = "toolStripStatusLabel5"; + this.toolStripStatusLabel5.Size = new System.Drawing.Size(659, 17); + this.toolStripStatusLabel5.Spring = true; + this.toolStripStatusLabel5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(40, 17); + this.toolStripStatusLabel1.Text = "SB_LN"; + // + // slLine + // + this.slLine.Name = "slLine"; + this.slLine.Size = new System.Drawing.Size(42, 17); + this.slLine.Text = " numb"; + this.slLine.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // toolStripStatusLabel2 + // + this.toolStripStatusLabel2.Name = "toolStripStatusLabel2"; + this.toolStripStatusLabel2.Size = new System.Drawing.Size(48, 17); + this.toolStripStatusLabel2.Text = "SB_COL"; + // + // slCol + // + this.slCol.AutoSize = false; + this.slCol.AutoToolTip = true; + this.slCol.Name = "slCol"; + this.slCol.Size = new System.Drawing.Size(46, 17); + this.slCol.Text = " numb"; + this.slCol.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // HealthLabel + // + this.HealthLabel.AutoToolTip = true; + this.HealthLabel.BackColor = System.Drawing.SystemColors.Control; + this.HealthLabel.IsLink = true; + this.HealthLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; + this.HealthLabel.LinkColor = System.Drawing.Color.Black; + this.HealthLabel.Name = "HealthLabel"; + this.HealthLabel.Size = new System.Drawing.Size(19, 17); + this.HealthLabel.Text = " "; + this.HealthLabel.ToolTipText = "Здоровье PascalABC.NET программы"; + this.HealthLabel.Click += new System.EventHandler(this.HealthLabel_Click); + // + // openFileDialog1 + // + this.openFileDialog1.Multiselect = true; + this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk); + // + // saveFileDialog1 + // + this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk); + // + // printDialog1 + // + this.printDialog1.UseEXDialog = true; + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.DarkRed; + this.imageList1.Images.SetKeyName(0, ""); + this.imageList1.Images.SetKeyName(1, ""); + this.imageList1.Images.SetKeyName(2, ""); + this.imageList1.Images.SetKeyName(3, ""); + this.imageList1.Images.SetKeyName(4, ""); + this.imageList1.Images.SetKeyName(5, ""); + this.imageList1.Images.SetKeyName(6, ""); + this.imageList1.Images.SetKeyName(7, ""); + this.imageList1.Images.SetKeyName(8, ""); + this.imageList1.Images.SetKeyName(9, ""); + this.imageList1.Images.SetKeyName(10, ""); + this.imageList1.Images.SetKeyName(11, ""); + this.imageList1.Images.SetKeyName(12, ""); + this.imageList1.Images.SetKeyName(13, ""); + this.imageList1.Images.SetKeyName(14, ""); + this.imageList1.Images.SetKeyName(15, "Delete.bmp"); + // + // fontDialog1 + // + this.fontDialog1.ShowApply = true; + this.fontDialog1.ShowColor = true; + this.fontDialog1.Apply += new System.EventHandler(this.fontDialog1_Apply); + // + // cmClose + // + this.cmClose.Name = "cmClose"; + this.cmClose.Size = new System.Drawing.Size(206, 38); + this.cmClose.Text = "M_CLOSE"; + this.cmClose.Click += new System.EventHandler(this.miClose_Click); + // + // cmCloseAllButThis + // + this.cmCloseAllButThis.Name = "cmCloseAllButThis"; + this.cmCloseAllButThis.Size = new System.Drawing.Size(206, 38); + this.cmCloseAllButThis.Text = "M_CLOSEALLBUTTHIS"; + this.cmCloseAllButThis.Click += new System.EventHandler(this.miCloseNonActive_Click); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32); + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmClose, + this.cmCloseAllButThis, + this.cmSave, + this.cmSetActive}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(207, 156); + this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); + // + // cmSave + // + this.cmSave.Image = global::VisualPascalABC.Properties.Resources.save; + this.cmSave.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmSave.Name = "cmSave"; + this.cmSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.cmSave.Size = new System.Drawing.Size(206, 38); + this.cmSave.Text = "M_SAVE"; + this.cmSave.Click += new System.EventHandler(this.miSave_Click); + // + // cmSetActive + // + this.cmSetActive.Name = "cmSetActive"; + this.cmSetActive.Size = new System.Drawing.Size(206, 38); + this.cmSetActive.Text = "M_SET_ACTIVE"; + this.cmSetActive.ToolTipText = "M_SET_ACTIVE"; + this.cmSetActive.Click += new System.EventHandler(this.cmSetActive_Click); + // + // cmEditor + // + this.cmEditor.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmGotoDefinition, + this.cmGotoRealization, + this.cmFindAllReferences, + this.cmGenerateRealization, + this.cmFormat, + this.cmCollapseRegions, + this.mNEWASPToolStripMenuItem, + this.cmsCodeCompletion, + this.cmCut, + this.cmCopy, + this.cmPaste, + this.toolStripSeparator5, + this.cmRun, + this.toolStripSeparator12, + this.cntxt_miAddExpr, + this.toolStripSeparator15, + this.cmHelp, + this.cmSamples}); + this.cmEditor.Name = "cmEditor"; + this.cmEditor.Size = new System.Drawing.Size(222, 336); + this.cmEditor.Opening += new System.ComponentModel.CancelEventHandler(this.cmEditor_Opening); + // + // cmGotoDefinition + // + this.cmGotoDefinition.Enabled = false; + this.cmGotoDefinition.Image = ((System.Drawing.Image)(resources.GetObject("cmGotoDefinition.Image"))); + this.cmGotoDefinition.Name = "cmGotoDefinition"; + this.cmGotoDefinition.Size = new System.Drawing.Size(221, 22); + this.cmGotoDefinition.Text = "M_GOTO_DEFINITION"; + // + // cmGotoRealization + // + this.cmGotoRealization.Enabled = false; + this.cmGotoRealization.Image = ((System.Drawing.Image)(resources.GetObject("cmGotoRealization.Image"))); + this.cmGotoRealization.Name = "cmGotoRealization"; + this.cmGotoRealization.Size = new System.Drawing.Size(221, 22); + this.cmGotoRealization.Text = "M_GOTO_REALIZATION"; + // + // cmFindAllReferences + // + this.cmFindAllReferences.Enabled = false; + this.cmFindAllReferences.Name = "cmFindAllReferences"; + this.cmFindAllReferences.Size = new System.Drawing.Size(221, 22); + this.cmFindAllReferences.Text = "M_FIND_ALL_REFERENCES"; + this.cmFindAllReferences.Click += new System.EventHandler(this.cmFindAllReferences_Click); + // + // cmGenerateRealization + // + this.cmGenerateRealization.Image = ((System.Drawing.Image)(resources.GetObject("cmGenerateRealization.Image"))); + this.cmGenerateRealization.Name = "cmGenerateRealization"; + this.cmGenerateRealization.Size = new System.Drawing.Size(221, 22); + this.cmGenerateRealization.Text = "M_GENERATE_REALIZATION"; + this.cmGenerateRealization.Visible = false; + this.cmGenerateRealization.Click += new System.EventHandler(this.mGENERATEREALIZATIONToolStripMenuItem_Click); + // + // cmFormat + // + this.cmFormat.Image = ((System.Drawing.Image)(resources.GetObject("cmFormat.Image"))); + this.cmFormat.Name = "cmFormat"; + this.cmFormat.Size = new System.Drawing.Size(221, 22); + this.cmFormat.Text = "M_FORMAT"; + this.cmFormat.Click += new System.EventHandler(this.cmFormat_Click); + // + // cmCollapseRegions + // + this.cmCollapseRegions.Name = "cmCollapseRegions"; + this.cmCollapseRegions.Size = new System.Drawing.Size(221, 22); + this.cmCollapseRegions.Text = "M_COLLAPSE_REGIONS"; + this.cmCollapseRegions.Click += new System.EventHandler(this.cmCollapseRegions_Click); + // + // mNEWASPToolStripMenuItem + // + this.mNEWASPToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("mNEWASPToolStripMenuItem.Image"))); + this.mNEWASPToolStripMenuItem.Name = "mNEWASPToolStripMenuItem"; + this.mNEWASPToolStripMenuItem.Size = new System.Drawing.Size(221, 22); + this.mNEWASPToolStripMenuItem.Text = "M_NEW_ASP"; + this.mNEWASPToolStripMenuItem.ToolTipText = "M_NEW_ASP"; + this.mNEWASPToolStripMenuItem.Click += new System.EventHandler(this.mNEWASPToolStripMenuItem_Click); + // + // cmsCodeCompletion + // + this.cmsCodeCompletion.Name = "cmsCodeCompletion"; + this.cmsCodeCompletion.Size = new System.Drawing.Size(218, 6); + // + // cmCut + // + this.cmCut.Image = global::VisualPascalABC.Properties.Resources.cut; + this.cmCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmCut.Name = "cmCut"; + this.cmCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.cmCut.Size = new System.Drawing.Size(221, 22); + this.cmCut.Text = "M_CUT"; + this.cmCut.Click += new System.EventHandler(this.miCurt_Click); + // + // cmCopy + // + this.cmCopy.Image = global::VisualPascalABC.Properties.Resources.copy; + this.cmCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmCopy.Name = "cmCopy"; + this.cmCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.cmCopy.Size = new System.Drawing.Size(221, 22); + this.cmCopy.Text = "M_COPY"; + this.cmCopy.Click += new System.EventHandler(this.miCopy_Click); + // + // cmPaste + // + this.cmPaste.Image = global::VisualPascalABC.Properties.Resources.paste; + this.cmPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmPaste.Name = "cmPaste"; + this.cmPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.cmPaste.Size = new System.Drawing.Size(221, 22); + this.cmPaste.Text = "M_PASTE"; + this.cmPaste.Click += new System.EventHandler(this.miPaste_Click); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(218, 6); + // + // cmRun + // + this.cmRun.Image = global::VisualPascalABC.Properties.Resources.start; + this.cmRun.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmRun.Name = "cmRun"; + this.cmRun.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.cmRun.Size = new System.Drawing.Size(221, 22); + this.cmRun.Text = "M_RUN_DEBUG"; + this.cmRun.Click += new System.EventHandler(this.StartMenuItem_Click); + // + // toolStripSeparator12 + // + this.toolStripSeparator12.Name = "toolStripSeparator12"; + this.toolStripSeparator12.Size = new System.Drawing.Size(218, 6); + // + // cntxt_miAddExpr + // + this.cntxt_miAddExpr.Name = "cntxt_miAddExpr"; + this.cntxt_miAddExpr.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F5))); + this.cntxt_miAddExpr.Size = new System.Drawing.Size(221, 22); + this.cntxt_miAddExpr.Text = "M_ADD_EXPR"; + this.cntxt_miAddExpr.Click += new System.EventHandler(this.miAddExpr_Click); + // + // toolStripSeparator15 + // + this.toolStripSeparator15.Name = "toolStripSeparator15"; + this.toolStripSeparator15.Size = new System.Drawing.Size(218, 6); + // + // cmHelp + // + this.cmHelp.Name = "cmHelp"; + this.cmHelp.Size = new System.Drawing.Size(221, 22); + this.cmHelp.Text = "M_HELP"; + this.cmHelp.Click += new System.EventHandler(this.cmHelp_Click); + // + // cmSamples + // + this.cmSamples.Name = "cmSamples"; + this.cmSamples.Size = new System.Drawing.Size(221, 22); + this.cmSamples.Text = "M_SAMPLES"; + this.cmSamples.Click += new System.EventHandler(this.cmSamples_Click); + // + // columnHeader1 + // + this.columnHeader1.Text = ""; + this.columnHeader1.Width = 22; + // + // columnHeader2 + // + this.columnHeader2.Text = "Строка"; + this.columnHeader2.Width = 16; + // + // columnHeader3 + // + this.columnHeader3.Text = "Ошибка"; + this.columnHeader3.Width = 269; + // + // columnHeader4 + // + this.columnHeader4.Text = "Файл"; + this.columnHeader4.Width = 95; + // + // columnHeader5 + // + this.columnHeader5.Text = "Путь к файлу"; + // + // MainDockPanel + // + this.MainDockPanel.BackColor = System.Drawing.SystemColors.Control; + this.MainDockPanel.ContextMenuStrip = this.contextMenuStrip1; + this.MainDockPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.MainDockPanel.DockBottomPortion = 0.35D; + this.MainDockPanel.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.MainDockPanel.Location = new System.Drawing.Point(0, 49); + this.MainDockPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.MainDockPanel.Name = "MainDockPanel"; + this.MainDockPanel.RightToLeftLayout = true; + this.MainDockPanel.Size = new System.Drawing.Size(876, 491); + this.MainDockPanel.TabIndex = 10; + // + // toolStripPanel + // + this.toolStripPanel.Controls.Add(this.toolStrip1); + this.toolStripPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.toolStripPanel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(204))); + this.toolStripPanel.Location = new System.Drawing.Point(0, 24); + this.toolStripPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.toolStripPanel.Name = "toolStripPanel"; + this.toolStripPanel.Size = new System.Drawing.Size(876, 25); + this.toolStripPanel.TabIndex = 13; + // + // cmBreakpointCondition + // + this.cmBreakpointCondition.ImageScalingSize = new System.Drawing.Size(32, 32); + this.cmBreakpointCondition.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mDELETEBREAKPOINTToolStripMenuItem, + this.mBREAKPOINTCONDITIONToolStripMenuItem1}); + this.cmBreakpointCondition.Name = "cmBreakpointCondition"; + this.cmBreakpointCondition.Size = new System.Drawing.Size(229, 48); + // + // mDELETEBREAKPOINTToolStripMenuItem + // + this.mDELETEBREAKPOINTToolStripMenuItem.Name = "mDELETEBREAKPOINTToolStripMenuItem"; + this.mDELETEBREAKPOINTToolStripMenuItem.Size = new System.Drawing.Size(228, 22); + this.mDELETEBREAKPOINTToolStripMenuItem.Text = "M_DELETE_BREAKPOINT"; + this.mDELETEBREAKPOINTToolStripMenuItem.Click += new System.EventHandler(this.mDELETEBREAKPOINTToolStripMenuItem_Click); + // + // mBREAKPOINTCONDITIONToolStripMenuItem1 + // + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Name = "mBREAKPOINTCONDITIONToolStripMenuItem1"; + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Size = new System.Drawing.Size(228, 22); + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Text = "M_BREAKPOINT_CONDITION"; + this.mBREAKPOINTCONDITIONToolStripMenuItem1.Click += new System.EventHandler(this.mBREAKPOINTCONDITIONToolStripMenuItem1_Click); + // + // openProjectDialog + // + this.openProjectDialog.FileOk += new System.ComponentModel.CancelEventHandler(this.openProjectDialog_FileOk); + // + // mRUNPARAMETERSToolStripMenuItem + // + this.mRUNPARAMETERSToolStripMenuItem.Name = "mRUNPARAMETERSToolStripMenuItem"; + this.mRUNPARAMETERSToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.mRUNPARAMETERSToolStripMenuItem.Text = "M_RUN_PARAMETERS"; + // + // cm_Designer + // + this.cm_Designer.ImageScalingSize = new System.Drawing.Size(32, 32); + this.cm_Designer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmViewCode, + this.cmiDelete, + this.cmiCopy, + this.cmiCut, + this.cmiPaste, + this.cmiAlign, + this.cmiCenter, + this.cmiSizeTo, + this.cmiZOrder, + this.cmiTabOrder, + this.cmiProperties}); + this.cm_Designer.Name = "cm_Designer"; + this.cm_Designer.Size = new System.Drawing.Size(210, 422); + // + // cmViewCode + // + this.cmViewCode.Image = ((System.Drawing.Image)(resources.GetObject("cmViewCode.Image"))); + this.cmViewCode.Name = "cmViewCode"; + this.cmViewCode.Size = new System.Drawing.Size(209, 38); + this.cmViewCode.Text = "M_VIEW_CODE"; + this.cmViewCode.Click += new System.EventHandler(this.cmViewCode_Click); + // + // cmiDelete + // + this.cmiDelete.Image = global::VisualPascalABC.Properties.Resources.Delete3; + this.cmiDelete.ImageTransparentColor = System.Drawing.Color.White; + this.cmiDelete.Name = "cmiDelete"; + this.cmiDelete.Size = new System.Drawing.Size(209, 38); + this.cmiDelete.Text = "M_DELETE"; + this.cmiDelete.Click += new System.EventHandler(this.cmiDelete_Click); + // + // cmiCopy + // + this.cmiCopy.Image = global::VisualPascalABC.Properties.Resources.copy; + this.cmiCopy.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmiCopy.Name = "cmiCopy"; + this.cmiCopy.Size = new System.Drawing.Size(209, 38); + this.cmiCopy.Text = "M_COPY"; + this.cmiCopy.Click += new System.EventHandler(this.cmiCopy_Click); + // + // cmiCut + // + this.cmiCut.Image = global::VisualPascalABC.Properties.Resources.cut; + this.cmiCut.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmiCut.Name = "cmiCut"; + this.cmiCut.Size = new System.Drawing.Size(209, 38); + this.cmiCut.Text = "M_CUT"; + this.cmiCut.Click += new System.EventHandler(this.cmiCut_Click); + // + // cmiPaste + // + this.cmiPaste.Image = global::VisualPascalABC.Properties.Resources.paste; + this.cmiPaste.ImageTransparentColor = System.Drawing.Color.Maroon; + this.cmiPaste.Name = "cmiPaste"; + this.cmiPaste.Size = new System.Drawing.Size(209, 38); + this.cmiPaste.Text = "M_PASTE"; + this.cmiPaste.Click += new System.EventHandler(this.cmiPaste_Click); + // + // cmiAlign + // + this.cmiAlign.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiAlignLefts, + this.cmiAlignRights, + this.cmiAlignTops, + this.cmiAlignBottoms, + this.cmiAlignMiddles, + this.cmiAlignCenters, + this.cmiAlignToGrid}); + this.cmiAlign.Name = "cmiAlign"; + this.cmiAlign.Size = new System.Drawing.Size(209, 38); + this.cmiAlign.Text = "M_ALIGN"; + // + // cmiAlignLefts + // + this.cmiAlignLefts.Image = global::VisualPascalABC.Properties.Resources.AlignObjectsLeftHS; + this.cmiAlignLefts.Name = "cmiAlignLefts"; + this.cmiAlignLefts.Size = new System.Drawing.Size(181, 22); + this.cmiAlignLefts.Text = "M_ALIGN_LEFTS"; + this.cmiAlignLefts.Click += new System.EventHandler(this.cmiAlignLefts_Click); + // + // cmiAlignRights + // + this.cmiAlignRights.Image = global::VisualPascalABC.Properties.Resources.AlignObjectsRightHS; + this.cmiAlignRights.Name = "cmiAlignRights"; + this.cmiAlignRights.Size = new System.Drawing.Size(181, 22); + this.cmiAlignRights.Text = "M_ALIGN_RIGHTS"; + this.cmiAlignRights.Click += new System.EventHandler(this.cmiAlignRights_Click); + // + // cmiAlignTops + // + this.cmiAlignTops.Image = global::VisualPascalABC.Properties.Resources.AlignObjectsTopHS; + this.cmiAlignTops.Name = "cmiAlignTops"; + this.cmiAlignTops.Size = new System.Drawing.Size(181, 22); + this.cmiAlignTops.Text = "M_ALIGN_TOPS"; + this.cmiAlignTops.Click += new System.EventHandler(this.cmiAlignTops_Click); + // + // cmiAlignBottoms + // + this.cmiAlignBottoms.Image = global::VisualPascalABC.Properties.Resources.AlignObjectsBottomHS; + this.cmiAlignBottoms.Name = "cmiAlignBottoms"; + this.cmiAlignBottoms.Size = new System.Drawing.Size(181, 22); + this.cmiAlignBottoms.Text = "M_ALIGN_BOTTOMS"; + this.cmiAlignBottoms.Click += new System.EventHandler(this.cmiAlignBottoms_Click); + // + // cmiAlignMiddles + // + this.cmiAlignMiddles.Image = global::VisualPascalABC.Properties.Resources.AlignObjectsCenteredHorizontalHS; + this.cmiAlignMiddles.Name = "cmiAlignMiddles"; + this.cmiAlignMiddles.Size = new System.Drawing.Size(181, 22); + this.cmiAlignMiddles.Text = "M_ALIGN_MIDDLES"; + this.cmiAlignMiddles.Click += new System.EventHandler(this.cmiAlignMiddles_Click); + // + // cmiAlignCenters + // + this.cmiAlignCenters.Image = global::VisualPascalABC.Properties.Resources.AlignObjectsCenteredVerticalHS; + this.cmiAlignCenters.Name = "cmiAlignCenters"; + this.cmiAlignCenters.Size = new System.Drawing.Size(181, 22); + this.cmiAlignCenters.Text = "M_ALIGN_CENTERS"; + this.cmiAlignCenters.Click += new System.EventHandler(this.cmiAlignCenters_Click); + // + // cmiAlignToGrid + // + this.cmiAlignToGrid.Image = global::VisualPascalABC.Properties.Resources.AlignToGridHS; + this.cmiAlignToGrid.Name = "cmiAlignToGrid"; + this.cmiAlignToGrid.Size = new System.Drawing.Size(181, 22); + this.cmiAlignToGrid.Text = "M_ALIGN_TO_GRID"; + this.cmiAlignToGrid.Click += new System.EventHandler(this.cmiAlignToGrid_Click); + // + // cmiCenter + // + this.cmiCenter.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiCenterHorizontally, + this.cmiCenterVertically}); + this.cmiCenter.Name = "cmiCenter"; + this.cmiCenter.Size = new System.Drawing.Size(209, 38); + this.cmiCenter.Text = "M_CENTER"; + // + // cmiCenterHorizontally + // + this.cmiCenterHorizontally.Name = "cmiCenterHorizontally"; + this.cmiCenterHorizontally.Size = new System.Drawing.Size(221, 22); + this.cmiCenterHorizontally.Text = "M_CENTER_HORIZONTALLY"; + this.cmiCenterHorizontally.Click += new System.EventHandler(this.cmiCenterHorizontally_Click); + // + // cmiCenterVertically + // + this.cmiCenterVertically.Name = "cmiCenterVertically"; + this.cmiCenterVertically.Size = new System.Drawing.Size(221, 22); + this.cmiCenterVertically.Text = "M_CENTER_VERTICALLY"; + this.cmiCenterVertically.Click += new System.EventHandler(this.cmiCenterVertically_Click); + // + // cmiSizeTo + // + this.cmiSizeTo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiSizeToControl, + this.cmiSizeToControlWidth, + this.cmiSizeToControlHeight, + this.cmiSizeToGrid}); + this.cmiSizeTo.Name = "cmiSizeTo"; + this.cmiSizeTo.Size = new System.Drawing.Size(209, 38); + this.cmiSizeTo.Text = "M_SIZE_TO"; + // + // cmiSizeToControl + // + this.cmiSizeToControl.Name = "cmiSizeToControl"; + this.cmiSizeToControl.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToControl.Text = "M_SIZE_TO_CONTROL"; + this.cmiSizeToControl.Click += new System.EventHandler(this.cmiSizeToControl_Click); + // + // cmiSizeToControlWidth + // + this.cmiSizeToControlWidth.Name = "cmiSizeToControlWidth"; + this.cmiSizeToControlWidth.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToControlWidth.Text = "M_SIZE_TO_CONTROL_WIDTH"; + this.cmiSizeToControlWidth.Click += new System.EventHandler(this.cmiSizeToControlWidth_Click); + // + // cmiSizeToControlHeight + // + this.cmiSizeToControlHeight.Name = "cmiSizeToControlHeight"; + this.cmiSizeToControlHeight.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToControlHeight.Text = "M_SIZE_TO_CONTROL_HEIGHT"; + this.cmiSizeToControlHeight.Click += new System.EventHandler(this.cmiSizeToControlHeight_Click); + // + // cmiSizeToGrid + // + this.cmiSizeToGrid.Name = "cmiSizeToGrid"; + this.cmiSizeToGrid.Size = new System.Drawing.Size(236, 22); + this.cmiSizeToGrid.Text = "M_SIZE_TO_GRID"; + // + // cmiZOrder + // + this.cmiZOrder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.cmiBringToFront, + this.cmiSendToBack}); + this.cmiZOrder.Name = "cmiZOrder"; + this.cmiZOrder.Size = new System.Drawing.Size(209, 38); + this.cmiZOrder.Text = "M_Z_ORDER"; + // + // cmiBringToFront + // + this.cmiBringToFront.Image = global::VisualPascalABC.Properties.Resources.BringToFrontHS; + this.cmiBringToFront.Name = "cmiBringToFront"; + this.cmiBringToFront.Size = new System.Drawing.Size(185, 22); + this.cmiBringToFront.Text = "M_BRING_TO_FRONT"; + this.cmiBringToFront.Click += new System.EventHandler(this.cmiBringToFront_Click); + // + // cmiSendToBack + // + this.cmiSendToBack.Image = global::VisualPascalABC.Properties.Resources.SendToBackHS; + this.cmiSendToBack.Name = "cmiSendToBack"; + this.cmiSendToBack.Size = new System.Drawing.Size(185, 22); + this.cmiSendToBack.Text = "M_SEND_TO_BACK"; + this.cmiSendToBack.Click += new System.EventHandler(this.cmiSendToBack_Click); + // + // cmiTabOrder + // + this.cmiTabOrder.Name = "cmiTabOrder"; + this.cmiTabOrder.Size = new System.Drawing.Size(209, 38); + this.cmiTabOrder.Text = "M_TAB_ORDER"; + this.cmiTabOrder.Click += new System.EventHandler(this.cmiTabOrder_Click); + // + // cmiProperties + // + this.cmiProperties.Image = ((System.Drawing.Image)(resources.GetObject("cmiProperties.Image"))); + this.cmiProperties.Name = "cmiProperties"; + this.cmiProperties.Size = new System.Drawing.Size(209, 38); + this.cmiProperties.Text = "M_SHOW_PROPERTIES"; + this.cmiProperties.Click += new System.EventHandler(this.cmiProperties_Click); + // + // Form1 + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(876, 562); + this.Controls.Add(this.MainDockPanel); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.toolStripPanel); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.IsMdiContainer = true; + this.KeyPreview = true; + this.MainMenuStrip = this.menuStrip1; + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.MinimumSize = new System.Drawing.Size(458, 431); + this.Name = "Form1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PascalABC.NET"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed); + this.Load += new System.EventHandler(this.Form1_Load); + this.Shown += new System.EventHandler(this.Form1_Shown); + this.LocationChanged += new System.EventHandler(this.Form1_LocationChanged); + this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.cmEditor.ResumeLayout(false); + this.toolStripPanel.ResumeLayout(false); + this.toolStripPanel.PerformLayout(); + this.cmBreakpointCondition.ResumeLayout(false); + this.cm_Designer.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + private System.Windows.Forms.ToolStripMenuItem tsImmediateWindow; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem12; + + #endregion + + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripButton tbNew; + private System.Windows.Forms.ToolStripButton tbOpen; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem mrFile; + private System.Windows.Forms.ToolStripMenuItem miOpen; + private System.Windows.Forms.ToolStripMenuItem miSave; + private System.Windows.Forms.ToolStripMenuItem mrEdit; + private System.Windows.Forms.ToolStripMenuItem mrView; + private System.Windows.Forms.ToolStripMenuItem mrProgram; + private System.Windows.Forms.ToolStripMenuItem mrService; + private System.Windows.Forms.ToolStripMenuItem mrHelp; + private System.Windows.Forms.ToolStripButton tbSave; + private System.Windows.Forms.ToolStripButton tbSaveAll; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripButton tsCut; + private System.Windows.Forms.ToolStripButton tsCopy; + private System.Windows.Forms.ToolStripButton tsPaste; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripButton tsUndo; + private System.Windows.Forms.ToolStripButton tsRedo; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripButton StartButton; + private System.Windows.Forms.ToolStripButton stopButton; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripButton toolStripButton16; + private System.Windows.Forms.ToolStripButton toolStripButton17; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.ToolStripMenuItem miSaveAs; + private System.Windows.Forms.ToolStripMenuItem miClose; + private System.Windows.Forms.ToolStripMenuItem miCloseAllButThis; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem miRecentFiles; + private System.Windows.Forms.ToolStripMenuItem miRecentProjects; + private System.Windows.Forms.ToolStripMenuItem miExit; + private System.Windows.Forms.ToolStripMenuItem miUndo; + private System.Windows.Forms.ToolStripMenuItem miRedo; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; + private System.Windows.Forms.ToolStripMenuItem miCut; + private System.Windows.Forms.ToolStripMenuItem miCopy; + private System.Windows.Forms.ToolStripMenuItem miPaste; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; + private System.Windows.Forms.ToolStripMenuItem miFind; + private System.Windows.Forms.ToolStripMenuItem miReplace; + private System.Windows.Forms.ToolStripMenuItem miFindNext; + private System.Windows.Forms.ToolStripMenuItem miOutputWindow; + private System.Windows.Forms.ToolStripMenuItem miClearOutput; + private System.Windows.Forms.ToolStripMenuItem miStop; + private System.Windows.Forms.ToolStripMenuItem miAbout; + private System.Windows.Forms.ToolStripButton toolStripButton19; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.ToolStripMenuItem miNew; + private System.Windows.Forms.PrintDialog printDialog1; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.ToolStripMenuItem miRun; + private System.Windows.Forms.FontDialog fontDialog1; + private System.Windows.Forms.ToolStripMenuItem cmClose; + private System.Windows.Forms.ToolStripMenuItem cmCloseAllButThis; + private System.Windows.Forms.ToolStripMenuItem cmSave; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripButton CompileButton; + private System.Windows.Forms.ToolStripButton ReCompileButton; + private System.Windows.Forms.ToolStripMenuItem miBuild; + private System.Windows.Forms.ToolStripMenuItem miRebuild; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; + public System.Windows.Forms.ToolStripStatusLabel slLine; + public System.Windows.Forms.ToolStripStatusLabel slCol; + private System.Windows.Forms.ToolStripMenuItem miPlugins; + private System.Windows.Forms.ToolStripMenuItem miSaveAll; + private System.Windows.Forms.ToolStripDropDownButton tstaSelect; + private System.Windows.Forms.ToolStripMenuItem tsatConsoleApplication; + private System.Windows.Forms.ToolStripMenuItem tsatWindowsApplication; + private System.Windows.Forms.ToolStripMenuItem tsatDll; + public System.Windows.Forms.ContextMenuStrip cmEditor; + private System.Windows.Forms.ToolStripMenuItem cmCut; + private System.Windows.Forms.ToolStripMenuItem cmCopy; + private System.Windows.Forms.ToolStripMenuItem cmPaste; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripMenuItem cmRun; + private System.Windows.Forms.ToolStripMenuItem miNavigBack; + private System.Windows.Forms.ToolStripMenuItem miNavigForw; + private System.Windows.Forms.ToolStripButton tsNavigBack; + private System.Windows.Forms.ToolStripButton tsNavigForw; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; + private System.Windows.Forms.ToolStripMenuItem cmSetActive; + private System.Windows.Forms.ToolStripSeparator tssRunStopSeparator; + private System.Windows.Forms.ToolStripButton tsOutputWindow; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem7; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8; + private System.Windows.Forms.ToolStripMenuItem mGOTONEXTBOOKMARKToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mGOTOPREVBOOKMARKToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mCLEARBOOKMARKSToolStripMenuItem; + private System.Windows.Forms.ToolStripButton StartNoDebugButton; + private System.Windows.Forms.ToolStripMenuItem miRunNoDebug; + private System.Windows.Forms.ToolStripMenuItem tsHelp; + private System.Windows.Forms.ToolStripMenuItem cmGotoDefinition; + private System.Windows.Forms.ToolStripSeparator cmsCodeCompletion; + private System.Windows.Forms.ToolStripMenuItem cmGotoRealization; + private System.Windows.Forms.ToolStripMenuItem cmFindAllReferences; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.ColumnHeader columnHeader3; + private System.Windows.Forms.ColumnHeader columnHeader4; + private System.Windows.Forms.ColumnHeader columnHeader5; + private System.Windows.Forms.ToolStripMenuItem cmGenerateRealization; + private System.Windows.Forms.ToolStripSeparator tssmIntellisence; + private System.Windows.Forms.ToolStripMenuItem tsGotoDefinition; + private System.Windows.Forms.ToolStripMenuItem tsGotoRealization; + private System.Windows.Forms.ToolStripMenuItem tsFindAllReferences; + private System.Windows.Forms.ToolStripMenuItem miGenerateRealization; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; + private System.Windows.Forms.ToolStripMenuItem tsSelectAll; + private System.Windows.Forms.ToolStripMenuItem tsGotoLine; + public WeifenLuo.WinFormsUI.Docking.DockPanel MainDockPanel; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; + private System.Windows.Forms.ToolStripMenuItem tsShowCompilerConsoleWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowDebugVariablesListWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowErrorsListWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowDebugWatchListWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowFindSymbolsResultWindow; + private System.Windows.Forms.ToolStripMenuItem tsShowOutputWindow; + private System.Windows.Forms.ToolStripMenuItem mOPTIONSToolStripMenuItem; + private System.Windows.Forms.Panel toolStripPanel; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; + private System.Windows.Forms.ToolStripMenuItem tsViewIntellisensePanel; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; + private System.Windows.Forms.ToolStripMenuItem miAddExpr; + private System.Windows.Forms.ToolStripMenuItem cntxt_miAddExpr; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; + private System.Windows.Forms.ContextMenuStrip cmBreakpointCondition; + private System.Windows.Forms.ToolStripMenuItem mDELETEBREAKPOINTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mBREAKPOINTCONDITIONToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem miNewAdv; + private System.Windows.Forms.ToolStripMenuItem miUnitWithForm; + private System.Windows.Forms.ToolStripMenuItem miToolBox; + private System.Windows.Forms.ToolStripMenuItem miProperties; + private System.Windows.Forms.ToolStripMenuItem miFormProgram; + private System.Windows.Forms.ToolStripMenuItem mrDesigner; + private System.Windows.Forms.ToolStripMenuItem miShowGrid; + private System.Windows.Forms.ToolStripMenuItem miSnapToGrid; + private System.Windows.Forms.ToolStripMenuItem miAlign; + private System.Windows.Forms.ToolStripMenuItem miCenter; + private System.Windows.Forms.ToolStripMenuItem miSizeTo; + private System.Windows.Forms.ToolStripMenuItem miZOrder; + private System.Windows.Forms.ToolStripMenuItem miTabOrder; + private System.Windows.Forms.ToolStripMenuItem miAlignLefts; + private System.Windows.Forms.ToolStripMenuItem miAlignRights; + private System.Windows.Forms.ToolStripMenuItem miAlignTops; + private System.Windows.Forms.ToolStripMenuItem miAlignBottoms; + private System.Windows.Forms.ToolStripMenuItem miAlignMiddles; + private System.Windows.Forms.ToolStripMenuItem miAlignCenters; + private System.Windows.Forms.ToolStripMenuItem miAlignToGrid; + private System.Windows.Forms.ToolStripMenuItem miCenterHorizontally; + private System.Windows.Forms.ToolStripMenuItem miCenterVertically; + private System.Windows.Forms.ToolStripMenuItem miSizeToControl; + private System.Windows.Forms.ToolStripMenuItem miSizeToControlWidth; + private System.Windows.Forms.ToolStripMenuItem miSizeToControlHeight; + private System.Windows.Forms.ToolStripMenuItem miSizeToGrid; + private System.Windows.Forms.ToolStripMenuItem miBringToFront; + private System.Windows.Forms.ToolStripMenuItem miSendToBack; + private System.Windows.Forms.ToolStripMenuItem miDelete; + private System.Windows.Forms.ToolStripMenuItem mMAINFEATURESToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem miNewProject; + private System.Windows.Forms.ToolStripMenuItem miCloseProject; + private System.Windows.Forms.ToolStripMenuItem miOpenProject; + private System.Windows.Forms.OpenFileDialog openProjectDialog; + private System.Windows.Forms.ToolStripMenuItem mRPROJECTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mADDFORMToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mADDFILEToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6; + private System.Windows.Forms.ToolStripMenuItem mADDREFERENCEToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mPROPERTIESToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mADDEXISTFILEToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem9; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem10; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem11; + private System.Windows.Forms.ToolStripMenuItem mRUNPARAMETERSToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mRUNPARAMETERSToolStripMenuItem1; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem13; + public System.Windows.Forms.ContextMenuStrip cm_Designer; + private System.Windows.Forms.ToolStripMenuItem cmiDelete; + private System.Windows.Forms.ToolStripMenuItem cmiAlign; + private System.Windows.Forms.ToolStripMenuItem cmiCenter; + private System.Windows.Forms.ToolStripMenuItem cmiSizeTo; + private System.Windows.Forms.ToolStripMenuItem cmiZOrder; + private System.Windows.Forms.ToolStripMenuItem cmiTabOrder; + private System.Windows.Forms.ToolStripMenuItem cmiCopy; + private System.Windows.Forms.ToolStripMenuItem cmiCut; + private System.Windows.Forms.ToolStripMenuItem cmiPaste; + private System.Windows.Forms.ToolStripMenuItem cmiAlignLefts; + private System.Windows.Forms.ToolStripMenuItem cmiAlignRights; + private System.Windows.Forms.ToolStripMenuItem cmiAlignTops; + private System.Windows.Forms.ToolStripMenuItem cmiAlignBottoms; + private System.Windows.Forms.ToolStripMenuItem cmiAlignMiddles; + private System.Windows.Forms.ToolStripMenuItem cmiAlignCenters; + private System.Windows.Forms.ToolStripMenuItem cmiAlignToGrid; + private System.Windows.Forms.ToolStripMenuItem cmiCenterHorizontally; + private System.Windows.Forms.ToolStripMenuItem cmiCenterVertically; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToControl; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToControlWidth; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToControlHeight; + private System.Windows.Forms.ToolStripMenuItem cmiSizeToGrid; + private System.Windows.Forms.ToolStripMenuItem cmiBringToFront; + private System.Windows.Forms.ToolStripMenuItem cmiSendToBack; + private System.Windows.Forms.ToolStripMenuItem mFORMATToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cmFormat; + private System.Windows.Forms.ToolStripButton tsFormat; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; + private System.Windows.Forms.ToolStripMenuItem mNEWASPToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mDOTNETHELPToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cmViewCode; + private System.Windows.Forms.ToolStripMenuItem cmiProperties; + private System.Windows.Forms.ToolStripMenuItem miPrint; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; + private System.Windows.Forms.ToolStripMenuItem miProjectExplorer; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; + private System.Windows.Forms.ToolStripMenuItem cmHelp; + private System.Windows.Forms.ToolStripMenuItem cmSamples; + private System.Windows.Forms.ToolStripMenuItem miCheckUpdates; + private System.Windows.Forms.ToolStripMenuItem cmCollapseRegions; + private System.Windows.Forms.ToolStripMenuItem tsDisassembly; + private System.Windows.Forms.ToolStripButton tsAutoInsertCode; + private System.Windows.Forms.ToolStripMenuItem mAUTOINSERTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mUNITTESTSToolStripMenuItem; + private System.Windows.Forms.ToolStripButton toolStripButton1; + private System.Windows.Forms.ToolStripStatusLabel HealthLabel; + } +} + diff --git a/VisualPascalABCNETLinux/Form1.cs b/VisualPascalABCNETLinux/Form1.cs new file mode 100644 index 000000000..a83e0abb5 --- /dev/null +++ b/VisualPascalABCNETLinux/Form1.cs @@ -0,0 +1,2034 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using System.Threading; +using System.Runtime.InteropServices; +using WeifenLuo.WinFormsUI.Docking; +using VisualPascalABC.OptionsContent; +using System.Security.Permissions; +using System.ComponentModel.Design; + +//using ICSharpCode.FormsDesigner; +//using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; + +namespace VisualPascalABC +{ + delegate void SetTextDelegate(string Text); + delegate void SetFileNameAndTextDelegate(string ExeFileName, string Text); + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + + public partial class Form1 : Form, VisualPascalABCPlugins.IWorkbench, VisualPascalABCPlugins.IWorkbenchDocumentService + { + static string VersionInTitle(string s) + { + // VersionInTitle(RevisionClass.FullVersion) + var i = s.LastIndexOf('.'); + return s.Substring(0, i); + } + + private const string MainFormTitle = "PascalABC.NET"; + private static bool DesignerUseable = true; + private static bool ProjectsUseable = true; +#if (DEBUG) + private static bool UseImmediate = true; +#else + private static bool UseImmediate = false; +#endif + +#if (DEBUG) + private const bool DebugModus = true; +#else + private const bool DebugModus = false; +#endif + private string MainFormText = MainFormTitle; + private string FTSFormat = "{0} [{1}]"; + + internal BottomDockContentForm BottomActiveContent = null; + + + private ICSharpCode.TextEditor.Document.FileSyntaxModeProvider FileSyntaxProvider; + + public PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager = new PascalABCCompiler.Errors.ErrorsStrategyManager(PascalABCCompiler.Errors.ErrorsStrategy.FirstSemanticAndSyntax); + + internal bool DebuggerVisible = true; // почему то влияет на Intellisense!!!!! Не отключать! + + private int FormLeft, FormTop, FormWidth, FormHeight; + + //public ToolBoxForm ToolBoxWindow = null; + //public PropertiesForm PropertiesWindow = null; + internal OutputWindowForm OutputWindow; + internal ErrorsListWindowForm ErrorsListWindow; + internal FindSymbolsResultWindowForm FindSymbolsResultWindow; + internal ImmediateWindow ImmediateWindow; + internal CompilerConsoleWindowForm CompilerConsoleWindow; + internal DebugVariablesListWindowForm DebugVariablesListWindow; + internal DebugWatchListWindowForm DebugWatchListWindow; + internal DisassemblyWindow DisassemblyWindow; + internal ProjectExplorerForm ProjectExplorerWindow = null; + public WeifenLuo.WinFormsUI.Docking.DockPane BottomPane; + public WeifenLuo.WinFormsUI.Docking.DockPane ProjectPane; + FSWatcherService WatcherService = new FSWatcherService(); + + private bool LoadComplete = false; + internal SourceLocationAction ErrorCursorPosStrategy = SourceLocationAction.GotoBeg; + + private CodeFileDocumentControl activeTabPage = null; + + PascalABCCompiler.Errors.ErrorsStrategyManager VisualPascalABCPlugins.IWorkbench.ErrorsManager + { + get + { + return ErrorsManager; + } + } + + VisualPascalABCPlugins.IOutputWindow VisualPascalABCPlugins.IWorkbench.OutputWindow + { + get + { + return OutputWindow; + } + } + + VisualPascalABCPlugins.IDisassemblyWindow VisualPascalABCPlugins.IWorkbench.DisassemblyWindow + { + get + { + return DisassemblyWindow; + } + } + + VisualPascalABCPlugins.ICompilerConsoleWindow VisualPascalABCPlugins.IWorkbench.CompilerConsoleWindow + { + get + { + return CompilerConsoleWindow; + } + } + + VisualPascalABCPlugins.IErrorListWindow VisualPascalABCPlugins.IWorkbench.ErrorsListWindow + { + get + { + return ErrorsListWindow; + } + } + + ICodeFileDocument VisualPascalABCPlugins.IWorkbenchDocumentService.ActiveCodeFileDocument + { + get + { + return ActiveCodeFileDocument; + } + set + { + ActiveCodeFileDocument = value as CodeFileDocumentControl; + } + } + + ICodeFileDocument VisualPascalABCPlugins.IWorkbenchDocumentService.LastSelectedTab + { + get + { + return LastSelectedTab; + } + + } + + void VisualPascalABCPlugins.IWorkbench.BeginInvoke(Delegate del, params object[] args) + { + this.BeginInvoke(del, args); + } + + internal System.Drawing.Image BuildImage + { + get + { + return miBuild.Image; + } + } + + internal System.Drawing.Image RebuildImage + { + get + { + return miRebuild.Image; + } + } + + internal System.Drawing.Image RunImage + { + get + { + return miRun.Image; + } + } + + internal System.Drawing.Image NewFileImage + { + get + { + return miNew.Image; + } + } + + internal System.Drawing.Image OpenFileImage + { + get + { + return miOpen.Image; + } + } + + internal System.Drawing.Image NewFormImage + { + get + { + return mADDFORMToolStripMenuItem.Image; + } + } + + public VisualEnvironmentCompiler VisualEnvironmentCompiler = null; + + public CompilerForm CompilerForm1; + + + public AboutBox AboutBox1; + public FindReplaceForm FindForm; + public GotoLineForm GotoLineForm; + public FindReplaceForm ReplaceForm; + + internal NavigationManager NavigationManager; + public bool SaveCanceled = false; + private WorkbenchServiceContainer serviceContainer; + + //private System.Windows.Forms.DataGridViewImageColumn PictColumn; + + OptionsContentEngine optionsContentEngine; + + // Для Linux сделать все Debug-кнопки неактивными + public void SetDebugButtonsInvisible() + { + this.SuspendLayout(); + this.toolStripPanel.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + + this._toolStripMenuItem10.Visible = false; + this.mSTEPOVERToolStripMenuItem.Visible = false; + this.mSTEPToolStripMenuItem.Visible = false; + this.mSTEPINToolStripMenuItem.Visible = false; + this.mRUNTOCURToolStripMenuItem.Visible = false; + this.StepOverButton.Visible = false; + this.StepIntoButton.Visible = false; + this.tsShowDebugVariablesListWindow.Visible = false; + this.tsShowDebugWatchListWindow.Visible = false; + this.tsImmediateWindow.Visible = false; + this.menuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + } + public Form1() + { + if (Tools.IsUnix()) + { + ProjectsUseable = false; + DesignerUseable = false; + //DebuggerVisible = false; + } + + PascalABCCompiler.StringResourcesLanguage.LoadDefaultConfig(); + + //if (PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages.Count > 0) + // PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages[0]; + + InitializeComponent(); + ScreenScale.FirstCalcScale(this); // !! + ICSharpCode.TextEditor.ScreenScale.FirstCalcScale(this); + + if (!DebuggerVisible) + { + tsShowDebugVariablesListWindow.Visible = false; + tsShowDebugWatchListWindow.Visible = false; + tsImmediateWindow.Visible = false; + } + + //toolStrip1.Visible = false; + //menuStrip1.Visible = false; + tsAutoInsertCode.Visible = false; + MainDockPanel.Theme = new WeifenLuo.WinFormsUI.Docking.VS2005Theme(); + BottomDockPanel.Theme = new WeifenLuo.WinFormsUI.Docking.VS2005Theme(); + //MainDockPanel.ActiveDocumentChanged += (oo, ee) => MessageBox.Show("MainDockPanel.ActiveDocumentChanged"); + //MainDockPanel.Click += (oo, ee) => MessageBox.Show("MainDockPanel.Click"); + + + VisualPABCSingleton.MainForm = this; + WorkbenchStorage.MainProgramThread = System.Threading.Thread.CurrentThread; + //images init + this.miNewProject.Image = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.NewProjectIcon.png")); + this.mADDFILEToolStripMenuItem.Image = miNew.Image; + this.mADDEXISTFILEToolStripMenuItem.Image = miOpen.Image; + this.mADDFORMToolStripMenuItem.Image = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Form.png")); + + //toolStripPanel.Size = new Size(toolStripPanel.Size.Width, toolStrip1.Height); + toolStripPanel.AutoSize = true; + var gr = CreateGraphics(); + if (gr.DpiX >= 96*2) + { + this.SuspendLayout(); + this.toolStripPanel.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + + toolStrip1.ImageScalingSize = new Size(32, 32); + menuStrip1.ImageScalingSize = new Size(32, 32); + toolStripPanel.Size = new Size(toolStripPanel.Size.Width, 38); + this.toolStripPanel.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + } + // !! + gr.Dispose(); + serviceContainer = new WorkbenchServiceContainer(); + + if (DebuggerVisible) + { + InitForm(); + this.StepOutButton.Visible = false; + PlayPauseButtonsVisibleInPanel = PlayPauseButtonsVisibleInPanel; + SetDebugButtonsEnabled(false); + } + + // Для Linux сделать все Debug-кнопки неактивными + SetDebugButtonsInvisible(); + + AddOwnedForm(CompilerForm1 = new CompilerForm()); + AddOwnedForm(AboutBox1 = new AboutBox()); + AddOwnedForm(FindForm = new FindReplaceForm(FindReplaceForm.FormType.Find)); + AddOwnedForm(ReplaceForm = new FindReplaceForm(FindReplaceForm.FormType.Replace)); + AddOwnedForm(GotoLineForm = new GotoLineForm()); + + LastOpenFiles = new List(); + LastOpenProjects = new List(); + + WorkbenchServiceFactory.BuildService.CompilerOptions.Debug = true; + WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + + LocalizeControls(); + + tsatConsoleApplication.Tag = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + tsatWindowsApplication.Tag = PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication; + tsatDll.Tag = PascalABCCompiler.CompilerOptions.OutputType.ClassLibrary; + + SelectAppType(WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType); + + //this.Width = 800; + //this.Height = 600; + UserOptions = new UserOptions(); + SetFiltersAndHighlighting(); + + FormLeft = this.Left; FormTop = this.Top; FormWidth = this.Width; FormHeight = this.Height; + //MainDockPanel.DockRightPortion = 0.22; + //MainDockPanel.DockLeftPortion = 0.22; + + //UserOptions.OutputDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)+"\\Output"; + UserOptions.OutputDirectory = Constants.DefaultOutputDirectory; + + PlayPauseButtonsVisibleInPanel = false; + + WorkbenchStorage.StandartDirectories = new Hashtable(StringComparer.InvariantCultureIgnoreCase); + WorkbenchStorage.StandartDirectories.Add(Constants.SystemDirectoryIdent, System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)); + + RestoreDesktop(); + OutputWindow.CloseButton = false; + ErrorsListWindow.CloseButton = false; + CompilerConsoleWindow.CloseButton = false; + + menuStrip1.Font = new Font(menuStrip1.Font.Name, 8.25f); + + // SSM 06.06.22 - это только для Линукса!!! + MainDockPanel.AllowEndUserDocking = false; + BottomDockPanel.AllowEndUserDocking = false; + + LoadOptions(); + + HelpExamplesDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesDirectory, WorkbenchStorage.StandartDirectories); + HelpTutorialExamplesDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpTutorialExamplesDirectory, WorkbenchStorage.StandartDirectories); + + UpdateUserOptions(); + //ErrorsListWindow.Resized(); + FindSymbolsResultWindow.Resized(); + + UpdateOutputWindowVisibleButtons(); + + if (WorkbenchStorage.WorkingDirectory == null || true) + { + WorkbenchStorage.WorkingDirectoryInOptionsFile = Constants.DefaultWorkingDirectory; + WorkbenchStorage.WorkingDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultWorkingDirectory, WorkbenchStorage.StandartDirectories); + } + if (Path.GetDirectoryName(Application.ExecutablePath).ToLower() != Environment.CurrentDirectory.ToLower()) + WorkbenchStorage.WorkingDirectory = Environment.CurrentDirectory; + WorkbenchStorage.StandartDirectories.Add(Constants.WorkingDirectoryIdent, WorkbenchStorage.WorkingDirectory); + openFileDialog1.InitialDirectory = WorkbenchStorage.WorkingDirectory; + + if (WorkbenchStorage.LibSourceDirectory == null) + WorkbenchStorage.LibSourceDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultLibSourceDirectory, WorkbenchStorage.StandartDirectories); + WorkbenchStorage.StandartDirectories.Add(Constants.LibSourceDirectoryIdent, WorkbenchStorage.LibSourceDirectory); + AddSearchDebugPath(WorkbenchStorage.LibSourceDirectory); + + if (UserOptions.UseOutputDirectory) + WorkbenchStorage.StandartDirectories.Add(Constants.OutputDirectoryIdent, UserOptions.OutputDirectory); + else + WorkbenchStorage.StandartDirectories.Add(Constants.OutputDirectoryIdent, null); + + RunManager RunnerManager = (WorkbenchServiceFactory.RunService as WorkbenchRunService).RunnerManager; + VisualEnvironmentCompiler = new VisualEnvironmentCompiler( + this.BeginInvoke, SetCompilingButtonsEnabled, SetDedugButtonsEnabled, SetStateText, + AddTextToCompilerMessagesSync, miPlugins, toolStrip1, + ExecuteSourceLocationAction, ExecuteVisualEnvironmentCompilerAction, ErrorsManager, RunnerManager, + WorkbenchServiceFactory.DebuggerManager, UserOptions, WorkbenchStorage.StandartDirectories, OpenDocuments, this); + if (OnEnvorimentEvent != null) + OnEnvorimentEvent(EnvorimentEvent.VisualEnvironmentCompilerCreated); + + NavigationManager = new NavigationManager(ExecuteSourceLocationAction); + NavigationManager.StateChanged += new NavigationManager.NavigationManagerStateChanged(NavigationManager_StateChanged); + + string newFileName = InstNameNewProgramm(MainDockPanel); + AddNewProgramToTab(MainDockPanel, newFileName); + + AddOptionsContent(); + Application.AddMessageFilter(this); + + if (DesignerUseable) + { + //miProperties.Visible = true; + //miToolBox.Visible = true; + //miNewAdv.Visible = true; + miUndo.Visible = true; + } + this.mRPROJECTToolStripMenuItem.Visible = false; + if (ProjectsUseable) + { + miNewProject.Visible = true; + miRecentProjects.Visible = true; + //miCloseProject.Visible = true; + miOpenProject.Visible = true; + } + if (!UseImmediate) + { + tsImmediateWindow.Visible = false; + } + this.mNEWASPToolStripMenuItem.Visible = DebugModus; + //if (!Tools.IsUnix()) + // AddDesignerSidebars(); + WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(newFileName); + } + + public class ProbaBForm : BottomDockContentForm { } + + private void Form1_Load(object sender, EventArgs e) + { + BottomDockPanel.AllowEndUserDocking = false; + + //CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += TextArea_KeyEventHandler; + + init = true; + foreach (string FileName in VisualPascalABCProgram.CommandLineArgs) + { + if (Path.GetExtension(FileName) == ".pabcproj") + WorkbenchServiceFactory.ProjectService.OpenProject(FileName); + else + WorkbenchServiceFactory.FileService.OpenFile(FileName, null); + } + if (FileNameToWait != null) + { + if (Path.GetExtension(FileNameToWait) == ".pabcproj") + WorkbenchServiceFactory.ProjectService.OpenProject(FileNameToWait); + else + WorkbenchServiceFactory.FileService.OpenFile(FileNameToWait, null); + } + SetStopEnabled(false); + CompilingButtonsEnabled = CloseButtonsEnabled = SaveAllButtonsEnabled = SaveButtonsEnabled = false; + if (DebuggerVisible) + SetDedugButtonsEnabled(false); + SetCompilingButtonsEnabled(false); + + HelpFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpFileName, WorkbenchStorage.StandartDirectories); + DotNetHelpFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DotNetHelpFileName, WorkbenchStorage.StandartDirectories); + if (!File.Exists(HelpFileName)) + tsHelp.Visible = false; + + HelpExamplesFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesFileName, WorkbenchStorage.StandartDirectories); + HelpExamplesMapFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesMapFileName, WorkbenchStorage.StandartDirectories); + + InitHelpProgramsDictionary(); // SSM + + NavigBackButtonsEnabled = NavigForwButtonsEnabled = false; + + try + { + if (!Directory.Exists(WorkbenchStorage.WorkingDirectory)) + Directory.CreateDirectory(WorkbenchStorage.WorkingDirectory); + } + catch (Exception exc) + { + AddTextToCompilerMessages(Form1StringResources.Get("MSGTYPE") + String.Format(Form1StringResources.Get("ERROR_CREATING_WORKDIR_{0}_{1}"), WorkbenchStorage.WorkingDirectory, exc.Message) + Environment.NewLine); + } + try + { + if (!Directory.Exists(UserOptions.OutputDirectory)) + Directory.CreateDirectory(UserOptions.OutputDirectory); + } + catch (Exception exc) + { + AddTextToCompilerMessages(Form1StringResources.Get("MSGTYPE") + String.Format(Form1StringResources.Get("ERROR_CREATING_WORKDIR_{0}_{1}"), UserOptions.OutputDirectory, exc.Message) + Environment.NewLine); + } + CodeCompletionActionsManager.templateManager = new CodeTemplateManager(); + } + + private void LocalizeControls() + { + Form1StringResources.SetTextForAllControls(this); + Form1StringResources.SetTextForAllControls(this.contextMenuStrip1); + Form1StringResources.SetTextForAllControls(this.cm_Designer); + Form1StringResources.SetTextForAllControls(this.cmEditor); + Form1StringResources.SetTextForAllControls(this.cmBreakpointCondition); + Form1StringResources.SetTextForAllControls(this.RunArgumentsForm); + PascalABCCompiler.StringResources.SetTextForAllObjects(AboutBox1, "VP_ABOUTBOXFORM_"); + PascalABCCompiler.StringResources.SetTextForAllObjects(FindForm, "VP_FINDFORM_"); + PascalABCCompiler.StringResources.SetTextForAllObjects(ReplaceForm, "VP_REPLACEFORM_"); + PascalABCCompiler.StringResources.SetTextForAllObjects(GotoLineForm, "VP_GOTOLINEFORM_"); + } + + private void SetFiltersAndHighlighting() + { + string hdir = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName), "Highlighting"); + if (Directory.Exists(hdir)) + { + FileSyntaxProvider = new ICSharpCode.TextEditor.Document.FileSyntaxModeProvider(hdir+Path.DirectorySeparatorChar); + ICSharpCode.TextEditor.Document.HighlightingManager.Manager.AddSyntaxModeFileProvider(FileSyntaxProvider); + string Filter = "", AllFilter = ""; + foreach (ICSharpCode.TextEditor.Document.SyntaxMode sm in FileSyntaxProvider.SyntaxModes) + { + Filter = Tools.MakeFilter(Filter, sm.Name, sm.Extensions); + AllFilter = Tools.MakeAllFilter(AllFilter, sm.Name, sm.Extensions); + } + saveFileDialog1.Filter = openFileDialog1.Filter = Tools.FinishMakeFilter(Filter, AllFilter); + } + } + + private void Form1_FormClosed(object sender, FormClosedEventArgs e) + { + WorkbenchServiceFactory.CodeCompletionParserController.StopParseThread(); + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + string text = Text; + //если запущены программы + if (WorkbenchServiceFactory.RunService.IsRun()) + { + //завершаем все программы + this.Text = string.Format(FTSFormat, MainFormText, Form1StringResources.Get("FTS_KILLPROCESS")); + WorkbenchServiceFactory.RunService.KillAll(); + this.Text = text; + } + + WorkbenchServiceFactory.CodeCompletionParserController.StopParsing(); + + //Сохраняем Файлы + if (ProjectFactory.Instance.ProjectLoaded) + { + if (!WorkbenchServiceFactory.ProjectService.CloseProject()) + { + e.Cancel = true; + return; + } + } + else if (!SaveAll(true)) + { + e.Cancel = true; + return; + } + + + //если стартовый поток запущен + try + { + if (VisualEnvironmentCompiler.Starting()) + { + //начинаем процедуру отмены старта компилятора + this.Text = string.Format(FTSFormat, MainFormText, Form1StringResources.Get("FTS_CANCELLOADING")); + VisualEnvironmentCompiler.AbortStaring(); + } + else + SaveOptions(); + } + catch + { + + } + e.Cancel = false; + } + + + + private void miClearOutputWindow_Click(object sender, EventArgs e) + { + var zoomf = OutputWindow.outputTextBox.ZoomFactor; + OutputWindow.outputTextBox.Clear(); + OutputWindow.outputTextBox.ZoomFactor = zoomf; + } + + public enum EnvorimentEvent {VisualEnvironmentCompilerCreated} + public delegate void EnvorimentEventDelegate(EnvorimentEvent EnvorimentEvent); + public event EnvorimentEventDelegate OnEnvorimentEvent; + bool init = false; + string FileNameToWait=null; + + void NavigationManager_StateChanged(NavigationManager sender) + { + NavigBackButtonsEnabled = NavigationManager.CanNavigateBackward; + NavigForwButtonsEnabled = NavigationManager.CanNavigateForward; + } + + private void OpenToolStripMenuItem1_Click_1(object sender, EventArgs e) + { + OpenFileDialog(Path.GetDirectoryName(CurrentSourceFileName)); + } + + VisualPascalABCPlugins.IVisualEnvironmentCompiler VisualPascalABCPlugins.IWorkbench.VisualEnvironmentCompiler + { + get + { + return VisualEnvironmentCompiler; + } + } + + private void UndoToolStripMenuItem_Click(object sender, EventArgs e) //roman// + { + ExecUndo(); + } + + private void RedoToolStripMenuItem_Click(object sender, EventArgs e) //roman// + { + ExecRedo(); + } + + private void ExitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + public void SetStateText(string text) + { + toolStripStatusLabel5.Text = text; + statusStrip1.Refresh(); + } + + public void Reset() + { + } + + private void Form1_Shown(object sender, EventArgs e) + { + + if(_mainFormWindowStateMaximized) + this.WindowState = FormWindowState.Maximized; + //PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = "Russi + + ChangedSelectedTab(); + VisualEnvironmentCompiler.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(VisualEnvironmentCompiler_ChangeVisualEnvironmentState); + VisualEnvironmentCompiler.RunStartingThread(); + + LoadComplete = true; + } + + private object ExecuteVisualEnvironmentCompilerAction(VisualEnvironmentCompilerAction Action,object obj) + { + switch (Action) + { + case VisualEnvironmentCompilerAction.Run: + return WorkbenchServiceFactory.RunService.Run(true); + case VisualEnvironmentCompilerAction.Stop: + return WorkbenchServiceFactory.RunService.Stop(); + case VisualEnvironmentCompilerAction.Build: + return WorkbenchServiceFactory.BuildService.Build(); + case VisualEnvironmentCompilerAction.BuildUnit: + return WorkbenchServiceFactory.BuildService.Build(obj as string); + case VisualEnvironmentCompilerAction.Rebuild: + return WorkbenchServiceFactory.BuildService.Rebuild(); + case VisualEnvironmentCompilerAction.OpenFile: + return WorkbenchServiceFactory.FileService.OpenFile((string)obj, null); + case VisualEnvironmentCompilerAction.GetDirectory: + string s=VisualEnvironmentCompiler.Compiler.CompilerOptions.StandartDirectories[(string)obj] as string; + if (s != null) + return s; + return WorkbenchStorage.StandartDirectories[(string)obj] as string; + case VisualEnvironmentCompilerAction.PT4PositionCursorAfterTask: // SSM 09.11.19 + { + var ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + var d = ta.Document; + for (var i = 0; i)obj,true); + return true; + case VisualEnvironmentCompilerAction.SaveFile: + string FileName = Tools.FileNameToLower((string)obj); + if (!OpenDocuments.ContainsKey(FileName)) + return false; + var doc = OpenDocuments[FileName]; + if (doc.DocumentSavedToDisk) + SaveFileAs(doc, (string)obj); + //else + // ExecuteSaveAs(doc); + return true; + } + return false; + } + + void VisualEnvironmentCompiler_ChangeVisualEnvironmentState(VisualEnvironmentState State, object obj) + { + switch (State) + { + case VisualEnvironmentState.StartCompilerLoading: + this.Text = String.Format(FTSFormat,MainFormText,Form1StringResources.Get("FTS_LOADING")); + break; + case VisualEnvironmentState.FinishCompilerLoading: + this.Text = String.Format("{0} {1}",MainFormText,PascalABCCompiler.Compiler.ShortVersion); + //this.Text = MainFormText; + openFileDialog1.Filter = saveFileDialog1.Filter = VisualEnvironmentCompiler.GetFilterForDialogs(); + openProjectDialog.Filter = VisualEnvironmentCompiler.GetProjectFilterForDialogs(); + VisualEnvironmentCompiler.Compiler.CompilerOptions = WorkbenchServiceFactory.BuildService.CompilerOptions; + break; + } + } + + public string CurrentSourceFileName + { + get { return CurrentCodeFileDocument.FileName; } + } + + public string CurrentEXEFileName + { + get + { + string path = ""; + + if (ProjectFactory.Instance.CurrentProject != null) + { + if (!string.IsNullOrEmpty(ProjectFactory.Instance.CurrentProject.OutputDirectory)) + return Path.Combine(ProjectFactory.Instance.CurrentProject.OutputDirectory, ProjectFactory.Instance.CurrentProject.OutputFileName); + return Path.Combine(ProjectFactory.Instance.CurrentProject.ProjectDirectory, ProjectFactory.Instance.CurrentProject.OutputFileName); + } + + + if (UserOptions.UseOutputDirectory) + path = Path.Combine(UserOptions.OutputDirectory, Path.GetFileNameWithoutExtension(CurrentSourceFileName)) + ".exe"; + else + path = Path.ChangeExtension(CurrentSourceFileName, ".exe"); + if (!File.Exists(path) && ActiveCodeFileDocument != null) + { + if (UserOptions.UseOutputDirectory) + path = Path.Combine(UserOptions.OutputDirectory, Path.GetFileNameWithoutExtension(ActiveCodeFileDocument.FileName)) + ".exe"; + else + path = Path.ChangeExtension(ActiveCodeFileDocument.FileName, ".exe"); + } + return path; + } + } + + private void OpenLastFile_ToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.FileService.OpenFile((sender as ToolStripMenuItem).Tag as string, null); + } + + private void OpenLastProject_ToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.ProjectService.OpenProject((sender as ToolStripMenuItem).Tag as string); + } + + private void toolStripButton19_Click(object sender, EventArgs e) + { + OutputWindow.outputTextBox.Text = ""; + } + + private void fontDialog1_Apply(object sender, EventArgs e) + { + CurrentCodeFileDocument.Font = fontDialog1.Font; + } + + private void toolStripButton12_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.BuildService.StartCompile(true); + } + + private void toolStripButton10_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.BuildService.StartCompile(false); + } + + private void miAboutToolStripMenuItem_Click(object sender, EventArgs e) + { + AboutBox1.ShowDialog(); + } + + private void CompileButton_EnabledChanged(object sender, EventArgs e) + { + //CompileMenuItem.Enabled = CompileButton.Enabled; + } + + private void StartButton_EnabledChanged(object sender, EventArgs e) + { + //StartMenuItem.Enabled = StartButton.Enabled; + } + + private void ReCompileButton_EnabledChanged(object sender, EventArgs e) + { + miRebuild.Enabled = ReCompileButton.Enabled; + } + + private void miCurt_Click(object sender, EventArgs e) + { + ExecCut(); + } + + private void miCopy_Click(object sender, EventArgs e) + { + ExecCopy(); + } + + private void miPaste_Click(object sender, EventArgs e) + { + ExecPaste(); + } + + private void miStop_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Stop(); + } + + private void miSave_Click(object sender, EventArgs e) + { + SaveSelFile(CurrentCodeFileDocument); + } + + private void miSaveAll_Click_1(object sender, EventArgs e) + { + SaveAll(false); + } + + private void miClose_Click(object sender, EventArgs e) + { + if (CurrentWebBrowserControl != null) + CurrentWebBrowserControl.Close(); + else + CurrentCodeFileDocument.Close(); + } + + private void miCloseNonActive_Click(object sender, EventArgs e) + { + CloseAllButThis(CurrentCodeFileDocument); + } + + private void miNew_Click(object sender, EventArgs e) + { + // SSM 26/04/22 - новый файл создается в папке текущего открытого файла + var CurrentFileNameDirectory = Path.GetDirectoryName(CurrentSourceFileName); + WorkbenchStorage.WorkingDirectory = CurrentFileNameDirectory; + Environment.CurrentDirectory = CurrentFileNameDirectory; + + WorkbenchServiceFactory.FileService.OpenFile(null, null); + } + + private void miSaveAs_Click(object sender, EventArgs e) + { + ExecuteSaveAs(CurrentCodeFileDocument); + } + + + + private void tsat_Click(object sender, EventArgs e) + { + SelectAppType((PascalABCCompiler.CompilerOptions.OutputType)((sender as ToolStripMenuItem).Tag)); + } + + public void SelectAppType(PascalABCCompiler.CompilerOptions.OutputType outputType) + { + Image img = null; + foreach (ToolStripMenuItem mi in tstaSelect.DropDownItems) + if (outputType == (PascalABCCompiler.CompilerOptions.OutputType)mi.Tag) + img = mi.Image; + tstaSelect.Image = img; + WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType = outputType; + } + + private void StartMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Run(true); + GC.Collect(); + if (VisualEnvironmentCompiler.Compiler != null && VisualEnvironmentCompiler.Compiler.ErrorsList.Count == 0) + { + var Percent = VisualEnvironmentCompiler.Compiler.PABCCodeHealth; + if (Percent > 0) + { + if (Percent >= 100) + { + HealthLabel.Text = ""; + return; + } + HealthLabel.Text = $"{Percent}%"; + + var c = SystemColors.Control; + var PM100 = 100 - Percent; + HealthLabel.BackColor = Color.FromArgb(c.R - PM100 - 20, c.G - PM100 - 20, c.B - PM100 - 20); + } + } + } + + private void Form1_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.F1) + { + ExecShowHelpF1(); + } + } + + private void Form1_SizeChanged(object sender, EventArgs e) + { + if (WindowState == FormWindowState.Normal) + { + FormWidth = Width; + FormHeight = Height; + } + } + + private void Form1_LocationChanged(object sender, EventArgs e) + { + if (WindowState == FormWindowState.Normal) + { + FormLeft = Left; + FormTop = Top; + } + } + + private void miFind_Click(object sender, EventArgs e) + { + ExecFind(); + } + + private void miReplace_Click(object sender, EventArgs e) + { + ExecReplace(); + } + + private void miFindNext_Click(object sender, EventArgs e) + { + ExecFindNext(); + } + + internal WebBrowserControl _currentWebBrowserControl = null; + + internal CodeFileDocumentControl _currentCodeFileDocument = null; + + public WebBrowserControl CurrentWebBrowserControl + { + get { return _currentWebBrowserControl; } + set + { + _currentWebBrowserControl = value; + if (value != null) + value.Activate(); + } + } + + public CodeFileDocumentControl CurrentCodeFileDocument + { + get { return _currentCodeFileDocument; } + set { + _currentCodeFileDocument = value; + value.Activate(); + } + } + + VisualPascalABCPlugins.ICodeFileDocument VisualPascalABCPlugins.IWorkbenchDocumentService.CurrentCodeFileDocument + { + get + { + return CurrentCodeFileDocument; + } + set + { + CurrentCodeFileDocument = value as CodeFileDocumentControl; + } + } + + public CodeFileDocumentControl ActiveCodeFileDocument + { + get { return activeTabPage; } + set + { + if (activeTabPage != value) + { + CodeFileDocumentControl tp = ActiveCodeFileDocument; + activeTabPage = value; + if (tp != null) + SetTabPageText(tp); + if (activeTabPage != null) + SetTabPageText(activeTabPage); + } + } + + } + + Form VisualPascalABCPlugins.IWorkbench.MainForm + { + get + { + return this; + } + } + + private void cmSetActive_Click(object sender, EventArgs e) + { + ActiveCodeFileDocument = CurrentCodeFileDocument; + } + + private void miOutputWindow_Click(object sender, EventArgs e) + { + SetVisibilityBottomPanel(!BPanel.Visible); + //BPanel.Visible = !BPanel.Visible; + //BottomDockPanel.Height = 0; + //BottomTabsVisible = !BottomTabsVisible; + /*OutputWindow.outputTextBox.BringToFront(); + var s = OutputWindow.outputTextBox.Height.ToString() + " " + OutputWindow.outputTextBox.Width.ToString() + "\n"; + s += OutputWindow.outputTextBox.Dock.ToString()+"\n"; + MessageBox.Show(s);*/ + } + + private void toolStripMenuItem8_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.ToggleBookmark(); + } + + private void mGOTONEXTBOOKMARKToolStripMenuItem_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.NextBookmark(); + } + + private void mGOTOPREVBOOKMARKToolStripMenuItem_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.PrevBookmark(); + } + + private void mCLEARBOOKMARKSToolStripMenuItem_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.ClearAllBookmarks(); + } + + private void miRunNoDebug_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Run(false); + } + + Dictionary lastInputTexts = new Dictionary(); + internal string lastInputText + { + get + { + if (lastInputTexts.ContainsKey(CurrentCodeFileDocument)) + return lastInputTexts[CurrentCodeFileDocument]; + else + return ""; + } + set + { + if (value == "") + if (lastInputTexts.ContainsKey(CurrentCodeFileDocument)) + { + lastInputTexts.Remove(CurrentCodeFileDocument); + return; + } + if (lastInputTexts.ContainsKey(CurrentCodeFileDocument)) + lastInputTexts[CurrentCodeFileDocument] = value; + else + lastInputTexts.Add(CurrentCodeFileDocument, value); + } + } + + private void cmFindAllReferences_Click(object sender, EventArgs e) + { + ExecFindReferences(); + } + + private void tsNavigBack_Click(object sender, EventArgs e) + { + ExecNavigateBackward(); + } + + private void tsNavigForw_Click(object sender, EventArgs e) + { + ExecNavigateForward(); + } + + // SSM 15.06.22 + public void SetVisibilityBottomPanel(bool value) + { + tsOutputWindow.Checked = value; + miOutputWindow.Checked = value; + BPanel.Visible = value; + } + public void HideBottomPanel() + { + SetVisibilityBottomPanel(false); + } + public void ShowBottomPanel() + { + SetVisibilityBottomPanel(true); + } + private void Form1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.Escape /*&& BottomTabsVisibleChekerEnabled*/) + { + tsOutputWindow.Checked = false; + BPanel.Visible = false; + //BottomTabsVisible = false; + e.Handled = true; + } + /*if (e.KeyData == Keys.Delete) + { + if (_designer_is_active && MainDockPanel.ActiveContent is CodeFileDocumentControl) + { + ExecDelete(); + } + }*/ + } + + private void mGENERATEREALIZATIONToolStripMenuItem_Click(object sender, EventArgs e) + { + (new ClassOrMethodRealizationAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void tsSelectAll_Click(object sender, EventArgs e) + { + ExecSelectAll(); + } + + private void tsGotoLine_Click(object sender, EventArgs e) + { + ExecGotoLine(); + } + + public SymbolsViwer FindSymbolResults + { + get + { + return FindSymbolsResultWindow.FindSymbolResults; + } + } + + public void ShowFindResults(List syms) + { + FindSymbolsResultWindow.ShowFindResults(syms); + } + + private void tsShowOutputWindow_Click(object sender, EventArgs e) + { + ShowContent(OutputWindow, true); + } + + private void tsShowErrorsListWindow_Click(object sender, EventArgs e) + { + ShowContent(ErrorsListWindow, true); + } + + private void tsShowCompilerConsoleWindow_Click(object sender, EventArgs e) + { + ShowContent(CompilerConsoleWindow, true); + } + + private void tsShowFindSymbolsResultWindow_Click(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(FindSymbolsResultWindow, true); + } + + private void tsShowDebugVariablesListWindow_Click(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(DebugVariablesListWindow, true); + } + + private void tsShowDebugWatchListWindow_Click(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(DebugWatchListWindow, true); + } + + private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) + { + if (!(MainDockPanel.ActiveContent is CodeFileDocumentControl)) + { + this.cmSave.Visible = false; + this.cmSetActive.Visible = false; + this.cmCloseAllButThis.Visible = false; + CloseButtonsEnabled = true; + } + else + { + this.cmSave.Visible = true; + this.cmSetActive.Visible = true; + this.cmCloseAllButThis.Visible = true; + CloseButtonsEnabled = OpenDocuments.Count > 1; + } + } + + private void mOPTIONSToolStripMenuItem_Click(object sender, EventArgs e) + { + optionsContentEngine.ShowDialog(); + } + + private void tsViewIntellisensePanel_CheckedChanged(object sender, EventArgs e) + { + if (tsViewIntellisensePanel.Checked != UserOptions.ShowQuickClassBrowserPanel) + { + UserOptions.ShowQuickClassBrowserPanel = tsViewIntellisensePanel.Checked; + UpdateUserOptions(); + } + } + + private void mEXAMPLESToolStripMenuItem_Click(object sender, EventArgs e) + { + Help.ShowHelp(null, HelpExamplesFileName); + } + + private void toolStripMenuItem1_Click_1(object sender, EventArgs e) + { + OpenFileDialog(HelpExamplesDirectory); + } + + private void toolStripMenuItem5_Click(object sender, EventArgs e) + { + OpenFileDialog(HelpTutorialExamplesDirectory); + } + + private void miAddExpr_Click(object sender, EventArgs e) + { + AddToWatchAction wact = new AddToWatchAction(); + wact.Execute(this.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea); + } + + public ContextMenuStrip BreakpointMenuStrip + { + get + { + return cmBreakpointCondition; + } + } + + private void mDELETEBREAKPOINTToolStripMenuItem_Click(object sender, EventArgs e) + { + this.CurrentCodeFileDocument.TextEditor.ContextMenuStrip = this.cmEditor; + BreakPointFactory.DeleteCurrentBreakpoint(); + } + + private void mBREAKPOINTCONDITIONToolStripMenuItem1_Click(object sender, EventArgs e) + { + this.CurrentCodeFileDocument.TextEditor.ContextMenuStrip = this.cmEditor; + BreakPointFactory.InvokeAddCondition(); + } + + private void miToolBox_Click(object sender, EventArgs e) + { + ToolBoxVisible = true; + } + + private void miProperties_Click(object sender, EventArgs e) + { + PropertiesWindowVisible = true; + } + + private void miUnitWithForm_Click(object sender, EventArgs e) + { + OpenFileWithForm(); + } + + private void mMAINFEATURESToolStripMenuItem_Click(object sender, EventArgs e) + { + if (!ThreadPool.QueueUserWorkItem(__showgettingstarted)) + __showgettingstarted(null); + } + + [System.ComponentModel.EditorBrowsableAttribute()] + protected override void WndProc(ref Message m) + { + if (m.Msg == 74)//WM_COPYDATA + { + try + { + COPYDATASTRUCT cds = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam,typeof(COPYDATASTRUCT)); + if (cds.dwData.ToInt32() == 32)//open file + { + string file_name = cds.lpData;//Marshal.PtrToStringUni(cds.lpData,(int)cds.cbData); + //MessageBox.Show(cds.cbData.ToString()); + if (init) + { + if (System.IO.Path.GetExtension(file_name) != ".pabcproj") + WorkbenchServiceFactory.FileService.OpenFile(file_name, null); + else + WorkbenchServiceFactory.ProjectService.OpenProject(file_name); + } + else + { + FileNameToWait = file_name; + } + } + } + catch + { + + } + } + base.WndProc(ref m); + } + + + + private void miNewProject_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.ProjectService.NewProject(); + } + + private void miOpenProject_Click(object sender, EventArgs e) + { + OpenProjectDialog(Constants.DefaultWorkingDirectory); + } + + List watches = new List(); + + private void miCloseProject_Click(object sender, EventArgs e) + { + //CloseProjectFiles(); + WorkbenchServiceFactory.ProjectService.CloseProject(); + } + + private void mADDFILEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.NewFile(ProjectExplorerWindow); + } + + private void mADDEXISTFILEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.AddFile(ProjectExplorerWindow); + } + + private void mADDFORMToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.NewForm(ProjectExplorerWindow, true);//roman// + } + + private void mADDREFERENCEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.AddReferencesToProject(ProjectExplorerWindow); + } + + private void mPROPERTIESToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.ProjectProperties(); + } + + void TsImmediateWindowClick(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(ImmediateWindow,true); + } + + private RunArguments RunArgumentsForm = new RunArguments(); + + private void mRUNPARAMETERSToolStripMenuItem1_Click(object sender, EventArgs e) + { + ExecRunParameters(); + } + + private void cmiCopy_Click(object sender, EventArgs e) + { + //ExecDesignerCopy(); + } + + private void cmiPaste_Click(object sender, EventArgs e) + { + //ExecDesignerPaste(); + } + + private void miDelete_Click(object sender, EventArgs e) + { + //ExecDelete(); + } + + private void cmiDelete_Click(object sender, EventArgs e) + { + //ExecDelete(); + } + + private void cmiCut_Click(object sender, EventArgs e) + { + //ExecDesignerCut(); + } + + private void miTabOrder_Click(object sender, EventArgs e) + { + //ExecTabOrder(); + } + + private void miShowGrid_Click(object sender, EventArgs e) + { + //ExecShowGrid(); + } + + private void miSnapToGrid_Click(object sender, EventArgs e) + { + //ExecSnapToGrid(); + } + + private void cmiAlignLefts_Click(object sender, EventArgs e) + { + // ExecAlignLefts(); + } + + private void cmiAlignRights_Click(object sender, EventArgs e) + { + //ExecAlignRights(); + } + + private void cmiAlignTops_Click(object sender, EventArgs e) + { + // ExecAlignTops(); + } + + private void cmiAlignBottoms_Click(object sender, EventArgs e) + { + //ExecAlignBottoms(); + } + + private void cmiAlignMiddles_Click(object sender, EventArgs e) + { + //ExecAlignMiddles(); + } + + private void cmiAlignCenters_Click(object sender, EventArgs e) + { + //ExecAlignCenters(); + } + + private void cmiAlignToGrid_Click(object sender, EventArgs e) + { + //ExecAlignToGrid(); + } + + private void cmiCenterHorizontally_Click(object sender, EventArgs e) + { + //ExecCenterHorizontally(); + } + + private void cmiCenterVertically_Click(object sender, EventArgs e) + { + // ExecCenterVertically(); + } + + private void cmiSizeToControl_Click(object sender, EventArgs e) + { + //ExecSizeToControl(); + } + + private void cmiSizeToControlWidth_Click(object sender, EventArgs e) + { + //ExecSizeToControlWidth(); + } + + private void cmiSizeToControlHeight_Click(object sender, EventArgs e) + { + //ExecSizeToControlHeight(); + } + + private void cmiSizeToGrid_Click(object sender, EventArgs e) + { + //ExecSizeToGrid(); + } + + private void cmiBringToFront_Click(object sender, EventArgs e) + { + //ExecBringToFront(); + } + + private void cmiSendToBack_Click(object sender, EventArgs e) + { + //ExecSendToBack(); + } + + private void cmiTabOrder_Click(object sender, EventArgs e) + { + cmiTabOrder.Checked = !cmiTabOrder.Checked; + //ExecTabOrder(); + } + + private void mFORMATToolStripMenuItem_Click(object sender, EventArgs e) + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void cmFormat_Click(object sender, EventArgs e) + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void tsFormat_Click(object sender, EventArgs e) + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + + //ZM + private void mNEWASPToolStripMenuItem_Click(object sender, EventArgs e) + { + string text = "{$asp newaspect}\n {$aspdata newaspect author 1.0}\n{$endasp newaspect}"; + ICSharpCode.TextEditor.TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + ta.InsertString(text); + + } + + public void MakeTemplate() + { + string text = "{$asp declarations}\n {$aspdata declarations author 1.0}\n{$endasp declarations}\n \n{$asp classes}\n{$endasp classes}\n \n{$asp main}\nbegin\nend.\n{$endasp main}\n"; + ICSharpCode.TextEditor.TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + ta.InsertString(text); + } + + public void SaveAspPlugin(CodeFileDocumentControl dc) + { + SaveSelFile(dc); + } + + public void CloseAspPlugin(CodeFileDocumentControl dc) + { + //CloseFile(dc); + } + + private void mDOTNETHELPToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenMSDN(); + } + + void ExecViewCode() + { + //ExecuteDesignerCommand(StandardCommands.ViewCode);//roman// + } + private void cmViewCode_Click(object sender, EventArgs e) + { + ExecViewCode(); + } + + void ExecShowProperties() + { + //ExecuteDesignerCommand(StandardCommands.PropertiesWindow);//roman// + } + private void cmiProperties_Click(object sender, EventArgs e) + { + ExecShowProperties(); + } + + private void miPrint_Click(object sender, EventArgs e) + { + ExecPrint(); + } + + private void tsFindAllReferences_Click(object sender, EventArgs e) + { + ExecFindReferences(); + } + //end ZM + + void ExecRunParameters() + { + RunArgumentsForm.CommandLineArguments = WorkbenchServiceFactory.RunService.GetRunArgument(this.CurrentCodeFileDocument.FileName.ToLower()); + if (RunArgumentsForm.ShowDialog() == DialogResult.OK) + { + WorkbenchServiceFactory.RunService.AddRunArgument(this.CurrentCodeFileDocument.FileName.ToLower(), RunArgumentsForm.CommandLineArguments); + } + } + + private void miProjectExplorer_Click(object sender, EventArgs e) + { + ProjectExplorerWindowVisible = true; + } + + private void cmSamples_Click(object sender, EventArgs e) + { + + } + + private void cmHelp_Click(object sender, EventArgs e) + { + __showhelpinqueue(); + } + + /*private void __checkforupdate(object state) + { + WorkbenchServiceFactory.UpdateService.CheckForUpdates(); + }*/ + + private void miCheckUpdates_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.UpdateService.CheckForUpdates(); + //if (!ThreadPool.QueueUserWorkItem(__checkforupdate)) + // __checkforupdate(null); + } + + private void cmCollapseRegions_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.EditorService.CollapseRegions(); + } + + private void tsDisassembly_Click(object sender, EventArgs e) + { + DisassemblyWindowVisible = true; + } + + private void tsAutoInsertCode_Click(object sender, EventArgs e) + { + tsAutoInsertCode.Checked = !tsAutoInsertCode.Checked; + mAUTOINSERTToolStripMenuItem.Checked = !mAUTOINSERTToolStripMenuItem.Checked; + } + + private void mAUTOINSERTToolStripMenuItem_Click(object sender, EventArgs e) + { + tsAutoInsertCode.Checked = !tsAutoInsertCode.Checked; + mAUTOINSERTToolStripMenuItem.Checked = !mAUTOINSERTToolStripMenuItem.Checked; + } + + private void mUNITTESTSToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ClearErrorList(); + var OutputFileName = WorkbenchServiceFactory.BuildService.Compile(CurrentSourceFileName, false, "__RunMode", true, true); + if (OutputFileName != null) + { + var process = new System.Diagnostics.Process(); + process.StartInfo.FileName = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "RunUnitTests.exe"); + process.StartInfo.Arguments = "\""+OutputFileName+"\""; + process.Start(); + } + /*WorkbenchServiceFactory.RunService.Run(@"D:\PABC_Git\bin\RunUnitTests.exe", + WorkbenchServiceFactory.Workbench.UserOptions.RedirectConsoleIO, "", false, + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileDirectory, + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName, false, false);*/ + } + catch (System.Exception ee) + { + ee = ee; + // SSM 22/04/19 - исправляю вылет оболочки при отсутствии exe файла + // this.RunnerManager_Exited(OutputFileName); // - это всё равно не срабатывает. Кнопки оказываются в заблокированном состоянии + //var OutputFileName = @"D:\PABC_Git\bin\RunUnitTests.exe"; + //WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(OutputFileName, "Произошла непредвиденная ошибка" + ee.StackTrace); + //throw; + } + } + + public ABCHealth ABCHealthForm = null; + + private Label AddString(double x, double y, string s, bool link = false, bool goodfeatures = false) + { + Label l; + if (link) + l = new LinkLabel(); + else l = new Label(); + l.Text = s; + l.Left = (int)Math.Round(x); + l.Top = (int)Math.Round(y); + //if (link) + if (!goodfeatures) + l.ForeColor = System.Drawing.Color.Red; + else l.ForeColor = System.Drawing.Color.Green; + l.AutoSize = true; + ABCHealthForm.Controls.Add(l); + return l; + } + + private string Raz(int n) + { + if ((n % 10 == 2 || n % 10 == 3 || n % 10 == 4) && (n / 10 % 10 != 1)) + return n + " раза"; + else return n + " раз"; + } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + if (ABCHealthForm == null) + { + ABCHealthForm = new ABCHealth(); + ABCHealthForm.FormBorderStyle = FormBorderStyle.Fixed3D; + } + try + { + var gr = Graphics.FromHwnd(Handle); + var scale = gr.DpiX / 96; + + var aw = ABCHealthForm.Width; + var ah = ABCHealthForm.Height; + var c = new PascalABCCompiler.Compiler(); + c.Reload(); + var errors = new List(); + var warnings = new List(); + + var text = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.TextContent; + + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ClearErrorList(); + var res = c.ParseText(CurrentSourceFileName, text, errors, warnings); + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ShowErrorsSync(c.ErrorsList, c.ErrorsList.Count != 0); + if (res != null) + { + var y = 30/2*scale; + var stat = new SyntaxVisitors.ABCStatisticsVisitor(); + stat.ProcessNode(res); + //stat. + var h = 40 / 2 * scale; + var x = 50 / 2 * scale; + ABCHealthForm.Controls.Clear(); + + var pp = new Panel(); + + ToolTip ToolTip1 = new ToolTip(); + ToolTip1.SetToolTip(pp, "Здоровье PascalABC.NET программы"); + + pp.Width = (int)Math.Round(220 / 2 * scale); + pp.Height = (int)Math.Round(100 / 2 * scale); + pp.Left = ABCHealthForm.ClientSize.Width - pp.Width - (int)Math.Round(24 / 2 * scale); + pp.Top = (int)Math.Round(24 / 2 * scale); + pp.BackColor = Color.Gray; + + ABCHealthForm.Controls.Add(pp); + + + var l0 = AddString(x, y, "О здоровье кода",true) as LinkLabel; + l0.LinkClicked += (o, e1) => + { + System.Diagnostics.Process.Start("https://pascalabcnet.github.io/program_health.html"); + }; + y += 48 / 2 * scale; + + var l1 = AddString(x, y, "В программе найдены следующие конструкции базового Паскаля,"); + y += 36 / 2 * scale; + var l2 = AddString(x, y, "считающиеся устаревшими в PascalABC.NET:"); + l1.ForeColor = Color.Black; + l2.ForeColor = Color.Black; + y += h; + y += 8 / 2 * scale; + x += 24 / 2 * scale; + + // Проценты в минус + // 1. Количество var вне - количество var внутри. За первую - -10%, за остальные - -2% пока не достигнет 25% + // 2. Количество for i - за первую - -15%, за каждую следующую - -3% пока не достигнет 25% + // 3. Read(i,j) - за первую -15%, за последующие - -2% пока не достигнет -20% + // 4. program - -10% + // 5. Статические массивы - -10%, за каждый последующий - -2% пока не достигнет -15% + // 6. Write(a,' ',b) - за каждую - -1% пока не достгнет -5% + // 7. string[10] - за каждую - -1% . Если минусуется > 100%, то здоровье делать 0% + + + var ShowNegativeInfo = false; + if (stat.OutBlockVarDefs > 0 && stat.OutBlockVarDefs > stat.InBlockVarDefs) + { + AddString(x, y, "Переменные описаны вне блоков begin-end: " + Raz(stat.OutBlockVarDefs), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.ForsWithoutVar != 0) + { + AddString(x, y, "Переменная цикла for не описана в заголовке цикла: " + Raz(stat.ForsWithoutVar), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.ReadProc > 0) + { + AddString(x, y, "Для ввода использована процедура Read: " + Raz(stat.ReadProc), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.ProgramKeyword) + { + AddString(x, y, "Использовано ключевое слово program", false); + y += h; + ShowNegativeInfo = true; + } + if (stat.WriteProcWithSpace > 0) + { + AddString(x, y, "Использована процедура Write с пробелом в качестве разделителя: " + Raz(stat.WriteProcWithSpace), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.StaticArrays > 0) + { + AddString(x, y, "Используются статические массивы вместо динамических: " + Raz(stat.StaticArrays), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.OldStrings > 0) + { + AddString(x, y, "Используются устаревшие строки вида string[10]: " + Raz(stat.OldStrings), false); + y += h; + ShowNegativeInfo = true; + } + + ///---------------------------------------------------- + y += 12 / 2 * scale; + x -= 24 / 2 * scale; + var l3 = AddString(x, y, "В программе используются следующие рекомендованные конструкции"); + y += 36 / 2 * scale; + var l4 = AddString(x, y, "PascalABC.NET:"); + l3.ForeColor = Color.Black; + l4.ForeColor = Color.Black; + x += 24 / 2 * scale; + y += h; + y += 8 / 2 * scale; + if (stat.InBlockVarDefs > 0) + { + AddString(x, y, "Используются внутриблочные описания переменных: " + Raz(stat.InBlockVarDefs), false, true); + y += h; + } + if (stat.ForsWithVar != 0) + { + AddString(x, y, "Переменная цикла for описана в заголовке цикла: " + Raz(stat.ForsWithVar), false, true); + y += h; + } + if (stat.InitVarInDef > 0) + { + AddString(x, y, "Используется инициализация при описании: " + Raz(stat.InitVarInDef), false, true); + y += h; + } + if (stat.ReadFuncCount > 0) + { + AddString(x, y, "Для ввода используется функция вида ReadInteger, ReadReal: " + Raz(stat.ReadFuncCount), false, true); + y += h; + } + if (stat.ExtAssignCount > 0) + { + AddString(x, y, "Используется расширенное присваивание: " + Raz(stat.ExtAssignCount), false, true); + y += h; + } + if (stat.PrintCount > 0) + { + AddString(x, y, "Для вывода использована Print: " + Raz(stat.PrintCount), false, true); + y += h; + } + if (stat.TuplesCount > 0) + { + AddString(x, y, "Используются кортежи: " + Raz(stat.TuplesCount), false, true); + y += h; + } + if (stat.DynamicArrays > 0) + { + AddString(x, y, "Используются динамические массивы: " + Raz(stat.DynamicArrays), false, true); + y += h; + } + if (stat.UnpackingAssign > 0) + { + AddString(x, y, "Используется распаковка значения в переменные: " + Raz(stat.UnpackingAssign), false, true); + y += h; + } + if (stat.LoopsCount > 0) + { + AddString(x, y, "Используется цикл loop: " + Raz(stat.LoopsCount), false, true); + y += h; + } + if (stat.ForeachCount > 0) + { + AddString(x, y, "Используется цикл foreach: " + Raz(stat.ForeachCount), false, true); + y += h; + } + if (stat.LambdasCount > 0) + { + AddString(x, y, "Используются лямбда-выражения: " + Raz(stat.LambdasCount), false, true); + y += h; + } + + var Percent = stat.CalcHealth(out int NegativePercent, out int PositivePercent); + // Процент здоровья + // VarDefs + + if (!ShowNegativeInfo) + { + l1.Text = "В программе отсутствуют устаревшие в PascalABC.NET конструкции"; + l2.Text = ""; + } + if (PositivePercent == 0) + { + l3.Text = "В программе отсутствуют рекомендованные в PascalABC.NET конструкции"; + l4.Text = ""; + } + + // Цвет панели + if (Percent < 25) + pp.BackColor = Color.FromArgb(255, 0, 0); + else if (Percent < 50) + pp.BackColor = Color.FromArgb(255, 64, 64); + else if (Percent < 75) + pp.BackColor = Color.FromArgb(128, 128, 128); + else if (Percent < 100) + pp.BackColor = Color.FromArgb(64 + 16 + 16, 128, 64 + 16 + 16); + else pp.BackColor = Color.FromArgb(0, 128, 0); + + pp.Paint += (o, ea) => + { + Font drawFont = new Font("Arial", 20); + SolidBrush drawBrush = new SolidBrush(Color.White); + StringFormat format = new StringFormat(StringFormatFlags.NoClip); + format.LineAlignment = StringAlignment.Center; + format.Alignment = StringAlignment.Center; + ea.Graphics.DrawString(Percent + "%", drawFont, drawBrush, new RectangleF(0, 0, pp.Width, pp.Height),format); + }; + + Button b = new Button(); + b.Text = "OK"; + b.Width = (int)Math.Round(156 / 2 * scale); + b.Height = (int)Math.Round(48 / 2 * scale); + y += h; + b.Top = (int)Math.Round(y); + b.Left = (int)Math.Round((double)(ABCHealthForm.Width - b.Width) / 2); + b.Click += (o, ee) => { ABCHealthForm.Close(); }; + ABCHealthForm.Controls.Add(b); + y += b.Height + h; + var hh = ABCHealthForm.Height - ABCHealthForm.ClientSize.Height; + ABCHealthForm.Height = (int)Math.Round(y+hh); + + ABCHealthForm.StartPosition = FormStartPosition.Manual; + ABCHealthForm.Left = this.Left + Width - aw; + ABCHealthForm.Top = this.Top; + b.PreviewKeyDown += (o, eee) => + { + if (eee.KeyCode == Keys.Escape) + ABCHealthForm.Close(); + }; + ABCHealthForm.ShowDialog(); + } + } + catch (System.Exception ee) + { + } + } + + private void HealthLabelClear() + { + HealthLabel.Text = ""; + HealthLabel.BackColor = System.Drawing.SystemColors.Control; + } + + private void HealthLabel_Click(object sender, EventArgs e) + { + toolStripButton1_Click(this, null); + //System.Diagnostics.Process.Start("https://pascalabcnet.github.io/program_health.html"); + } + + private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + + } + + private void tsHelp_Click(object sender, EventArgs e) + { + __showhelpinqueue(); + } + + private void cmEditor_Opening(object sender, CancelEventArgs e) + { + ICSharpCode.TextEditor.TextLocation cp = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret.Position; + ICSharpCode.TextEditor.Document.TextWord tw = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.GetLineSegment(cp.Line).GetWord(cp.Column); + this.cmSamples.DropDownItems.Clear(); + try + { + if (tw != null) + { + var header = sampleManager.GetSampleHeader(tw.Word); + if (header != null) + { + var samples = sampleManager.GetSamples(header); + foreach (string pattern in samples) + { + var files = Directory.GetFiles(HelpExamplesDirectory, pattern); + foreach (string file in files) + { + if (File.Exists(file)) + { + var sample_mi = new ToolStripMenuItem(); + sample_mi.Text = file.Replace(HelpExamplesDirectory + Path.DirectorySeparatorChar, ""); + sample_mi.Click += delegate(object _sender, EventArgs _e) + { + VisualPascalABC.VisualPascalABCProgram.MainForm.Activate(); + ExecuteVisualEnvironmentCompilerAction(VisualEnvironmentCompilerAction.OpenFile, file); + }; + this.cmSamples.DropDownItems.Add(sample_mi); + } + } + } + } + } + } + catch + { + + } + this.cmSamples.Enabled = this.cmSamples.DropDownItems.Count > 0; + } + + IWorkbenchServiceContainer VisualPascalABCPlugins.IWorkbench.ServiceContainer + { + get { return serviceContainer; } + } + + } + +} diff --git a/VisualPascalABCNETLinux/Form1.cs1 b/VisualPascalABCNETLinux/Form1.cs1 new file mode 100644 index 000000000..a5e0d0763 --- /dev/null +++ b/VisualPascalABCNETLinux/Form1.cs1 @@ -0,0 +1,1969 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using System.Threading; +using System.Runtime.InteropServices; +using WeifenLuo.WinFormsUI.Docking; +using VisualPascalABC.OptionsContent; +using System.Security.Permissions; +using System.ComponentModel.Design; + +//using ICSharpCode.FormsDesigner; +//using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; + +namespace VisualPascalABC +{ + delegate void SetTextDelegate(string Text); + delegate void SetFileNameAndTextDelegate(string ExeFileName, string Text); + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + + public partial class Form1 : Form, VisualPascalABCPlugins.IWorkbench, VisualPascalABCPlugins.IWorkbenchDocumentService + { + static string VersionInTitle(string s) + { + // VersionInTitle(RevisionClass.FullVersion) + var i = s.LastIndexOf('.'); + return s.Substring(0, i); + } + + private const string MainFormTitle = "PascalABC.NET"; + private static bool DesignerUseable = true; + private static bool ProjectsUseable = true; +#if (DEBUG) + private static bool UseImmediate = true; +#else + private static bool UseImmediate = false; +#endif + +#if (DEBUG) + private const bool DebugModus = true; +#else + private const bool DebugModus = false; +#endif + private string MainFormText = MainFormTitle; + private string FTSFormat = "{0} [{1}]"; + + internal BottomDockContentForm BottomActiveContent = null; + + + private ICSharpCode.TextEditor.Document.FileSyntaxModeProvider FileSyntaxProvider; + + public PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager = new PascalABCCompiler.Errors.ErrorsStrategyManager(PascalABCCompiler.Errors.ErrorsStrategy.FirstSemanticAndSyntax); + + internal bool DebuggerVisible = true; + + private int FormLeft, FormTop, FormWidth, FormHeight; + + //public ToolBoxForm ToolBoxWindow = null; + //public PropertiesForm PropertiesWindow = null; + internal OutputWindowForm OutputWindow; + internal ErrorsListWindowForm ErrorsListWindow; + internal FindSymbolsResultWindowForm FindSymbolsResultWindow; + internal ImmediateWindow ImmediateWindow; + internal CompilerConsoleWindowForm CompilerConsoleWindow; + internal DebugVariablesListWindowForm DebugVariablesListWindow; + internal DebugWatchListWindowForm DebugWatchListWindow; + internal DisassemblyWindow DisassemblyWindow; + internal ProjectExplorerForm ProjectExplorerWindow = null; + public WeifenLuo.WinFormsUI.Docking.DockPane BottomPane; + public WeifenLuo.WinFormsUI.Docking.DockPane ProjectPane; + FSWatcherService WatcherService = new FSWatcherService(); + + private bool LoadComplete = false; + internal SourceLocationAction ErrorCursorPosStrategy = SourceLocationAction.GotoBeg; + + private CodeFileDocumentControl activeTabPage = null; + + PascalABCCompiler.Errors.ErrorsStrategyManager VisualPascalABCPlugins.IWorkbench.ErrorsManager + { + get + { + return ErrorsManager; + } + } + + VisualPascalABCPlugins.IOutputWindow VisualPascalABCPlugins.IWorkbench.OutputWindow + { + get + { + return OutputWindow; + } + } + + VisualPascalABCPlugins.IDisassemblyWindow VisualPascalABCPlugins.IWorkbench.DisassemblyWindow + { + get + { + return DisassemblyWindow; + } + } + + VisualPascalABCPlugins.ICompilerConsoleWindow VisualPascalABCPlugins.IWorkbench.CompilerConsoleWindow + { + get + { + return CompilerConsoleWindow; + } + } + + VisualPascalABCPlugins.IErrorListWindow VisualPascalABCPlugins.IWorkbench.ErrorsListWindow + { + get + { + return ErrorsListWindow; + } + } + + ICodeFileDocument VisualPascalABCPlugins.IWorkbenchDocumentService.ActiveCodeFileDocument + { + get + { + return ActiveCodeFileDocument; + } + set + { + ActiveCodeFileDocument = value as CodeFileDocumentControl; + } + } + + ICodeFileDocument VisualPascalABCPlugins.IWorkbenchDocumentService.LastSelectedTab + { + get + { + return LastSelectedTab; + } + + } + + void VisualPascalABCPlugins.IWorkbench.BeginInvoke(Delegate del, params object[] args) + { + this.BeginInvoke(del, args); + } + + internal System.Drawing.Image BuildImage + { + get + { + return miBuild.Image; + } + } + + internal System.Drawing.Image RebuildImage + { + get + { + return miRebuild.Image; + } + } + + internal System.Drawing.Image RunImage + { + get + { + return miRun.Image; + } + } + + internal System.Drawing.Image NewFileImage + { + get + { + return miNew.Image; + } + } + + internal System.Drawing.Image OpenFileImage + { + get + { + return miOpen.Image; + } + } + + internal System.Drawing.Image NewFormImage + { + get + { + return mADDFORMToolStripMenuItem.Image; + } + } + + public VisualEnvironmentCompiler VisualEnvironmentCompiler = null; + + public CompilerForm CompilerForm1; + + + public AboutBox AboutBox1; + public FindReplaceForm FindForm; + public GotoLineForm GotoLineForm; + public FindReplaceForm ReplaceForm; + + internal NavigationManager NavigationManager; + public bool SaveCanceled = false; + private WorkbenchServiceContainer serviceContainer; + + //private System.Windows.Forms.DataGridViewImageColumn PictColumn; + + OptionsContentEngine optionsContentEngine; + + public Form1() + { + if (Tools.IsUnix()) + { + ProjectsUseable = false; + DesignerUseable = false; + //DebuggerVisible = false; + } + + PascalABCCompiler.StringResourcesLanguage.LoadDefaultConfig(); + + //if (PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages.Count > 0) + // PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages[0]; + + InitializeComponent(); + //toolStrip1.Visible = false; + //menuStrip1.Visible = false; + tsAutoInsertCode.Visible = false; + MainDockPanel.Theme = new WeifenLuo.WinFormsUI.Docking.VS2005Theme(); + + + VisualPABCSingleton.MainForm = this; + WorkbenchStorage.MainProgramThread = System.Threading.Thread.CurrentThread; + //images init + this.miNewProject.Image = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.NewProjectIcon.png")); + this.mADDFILEToolStripMenuItem.Image = miNew.Image; + this.mADDEXISTFILEToolStripMenuItem.Image = miOpen.Image; + this.mADDFORMToolStripMenuItem.Image = new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Form.png")); + + //toolStripPanel.Size = new Size(toolStripPanel.Size.Width, toolStrip1.Height); + toolStripPanel.AutoSize = true; + /*var gr = Graphics.FromHwnd(Handle); + if (gr.DpiX >= 96*2) + { + this.SuspendLayout(); + this.toolStripPanel.SuspendLayout(); + + toolStrip1.ImageScalingSize = new Size(32, 32); + //menuStrip1.ImageScalingSize = new Size(32, 32); + toolStripPanel.Size = new Size(toolStripPanel.Size.Width, 38); + this.toolStripPanel.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + }*/ + serviceContainer = new WorkbenchServiceContainer(); + + if (DebuggerVisible) + { + InitForm(); + this.StepOutButton.Visible = false; + PlayPauseButtonsVisibleInPanel = PlayPauseButtonsVisibleInPanel; + SetDebugButtonsEnabled(false); + } + + AddOwnedForm(CompilerForm1 = new CompilerForm()); + AddOwnedForm(AboutBox1 = new AboutBox()); + AddOwnedForm(FindForm = new FindReplaceForm(FindReplaceForm.FormType.Find)); + AddOwnedForm(ReplaceForm = new FindReplaceForm(FindReplaceForm.FormType.Replace)); + AddOwnedForm(GotoLineForm = new GotoLineForm()); + + LastOpenFiles = new List(); + LastOpenProjects = new List(); + + WorkbenchServiceFactory.BuildService.CompilerOptions.Debug = true; + WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + + LocalizeControls(); + + tsatConsoleApplication.Tag = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + tsatWindowsApplication.Tag = PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication; + tsatDll.Tag = PascalABCCompiler.CompilerOptions.OutputType.ClassLibrary; + + SelectAppType(WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType); + + //this.Width = 800; + //this.Height = 600; + UserOptions = new UserOptions(); + SetFiltersAndHighlighting(); + + FormLeft = this.Left; FormTop = this.Top; FormWidth = this.Width; FormHeight = this.Height; + MainDockPanel.DockRightPortion = 0.22; + MainDockPanel.DockLeftPortion = 0.22; + + //UserOptions.OutputDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)+"\\Output"; + UserOptions.OutputDirectory = Constants.DefaultOutputDirectory; + + PlayPauseButtonsVisibleInPanel = false; + + WorkbenchStorage.StandartDirectories = new Hashtable(StringComparer.InvariantCultureIgnoreCase); + WorkbenchStorage.StandartDirectories.Add(Constants.SystemDirectoryIdent, System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)); + + RestoreDesktop(); + + // SSM 06.06.22 - это только для Линукса!!! + MainDockPanel.AllowEndUserDocking = false; + this.BottomPane.Activate(); + this.BottomPane.BringToFront(); + //MessageBox.Show(this.BottomPane.Contents[0].ToString()); + //MessageBox.Show(this.BottomPane.ClientRectangle.ToString()); + + LoadOptions(); + + HelpExamplesDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesDirectory, WorkbenchStorage.StandartDirectories); + HelpTutorialExamplesDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpTutorialExamplesDirectory, WorkbenchStorage.StandartDirectories); + + UpdateUserOptions(); + ErrorsListWindow.Resized(); + FindSymbolsResultWindow.Resized(); + + UpdateOutputWindowVisibleButtons(); + + if (WorkbenchStorage.WorkingDirectory == null || true) + { + WorkbenchStorage.WorkingDirectoryInOptionsFile = Constants.DefaultWorkingDirectory; + WorkbenchStorage.WorkingDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultWorkingDirectory, WorkbenchStorage.StandartDirectories); + } + if (Path.GetDirectoryName(Application.ExecutablePath).ToLower() != Environment.CurrentDirectory.ToLower()) + WorkbenchStorage.WorkingDirectory = Environment.CurrentDirectory; + WorkbenchStorage.StandartDirectories.Add(Constants.WorkingDirectoryIdent, WorkbenchStorage.WorkingDirectory); + openFileDialog1.InitialDirectory = WorkbenchStorage.WorkingDirectory; + + if (WorkbenchStorage.LibSourceDirectory == null) + WorkbenchStorage.LibSourceDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultLibSourceDirectory, WorkbenchStorage.StandartDirectories); + WorkbenchStorage.StandartDirectories.Add(Constants.LibSourceDirectoryIdent, WorkbenchStorage.LibSourceDirectory); + AddSearchDebugPath(WorkbenchStorage.LibSourceDirectory); + + if (UserOptions.UseOutputDirectory) + WorkbenchStorage.StandartDirectories.Add(Constants.OutputDirectoryIdent, UserOptions.OutputDirectory); + else + WorkbenchStorage.StandartDirectories.Add(Constants.OutputDirectoryIdent, null); + + RunManager RunnerManager = (WorkbenchServiceFactory.RunService as WorkbenchRunService).RunnerManager; + VisualEnvironmentCompiler = new VisualEnvironmentCompiler( + this.BeginInvoke, SetCompilingButtonsEnabled, SetDedugButtonsEnabled, SetStateText, + AddTextToCompilerMessagesSync, miPlugins, toolStrip1, + ExecuteSourceLocationAction, ExecuteVisualEnvironmentCompilerAction, ErrorsManager, RunnerManager, + WorkbenchServiceFactory.DebuggerManager, UserOptions, WorkbenchStorage.StandartDirectories, OpenDocuments, this); + if (OnEnvorimentEvent != null) + OnEnvorimentEvent(EnvorimentEvent.VisualEnvironmentCompilerCreated); + + NavigationManager = new NavigationManager(ExecuteSourceLocationAction); + NavigationManager.StateChanged += new NavigationManager.NavigationManagerStateChanged(NavigationManager_StateChanged); + + string newFileName = InstNameNewProgramm(MainDockPanel); + AddNewProgramToTab(MainDockPanel, newFileName); + + AddOptionsContent(); + Application.AddMessageFilter(this); + + if (DesignerUseable) + { + //miProperties.Visible = true; + //miToolBox.Visible = true; + //miNewAdv.Visible = true; + miUndo.Visible = true; + } + this.mRPROJECTToolStripMenuItem.Visible = false; + if (ProjectsUseable) + { + miNewProject.Visible = true; + miRecentProjects.Visible = true; + //miCloseProject.Visible = true; + miOpenProject.Visible = true; + } + if (!UseImmediate) + { + tsImmediateWindow.Visible = false; + } + this.mNEWASPToolStripMenuItem.Visible = DebugModus; + //if (!Tools.IsUnix()) + // AddDesignerSidebars(); + WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(newFileName); + } + + private void Form1_Load(object sender, EventArgs e) + { + // Автовставка кода по умолчанию включена. Отключил это - теперь сохраняется в настройках! + //tsAutoInsertCode.Checked = true; + //mAUTOINSERTToolStripMenuItem.Checked = true; + + //CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += TextArea_KeyEventHandler; + + init = true; + foreach (string FileName in VisualPascalABCProgram.CommandLineArgs) + { + if (Path.GetExtension(FileName) == ".pabcproj") + WorkbenchServiceFactory.ProjectService.OpenProject(FileName); + else + WorkbenchServiceFactory.FileService.OpenFile(FileName, null); + } + if (FileNameToWait != null) + { + if (Path.GetExtension(FileNameToWait) == ".pabcproj") + WorkbenchServiceFactory.ProjectService.OpenProject(FileNameToWait); + else + WorkbenchServiceFactory.FileService.OpenFile(FileNameToWait, null); + } + SetStopEnabled(false); + CompilingButtonsEnabled = CloseButtonsEnabled = SaveAllButtonsEnabled = SaveButtonsEnabled = false; + SetDedugButtonsEnabled(false); + SetCompilingButtonsEnabled(false); + + HelpFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpFileName, WorkbenchStorage.StandartDirectories); + DotNetHelpFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DotNetHelpFileName, WorkbenchStorage.StandartDirectories); + if (!File.Exists(HelpFileName)) + tsHelp.Visible = false; + + HelpExamplesFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesFileName, WorkbenchStorage.StandartDirectories); + HelpExamplesMapFileName = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.HelpExamplesMapFileName, WorkbenchStorage.StandartDirectories); + + InitHelpProgramsDictionary(); // SSM + + NavigBackButtonsEnabled = NavigForwButtonsEnabled = false; + + try + { + if (!Directory.Exists(WorkbenchStorage.WorkingDirectory)) + Directory.CreateDirectory(WorkbenchStorage.WorkingDirectory); + } + catch (Exception exc) + { + AddTextToCompilerMessages(Form1StringResources.Get("MSGTYPE") + String.Format(Form1StringResources.Get("ERROR_CREATING_WORKDIR_{0}_{1}"), WorkbenchStorage.WorkingDirectory, exc.Message) + Environment.NewLine); + } + try + { + if (!Directory.Exists(UserOptions.OutputDirectory)) + Directory.CreateDirectory(UserOptions.OutputDirectory); + } + catch (Exception exc) + { + AddTextToCompilerMessages(Form1StringResources.Get("MSGTYPE") + String.Format(Form1StringResources.Get("ERROR_CREATING_WORKDIR_{0}_{1}"), UserOptions.OutputDirectory, exc.Message) + Environment.NewLine); + } + CodeCompletionActionsManager.templateManager = new CodeTemplateManager(); + } + + private void LocalizeControls() + { + Form1StringResources.SetTextForAllControls(this); + Form1StringResources.SetTextForAllControls(this.contextMenuStrip1); + Form1StringResources.SetTextForAllControls(this.cm_Designer); + Form1StringResources.SetTextForAllControls(this.cmEditor); + Form1StringResources.SetTextForAllControls(this.cmBreakpointCondition); + Form1StringResources.SetTextForAllControls(this.RunArgumentsForm); + PascalABCCompiler.StringResources.SetTextForAllObjects(AboutBox1, "VP_ABOUTBOXFORM_"); + PascalABCCompiler.StringResources.SetTextForAllObjects(FindForm, "VP_FINDFORM_"); + PascalABCCompiler.StringResources.SetTextForAllObjects(ReplaceForm, "VP_REPLACEFORM_"); + PascalABCCompiler.StringResources.SetTextForAllObjects(GotoLineForm, "VP_GOTOLINEFORM_"); + } + + private void SetFiltersAndHighlighting() + { + string hdir = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName), "Highlighting"); + if (Directory.Exists(hdir)) + { + FileSyntaxProvider = new ICSharpCode.TextEditor.Document.FileSyntaxModeProvider(hdir+Path.DirectorySeparatorChar); + ICSharpCode.TextEditor.Document.HighlightingManager.Manager.AddSyntaxModeFileProvider(FileSyntaxProvider); + string Filter = "", AllFilter = ""; + foreach (ICSharpCode.TextEditor.Document.SyntaxMode sm in FileSyntaxProvider.SyntaxModes) + { + Filter = Tools.MakeFilter(Filter, sm.Name, sm.Extensions); + AllFilter = Tools.MakeAllFilter(AllFilter, sm.Name, sm.Extensions); + } + saveFileDialog1.Filter = openFileDialog1.Filter = Tools.FinishMakeFilter(Filter, AllFilter); + } + } + + private void Form1_FormClosed(object sender, FormClosedEventArgs e) + { + WorkbenchServiceFactory.CodeCompletionParserController.StopParseThread(); + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + string text = Text; + //если запущены программы + if (WorkbenchServiceFactory.RunService.IsRun()) + { + //завершаем все программы + this.Text = string.Format(FTSFormat, MainFormText, Form1StringResources.Get("FTS_KILLPROCESS")); + WorkbenchServiceFactory.RunService.KillAll(); + this.Text = text; + } + + WorkbenchServiceFactory.CodeCompletionParserController.StopParsing(); + + //Сохраняем Файлы + if (ProjectFactory.Instance.ProjectLoaded) + { + if (!WorkbenchServiceFactory.ProjectService.CloseProject()) + { + e.Cancel = true; + return; + } + } + else if (!SaveAll(true)) + { + e.Cancel = true; + return; + } + + + //если стартовый поток запущен + try + { + if (VisualEnvironmentCompiler.Starting()) + { + //начинаем процедуру отмены старта компилятора + this.Text = string.Format(FTSFormat, MainFormText, Form1StringResources.Get("FTS_CANCELLOADING")); + VisualEnvironmentCompiler.AbortStaring(); + } + else + SaveOptions(); + } + catch + { + + } + e.Cancel = false; + } + + + + private void miClearOutputWindow_Click(object sender, EventArgs e) + { + var zoomf = OutputWindow.outputTextBox.ZoomFactor; + OutputWindow.outputTextBox.Clear(); + OutputWindow.outputTextBox.ZoomFactor = zoomf; + } + + public enum EnvorimentEvent {VisualEnvironmentCompilerCreated} + public delegate void EnvorimentEventDelegate(EnvorimentEvent EnvorimentEvent); + public event EnvorimentEventDelegate OnEnvorimentEvent; + bool init = false; + string FileNameToWait=null; + + void NavigationManager_StateChanged(NavigationManager sender) + { + NavigBackButtonsEnabled = NavigationManager.CanNavigateBackward; + NavigForwButtonsEnabled = NavigationManager.CanNavigateForward; + } + + private void OpenToolStripMenuItem1_Click_1(object sender, EventArgs e) + { + OpenFileDialog(Path.GetDirectoryName(CurrentSourceFileName)); + } + + VisualPascalABCPlugins.IVisualEnvironmentCompiler VisualPascalABCPlugins.IWorkbench.VisualEnvironmentCompiler + { + get + { + return VisualEnvironmentCompiler; + } + } + + private void UndoToolStripMenuItem_Click(object sender, EventArgs e) //roman// + { + ExecUndo(); + } + + private void RedoToolStripMenuItem_Click(object sender, EventArgs e) //roman// + { + ExecRedo(); + } + + private void ExitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + public void SetStateText(string text) + { + toolStripStatusLabel5.Text = text; + statusStrip1.Refresh(); + } + + public void Reset() + { + } + + private void Form1_Shown(object sender, EventArgs e) + { + + if(_mainFormWindowStateMaximized) + this.WindowState = FormWindowState.Maximized; + //PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = "Russi + + ChangedSelectedTab(); + VisualEnvironmentCompiler.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(VisualEnvironmentCompiler_ChangeVisualEnvironmentState); + VisualEnvironmentCompiler.RunStartingThread(); + + LoadComplete = true; + } + + private object ExecuteVisualEnvironmentCompilerAction(VisualEnvironmentCompilerAction Action,object obj) + { + switch (Action) + { + case VisualEnvironmentCompilerAction.Run: + return WorkbenchServiceFactory.RunService.Run(true); + case VisualEnvironmentCompilerAction.Stop: + return WorkbenchServiceFactory.RunService.Stop(); + case VisualEnvironmentCompilerAction.Build: + return WorkbenchServiceFactory.BuildService.Build(); + case VisualEnvironmentCompilerAction.BuildUnit: + return WorkbenchServiceFactory.BuildService.Build(obj as string); + case VisualEnvironmentCompilerAction.Rebuild: + return WorkbenchServiceFactory.BuildService.Rebuild(); + case VisualEnvironmentCompilerAction.OpenFile: + return WorkbenchServiceFactory.FileService.OpenFile((string)obj, null); + case VisualEnvironmentCompilerAction.GetDirectory: + string s=VisualEnvironmentCompiler.Compiler.CompilerOptions.StandartDirectories[(string)obj] as string; + if (s != null) + return s; + return WorkbenchStorage.StandartDirectories[(string)obj] as string; + case VisualEnvironmentCompilerAction.PT4PositionCursorAfterTask: // SSM 09.11.19 + { + var ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + var d = ta.Document; + for (var i = 0; i)obj,true); + return true; + case VisualEnvironmentCompilerAction.SaveFile: + string FileName = Tools.FileNameToLower((string)obj); + if (!OpenDocuments.ContainsKey(FileName)) + return false; + var doc = OpenDocuments[FileName]; + if (doc.DocumentSavedToDisk) + SaveFileAs(doc, (string)obj); + //else + // ExecuteSaveAs(doc); + return true; + } + return false; + } + + void VisualEnvironmentCompiler_ChangeVisualEnvironmentState(VisualEnvironmentState State, object obj) + { + switch (State) + { + case VisualEnvironmentState.StartCompilerLoading: + this.Text = String.Format(FTSFormat,MainFormText,Form1StringResources.Get("FTS_LOADING")); + break; + case VisualEnvironmentState.FinishCompilerLoading: + this.Text = String.Format("{0} {1}",MainFormText,PascalABCCompiler.Compiler.ShortVersion); + //this.Text = MainFormText; + openFileDialog1.Filter = saveFileDialog1.Filter = VisualEnvironmentCompiler.GetFilterForDialogs(); + openProjectDialog.Filter = VisualEnvironmentCompiler.GetProjectFilterForDialogs(); + VisualEnvironmentCompiler.Compiler.CompilerOptions = WorkbenchServiceFactory.BuildService.CompilerOptions; + break; + } + } + + public string CurrentSourceFileName + { + get { return CurrentCodeFileDocument.FileName; } + } + + public string CurrentEXEFileName + { + get + { + string path = ""; + + if (ProjectFactory.Instance.CurrentProject != null) + { + if (!string.IsNullOrEmpty(ProjectFactory.Instance.CurrentProject.OutputDirectory)) + return Path.Combine(ProjectFactory.Instance.CurrentProject.OutputDirectory, ProjectFactory.Instance.CurrentProject.OutputFileName); + return Path.Combine(ProjectFactory.Instance.CurrentProject.ProjectDirectory, ProjectFactory.Instance.CurrentProject.OutputFileName); + } + + + if (UserOptions.UseOutputDirectory) + path = Path.Combine(UserOptions.OutputDirectory, Path.GetFileNameWithoutExtension(CurrentSourceFileName)) + ".exe"; + else + path = Path.ChangeExtension(CurrentSourceFileName, ".exe"); + if (!File.Exists(path) && ActiveCodeFileDocument != null) + { + if (UserOptions.UseOutputDirectory) + path = Path.Combine(UserOptions.OutputDirectory, Path.GetFileNameWithoutExtension(ActiveCodeFileDocument.FileName)) + ".exe"; + else + path = Path.ChangeExtension(ActiveCodeFileDocument.FileName, ".exe"); + } + return path; + } + } + + private void OpenLastFile_ToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.FileService.OpenFile((sender as ToolStripMenuItem).Tag as string, null); + } + + private void OpenLastProject_ToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.ProjectService.OpenProject((sender as ToolStripMenuItem).Tag as string); + } + + private void toolStripButton19_Click(object sender, EventArgs e) + { + OutputWindow.outputTextBox.Text = ""; + } + + private void fontDialog1_Apply(object sender, EventArgs e) + { + CurrentCodeFileDocument.Font = fontDialog1.Font; + } + + private void toolStripButton12_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.BuildService.StartCompile(true); + } + + private void toolStripButton10_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.BuildService.StartCompile(false); + } + + private void miAboutToolStripMenuItem_Click(object sender, EventArgs e) + { + AboutBox1.ShowDialog(); + } + + private void CompileButton_EnabledChanged(object sender, EventArgs e) + { + //CompileMenuItem.Enabled = CompileButton.Enabled; + } + + private void StartButton_EnabledChanged(object sender, EventArgs e) + { + //StartMenuItem.Enabled = StartButton.Enabled; + } + + private void ReCompileButton_EnabledChanged(object sender, EventArgs e) + { + miRebuild.Enabled = ReCompileButton.Enabled; + } + + private void miCurt_Click(object sender, EventArgs e) + { + ExecCut(); + } + + private void miCopy_Click(object sender, EventArgs e) + { + ExecCopy(); + } + + private void miPaste_Click(object sender, EventArgs e) + { + ExecPaste(); + } + + private void miStop_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Stop(); + } + + private void miSave_Click(object sender, EventArgs e) + { + SaveSelFile(CurrentCodeFileDocument); + } + + private void miSaveAll_Click_1(object sender, EventArgs e) + { + SaveAll(false); + } + + private void miClose_Click(object sender, EventArgs e) + { + if (CurrentWebBrowserControl != null) + CurrentWebBrowserControl.Close(); + else + CurrentCodeFileDocument.Close(); + } + + private void miCloseNonActive_Click(object sender, EventArgs e) + { + CloseAllButThis(CurrentCodeFileDocument); + } + + private void miNew_Click(object sender, EventArgs e) + { + // SSM 26/04/22 - новый файл создается в папке текущего открытого файла + var CurrentFileNameDirectory = Path.GetDirectoryName(CurrentSourceFileName); + WorkbenchStorage.WorkingDirectory = CurrentFileNameDirectory; + Environment.CurrentDirectory = CurrentFileNameDirectory; + + WorkbenchServiceFactory.FileService.OpenFile(null, null); + } + + private void miSaveAs_Click(object sender, EventArgs e) + { + ExecuteSaveAs(CurrentCodeFileDocument); + } + + + + private void tsat_Click(object sender, EventArgs e) + { + SelectAppType((PascalABCCompiler.CompilerOptions.OutputType)((sender as ToolStripMenuItem).Tag)); + } + + public void SelectAppType(PascalABCCompiler.CompilerOptions.OutputType outputType) + { + Image img = null; + foreach (ToolStripMenuItem mi in tstaSelect.DropDownItems) + if (outputType == (PascalABCCompiler.CompilerOptions.OutputType)mi.Tag) + img = mi.Image; + tstaSelect.Image = img; + WorkbenchServiceFactory.BuildService.CompilerOptions.OutputFileType = outputType; + } + + private void StartMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Run(true); + if (VisualEnvironmentCompiler.Compiler != null && VisualEnvironmentCompiler.Compiler.ErrorsList.Count == 0) + { + var Percent = VisualEnvironmentCompiler.Compiler.PABCCodeHealth; + if (Percent > 0) + { + if (Percent >= 100) + { + HealthLabel.Text = ""; + return; + } + HealthLabel.Text = $"{Percent}%"; + + var c = SystemColors.Control; + var PM100 = 100 - Percent; + HealthLabel.BackColor = Color.FromArgb(c.R - PM100 - 20, c.G - PM100 - 20, c.B - PM100 - 20); + } + } + } + + private void Form1_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.F1) + { + ExecShowHelpF1(); + } + } + + private void Form1_SizeChanged(object sender, EventArgs e) + { + if (WindowState == FormWindowState.Normal) + { + FormWidth = Width; + FormHeight = Height; + } + } + + private void Form1_LocationChanged(object sender, EventArgs e) + { + if (WindowState == FormWindowState.Normal) + { + FormLeft = Left; + FormTop = Top; + } + } + + private void miFind_Click(object sender, EventArgs e) + { + ExecFind(); + } + + private void miReplace_Click(object sender, EventArgs e) + { + ExecReplace(); + } + + private void miFindNext_Click(object sender, EventArgs e) + { + ExecFindNext(); + } + + internal WebBrowserControl _currentWebBrowserControl = null; + + internal CodeFileDocumentControl _currentCodeFileDocument = null; + + public WebBrowserControl CurrentWebBrowserControl + { + get { return _currentWebBrowserControl; } + set + { + _currentWebBrowserControl = value; + if (value != null) + value.Activate(); + } + } + + public CodeFileDocumentControl CurrentCodeFileDocument + { + get { return _currentCodeFileDocument; } + set { + _currentCodeFileDocument = value; + value.Activate(); + } + } + + VisualPascalABCPlugins.ICodeFileDocument VisualPascalABCPlugins.IWorkbenchDocumentService.CurrentCodeFileDocument + { + get + { + return CurrentCodeFileDocument; + } + set + { + CurrentCodeFileDocument = value as CodeFileDocumentControl; + } + } + + public CodeFileDocumentControl ActiveCodeFileDocument + { + get { return activeTabPage; } + set + { + if (activeTabPage != value) + { + CodeFileDocumentControl tp = ActiveCodeFileDocument; + activeTabPage = value; + if (tp != null) + SetTabPageText(tp); + if (activeTabPage != null) + SetTabPageText(activeTabPage); + } + } + + } + + Form VisualPascalABCPlugins.IWorkbench.MainForm + { + get + { + return this; + } + } + + private void cmSetActive_Click(object sender, EventArgs e) + { + ActiveCodeFileDocument = CurrentCodeFileDocument; + } + + private void miOutputWindow_Click(object sender, EventArgs e) + { + BottomTabsVisible = !BottomTabsVisible; + /*OutputWindow.outputTextBox.BringToFront(); + var s = OutputWindow.outputTextBox.Height.ToString() + " " + OutputWindow.outputTextBox.Width.ToString() + "\n"; + s += OutputWindow.outputTextBox.Dock.ToString()+"\n"; + MessageBox.Show(s);*/ + } + + private void toolStripMenuItem8_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.ToggleBookmark(); + } + + private void mGOTONEXTBOOKMARKToolStripMenuItem_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.NextBookmark(); + } + + private void mGOTOPREVBOOKMARKToolStripMenuItem_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.PrevBookmark(); + } + + private void mCLEARBOOKMARKSToolStripMenuItem_Click(object sender, EventArgs e) + { + CurrentSyntaxEditor.ClearAllBookmarks(); + } + + private void miRunNoDebug_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Run(false); + } + + Dictionary lastInputTexts = new Dictionary(); + internal string lastInputText + { + get + { + if (lastInputTexts.ContainsKey(CurrentCodeFileDocument)) + return lastInputTexts[CurrentCodeFileDocument]; + else + return ""; + } + set + { + if (value == "") + if (lastInputTexts.ContainsKey(CurrentCodeFileDocument)) + { + lastInputTexts.Remove(CurrentCodeFileDocument); + return; + } + if (lastInputTexts.ContainsKey(CurrentCodeFileDocument)) + lastInputTexts[CurrentCodeFileDocument] = value; + else + lastInputTexts.Add(CurrentCodeFileDocument, value); + } + } + + private void cmFindAllReferences_Click(object sender, EventArgs e) + { + ExecFindReferences(); + } + + private void tsNavigBack_Click(object sender, EventArgs e) + { + ExecNavigateBackward(); + } + + private void tsNavigForw_Click(object sender, EventArgs e) + { + ExecNavigateForward(); + } + + private void Form1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.Escape && BottomTabsVisibleChekerEnabled) + { + BottomTabsVisible = false; + e.Handled = true; + } + /*if (e.KeyData == Keys.Delete) + { + if (_designer_is_active && MainDockPanel.ActiveContent is CodeFileDocumentControl) + { + ExecDelete(); + } + }*/ + } + + private void mGENERATEREALIZATIONToolStripMenuItem_Click(object sender, EventArgs e) + { + (new ClassOrMethodRealizationAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void tsSelectAll_Click(object sender, EventArgs e) + { + ExecSelectAll(); + } + + private void tsGotoLine_Click(object sender, EventArgs e) + { + ExecGotoLine(); + } + + public SymbolsViwer FindSymbolResults + { + get + { + return FindSymbolsResultWindow.FindSymbolResults; + } + } + + public void ShowFindResults(List syms) + { + FindSymbolsResultWindow.ShowFindResults(syms); + } + + private void tsShowOutputWindow_Click(object sender, EventArgs e) + { + ShowContent(OutputWindow, true); + } + + private void tsShowErrorsListWindow_Click(object sender, EventArgs e) + { + ShowContent(ErrorsListWindow, true); + } + + private void tsShowCompilerConsoleWindow_Click(object sender, EventArgs e) + { + ShowContent(CompilerConsoleWindow, true); + } + + private void tsShowFindSymbolsResultWindow_Click(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(FindSymbolsResultWindow, true); + } + + private void tsShowDebugVariablesListWindow_Click(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(DebugVariablesListWindow, true); + } + + private void tsShowDebugWatchListWindow_Click(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(DebugWatchListWindow, true); + } + + private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) + { + if (!(MainDockPanel.ActiveContent is CodeFileDocumentControl)) + { + this.cmSave.Visible = false; + this.cmSetActive.Visible = false; + this.cmCloseAllButThis.Visible = false; + CloseButtonsEnabled = true; + } + else + { + this.cmSave.Visible = true; + this.cmSetActive.Visible = true; + this.cmCloseAllButThis.Visible = true; + CloseButtonsEnabled = OpenDocuments.Count > 1; + } + } + + private void mOPTIONSToolStripMenuItem_Click(object sender, EventArgs e) + { + optionsContentEngine.ShowDialog(); + } + + private void tsViewIntellisensePanel_CheckedChanged(object sender, EventArgs e) + { + if (tsViewIntellisensePanel.Checked != UserOptions.ShowQuickClassBrowserPanel) + { + UserOptions.ShowQuickClassBrowserPanel = tsViewIntellisensePanel.Checked; + UpdateUserOptions(); + } + } + + private void mEXAMPLESToolStripMenuItem_Click(object sender, EventArgs e) + { + Help.ShowHelp(null, HelpExamplesFileName); + } + + private void toolStripMenuItem1_Click_1(object sender, EventArgs e) + { + OpenFileDialog(HelpExamplesDirectory); + } + + private void toolStripMenuItem5_Click(object sender, EventArgs e) + { + OpenFileDialog(HelpTutorialExamplesDirectory); + } + + private void miAddExpr_Click(object sender, EventArgs e) + { + AddToWatchAction wact = new AddToWatchAction(); + wact.Execute(this.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea); + } + + public ContextMenuStrip BreakpointMenuStrip + { + get + { + return cmBreakpointCondition; + } + } + + private void mDELETEBREAKPOINTToolStripMenuItem_Click(object sender, EventArgs e) + { + this.CurrentCodeFileDocument.TextEditor.ContextMenuStrip = this.cmEditor; + BreakPointFactory.DeleteCurrentBreakpoint(); + } + + private void mBREAKPOINTCONDITIONToolStripMenuItem1_Click(object sender, EventArgs e) + { + this.CurrentCodeFileDocument.TextEditor.ContextMenuStrip = this.cmEditor; + BreakPointFactory.InvokeAddCondition(); + } + + private void miToolBox_Click(object sender, EventArgs e) + { + ToolBoxVisible = true; + } + + private void miProperties_Click(object sender, EventArgs e) + { + PropertiesWindowVisible = true; + } + + private void miUnitWithForm_Click(object sender, EventArgs e) + { + OpenFileWithForm(); + } + + private void mMAINFEATURESToolStripMenuItem_Click(object sender, EventArgs e) + { + if (!ThreadPool.QueueUserWorkItem(__showgettingstarted)) + __showgettingstarted(null); + } + + [System.ComponentModel.EditorBrowsableAttribute()] + protected override void WndProc(ref Message m) + { + if (m.Msg == 74)//WM_COPYDATA + { + try + { + COPYDATASTRUCT cds = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam,typeof(COPYDATASTRUCT)); + if (cds.dwData.ToInt32() == 32)//open file + { + string file_name = cds.lpData;//Marshal.PtrToStringUni(cds.lpData,(int)cds.cbData); + //MessageBox.Show(cds.cbData.ToString()); + if (init) + { + if (System.IO.Path.GetExtension(file_name) != ".pabcproj") + WorkbenchServiceFactory.FileService.OpenFile(file_name, null); + else + WorkbenchServiceFactory.ProjectService.OpenProject(file_name); + } + else + { + FileNameToWait = file_name; + } + } + } + catch + { + + } + } + base.WndProc(ref m); + } + + + + private void miNewProject_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.ProjectService.NewProject(); + } + + private void miOpenProject_Click(object sender, EventArgs e) + { + OpenProjectDialog(Constants.DefaultWorkingDirectory); + } + + List watches = new List(); + + private void miCloseProject_Click(object sender, EventArgs e) + { + //CloseProjectFiles(); + WorkbenchServiceFactory.ProjectService.CloseProject(); + } + + private void mADDFILEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.NewFile(ProjectExplorerWindow); + } + + private void mADDEXISTFILEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.AddFile(ProjectExplorerWindow); + } + + private void mADDFORMToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.NewForm(ProjectExplorerWindow, true);//roman// + } + + private void mADDREFERENCEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.AddReferencesToProject(ProjectExplorerWindow); + } + + private void mPROPERTIESToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.ProjectProperties(); + } + + void TsImmediateWindowClick(object sender, EventArgs e) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(ImmediateWindow,true); + } + + private RunArguments RunArgumentsForm = new RunArguments(); + + private void mRUNPARAMETERSToolStripMenuItem1_Click(object sender, EventArgs e) + { + ExecRunParameters(); + } + + private void cmiCopy_Click(object sender, EventArgs e) + { + //ExecDesignerCopy(); + } + + private void cmiPaste_Click(object sender, EventArgs e) + { + //ExecDesignerPaste(); + } + + private void miDelete_Click(object sender, EventArgs e) + { + //ExecDelete(); + } + + private void cmiDelete_Click(object sender, EventArgs e) + { + //ExecDelete(); + } + + private void cmiCut_Click(object sender, EventArgs e) + { + //ExecDesignerCut(); + } + + private void miTabOrder_Click(object sender, EventArgs e) + { + //ExecTabOrder(); + } + + private void miShowGrid_Click(object sender, EventArgs e) + { + //ExecShowGrid(); + } + + private void miSnapToGrid_Click(object sender, EventArgs e) + { + //ExecSnapToGrid(); + } + + private void cmiAlignLefts_Click(object sender, EventArgs e) + { + // ExecAlignLefts(); + } + + private void cmiAlignRights_Click(object sender, EventArgs e) + { + //ExecAlignRights(); + } + + private void cmiAlignTops_Click(object sender, EventArgs e) + { + // ExecAlignTops(); + } + + private void cmiAlignBottoms_Click(object sender, EventArgs e) + { + //ExecAlignBottoms(); + } + + private void cmiAlignMiddles_Click(object sender, EventArgs e) + { + //ExecAlignMiddles(); + } + + private void cmiAlignCenters_Click(object sender, EventArgs e) + { + //ExecAlignCenters(); + } + + private void cmiAlignToGrid_Click(object sender, EventArgs e) + { + //ExecAlignToGrid(); + } + + private void cmiCenterHorizontally_Click(object sender, EventArgs e) + { + //ExecCenterHorizontally(); + } + + private void cmiCenterVertically_Click(object sender, EventArgs e) + { + // ExecCenterVertically(); + } + + private void cmiSizeToControl_Click(object sender, EventArgs e) + { + //ExecSizeToControl(); + } + + private void cmiSizeToControlWidth_Click(object sender, EventArgs e) + { + //ExecSizeToControlWidth(); + } + + private void cmiSizeToControlHeight_Click(object sender, EventArgs e) + { + //ExecSizeToControlHeight(); + } + + private void cmiSizeToGrid_Click(object sender, EventArgs e) + { + //ExecSizeToGrid(); + } + + private void cmiBringToFront_Click(object sender, EventArgs e) + { + //ExecBringToFront(); + } + + private void cmiSendToBack_Click(object sender, EventArgs e) + { + //ExecSendToBack(); + } + + private void cmiTabOrder_Click(object sender, EventArgs e) + { + cmiTabOrder.Checked = !cmiTabOrder.Checked; + //ExecTabOrder(); + } + + private void mFORMATToolStripMenuItem_Click(object sender, EventArgs e) + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void cmFormat_Click(object sender, EventArgs e) + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void tsFormat_Click(object sender, EventArgs e) + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + + + //ZM + private void mNEWASPToolStripMenuItem_Click(object sender, EventArgs e) + { + string text = "{$asp newaspect}\n {$aspdata newaspect author 1.0}\n{$endasp newaspect}"; + ICSharpCode.TextEditor.TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + ta.InsertString(text); + + } + + public void MakeTemplate() + { + string text = "{$asp declarations}\n {$aspdata declarations author 1.0}\n{$endasp declarations}\n \n{$asp classes}\n{$endasp classes}\n \n{$asp main}\nbegin\nend.\n{$endasp main}\n"; + ICSharpCode.TextEditor.TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + ta.InsertString(text); + } + + public void SaveAspPlugin(CodeFileDocumentControl dc) + { + SaveSelFile(dc); + } + + public void CloseAspPlugin(CodeFileDocumentControl dc) + { + //CloseFile(dc); + } + + private void mDOTNETHELPToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenMSDN(); + } + + void ExecViewCode() + { + //ExecuteDesignerCommand(StandardCommands.ViewCode);//roman// + } + private void cmViewCode_Click(object sender, EventArgs e) + { + ExecViewCode(); + } + + void ExecShowProperties() + { + //ExecuteDesignerCommand(StandardCommands.PropertiesWindow);//roman// + } + private void cmiProperties_Click(object sender, EventArgs e) + { + ExecShowProperties(); + } + + private void miPrint_Click(object sender, EventArgs e) + { + ExecPrint(); + } + + private void tsFindAllReferences_Click(object sender, EventArgs e) + { + ExecFindReferences(); + } + //end ZM + + void ExecRunParameters() + { + RunArgumentsForm.CommandLineArguments = WorkbenchServiceFactory.RunService.GetRunArgument(this.CurrentCodeFileDocument.FileName.ToLower()); + if (RunArgumentsForm.ShowDialog() == DialogResult.OK) + { + WorkbenchServiceFactory.RunService.AddRunArgument(this.CurrentCodeFileDocument.FileName.ToLower(), RunArgumentsForm.CommandLineArguments); + } + } + + private void miProjectExplorer_Click(object sender, EventArgs e) + { + ProjectExplorerWindowVisible = true; + } + + private void cmSamples_Click(object sender, EventArgs e) + { + + } + + private void cmHelp_Click(object sender, EventArgs e) + { + __showhelpinqueue(); + } + + /*private void __checkforupdate(object state) + { + WorkbenchServiceFactory.UpdateService.CheckForUpdates(); + }*/ + + private void miCheckUpdates_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.UpdateService.CheckForUpdates(); + //if (!ThreadPool.QueueUserWorkItem(__checkforupdate)) + // __checkforupdate(null); + } + + private void cmCollapseRegions_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.EditorService.CollapseRegions(); + } + + private void tsDisassembly_Click(object sender, EventArgs e) + { + DisassemblyWindowVisible = true; + } + + private void tsAutoInsertCode_Click(object sender, EventArgs e) + { + tsAutoInsertCode.Checked = !tsAutoInsertCode.Checked; + mAUTOINSERTToolStripMenuItem.Checked = !mAUTOINSERTToolStripMenuItem.Checked; + } + + private void mAUTOINSERTToolStripMenuItem_Click(object sender, EventArgs e) + { + tsAutoInsertCode.Checked = !tsAutoInsertCode.Checked; + mAUTOINSERTToolStripMenuItem.Checked = !mAUTOINSERTToolStripMenuItem.Checked; + } + + private void mUNITTESTSToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ClearErrorList(); + var OutputFileName = WorkbenchServiceFactory.BuildService.Compile(CurrentSourceFileName, false, "__RunMode", true, true); + if (OutputFileName != null) + { + var process = new System.Diagnostics.Process(); + process.StartInfo.FileName = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "RunUnitTests.exe"); + process.StartInfo.Arguments = "\""+OutputFileName+"\""; + process.Start(); + } + /*WorkbenchServiceFactory.RunService.Run(@"D:\PABC_Git\bin\RunUnitTests.exe", + WorkbenchServiceFactory.Workbench.UserOptions.RedirectConsoleIO, "", false, + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileDirectory, + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName, false, false);*/ + } + catch (System.Exception ee) + { + ee = ee; + // SSM 22/04/19 - исправляю вылет оболочки при отсутствии exe файла + // this.RunnerManager_Exited(OutputFileName); // - это всё равно не срабатывает. Кнопки оказываются в заблокированном состоянии + //var OutputFileName = @"D:\PABC_Git\bin\RunUnitTests.exe"; + //WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(OutputFileName, "Произошла непредвиденная ошибка" + ee.StackTrace); + //throw; + } + } + + public ABCHealth ABCHealthForm = null; + + private Label AddString(double x, double y, string s, bool link = false, bool goodfeatures = false) + { + Label l; + if (link) + l = new LinkLabel(); + else l = new Label(); + l.Text = s; + l.Left = (int)Math.Round(x); + l.Top = (int)Math.Round(y); + //if (link) + if (!goodfeatures) + l.ForeColor = System.Drawing.Color.Red; + else l.ForeColor = System.Drawing.Color.Green; + l.AutoSize = true; + ABCHealthForm.Controls.Add(l); + return l; + } + + private string Raz(int n) + { + if ((n % 10 == 2 || n % 10 == 3 || n % 10 == 4) && (n / 10 % 10 != 1)) + return n + " раза"; + else return n + " раз"; + } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + if (ABCHealthForm == null) + { + ABCHealthForm = new ABCHealth(); + ABCHealthForm.FormBorderStyle = FormBorderStyle.Fixed3D; + } + try + { + var gr = Graphics.FromHwnd(Handle); + var scale = gr.DpiX / 96; + + var aw = ABCHealthForm.Width; + var ah = ABCHealthForm.Height; + var c = new PascalABCCompiler.Compiler(); + c.Reload(); + var errors = new List(); + var warnings = new List(); + + var text = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.TextContent; + + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ClearErrorList(); + var res = c.ParseText(CurrentSourceFileName, text, errors, warnings); + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ShowErrorsSync(c.ErrorsList, c.ErrorsList.Count != 0); + if (res != null) + { + var y = 30/2*scale; + var stat = new SyntaxVisitors.ABCStatisticsVisitor(); + stat.ProcessNode(res); + //stat. + var h = 40 / 2 * scale; + var x = 50 / 2 * scale; + ABCHealthForm.Controls.Clear(); + + var pp = new Panel(); + + ToolTip ToolTip1 = new ToolTip(); + ToolTip1.SetToolTip(pp, "Здоровье PascalABC.NET программы"); + + pp.Width = (int)Math.Round(220 / 2 * scale); + pp.Height = (int)Math.Round(100 / 2 * scale); + pp.Left = ABCHealthForm.ClientSize.Width - pp.Width - (int)Math.Round(24 / 2 * scale); + pp.Top = (int)Math.Round(24 / 2 * scale); + pp.BackColor = Color.Gray; + + ABCHealthForm.Controls.Add(pp); + + + var l0 = AddString(x, y, "О здоровье кода",true) as LinkLabel; + l0.LinkClicked += (o, e1) => + { + System.Diagnostics.Process.Start("https://pascalabcnet.github.io/program_health.html"); + }; + y += 48 / 2 * scale; + + var l1 = AddString(x, y, "В программе найдены следующие конструкции базового Паскаля,"); + y += 36 / 2 * scale; + var l2 = AddString(x, y, "считающиеся устаревшими в PascalABC.NET:"); + l1.ForeColor = Color.Black; + l2.ForeColor = Color.Black; + y += h; + y += 8 / 2 * scale; + x += 24 / 2 * scale; + + // Проценты в минус + // 1. Количество var вне - количество var внутри. За первую - -10%, за остальные - -2% пока не достигнет 25% + // 2. Количество for i - за первую - -15%, за каждую следующую - -3% пока не достигнет 25% + // 3. Read(i,j) - за первую -15%, за последующие - -2% пока не достигнет -20% + // 4. program - -10% + // 5. Статические массивы - -10%, за каждый последующий - -2% пока не достигнет -15% + // 6. Write(a,' ',b) - за каждую - -1% пока не достгнет -5% + // 7. string[10] - за каждую - -1% . Если минусуется > 100%, то здоровье делать 0% + + + var ShowNegativeInfo = false; + if (stat.OutBlockVarDefs > 0 && stat.OutBlockVarDefs > stat.InBlockVarDefs) + { + AddString(x, y, "Переменные описаны вне блоков begin-end: " + Raz(stat.OutBlockVarDefs), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.ForsWithoutVar != 0) + { + AddString(x, y, "Переменная цикла for не описана в заголовке цикла: " + Raz(stat.ForsWithoutVar), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.ReadProc > 0) + { + AddString(x, y, "Для ввода использована процедура Read: " + Raz(stat.ReadProc), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.ProgramKeyword) + { + AddString(x, y, "Использовано ключевое слово program", false); + y += h; + ShowNegativeInfo = true; + } + if (stat.WriteProcWithSpace > 0) + { + AddString(x, y, "Использована процедура Write с пробелом в качестве разделителя: " + Raz(stat.WriteProcWithSpace), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.StaticArrays > 0) + { + AddString(x, y, "Используются статические массивы вместо динамических: " + Raz(stat.StaticArrays), false); + y += h; + ShowNegativeInfo = true; + } + if (stat.OldStrings > 0) + { + AddString(x, y, "Используются устаревшие строки вида string[10]: " + Raz(stat.OldStrings), false); + y += h; + ShowNegativeInfo = true; + } + + ///---------------------------------------------------- + y += 12 / 2 * scale; + x -= 24 / 2 * scale; + var l3 = AddString(x, y, "В программе используются следующие рекомендованные конструкции"); + y += 36 / 2 * scale; + var l4 = AddString(x, y, "PascalABC.NET:"); + l3.ForeColor = Color.Black; + l4.ForeColor = Color.Black; + x += 24 / 2 * scale; + y += h; + y += 8 / 2 * scale; + if (stat.InBlockVarDefs > 0) + { + AddString(x, y, "Используются внутриблочные описания переменных: " + Raz(stat.InBlockVarDefs), false, true); + y += h; + } + if (stat.ForsWithVar != 0) + { + AddString(x, y, "Переменная цикла for описана в заголовке цикла: " + Raz(stat.ForsWithVar), false, true); + y += h; + } + if (stat.InitVarInDef > 0) + { + AddString(x, y, "Используется инициализация при описании: " + Raz(stat.InitVarInDef), false, true); + y += h; + } + if (stat.ReadFuncCount > 0) + { + AddString(x, y, "Для ввода используется функция вида ReadInteger, ReadReal: " + Raz(stat.ReadFuncCount), false, true); + y += h; + } + if (stat.ExtAssignCount > 0) + { + AddString(x, y, "Используется расширенное присваивание: " + Raz(stat.ExtAssignCount), false, true); + y += h; + } + if (stat.PrintCount > 0) + { + AddString(x, y, "Для вывода использована Print: " + Raz(stat.PrintCount), false, true); + y += h; + } + if (stat.TuplesCount > 0) + { + AddString(x, y, "Используются кортежи: " + Raz(stat.TuplesCount), false, true); + y += h; + } + if (stat.DynamicArrays > 0) + { + AddString(x, y, "Используются динамические массивы: " + Raz(stat.DynamicArrays), false, true); + y += h; + } + if (stat.UnpackingAssign > 0) + { + AddString(x, y, "Используется распаковка значения в переменные: " + Raz(stat.UnpackingAssign), false, true); + y += h; + } + if (stat.LoopsCount > 0) + { + AddString(x, y, "Используется цикл loop: " + Raz(stat.LoopsCount), false, true); + y += h; + } + if (stat.ForeachCount > 0) + { + AddString(x, y, "Используется цикл foreach: " + Raz(stat.ForeachCount), false, true); + y += h; + } + if (stat.LambdasCount > 0) + { + AddString(x, y, "Используются лямбда-выражения: " + Raz(stat.LambdasCount), false, true); + y += h; + } + + var Percent = stat.CalcHealth(out int NegativePercent, out int PositivePercent); + // Процент здоровья + // VarDefs + + if (!ShowNegativeInfo) + { + l1.Text = "В программе отсутствуют устаревшие в PascalABC.NET конструкции"; + l2.Text = ""; + } + if (PositivePercent == 0) + { + l3.Text = "В программе отсутствуют рекомендованные в PascalABC.NET конструкции"; + l4.Text = ""; + } + + // Цвет панели + if (Percent < 25) + pp.BackColor = Color.FromArgb(255, 0, 0); + else if (Percent < 50) + pp.BackColor = Color.FromArgb(255, 64, 64); + else if (Percent < 75) + pp.BackColor = Color.FromArgb(128, 128, 128); + else if (Percent < 100) + pp.BackColor = Color.FromArgb(64 + 16 + 16, 128, 64 + 16 + 16); + else pp.BackColor = Color.FromArgb(0, 128, 0); + + pp.Paint += (o, ea) => + { + Font drawFont = new Font("Arial", 20); + SolidBrush drawBrush = new SolidBrush(Color.White); + StringFormat format = new StringFormat(StringFormatFlags.NoClip); + format.LineAlignment = StringAlignment.Center; + format.Alignment = StringAlignment.Center; + ea.Graphics.DrawString(Percent + "%", drawFont, drawBrush, new RectangleF(0, 0, pp.Width, pp.Height),format); + }; + + Button b = new Button(); + b.Text = "OK"; + b.Width = (int)Math.Round(156 / 2 * scale); + b.Height = (int)Math.Round(48 / 2 * scale); + y += h; + b.Top = (int)Math.Round(y); + b.Left = (int)Math.Round((double)(ABCHealthForm.Width - b.Width) / 2); + b.Click += (o, ee) => { ABCHealthForm.Close(); }; + ABCHealthForm.Controls.Add(b); + y += b.Height + h; + var hh = ABCHealthForm.Height - ABCHealthForm.ClientSize.Height; + ABCHealthForm.Height = (int)Math.Round(y+hh); + + ABCHealthForm.StartPosition = FormStartPosition.Manual; + ABCHealthForm.Left = this.Left + Width - aw; + ABCHealthForm.Top = this.Top; + b.PreviewKeyDown += (o, eee) => + { + if (eee.KeyCode == Keys.Escape) + ABCHealthForm.Close(); + }; + ABCHealthForm.ShowDialog(); + } + } + catch (System.Exception ee) + { + } + } + + private void HealthLabelClear() + { + HealthLabel.Text = ""; + HealthLabel.BackColor = System.Drawing.SystemColors.Control; + } + + private void HealthLabel_Click(object sender, EventArgs e) + { + toolStripButton1_Click(this, null); + //System.Diagnostics.Process.Start("https://pascalabcnet.github.io/program_health.html"); + } + + private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + + } + + private void tsHelp_Click(object sender, EventArgs e) + { + __showhelpinqueue(); + } + + private void cmEditor_Opening(object sender, CancelEventArgs e) + { + ICSharpCode.TextEditor.TextLocation cp = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret.Position; + ICSharpCode.TextEditor.Document.TextWord tw = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.GetLineSegment(cp.Line).GetWord(cp.Column); + this.cmSamples.DropDownItems.Clear(); + try + { + if (tw != null) + { + var header = sampleManager.GetSampleHeader(tw.Word); + if (header != null) + { + var samples = sampleManager.GetSamples(header); + foreach (string pattern in samples) + { + var files = Directory.GetFiles(HelpExamplesDirectory, pattern); + foreach (string file in files) + { + if (File.Exists(file)) + { + var sample_mi = new ToolStripMenuItem(); + sample_mi.Text = file.Replace(HelpExamplesDirectory + Path.DirectorySeparatorChar, ""); + sample_mi.Click += delegate(object _sender, EventArgs _e) + { + VisualPascalABC.VisualPascalABCProgram.MainForm.Activate(); + ExecuteVisualEnvironmentCompilerAction(VisualEnvironmentCompilerAction.OpenFile, file); + }; + this.cmSamples.DropDownItems.Add(sample_mi); + } + } + } + } + } + } + catch + { + + } + this.cmSamples.Enabled = this.cmSamples.DropDownItems.Count > 0; + } + + IWorkbenchServiceContainer VisualPascalABCPlugins.IWorkbench.ServiceContainer + { + get { return serviceContainer; } + } + + } + +} diff --git a/VisualPascalABCNETLinux/Form1.resx b/VisualPascalABCNETLinux/Form1.resx new file mode 100644 index 000000000..40c15d8b4 --- /dev/null +++ b/VisualPascalABCNETLinux/Form1.resx @@ -0,0 +1,1477 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 589, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv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1XcucYpxARXPaSQYwMAAAN+l4+UuGKMNAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAExSURBVDhPY6AYTJnQ9J9YHBsd9B+qDQFAEqeObfpPDLA0 + 1cBvAIMKJoaJgwBBAwgBggbMnj0bBSOLgQDtXXD06FE4BgH0sCib84IyFxTPfPrfr+woqiHIBuzevRuM + X7x4AbatYNqj/xl9t8A4vvXi/6wJt/9nz/r+XztiHcIQXC4omvHk/7LDv//P2/f3/+Ttf/+3rvv3v3bF + ///5c3/8D2x+ijAEFDDYcM6ke/+n7/zzv2Lp3/+58/7+j5v8539kz6f/wS1P//tU3/jvmHcM1SXoILX7 + +v+m1X//x0z4/j+q99P/sI43//3r7/33KLv43ynvyH/DsEW4NYNAbPP5/8ruk/6res8CY3X/Rf81Q1b/ + t8/a/18rYAF+zbiAqu/c/xp+c8nTDAIqntPQNDMwAADW1uqs2ammdwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACzSURBVDhPY6AJOP/ozH8okzyQMCPh//mHp8k3BGSAQ4XB + /3MPTpFnSMKMgP8bbiwAG3L2wUnSDQmYEPC/4EAB3JAz90+QZkhAhwPYABBOWBAAMeTeceINcWgAGrAh + AaK5weC/QYHCf4UMgf+XbhAZsAZATciaBRIYiNcMAgYVCiiaL1wnMQwUgBphms9fJcHvMADyL0jz2ctH + SdcMAgIJAv9PXzxEnmYQOHnhAPma6QwYGABknnWSB9LZUAAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 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k2crElh1qxBQoX + Wba5c3wKtsGWssEmpjwR0ir06ZMq31yklY5F9Qkpv5oKk4lPUEa23uFYeUKX7xaW2Qxplc6WHPwPCF89 + 4bUcjLttyQAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAABJoAAASaAFMBYDFAAABkElE + QVQ4T42Ry0sCURjFB3dtg/6DwEUUboII1y5NgpCgB7QJirQiIcrUiB6L1LQyzcwU8tVz0a7HP1Agau6q + hUVRhraeWZzm3rzjo1E88GPmm3vOmY8ZDoBEciMpXspzPWRFwq+nryBXMssF5aAiocJdAfy5gLzrm5bU + GutBw7mLHPgTAbz3j8+tr6ZLuIguimvjDQrHRfD+UolPwLv3A1tal+iRDzK4aF8Mqal0uSQooBAowtO/ + B3OXWfSAG3ZxqISFCVy8P4HURBpZYxY307d49r7AoXHiQB2ApctSZWZUllDFdHGkJzPIGB5hUVkRVAdh + 73bA3LkkGWthJZLiugTuxx/oW3d7PFjoWKSnlaFaSAkNM5FNrCobTEqTdCAXZNACNjDNtM/S4TB+BU/o + DM79KNa3j0RL2TNaWr+qoBmIhtwcRnYU4tigIHJ5DbpBmG0QwrLdD/1KK0bcCgxutki/81+4EUTaOSUG + VtvEsfSM3VRii/2AMB/Ow+B7w5jzCfq1rPQRNOO9oq1BQfOA+wWzN5gGZVZ+LgAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAr/AAAK/wE0YpqCAAACBUlE + QVQ4T5WRy08TYRTF528xRhfGCguNMaxdaoMbN65NNAhqWKil6MZHItAGrUUhjfFRSh9s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jQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGcSURBVDhPrZJLS0JRFIX9CQ4b3kGDoAZ3VOFA7qArVIO0 + kZAaESKVAxHtoVkhSBaEkwYlSI2zWwaVvUjSfCLm2zR60Q9ZXU9qiM+gBXty9l7f2WefLfgXpZ4SWNIt + IuT3o3L0N3EeNxiGwdjYKG693raQRDyMfedufQ3HubFoNIAeZgjItedsgBTyadx4zyGXymE2Ldfni8U8 + Ag8+GHlIGVCO9TULPt5KpLBUzEG/ZCbnlo0VZFPx1l0eHrhqkC37JiJBP+xW24951YRsOtHaXFUsGsS0 + SkWeJBKJSChm1Mhnk53NVd1cX4KmaTA8RMKyKOTS3ZszfJvsuIwASPAQVsx2B8imk8RM9dGYm9XA57uD + UjFFQDsOR3tIPpMCy46AoigolQq8lgrE8Mx/odGgJ7OIhAPNIV+f79Bq5zHQ2w+JRILQ4+9WlgHlAUql + EzDodc0BJ8dHEPZQpHWbfRsv/G5UUjXFIkEMiQcR9N83QtatqxAKhZiUyfAUjzW/hZdlw4qri7PGfCQU + gGZBDc8p19JcVSoR7VjTpQSCb8pj/goNN/8AAAAAAElFTkSuQmCC + + + + 704, 17 + + + 975, 17 + + + 1115, 17 + + + 1251, 17 + + + 233, 56 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmV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G + eK9k2/LBRzp+/q81DH8BbugBLfx5TJkAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACzSURBVDhPY6AJOP/ozH8okzyQMCPh//mHp8k3BGSAQ4XB + /3MPTpFnSMKMgP8bbiwAG3L2wUnSDQmYEPC/4EAB3JAz90+QZkhAhwPYABBOWBAAMeTeceINcWgAGrAh + AaK5weC/QYHCf4UMgf+XbhAZsAZATciaBRIYiNcMAgYVCiiaL1wnMQwUgBphms9fJcHvMADyL0jz2ctH + SdcMAgIJAv9PXzxEnmYQOHnhAPma6QwYGABknnWSB9LZUAAAAABJRU5ErkJggg== + + + + 304, 17 + + + 151, 17 + + + 343, 56 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAYklEQVQ4T2P4//8/RRhMTOip+U8qtjTV + AGpFMuDUsU1gTCygrQEMQGFkDAJr1qyBYxCgjxcYVBAYBOjvAmR/I9sOArR1AXoMYAP0CQN8AMWA2Ogg + sACpGG4AJRirIPH4PwMAAVAeufM171AAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHLSURBVDhPxZJbaxNRFIXzGxTUJ7FgvSDVRmumuTTJxNji + JRIQI2lBxNZEEduZkLyrD7USapLXtLENjNQkMDLm0jT3f/Y5Z4xISJD45ILDgdl7r7VmnW0bDAaUSiXi + r19xWCzS7/ex/Qt6vR67u5+R5SDLKyvk83nEt2F5BN1uF8MwSKfTf+qiOZPJsr4eQ3Iu4Z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/1X//////5mP//////AP//9V//////iZj//////wD/ + //Vf/////4mY///////////1X/////+JmP//////////9V//////+Zn///+f//////Vf//////iZj//5 + n//////1X///////iZj/mZ//////9V////////iZmYif//////Vf///////////////////1X/REj//0 + RET/giIiIo//9V//SP///3RI//gi/4Ii//Vf/4T///hEf//4Iv/4Io/1X//0RERERI//+CL/+CKP9V// + +E//hEf///gi//gij/Vf//hI/3RI///4Iv+CKP/1X///dPhEf///+CIiIo//9V///4SHRI////gi/4Io + //Vf///3REf////4Iv/yJ//1X///+ERI////+CL/8if/9V////REf/////gi/4Io//Vf////hI////+C + IiIij//1X///////////////////9VVVVVVVVVVVVVVVVVVVVVUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Form1OpenFromHelp.cs b/VisualPascalABCNETLinux/Form1OpenFromHelp.cs new file mode 100644 index 000000000..e69de29bb diff --git a/VisualPascalABCNETLinux/GotoLine.Designer.cs b/VisualPascalABCNETLinux/GotoLine.Designer.cs new file mode 100644 index 000000000..0b8484845 --- /dev/null +++ b/VisualPascalABCNETLinux/GotoLine.Designer.cs @@ -0,0 +1,104 @@ +namespace VisualPascalABC +{ + partial class GotoLineForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btOk = new System.Windows.Forms.Button(); + this.btCancel = new System.Windows.Forms.Button(); + this.tbLineNumber = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btOk + // + this.btOk.Location = new System.Drawing.Point(76, 56); + this.btOk.Name = "btOk"; + this.btOk.Size = new System.Drawing.Size(75, 23); + this.btOk.TabIndex = 0; + this.btOk.Text = "!OK"; + this.btOk.UseVisualStyleBackColor = true; + this.btOk.Click += new System.EventHandler(this.btOk_Click); + // + // btCancel + // + this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btCancel.Location = new System.Drawing.Point(157, 56); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(75, 23); + this.btCancel.TabIndex = 1; + this.btCancel.Text = "!CANCEL"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // + // tbLineNumber + // + this.tbLineNumber.Location = new System.Drawing.Point(10, 30); + this.tbLineNumber.Name = "tbLineNumber"; + this.tbLineNumber.Size = new System.Drawing.Size(222, 20); + this.tbLineNumber.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(7, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 13); + this.label1.TabIndex = 3; + this.label1.Text = "_text"; + // + // GotoLineForm + // + this.AcceptButton = this.btOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btCancel; + this.ClientSize = new System.Drawing.Size(244, 87); + this.Controls.Add(this.label1); + this.Controls.Add(this.tbLineNumber); + this.Controls.Add(this.btCancel); + this.Controls.Add(this.btOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "GotoLineForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FORMTEXT"; + this.Load += new System.EventHandler(this.GotoLineForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + } + + #endregion + + private System.Windows.Forms.Button btOk; + private System.Windows.Forms.Button btCancel; + private System.Windows.Forms.TextBox tbLineNumber; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/GotoLine.cs b/VisualPascalABCNETLinux/GotoLine.cs new file mode 100644 index 000000000..53de99b94 --- /dev/null +++ b/VisualPascalABCNETLinux/GotoLine.cs @@ -0,0 +1,47 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class GotoLineForm : Form + { + Form1 MainForm; + public GotoLineForm() + { + InitializeComponent(); + } + + private void btCancel_Click(object sender, EventArgs e) + { + Close(); + } + + private void GotoLineForm_Load(object sender, EventArgs e) + { + this.ActiveControl = tbLineNumber; + MainForm = (Form1)this.Owner; + label1.Text = string.Format(PascalABCCompiler.StringResources.Get("VP_GOTOLINEFORM_GOTO_LINE_{0}_{1}"), + 1, MainForm.CurrentSyntaxEditor.LinesCount); + } + + private void btOk_Click(object sender, EventArgs e) + { + int line; + if (int.TryParse(tbLineNumber.Text, out line)) + if (line <= MainForm.CurrentSyntaxEditor.LinesCount) + { + Close(); + MainForm.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(MainForm.CurrentSourceFileName, line, 1, line, 1), VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + return; + } + this.ActiveControl = tbLineNumber; + } + } +} diff --git a/VisualPascalABCNETLinux/GotoLine.resx b/VisualPascalABCNETLinux/GotoLine.resx new file mode 100644 index 000000000..7080a7d11 --- /dev/null +++ b/VisualPascalABCNETLinux/GotoLine.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionActions.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionActions.cs new file mode 100644 index 000000000..64e79aa3f --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionActions.cs @@ -0,0 +1,724 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using System.IO; +using System.Threading; +using System.Text; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Gui; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Gui.InsightWindow; +using PascalABCCompiler; +using PascalABCCompiler.Parsers; + +namespace VisualPascalABC +{ + public class CodeCompletionActionsManager + { + static CodeCompletionProvider ccp; + public static CodeTemplateManager templateManager; + + public static void Rename(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + IDocument doc = textArea.Document; + string textContent = doc.TextContent; + ccp = new CodeCompletionProvider(); + string name = null; + string expressionResult = FindOnlyIdent(textContent, textArea, ref name).Trim(' ', '\n', '\t', '\r'); + string new_val = null; + List refers = ccp.Rename(expressionResult, name, textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref new_val); + if (refers == null || new_val == null) return; + int addit = 0; + PascalABCCompiler.SourceLocation tmp = new PascalABCCompiler.SourceLocation(null, 0, 0, 0, 0); + string file_name = null; + if (CodeCompletion.CodeCompletionNameHelper.Helper.IsKeyword(new_val)) + new_val = "&" + new_val; + foreach (SymbolsViewerSymbol svs in refers) + { + if (svs.SourceLocation.BeginPosition.Line != tmp.BeginPosition.Line) + addit = 0; + else if (svs.SourceLocation.BeginPosition.Column < tmp.BeginPosition.Column) + addit = 0; + if (svs.SourceLocation.FileName != file_name) + { + CodeFileDocumentControl cfdoc = VisualPABCSingleton.MainForm.FindTab(svs.SourceLocation.FileName); + if (cfdoc == null) continue; + doc = cfdoc.TextEditor.ActiveTextAreaControl.TextArea.Document; + file_name = svs.SourceLocation.FileName; + } + tmp = svs.SourceLocation; + TextLocation tl_beg = new TextLocation(svs.SourceLocation.BeginPosition.Column - 1 + addit, svs.SourceLocation.BeginPosition.Line - 1); + //TextLocation tl_end = new TextLocation(svs.SourceLocation.EndPosition.Line,svs.SourceLocation.EndPosition.Column); + int offset = doc.PositionToOffset(tl_beg); + + addit += new_val.Length - name.Length; + doc.Replace(offset, name.Length, new_val); + doc.CommitUpdate(); + } + } + + public static void RenameUnit(string FileName, string new_val) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + ccp = new CodeCompletionProvider(); + IDocument doc = null; + CodeCompletion.CodeCompletionController controller = new CodeCompletion.CodeCompletionController(); + string text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(FileName, PascalABCCompiler.SourceFileOperation.GetText) as string; + PascalABCCompiler.SyntaxTree.compilation_unit cu = controller.ParseOnlySyntaxTree(FileName, text); + PascalABCCompiler.SyntaxTree.ident unitName = null; + if (cu is PascalABCCompiler.SyntaxTree.unit_module) + { + unitName = (cu as PascalABCCompiler.SyntaxTree.unit_module).unit_name.idunit_name; + } + else if (cu is PascalABCCompiler.SyntaxTree.program_module) + { + if ((cu as PascalABCCompiler.SyntaxTree.program_module).program_name == null) + return; + unitName = (cu as PascalABCCompiler.SyntaxTree.program_module).program_name.prog_name; + } + if (unitName.source_context == null) + return; + List refers = ccp.Rename(unitName.name, unitName.name, FileName, unitName.source_context.begin_position.line_num, unitName.source_context.begin_position.column_num); + if (refers == null || new_val == null) return; + int addit = 0; + PascalABCCompiler.SourceLocation tmp = new PascalABCCompiler.SourceLocation(null, 0, 0, 0, 0); + string file_name = null; + VisualPABCSingleton.MainForm.StopTimer(); + WorkbenchServiceFactory.CodeCompletionParserController.StopParseThread(); + foreach (IFileInfo fi in ProjectFactory.Instance.CurrentProject.SourceFiles) + { + WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(fi.Path); + } + WorkbenchServiceFactory.CodeCompletionParserController.ParseInThread(); + foreach (SymbolsViewerSymbol svs in refers) + { + if (svs.SourceLocation.BeginPosition.Line != tmp.BeginPosition.Line) + addit = 0; + else if (svs.SourceLocation.BeginPosition.Column < tmp.BeginPosition.Column) + addit = 0; + if (svs.SourceLocation.FileName != file_name) + { + CodeFileDocumentControl cfdoc = VisualPABCSingleton.MainForm.FindTab(svs.SourceLocation.FileName); + if (cfdoc == null) continue; + doc = cfdoc.TextEditor.ActiveTextAreaControl.TextArea.Document; + file_name = svs.SourceLocation.FileName; + } + tmp = svs.SourceLocation; + TextLocation tl_beg = new TextLocation(svs.SourceLocation.BeginPosition.Column - 1, svs.SourceLocation.BeginPosition.Line - 1); + //TextLocation tl_end = new TextLocation(svs.SourceLocation.EndPosition.Line,svs.SourceLocation.EndPosition.Column); + int offset = doc.PositionToOffset(tl_beg); + //addit += new_val.Length - unitName.name.Length; + doc.Replace(offset, unitName.name.Length, new_val); + doc.CommitUpdate(); + } + WorkbenchServiceFactory.CodeCompletionParserController.RunParseThread(); + VisualPABCSingleton.MainForm.StartTimer(); + } + + public static List GetDefinitionPosition(TextArea textArea, bool only_check) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return new List(); + IDocument doc = textArea.Document; + string textContent = doc.TextContent; + ccp = new CodeCompletionProvider(); + string full_expr; + string expressionResult = FindFullExpression(textContent, textArea, out ccp.keyword, out full_expr); + if (expressionResult != null) + expressionResult = expressionResult.Trim(); + if (expressionResult != full_expr && full_expr.StartsWith("(")) + return new List(); + + if (full_expr != null && full_expr.Contains("^")) + full_expr = full_expr.Replace("^",""); + List poses = ccp.GetDefinition(full_expr, textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, only_check); + if (poses == null || poses.Count == 0) + poses = ccp.GetDefinition(expressionResult, textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, only_check); + return poses; + } + + public static List GetRealizationPosition(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return new List(); + IDocument doc = textArea.Document; + string textContent = doc.TextContent; + ccp = new CodeCompletionProvider(); + string full_expr; + string expressionResult = FindFullExpression(textContent, textArea, out ccp.keyword, out full_expr); + List poses = ccp.GetRealization(full_expr, textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column); + if (poses == null || poses.Count == 0) + poses = ccp.GetRealization(expressionResult, textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column); + return poses; + } + + public static List FindReferences(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return new List(); + ccp = new CodeCompletionProvider(); + string full_expr; + string expressionResult = FindFullExpression(textArea.Document.TextContent, textArea, out ccp.keyword, out full_expr); + return ccp.FindReferences(expressionResult, textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, false); + } + + public static void GotoRealization(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + position = GetRealizationPosition(textArea); + if (position == null || position.Count == 0) return; + if (position.Count == 1) + { + Position pos = position[0]; + if (pos.file_name != null) + { + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteSourceLocationAction( + new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.line, pos.column), VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + } + else + { + List svs_lst = new List(); + foreach (Position pos in position) + { + if (pos.file_name != null) + svs_lst.Add(new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.end_line, pos.end_column), CodeCompletionProvider.ImagesProvider.IconNumberGotoText)); + } + VisualPABCSingleton.MainForm.FindSymbolResults.showInThread = false; + VisualPABCSingleton.MainForm.ShowFindResults(svs_lst); + VisualPABCSingleton.MainForm.FindSymbolResults.showInThread = true; + + } + } + + public static bool CanGoTo(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + List poses = GetDefinitionPosition(textArea, true); + if (poses == null || poses.Count == 0) return false; + foreach (Position pos in poses) + if (pos.from_metadata || pos.file_name != null && (bool)WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(pos.file_name, PascalABCCompiler.SourceFileOperation.Exists)) + return true; + return false; + //string file_name = GetDefinitionPosition(textArea).file_name; + //return file_name != null && (bool)VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.SourceFilesProvider(file_name, PascalABCCompiler.SourceFileOperation.Exists); + } + + public static bool CanGoToRealization(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + List poses = GetRealizationPosition(textArea); + if (poses == null || poses.Count == 0) return false; + foreach (Position pos in poses) + if (pos.file_name != null && (bool)WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(pos.file_name, PascalABCCompiler.SourceFileOperation.Exists)) + return true; + return false; + // string file_name = GetRealizationPosition(textArea).file_name; + // return file_name != null && (bool)VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.SourceFilesProvider(file_name, PascalABCCompiler.SourceFileOperation.Exists); + } + + public static bool CanFindReferences(TextArea textArea) + { + try + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + ccp = new CodeCompletionProvider(); + string full_expr; + string expressionResult = FindFullExpression(textArea.Document.TextContent, textArea, out ccp.keyword, out full_expr); + if (expressionResult != null) + { + expressionResult = expressionResult.Trim(' ', '\n', '\t', '\r'); + return expressionResult != null && expressionResult != ""; + } + return expressionResult != null && expressionResult != ""; + } + catch (Exception e) + { + return false; + } + } + + public static bool CanGenerateRealization(TextArea textArea) + { + try + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + ccp = new CodeCompletionProvider(); + Position pos = new Position(); + //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos); + string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea); + return text != null && pos.file_name != null; + } + catch (Exception e) + { + return false; + } + } + + public static void GenerateMethodImplementationHeaders(TextArea textArea) + { + try + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + ccp = new CodeCompletionProvider(); + Position pos = new Position(); + //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos); + string text = ccp.GetMethodImplementationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea); + if (!string.IsNullOrEmpty(text) && pos.file_name != null) + { + textArea.Caret.Line = pos.line - 1; + textArea.Caret.Column = 0; + textArea.InsertString(text); + textArea.Caret.Line = pos.line - 1; + textArea.Caret.Column = 0; + } + } + catch (System.Exception e) + { + + } + } + private static PABCNETCodeCompletionWindow codeCompletionWindow; + private static TextArea _textArea; + public static void GenerateOverridableMethods(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + ccp = new CodeCompletionProvider(); + _textArea = textArea; + int off = textArea.Caret.Offset; + codeCompletionWindow = PABCNETCodeCompletionWindow.ShowOverridableMethodsCompletionWindows + (VisualPABCSingleton.MainForm, textArea.MotherTextEditorControl, textArea.MotherTextEditorControl.FileName, ccp); + CodeCompletionAllNamesAction.comp_windows[textArea] = codeCompletionWindow; + if (codeCompletionWindow != null) + { + // ShowCompletionWindow can return null when the provider returns an empty list + codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow); + } + } + + private static void CloseCodeCompletionWindow(object sender, EventArgs e) + { + if (codeCompletionWindow != null) + { + codeCompletionWindow.Closed -= new EventHandler(CloseCodeCompletionWindow); + CodeCompletionProvider.disp.Reset(); + codeCompletionWindow.Dispose(); + CodeCompletion.AssemblyDocCache.Reset(); + CodeCompletion.UnitDocCache.Reset(); + codeCompletionWindow = null; + } + CodeCompletionAllNamesAction.comp_windows[_textArea] = null; + } + + public static void GenerateClassOrMethodRealization(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + ccp = new CodeCompletionProvider(); + Position pos = new Position(); + //string text = "procedure Test(a : integer);\n begin \n x := 1; \n end;";//ccp.GetRealizationTextToAdd(out pos); + string text = ccp.GetRealizationTextToAdd(textArea.MotherTextEditorControl.FileName, textArea.Caret.Line, textArea.Caret.Column, ref pos, textArea); + if (text != null && pos.file_name != null) + { + textArea.Caret.Line = pos.line - 1; + textArea.Caret.Column = pos.column - 1; + textArea.InsertString(text); + textArea.Caret.Line = pos.line + 4 - 1; + textArea.Caret.Column = VisualPABCSingleton.MainForm.UserOptions.CursorTabCount + 1; + } + } + + private static void find_cursor_pos(string s, out int line, out int col) + { + line = 0; + col = 0; + for (int i = 0; i < s.Length; i++) + if (s[i] == '\n') + { + line++; + col = 0; + } + else if (s[i] == '|') + { + break; + } + else + { + col++; + } + } + + public static void GenerateTemplate(string pattern, TextArea textArea) => GenerateTemplate(pattern, textArea, templateManager); + + public static void GenerateTemplate(string pattern, TextArea textArea, CodeTemplateManager templateManager, bool withPatternLength = true, Func PostAction = null) + { + try + { + StringBuilder sb = new StringBuilder(); + IDocument doc = textArea.Document; + + if (textArea.SelectionManager.HasSomethingSelected) // удаление выделенного + { + var isel = textArea.SelectionManager.SelectionCollection[0]; + textArea.Caret.Line = isel.StartPosition.Line; + textArea.Caret.Column = isel.StartPosition.Column; + textArea.SelectionManager.RemoveSelectedText(); + } + + int line = textArea.Caret.Line; + int col = textArea.Caret.Column; + string name = templateManager.GetTemplateHeader(pattern); + if (name == null) return; + string templ = templateManager.GetTemplate(name); + int ind = withPatternLength ? pattern.Length : 0; + int cline; + int ccol; + find_cursor_pos(templ, out cline, out ccol); + sb.Append(templ); + int cur_ind = templ.IndexOf('|'); + if (cur_ind != -1) + sb = sb.Remove(cur_ind, 1); + sb = sb.Replace("", Path.GetFileNameWithoutExtension(textArea.MotherTextEditorControl.FileName)); + templ = sb.ToString(); + int i = 0; + i = templ.IndexOf('\n', i); + while (i != -1) + { + if (i + 1 < sb.Length) + sb.Insert(i + 1, " ", col - ind); + i = sb.ToString().IndexOf('\n', i + 1); + } + TextLocation tl_beg = new TextLocation(col - ind, line); + int offset = doc.PositionToOffset(tl_beg); + doc.Replace(offset, ind, ""); + doc.CommitUpdate(); + textArea.Caret.Column = col - ind; + var sbs = sb.ToString(); + if (PostAction != null) + { + sbs = PostAction(sbs); + } + textArea.InsertString(sbs); + textArea.Caret.Line = line + cline; + textArea.Caret.Column = col - ind + ccol; + } + catch (Exception e) + { + + } + } + + private static bool should_insert_comment(TextArea textArea) + { + string content = textArea.Document.TextContent; + LineSegment seg = textArea.Document.GetLineSegment(textArea.Caret.Line); + string line = textArea.Document.GetText(seg); + if (line.Trim(' ', '\t') != "//") + return false; + if (textArea.Caret.Line + 1 >= textArea.Document.TotalNumberOfLines) + return false; + return true; + } + + private static string get_next_line(TextArea textArea) + { + if (textArea.Caret.Line + 1 >= textArea.Document.TotalNumberOfLines) + return null; + LineSegment seg = textArea.Document.GetLineSegment(textArea.Caret.Line + 1); + return textArea.Document.GetText(seg).Trim(' ', '\t'); + } + + private static string get_possible_description(TextArea textArea, out int len) + { + LineSegment seg = textArea.Document.GetLineSegment(textArea.Caret.Line); + len = 0; + string s = textArea.Document.GetText(seg).TrimStart(' ', '\t'); + if (s != "///" && s.StartsWith("///")) + { + len = s.Length - 3; + return s.Substring(3).Trim(' ', '\t'); + } + return null; + } + + public static bool GenerateCommentTemplate(TextArea textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + ccp = new CodeCompletionProvider(); + //if (!should_insert_comment(textArea)) + // return false; + string lineText = get_next_line(textArea); + string addit = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.GetDocumentTemplate( + lineText, textArea.Document.TextContent, textArea.Caret.Line, textArea.Caret.Column, textArea.Caret.Offset); + if (addit == null) + return false; + int col = textArea.Caret.Column; + int line = textArea.Caret.Line; + int len; + string desc = get_possible_description(textArea, out len); + StringBuilder sb = new StringBuilder(); + sb.AppendLine(" "); + for (int i = 0; i < col - 3; i++) + sb.Append(' '); + sb.Append("/// "); + if (desc != null) + sb.Append(desc); + sb.AppendLine(); + for (int i = 0; i < col - 3; i++) + sb.Append(' '); + sb.Append("/// "); + if (addit != "") + { + sb.Append(addit); + } + if (desc == null) + textArea.InsertString(sb.ToString()); + else + { + IDocument doc = textArea.Document; + TextLocation tl_beg = new TextLocation(col, line); + //TextLocation tl_end = new TextLocation(svs.SourceLocation.EndPosition.Line,svs.SourceLocation.EndPosition.Column); + int offset = doc.PositionToOffset(tl_beg); + doc.Replace(offset, len, ""); + doc.CommitUpdate(); + textArea.InsertString(sb.ToString()); + } + textArea.Caret.Line = line + 1; + textArea.Caret.Column = col + 1; + return true; + } + + public static void GotoDefinition(TextArea _textArea) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + position = GetDefinitionPosition(_textArea, false); + if (position == null) return; + if (position.Count == 1) + { + Position pos = position[0]; + if (pos.file_name != null) + { + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteSourceLocationAction( + new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.line, pos.column), VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + else + if (pos.from_metadata) + { + WorkbenchServiceFactory.FileService.OpenTabWithText(pos.metadata_title, pos.metadata); + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteSourceLocationAction( + new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.line, pos.column), VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + } + else + { + List svs_lst = new List(); + foreach (Position pos in position) + { + if (pos.file_name != null) + svs_lst.Add(new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.end_line, pos.end_column), CodeCompletionProvider.ImagesProvider.IconNumberGotoText)); + } + VisualPABCSingleton.MainForm.FindSymbolResults.showInThread = false; + VisualPABCSingleton.MainForm.ShowFindResults(svs_lst); + VisualPABCSingleton.MainForm.FindSymbolResults.showInThread = true; + } + } + + private static string FindFullExpression(string Text, TextArea _textArea, out PascalABCCompiler.Parsers.KeywordKind keyw, out string full_expr) + { + keyw = PascalABCCompiler.Parsers.KeywordKind.None; + string expr_without_brackets = null; + full_expr = null; + if (CodeCompletion.CodeCompletionController.CurrentParser != null) + { + full_expr = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindExpressionFromAnyPosition(_textArea.Caret.Offset, Text, _textArea.Caret.Line, _textArea.Caret.Column, out keyw, out expr_without_brackets); + return expr_without_brackets; + } + return null; + } + + private static string FindOnlyIdent(string Text, TextArea _textArea, ref string name) + { + return CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindOnlyIdentifier(_textArea.Caret.Offset, Text, _textArea.Caret.Line, _textArea.Caret.Column, ref name); + } + + + private static List position; + } + + public class VirtualMethodsAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public override void Execute(TextArea textArea) + { + CodeCompletionActionsManager.GenerateOverridableMethods(textArea); + } + } + + public class ClassOrMethodRealizationAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public override void Execute(TextArea textArea) + { + CodeCompletionActionsManager.GenerateClassOrMethodRealization(textArea); + } + } + + public class GenerateMethodImplementationHeadersAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public override void Execute(TextArea textArea) + { + CodeCompletionActionsManager.GenerateMethodImplementationHeaders(textArea); + } + } + + public class GotoAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public override void Execute(TextArea textArea) + { + CodeCompletionActionsManager.GotoDefinition(textArea); + } + } + + public class CodeCompletionNamesOnlyInModuleAction : CodeCompletionAllNamesAction + { + public override void Execute(TextArea _textArea) + { + key = '\0'; + base.Execute(_textArea); + } + } + + public class CodeFormattingAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public override void Execute(TextArea textArea) + { + if (WorkbenchServiceFactory.DebuggerManager.IsRunning) + return; + WorkbenchServiceFactory.Workbench.ErrorsListWindow.ClearErrorList(); + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.DeselectAll(); + CodeFormatters.CodeFormatter cf = new CodeFormatters.CodeFormatter(VisualPABCSingleton.MainForm.UserOptions.TabIndent); + List Errors = new List(); + //PascalABCCompiler.SyntaxTree.syntax_tree_node sn = + // MainForm.VisualEnvironmentCompiler.Compiler.ParsersController.Compile( + // FileName, TextEditor.Text, null, Errors, PascalABCCompiler.Parsers.ParseMode.Normal); + string text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName, PascalABCCompiler.SourceFileOperation.GetText) as string; + PascalABCCompiler.SyntaxTree.compilation_unit cu = + CodeCompletion.CodeCompletionController.ParsersController.GetCompilationUnitForFormatter( + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName, + text, //VisualPascalABC.Form1.Form1_object._currentCodeFileDocument.TextEditor.Text, + Errors, + new List()); + if (Errors.Count == 0) + { + string formattedText = cf.FormatTree(text, cu, textArea.Caret.Line + 1, textArea.Caret.Column + 1); + bool success = true; + if (success) + { + //WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteAction(VisualPascalABCPlugins.VisualEnvironmentCompilerAction.SetCurrentSourceFileTextFormatting, ""); + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteAction(VisualPascalABCPlugins.VisualEnvironmentCompilerAction.SetCurrentSourceFileTextFormatting, formattedText); + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteSourceLocationAction( + new PascalABCCompiler.SourceLocation(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName, cf.Line, cf.Column, cf.Line, cf.Column), VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + } + else if (!(Errors[0] is PascalABCCompiler.Errors.ParserBadFileExtension)) + { + WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.ExecuteAction(VisualPascalABCPlugins.VisualEnvironmentCompilerAction.AddMessageToErrorListWindow, new List(new PascalABCCompiler.Errors.Error[] { Errors[0] })); + } + } + } + + public class CodeCompletionAllNamesAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + PABCNETCodeCompletionWindow codeCompletionWindow; + public static TextArea textArea; + public static Hashtable comp_windows = new Hashtable(); + public static bool is_begin = false; + protected char key = '_'; + + private string get_prev_text(string text, int off) + { + StringBuilder sb = new StringBuilder(); + while (off >= 0 && char.IsLetterOrDigit(text[off])) + { + sb.Insert(0, text[off--]); + } + return sb.ToString(); + } + + public override void Execute(TextArea _textArea) + { + //try + { + textArea = _textArea; + int off = textArea.Caret.Offset; + string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset); + if (key == '\0') + if (off > 2 && text[off - 1] == '/' && text[off - 2] == '/' && text[off - 3] == '/') + { + CodeCompletionActionsManager.GenerateCommentTemplate(textArea); + return; + } + else + { + string prev = get_prev_text(text, off - 1); + if (!string.IsNullOrEmpty(prev)) + { + CodeCompletionActionsManager.GenerateTemplate(prev, textArea); + return; + } + } + if (!WorkbenchServiceFactory.Workbench.UserOptions.CodeCompletionDot) + return; + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return; + CodeCompletionProvider completionDataProvider = new CodeCompletionProvider(); + + bool is_pattern = false; + + + is_begin = true; + + completionDataProvider.preSelection = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindPattern(off, text, out is_pattern); + + if (!is_pattern && off > 0 && text[off - 1] == '.') + key = '$'; + codeCompletionWindow = PABCNETCodeCompletionWindow.ShowCompletionWindow( + VisualPABCSingleton.MainForm, // The parent window for the completion window + textArea.MotherTextEditorControl, // The text editor to show the window for + textArea.MotherTextEditorControl.FileName, // Filename - will be passed back to the provider + completionDataProvider, // Provider to get the list of possible completions + key, // Key pressed - will be passed to the provider + false, + false, + PascalABCCompiler.Parsers.KeywordKind.None + ); + key = '_'; + CodeCompletionNamesOnlyInModuleAction.comp_windows[textArea] = codeCompletionWindow; + + if (codeCompletionWindow != null) + { + // ShowCompletionWindow can return null when the provider returns an empty list + codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow); + } + } + //catch (Exception e) + { + + } + } + + public void CloseCodeCompletionWindow(object sender, EventArgs e) + { + if (codeCompletionWindow != null) + { + codeCompletionWindow.Closed -= new EventHandler(CloseCodeCompletionWindow); + CodeCompletionProvider.disp.Reset(); + CodeCompletion.AssemblyDocCache.Reset(); + CodeCompletion.UnitDocCache.Reset(); + codeCompletionWindow.Dispose(); + codeCompletionWindow = null; + } + comp_windows[textArea] = null; + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHelpers.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHelpers.cs new file mode 100644 index 000000000..41c692b96 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHelpers.cs @@ -0,0 +1,100 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Document; + +namespace VisualPascalABC +{ + /// + /// Класс, предназначенный для хранения последних выбранных методов в Intellisense + /// + public class CompletionDataDispatcher + { + private static Hashtable dict = new Hashtable(StringComparer.OrdinalIgnoreCase); + + public static void AddLastUsedItem(ICompletionData item) + { + if (item != null && item.Text != null && item.Text.Length > 0) + dict[item.Text[0].ToString()] = item; + } + + public static ICompletionData GetLastUsedItem(char ch) + { + return dict[ch.ToString()] as ICompletionData; + } + + private static CodeCompletion.SymScope cur_sc; + private static Hashtable ht = new Hashtable(); + + public static void AddMemberBeforeDot(CodeCompletion.SymScope sc) + { + cur_sc = sc; + } + + public static void BindMember(ICompletionData item) + { + if (cur_sc != null && item != null) + ht[cur_sc.GetFullName()] = item.Text; + cur_sc = null; + } + + public static string GetRecentUsedMember(CodeCompletion.SymScope sc) + { + return ht[sc.GetFullName()] as string; + } + } + + public class KeywordChecker + { + public static PascalABCCompiler.Parsers.KeywordKind TestForKeyword(string Text, int i) + { + if (CodeCompletion.CodeCompletionController.CurrentParser != null && CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation !=null) + return CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.TestForKeyword(Text, i); + return PascalABCCompiler.Parsers.KeywordKind.None; + } + + } + + /// + /// Класс-диспетчер, прицепляющий документацию к методам и классам. + /// Документация прицепляется в отдельном потоке + /// + public class DefaultDispatcher : CodeCompletion.AbstractDispatcher + { + private Dictionary dict = new Dictionary(); + private Dictionary dict2 = new Dictionary(); + public void Reset() + { + dict.Clear(); + dict2.Clear(); + } + + public void Add(PascalABCCompiler.Parsers.SymInfo si, ICompletionData data) + { + if (!dict.ContainsKey(si)) + dict[si] = data; + if (!string.IsNullOrEmpty(si.description) && !dict2.ContainsKey(si.description)) + dict2[si.description] = data; + } + + public override void Update(PascalABCCompiler.Parsers.SymInfo si) + { + ICompletionData val=null; + if (dict.TryGetValue(si,out val)) + { + val.Description = si.description; + } + else if (si.description != null && dict2.TryGetValue(si.description.Split('\n')[0], out val)) + { + val.Description = si.description; + } + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHighlighter.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHighlighter.cs new file mode 100644 index 000000000..6a0c2c907 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionHighlighter.cs @@ -0,0 +1,699 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using System.IO; +using CodeCompletion; + +namespace VisualPascalABC +{ + public class CodeCompletionHighlighter + { + private static Hashtable markers = new Hashtable(); + private static Hashtable highlighted_keywords = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + private static Hashtable ignored_keywords = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + + static CodeCompletionHighlighter() + { + highlighted_keywords["try"] = "try"; + highlighted_keywords["case"] = "case"; + highlighted_keywords["class"] = "class"; + highlighted_keywords["record"] = "record"; + highlighted_keywords["match"] = "match"; + highlighted_keywords["interface"] = "interface"; + //highlighted_keywords["interface"] = "interface"; + //ignored_keywords["class"] = "class"; + //ignored_keywords["record"] = "record"; + //ignored_keywords["interface"] = "interface"; + } + + public static void Highlight(TextArea textArea) + { + try + { + + int beg_off = -1; + int end_off = -1; + List marks = markers[textArea] as List; + if (marks == null) + { + marks = new List(); + markers[textArea] = marks; + } + RemoveMarkers(textArea); + string word = GetWordAtOffset(textArea, out beg_off, out end_off); + if (string.Compare(word, "begin", true) == 0 || string.Compare(word, "repeat", true) == 0 || highlighted_keywords[word] != null) + { + + if (string.Compare(word, "class", true) == 0) + { + if (isClassMember(beg_off, textArea)) + return; + if (isClassPredefinition(end_off, textArea)) + return; + } + else if (string.Compare(word, "record", true) == 0) + { + if (isClassPredefinition(end_off, textArea)) + return; + } + else if (string.Compare(word, "interface", true) == 0) + { + if (!isTypeDeclaration(beg_off, textArea)) + return; + if (isClassPredefinition(end_off, textArea)) + return; + } + TmpPos end_pos = null; + if (string.Compare(word, "repeat", true) != 0) + end_pos = GetPositionOfEnd(textArea, end_off); + else + end_pos = GetPositionOfUntil(textArea, end_off); + if (end_pos != null) + { + textArea.BeginUpdate(); + TextLocation Beg = textArea.Document.OffsetToPosition(beg_off); + TextLocation End = textArea.Document.OffsetToPosition(end_off); + TextMarker marker = new TextMarker(beg_off, word.Length, TextMarkerType.SolidBlock, System.Drawing.Color.FromArgb(219, 224, 204)); + marker.WholeLine = false; + textArea.Document.MarkerStrategy.AddMarker(marker); + marks.Add(marker); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, textArea.Document.GetLineNumberForOffset(beg_off))); + textArea.EndUpdate(); + textArea.BeginUpdate(); + Beg = textArea.Document.OffsetToPosition(end_pos.start_pos); + End = textArea.Document.OffsetToPosition(end_pos.start_pos + end_pos.len); + marker = new TextMarker(end_pos.start_pos, end_pos.len, TextMarkerType.SolidBlock, System.Drawing.Color.FromArgb(219, 224, 204)); + marker.WholeLine = false; + textArea.Document.MarkerStrategy.AddMarker(marker); + marks.Add(marker); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, textArea.Document.GetLineNumberForOffset(end_pos.start_pos))); + textArea.EndUpdate(); + textArea.Document.CommitUpdate(); + } + } + else if (string.Compare(word, "end", true) == 0 || string.Compare(word, "until", true) == 0) + { + TmpPos beg_pos = null; + if (string.Compare(word, "end", true) == 0) + beg_pos = GetPositionOfBegin(textArea, beg_off); + else + beg_pos = GetPositionOfRepeat(textArea, beg_off); + if (beg_pos != null) + { + textArea.BeginUpdate(); + TextLocation Beg = textArea.Document.OffsetToPosition(beg_off); + TextLocation End = textArea.Document.OffsetToPosition(end_off); + TextMarker marker = new TextMarker(beg_off, word.Length, TextMarkerType.SolidBlock, System.Drawing.Color.FromArgb(219, 224, 204)); + marker.WholeLine = false; + textArea.Document.MarkerStrategy.AddMarker(marker); + marks.Add(marker); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, textArea.Document.GetLineNumberForOffset(beg_off))); + textArea.EndUpdate(); + textArea.BeginUpdate(); + Beg = textArea.Document.OffsetToPosition(beg_pos.start_pos); + End = textArea.Document.OffsetToPosition(beg_pos.start_pos + beg_pos.len); + marker = new TextMarker(beg_pos.start_pos, beg_pos.len, TextMarkerType.SolidBlock, System.Drawing.Color.FromArgb(219, 224, 204)); + marker.WholeLine = false; + textArea.Document.MarkerStrategy.AddMarker(marker); + marks.Add(marker); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, textArea.Document.GetLineNumberForOffset(beg_pos.start_pos))); + textArea.EndUpdate(); + textArea.Document.CommitUpdate(); + } + } + } + catch (Exception e) + { +#if DEBUG + File.AppendAllText("log.txt", DateTime.Now + Environment.NewLine + e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine); +#endif + } + } + + private static bool remove_pred(TextMarker marker) + { + return true; + } + + private static bool isTypeDeclaration(int beg_off, TextArea textArea) + { + int off = beg_off - 1; + if (CheckForCommentOrKav(textArea.Document.TextContent, beg_off)) + return false; + if (off >= textArea.Document.TextContent.Length) + return false; + char c = textArea.Document.TextContent[off]; + if (textArea.Document.TextContent[beg_off] == '=') + return true; + while (char.IsWhiteSpace(c) || c == '}') + { + if (c == '}') + { + while (c != '{') + { + off--; + if (off < 0) + break; + c = textArea.Document.TextContent[off]; + } + } + off--; + if (off < 0) + return false; + c = textArea.Document.TextContent[off]; + } + c = char.ToLower(c); + if (c == '=') + { + return true; + } + return false; + } + + private static bool isClassPredefinition(int end_off, TextArea textArea) + { + int off = end_off; + if (off >= textArea.Document.TextContent.Length) + return true; + char c = textArea.Document.TextContent[off]; + while (char.IsWhiteSpace(c) || c == '{') + { + if (c == '{') + { + while (c != '}') + { + off++; + if (off >= textArea.Document.TextContent.Length) + break; + c = textArea.Document.TextContent[off]; + } + } + off++; + if (off >= textArea.Document.TextContent.Length) + break; + c = textArea.Document.TextContent[off]; + } + if (c == ';') + return true; + return false; + } + + private static bool isClassMember(int beg_off, TextArea textArea) + { + int off = beg_off - 1; + if (CheckForCommentOrKav(textArea.Document.TextContent, beg_off)) + return false; + if (off >= textArea.Document.TextContent.Length) + return false; + char c = textArea.Document.TextContent[off]; + if (textArea.Document.TextContent[beg_off] == '=') + c = '='; + while (char.IsWhiteSpace(c) || c == '}') + { + if (c == '}') + { + while (c != '{') + { + off--; + if (off < 0) + break; + c = textArea.Document.TextContent[off]; + } + } + off--; + if (off < 0) + return false; + c = textArea.Document.TextContent[off]; + } + c = char.ToLower(c); + if (c != '=' && c != 't' && c != 'd' && c != 'o' && c != '{' && c != 'c') + { + return true; + } + + + if (c == 't' || c == 'd' || c == 'o' || c == 'c') + { + StringBuilder keyword = new StringBuilder(); + + while (char.IsLetter(c)) + { + keyword.Insert(0, c); + off--; + if (off < 0) + break; + c = textArea.Document.TextContent[off]; + } + string keywordstr = keyword.ToString().ToLower(); + if (keywordstr == "sealed" || keywordstr == "abstract" || keywordstr == "auto") + { + return isClassMember(off, textArea); + } + if (keywordstr == "public" || keywordstr == "protected") + return true; + return false; + } + return false; + } + + private static void RemoveMarkers(TextArea textArea) + { + //textArea.Document.MarkerStrategy.RemoveAll(remove_pred); + List marks = markers[textArea] as List; + if (marks != null) + { + foreach (TextMarker marker in marks) + { + try + { + textArea.BeginUpdate(); + textArea.Document.MarkerStrategy.RemoveMarker(marker); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, textArea.Document.GetLineNumberForOffset(marker.Offset))); + textArea.EndUpdate(); + } + catch + { + + } + } + marks.Clear(); + } + textArea.Document.CommitUpdate(); + } + + class TmpPos + { + public int start_pos; + public int len; + public TmpPos(int start_pos, int len) + { + this.start_pos = start_pos; + this.len = len; + } + } + + private static TmpPos GetPositionOfUntil(TextArea textArea, int end_off) + { + string text = textArea.Document.TextContent; + int off = textArea.Caret.Offset; + if (CheckForCommentOrKavAhead(text, off - 1)) //proverka esli my v kommentarii ili v kavychkah + return null; + Stack beg_stack = new Stack(); + beg_stack.Push("repeat"); + StringBuilder sb = new StringBuilder(); + while (end_off < text.Length) + { + char c = text[end_off]; + if (char.IsLetterOrDigit(c) || c == '_' || c == '&') + { + sb.Append(c); + } + else if (c == '}')//okazalis vnutri kommentarija + { + return null; + } + + else if (c == '\'')//nachalo kavychek, propuskaem + { + end_off++; + while (end_off < text.Length && text[end_off] != '\'') + end_off++; + } + else + { + string word = sb.ToString(); + if (string.Compare(word, "repeat", true) == 0) + { + beg_stack.Push(word); + } + else if (string.Compare(word, "until", true) == 0) + { + //if (!CheckForCommentOrKavAhead(text, end_off)) + { + string s = beg_stack.Pop(); + if (beg_stack.Count == 0 && string.Compare(s, "repeat", true) == 0) + return new TmpPos(end_off - 5, word.Length); + if (beg_stack.Count == 0 && ignored_keywords[s] != null) + return null; + } + } + sb.Remove(0, sb.Length); + if (c == '{') + { + end_off++; + while (end_off < text.Length && text[end_off] != '}') + end_off++; + } + else if (c == '/' && end_off < text.Length - 1 && text[end_off + 1] == '/') + { + while (end_off < text.Length && text[end_off] != '\n') + end_off++; + } + } + end_off++; + } + if (string.Compare(sb.ToString(), "until", true) == 0 && beg_stack.Count > 0) + { + return new TmpPos(end_off - 5, 5); + } + return null; + } + + private static TmpPos GetPositionOfEnd(TextArea textArea, int end_off) + { + string text = textArea.Document.TextContent; + int off = textArea.Caret.Offset; + if (CheckForCommentOrKavAhead(text, off - 1)) //proverka esli my v kommentarii ili v kavychkah + return null; + Stack beg_stack = new Stack(); + beg_stack.Push("begin"); + StringBuilder sb = new StringBuilder(); + while (end_off < text.Length) + { + char c = text[end_off]; + if (char.IsLetterOrDigit(c) || c == '_' || c == '&' || c == '.') + { + sb.Append(c); + } + else if (c == '}')//okazalis vnutri kommentarija + { + return null; + } + else if (c == '\'')//nachalo kavychek, propuskaem + { + end_off++; + while (end_off < text.Length && text[end_off] != '\'') + end_off++; + } + else + { + string word = sb.ToString(); + if (string.Compare(word, "begin", true) == 0 || highlighted_keywords[word] != null || ignored_keywords[word] != null) + { + //if (!CheckForCommentOrKavAhead(text, end_off)) + if (string.Compare(word, "class", true) != 0 || !isClassMember(end_off, textArea)) + beg_stack.Push(word); + } + else if (string.Compare(word, "end", true) == 0) + { + //if (!CheckForCommentOrKavAhead(text, end_off)) + { + string s = beg_stack.Pop(); + if (beg_stack.Count == 0 && (string.Compare(s, "begin", true) == 0 || highlighted_keywords[s] != null)) + return new TmpPos(end_off - 3, word.Length); + if (beg_stack.Count == 0 && ignored_keywords[s] != null) + return null; + } + } + else if (string.Compare(word, "end.", true) == 0) + { + string s = beg_stack.Pop(); + if (beg_stack.Count == 0 && (string.Compare(s, "begin", true) == 0 || highlighted_keywords[s] != null)) + return new TmpPos(end_off - 4, word.Length - 1); + if (beg_stack.Count == 0 && ignored_keywords[s] != null) + return null; + } + sb.Remove(0, sb.Length); + if (c == '{') + { + end_off++; + while (end_off < text.Length && text[end_off] != '}') + end_off++; + } + else if (c == '/' && end_off < text.Length - 1 && text[end_off + 1] == '/') + { + while (end_off < text.Length && text[end_off] != '\n') + end_off++; + } + } + end_off++; + } + if (string.Compare(sb.ToString(), "end", true) == 0 && beg_stack.Count > 0) + { + return new TmpPos(end_off - 3, 3); + } + else if (string.Compare(sb.ToString(), "end.", true) == 0 && beg_stack.Count > 0) + { + return new TmpPos(end_off - 4, 3); + } + return null; + } + + private static TmpPos GetPositionOfBegin(TextArea textArea, int beg_off) + { + string text = textArea.Document.TextContent; + int off = textArea.Caret.Offset; + if (CheckForCommentOrKav(text, off))//zdes nado proverjat vpered i nazad + return null; + Stack beg_stack = new Stack(); + beg_stack.Push("end"); + StringBuilder sb = new StringBuilder(); + bool was_comment = false; + while (beg_off >= 0) + { + char c = text[beg_off]; + if (char.IsLetterOrDigit(c) || c == '_' || c == '&' || c == '.') + { + sb.Insert(0, c); + } + else if (c == '{')//v kommentarii, vyhodim + { + if (!was_comment) + return null; + } + + else if (c == '\'') + { + beg_off--; + while (beg_off >= 0 && text[beg_off] != '\'') + beg_off--; + } + else + { + string word = sb.ToString(); + if (string.Compare(word, "end", true) == 0) + { + if (!CheckForCommentOrKavAhead(text, beg_off))//esli end ne v kavychkah i ne v kommentarii + beg_stack.Push("end"); + } + else if (string.Compare(word, "begin", true) == 0 || highlighted_keywords[word] != null || ignored_keywords[word] != null) + { + if (!CheckForCommentOrKavAhead(text, beg_off)) + { + if (string.Compare(word, "class", true) == 0) + { + if (isClassMember(c == '}' ? beg_off + 1: beg_off, textArea)) + { + sb.Remove(0, sb.Length); + if (c != '}') + beg_off--; + continue; + } + } + beg_stack.Pop(); + if (beg_stack.Count == 0 && (string.Compare(word, "begin", true) == 0 || highlighted_keywords[word] != null)) + { + return new TmpPos(beg_off + 1, word.Length); + } + if (beg_stack.Count == 0 && ignored_keywords[word] != null) + return null; + } + } + sb.Remove(0, sb.Length); + if (c == '}')//nachalo kommenta + { + beg_off--; + was_comment = true; + while (beg_off >= 0 && text[beg_off] != '{') + beg_off--; + } + } + beg_off--; + } + string s = sb.ToString(); + if ((string.Compare(s, "begin", true) == 0 || highlighted_keywords[s] != null) && beg_stack.Count > 0) + { + return new TmpPos(beg_off + 1, s.Length); + } + return null; + } + + private static TmpPos GetPositionOfRepeat(TextArea textArea, int beg_off) + { + string text = textArea.Document.TextContent; + int off = textArea.Caret.Offset; + if (CheckForCommentOrKav(text, off))//zdes nado proverjat vpered i nazad + return null; + Stack beg_stack = new Stack(); + beg_stack.Push("until"); + StringBuilder sb = new StringBuilder(); + bool was_comment = false; + while (beg_off >= 0) + { + char c = text[beg_off]; + if (char.IsLetterOrDigit(c) || c == '_' || c == '&') + { + sb.Insert(0, c); + } + else if (c == '{')//v kommentarii, vyhodim + { + if (!was_comment) + return null; + } + else if (c == '\'') + { + beg_off--; + while (beg_off >= 0 && text[beg_off] != '\'') + beg_off--; + } + else + { + string word = sb.ToString(); + if (string.Compare(word, "until", true) == 0) + { + if (!CheckForCommentOrKavAhead(text, beg_off))//esli end ne v kavychkah i ne v kommentarii + beg_stack.Push("until"); + } + else if (string.Compare(word, "repeat", true) == 0) + { + if (!CheckForCommentOrKavAhead(text, beg_off)) + { + beg_stack.Pop(); + if (beg_stack.Count == 0 && string.Compare(word, "repeat", true) == 0) + { + return new TmpPos(beg_off + 1, word.Length); + } + if (beg_stack.Count == 0 && ignored_keywords[word] != null) + return null; + } + } + sb.Remove(0, sb.Length); + if (c == '}')//nachalo kommenta + { + beg_off--; + was_comment = true; + while (beg_off >= 0 && text[beg_off] != '{') + beg_off--; + } + } + beg_off--; + } + string s = sb.ToString(); + if (string.Compare(s, "repeat", true) == 0 && beg_stack.Count > 0) + { + return new TmpPos(beg_off + 1, s.Length); + } + return null; + } + + private static bool CheckForCommentOrKavAhead(string Text, int off) + { + int i = off; + Stack kav = new Stack(); + bool is_comm = false; + while (i >= 0 && !is_comm && Text[i] != '\n') + { + if (Text[i] == '\'') + { + if (kav.Count == 0) kav.Push('\''); + else kav.Pop(); + } + else if (Text[i] == '{') + { + if (kav.Count == 0) is_comm = true; + } + else if (Text[i] == '}') + { + return false; + } + else if (Text[i] == '/') + if (i > 0 && Text[i - 1] == '/' && kav.Count == 0) + is_comm = true; + i--; + } + return is_comm || kav.Count > 0; + } + + private static bool CheckForCommentOrKav(string Text, int off) + { + int i = off; + Stack kav = new Stack(); + bool is_comm = false; + while (i >= 0 && !is_comm && Text[i] != '\n') + { + if (Text[i] == '\'') + { + if (kav.Count == 0) kav.Push('\''); + else kav.Pop(); + } + else if (Text[i] == '{') + { + if (kav.Count == 0) is_comm = true; + } + else if (Text[i] == '}') + { + return false; + } + else if (Text[i] == '/') + if (i > 0 && Text[i - 1] == '/' && kav.Count == 0) + is_comm = true; + i--; + } + if (is_comm || kav.Count > 0) + return true; + i = off; + while (i < Text.Length && !is_comm && Text[i] != '\n') + { + if (Text[i] == '{') + return false; + if (Text[i] == '}') + { + return true; + } + i++; + } + return false; + } + + private static string GetWordAtOffset(TextArea textArea, out int beg_off, out int end_off) + { + string text = textArea.Document.TextContent; + int off = textArea.Caret.Offset; + StringBuilder sb = new StringBuilder(); + if (off < 0 || off >= text.Length /*|| !(char.IsLetterOrDigit(text[off]) || text[off]=='&' || text[off]=='_')*/) + { + beg_off = -1; + end_off = -1; + return ""; + } + if (off >= 1 && (off >= text.Length || !(char.IsLetterOrDigit(text[off]) || text[off] == '&' || text[off] == '_' || text[off] == '.')) && (char.IsLetterOrDigit(text[off - 1]) || text[off - 1] == '&' || text[off - 1] == '_' || text[off - 1] == '.')) + off--; + if (off < 0 || !(char.IsLetterOrDigit(text[off]) || text[off] == '&' || text[off] == '_')) + { + beg_off = -1; + end_off = -1; + return ""; + } + while (off >= 0 && off < text.Length && (char.IsLetterOrDigit(text[off]) || text[off] == '&' || text[off] == '_' || text[off] == '.')) + { + off--; + } + off++; + beg_off = off; + while (off < text.Length && (char.IsLetterOrDigit(text[off]) || text[off] == '&' || text[off] == '_')) + { + sb.Append(text[off]); + off++; + } + end_off = off; + return sb.ToString(); + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionImagesProvider.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionImagesProvider.cs new file mode 100644 index 000000000..c4009ef29 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionImagesProvider.cs @@ -0,0 +1,205 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public class CodeCompletionImagesProvider + { + ImageList images = new ImageList(); + public int IconNumberMethod = -1; + public int IconNumberField = -1; + public int IconNumberProperty = -1; + public int IconNumberEvent = -1; + public int IconNumberClass = -1; + public int IconNumberNamespace = -1; + public int IconNumberInterface = -1; + public int IconNumberStruct = -1; + public int IconNumberDelegate = -1; + public int IconNumberEnum = -1; + public int IconNumberLocal = -1; + public int IconNumberConstant = -1; + public int IconNumberPrivateField = -1; + public int IconNumberPrivateMethod = -1; + public int IconNumberPrivateProperty = -1; + public int IconNumberProtectedField = -1; + public int IconNumberProtectedMethod = -1; + public int IconNumberProtectedProperty = -1; + public int IconNumberPrivateEvent = -1; + public int IconNumberProtectedEvent = -1; + public int IconNumberPrivateDelegate = -1; + public int IconNumberProtectedDelegate = -1; + public int IconNumberUnitNamespace = -1; + public int IconNumberInternalField = -1; + public int IconNumberInternalMethod = -1; + public int IconNumberInternalProperty = -1; + public int IconNumberInternalEvent = -1; + public int IconNumberInternalDelegate = -1; + public int IconNumberGotoText = -1; + public int IconNumberPrivateConstant = -1; + public int IconNumberProtectedConstant = -1; + public int IconNumberInternalConstant = -1; + public int IconNumberKeyword = -1; + public int IconNumberEvalError = -1; + public int IconNumberExtensionMethod = -1; + + int AddImageFromManifestResource(string ResName) + { + images.Images.Add(new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources." + ResName))); + return images.Images.Count - 1; + } + + public ImageList ImageList + { + get + { + return images; + } + } + + public CodeCompletionImagesProvider() + { + images.ColorDepth = ColorDepth.Depth32Bit; + IconNumberMethod = AddImageFromManifestResource("Icons.16x16.Method.png"); + IconNumberField = AddImageFromManifestResource("Icons.16x16.Field.png"); + IconNumberProperty = AddImageFromManifestResource("Icons.16x16.Property.png"); + IconNumberEvent = AddImageFromManifestResource("Icons.16x16.Event.png"); + IconNumberClass = AddImageFromManifestResource("Icons.16x16.Class.png"); + IconNumberNamespace = AddImageFromManifestResource("Icons.16x16.NameSpace.png"); + IconNumberInterface = AddImageFromManifestResource("Icons.16x16.Interface.png"); + IconNumberStruct = AddImageFromManifestResource("Icons.16x16.Struct.png"); + IconNumberDelegate = AddImageFromManifestResource("Icons.16x16.Delegate.png"); + IconNumberEnum = AddImageFromManifestResource("Icons.16x16.Enum.png"); + IconNumberLocal = AddImageFromManifestResource("Icons.16x16.Local.png"); + IconNumberConstant = AddImageFromManifestResource("Icons.16x16.Literal.png"); + IconNumberPrivateField = AddImageFromManifestResource("Icons.16x16.PrivateField.png"); + IconNumberPrivateMethod = AddImageFromManifestResource("Icons.16x16.PrivateMethod.png"); + IconNumberPrivateProperty = AddImageFromManifestResource("Icons.16x16.PrivateProperty.png"); + IconNumberProtectedField = AddImageFromManifestResource("Icons.16x16.ProtectedField.png"); + IconNumberProtectedMethod = AddImageFromManifestResource("Icons.16x16.ProtectedMethod.png"); + IconNumberProtectedProperty = AddImageFromManifestResource("Icons.16x16.ProtectedProperty.png"); + IconNumberPrivateEvent = AddImageFromManifestResource("Icons.16x16.PrivateEvent.png"); + IconNumberProtectedEvent = AddImageFromManifestResource("Icons.16x16.ProtectedEvent.png"); + IconNumberPrivateDelegate = AddImageFromManifestResource("Icons.16x16.PrivateDelegate.png"); + IconNumberProtectedDelegate = AddImageFromManifestResource("Icons.16x16.ProtectedDelegate.png"); + IconNumberUnitNamespace = AddImageFromManifestResource("Icons.16x16.UnitNamespace.png"); + IconNumberInternalField = AddImageFromManifestResource("Icons.16x16.InternalField.png"); + IconNumberInternalMethod = AddImageFromManifestResource("Icons.16x16.InternalMethod.png"); + IconNumberInternalProperty = AddImageFromManifestResource("Icons.16x16.InternalProperty.png"); + IconNumberInternalEvent = AddImageFromManifestResource("Icons.16x16.InternalEvent.png"); + IconNumberInternalDelegate = AddImageFromManifestResource("Icons.16x16.InternalDelegate.png"); + IconNumberGotoText = AddImageFromManifestResource("Icons.16x16.GotoText.png"); + IconNumberInternalConstant = AddImageFromManifestResource("Icons.16x16.InternalConstant.png"); + IconNumberPrivateConstant = AddImageFromManifestResource("Icons.16x16.PrivateConstant.png"); + IconNumberProtectedConstant = AddImageFromManifestResource("Icons.16x16.ProtectedConstant.png"); + IconNumberKeyword = AddImageFromManifestResource("Icons.16x16.Keyword.png"); + IconNumberEvalError = AddImageFromManifestResource("Icons.16x16.ErrorInWatch.png"); + IconNumberExtensionMethod = AddImageFromManifestResource("Icons.16x16.ExtensionMethod.png"); + } + + public int GetPictureNum(PascalABCCompiler.Parsers.SymInfo si) + { + switch (si.kind) + { + + case PascalABCCompiler.Parsers.SymbolKind.Field: + switch (si.acc_mod) + { + case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer: + return IconNumberPrivateField; + case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer: + return IconNumberProtectedField; + case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer: + return IconNumberInternalField; + default: + return IconNumberField; + } + case PascalABCCompiler.Parsers.SymbolKind.Method: + switch (si.acc_mod) + { + case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer: + return IconNumberPrivateMethod; + case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer: + return IconNumberProtectedMethod; + case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer: + return IconNumberInternalMethod; + default: + if (si.description != null && si.description.Contains("(" + PascalABCCompiler.StringResources.Get("CODE_COMPLETION_EXTENSION"))) + return IconNumberExtensionMethod; + return IconNumberMethod; + } + case PascalABCCompiler.Parsers.SymbolKind.Property: + switch (si.acc_mod) + { + case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer: + return IconNumberPrivateProperty; + case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer: + return IconNumberProtectedProperty; + case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer: + return IconNumberInternalProperty; + default: + return IconNumberProperty; + } + case PascalABCCompiler.Parsers.SymbolKind.Event: + switch (si.acc_mod) + { + case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer: + return IconNumberPrivateEvent; + case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer: + return IconNumberProtectedEvent; + case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer: + return IconNumberInternalEvent; + default: + return IconNumberEvent; + } + case PascalABCCompiler.Parsers.SymbolKind.Delegate: + switch (si.acc_mod) + { + case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer: + return IconNumberPrivateDelegate; + case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer: + return IconNumberProtectedDelegate; + case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer: + return IconNumberInternalDelegate; + default: + return IconNumberDelegate; + } + case PascalABCCompiler.Parsers.SymbolKind.Variable: + case PascalABCCompiler.Parsers.SymbolKind.Parameter: + return IconNumberLocal; + case PascalABCCompiler.Parsers.SymbolKind.Type: + case PascalABCCompiler.Parsers.SymbolKind.Class: + return IconNumberClass; + case PascalABCCompiler.Parsers.SymbolKind.Namespace: + if (si.IsUnitNamespace) + return IconNumberUnitNamespace; + else + return IconNumberNamespace; + case PascalABCCompiler.Parsers.SymbolKind.Interface: + return IconNumberInterface; + case PascalABCCompiler.Parsers.SymbolKind.Struct: + return IconNumberStruct; + case PascalABCCompiler.Parsers.SymbolKind.Enum: + return IconNumberEnum; + case PascalABCCompiler.Parsers.SymbolKind.Constant: + switch (si.acc_mod) + { + case PascalABCCompiler.SyntaxTree.access_modifer.private_modifer: + return IconNumberPrivateConstant; + case PascalABCCompiler.SyntaxTree.access_modifer.protected_modifer: + return IconNumberProtectedConstant; + case PascalABCCompiler.SyntaxTree.access_modifer.internal_modifer: + return IconNumberInternalConstant; + default: + return IconNumberConstant; + } + } + return IconNumberMethod; + } + + + } +} diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionKeyHandler.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionKeyHandler.cs new file mode 100644 index 000000000..208e498c6 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionKeyHandler.cs @@ -0,0 +1,282 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using System.IO; +using System.Threading; + +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Gui; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Gui.InsightWindow; + +namespace VisualPascalABC +{ + + class CodeCompletionKeyHandler + { + public TextEditorControl editor; + public PABCNETCodeCompletionWindow codeCompletionWindow; + public PABCNETInsightWindow insightWindow; + public CodeCompletionProvider completionDataProvider; + + private static Hashtable ht = new Hashtable(); + + private CodeCompletionKeyHandler(TextEditorControl editor) + { + this.editor = editor; + } + + public static CodeCompletionKeyHandler Attach(TextEditorControl editor) + { + CodeCompletionKeyHandler h = new CodeCompletionKeyHandler(editor); + ht[editor] = h; + editor.ActiveTextAreaControl.TextArea.KeyEventHandler += h.TextAreaKeyEventHandler; + editor.ActiveTextAreaControl.TextArea.Caret.PositionChanged += h.CaretPositionChangedEventHandler; + //editor.ActiveTextAreaControl.TextArea.KeyDown += new System.Windows.Forms.KeyEventHandler(TextArea_KeyDown); + //editor.ActiveTextAreaControl.KeyDown += h.TextControlEventHandler; + // When the editor is disposed, close the code completion window + editor.Disposed += h.CloseCodeCompletionWindow; + return h; + } + + public static void Detach(TextEditorControl editor) + { + if (ht.ContainsKey(editor)) + ht.Remove(editor); + } + + void CaretPositionChangedEventHandler(object sender, EventArgs e) + { + if (!VisualPABCSingleton.MainForm.UserOptions.HighlightOperatorBrackets || WorkbenchServiceFactory.DebuggerManager.IsRunning) + return; + CodeCompletionHighlighter.Highlight(editor.ActiveTextAreaControl.TextArea); + } + + /// + /// Return true to handle the keypress, return false to let the text area handle the keypress + /// + bool TextAreaKeyEventHandler(char key) + { + if (!WorkbenchServiceFactory.Workbench.UserOptions.AllowCodeCompletion || !VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.compilerLoaded) + return false; + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + if (codeCompletionWindow != null) + { + // If completion window is open and wants to handle the key, don't let the text area + // handle it + if (codeCompletionWindow.ProcessKeyEvent(key)) + return true; + } + else + { + PABCNETCodeCompletionWindow ccw = CodeCompletionNamesOnlyInModuleAction.comp_windows[editor.ActiveTextAreaControl.TextArea] as PABCNETCodeCompletionWindow; + + if (ccw != null && CodeCompletionNamesOnlyInModuleAction.is_begin) + { + CodeCompletionNamesOnlyInModuleAction.is_begin = false; + if (key != ' ') + ccw.ProcessKeyEvent(key); + else + { + ccw.ProcessKeyEvent('_'); + ccw.Close(); + } + + } + else if (ccw != null && ccw.ProcessKeyEvent(key)) + return true; + } + if (key == '.') + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) + return false; + if (!string.IsNullOrEmpty(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.SelectionManager.SelectedText)) + { + WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Position = WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.SelectionManager.SelectionCollection[0].StartPosition; + WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.SelectionManager.RemoveSelectedText(); + } + + if (WorkbenchServiceFactory.Workbench.UserOptions.CodeCompletionDot) + { + completionDataProvider = new CodeCompletionProvider(); + + codeCompletionWindow = PABCNETCodeCompletionWindow.ShowCompletionWindow( + VisualPABCSingleton.MainForm, // The parent window for the completion window + editor, // The text editor to show the window for + editor.FileName, // Filename - will be passed back to the provider + completionDataProvider, // Provider to get the list of possible completions + key, // Key pressed - will be passed to the provider + true, + true, + PascalABCCompiler.Parsers.KeywordKind.None + ); + editor.Focus(); + CodeCompletionNamesOnlyInModuleAction.is_begin = true; + CodeCompletionNamesOnlyInModuleAction.comp_windows[editor.ActiveTextAreaControl.TextArea] = codeCompletionWindow; + if (codeCompletionWindow != null) + codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow); + } + } + else if (key == '(' || key == '[' || key == ',') + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + if (VisualPABCSingleton.MainForm.UserOptions.CodeCompletionParams) + { + ICSharpCode.TextEditor.Gui.InsightWindow.IInsightDataProvider idp = new DefaultInsightDataProvider(-1, false, key); + if (insightWindow == null || insightWindow.InsightProviderStackLength == 0) + { + insightWindow = new PABCNETInsightWindow(VisualPABCSingleton.MainForm, editor); + insightWindow.Font = new Font(Constants.CompletionInsightWindowFontName, insightWindow.Font.Size); + insightWindow.Closed += new EventHandler(CloseInsightWindow); + } + else + { + (idp as DefaultInsightDataProvider).defaultIndex = insightWindow.GetCurrentData(); + (idp as DefaultInsightDataProvider).cur_param_num = (insightWindow.GetInsightProvider() as DefaultInsightDataProvider).param_count; + + } + insightWindow.AddInsightDataProvider(idp, editor.FileName); + insightWindow.ShowInsightWindow(); + editor.Focus(); + } + } + else if (key == ' ') + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + if (VisualPABCSingleton.MainForm.UserOptions.CodeCompletionDot) + { + PascalABCCompiler.Parsers.KeywordKind keyw = KeywordChecker.TestForKeyword(editor.Document.TextContent, editor.ActiveTextAreaControl.TextArea.Caret.Offset - 1); + if (keyw == PascalABCCompiler.Parsers.KeywordKind.New || keyw == PascalABCCompiler.Parsers.KeywordKind.Uses) + { + completionDataProvider = new CodeCompletionProvider(); + codeCompletionWindow = PABCNETCodeCompletionWindow.ShowCompletionWindow( + VisualPABCSingleton.MainForm, // The parent window for the completion window + editor, // The text editor to show the window for + editor.FileName, // Filename - will be passed back to the provider + completionDataProvider, // Provider to get the list of possible completions + ' ', // Key pressed - will be passed to the provider + true, + false, + keyw + ); + CodeCompletionNamesOnlyInModuleAction.comp_windows[editor.ActiveTextAreaControl.TextArea] = codeCompletionWindow; + if (codeCompletionWindow != null) + codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow); + //return true; + } + } + } + else if (key == '\n') + { + if (VisualPABCSingleton.MainForm.UserOptions.AllowCodeCompletion && CodeCompletion.CodeCompletionController.CurrentParser != null) + { + try + { + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[editor.FileName]; + if (dconv != null) + { + CodeCompletion.SymScope ss = dconv.FindScopeByLocation(editor.ActiveTextAreaControl.TextArea.Caret.Line + 1, editor.ActiveTextAreaControl.TextArea.Caret.Column + 1); + ss.IncreaseEndLine(); + } + } + catch + { + + } + } + } + else if (codeCompletionWindow == null && VisualPABCSingleton.MainForm.UserOptions.EnableSmartIntellisense && (char.IsLetter(key) || key == '_')) + { + if (VisualPABCSingleton.MainForm.UserOptions.CodeCompletionDot) + { + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + PascalABCCompiler.Parsers.KeywordKind keyw = KeywordChecker.TestForKeyword(editor.Document.TextContent, editor.ActiveTextAreaControl.TextArea.Caret.Offset - 1); + if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsDefinitionIdentifierAfterKeyword(keyw)) + return false; + + if (editor.ActiveTextAreaControl.TextArea.Caret.Offset > 0 && (char.IsLetterOrDigit(editor.Document.TextContent[editor.ActiveTextAreaControl.TextArea.Caret.Offset - 1]) || editor.Document.TextContent[editor.ActiveTextAreaControl.TextArea.Caret.Offset - 1] == '_')) + return false; + completionDataProvider = new CodeCompletionProvider(); + codeCompletionWindow = PABCNETCodeCompletionWindow.ShowCompletionWindowWithFirstChar( + VisualPABCSingleton.MainForm, // The parent window for the completion window + editor, // The text editor to show the window for + editor.FileName, // Filename - will be passed back to the provider + completionDataProvider, // Provider to get the list of possible completions + key, // Key pressed - will be passed to the provider + keyw + ); + CodeCompletionNamesOnlyInModuleAction.comp_windows[editor.ActiveTextAreaControl.TextArea] = codeCompletionWindow; + if (codeCompletionWindow != null) + codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow); + + } + } + /*else if (codeCompletionWindow == null && key == '\n') + { + if (mainForm.UserOptions.AllowCodeFormatting) + { + if (CodeCompletion.CodeCompletionController.currentParser == null) return false; + string bracket = CodeCompletion.CodeCompletionController.currentParser.LanguageInformation.GetBodyStartBracket(); + string end_bracket = CodeCompletion.CodeCompletionController.currentParser.LanguageInformation.GetBodyEndBracket(); + if (bracket != null) + { + int i = editor.ActiveTextAreaControl.TextArea.Caret.Offset-1; + int j = bracket.Length-1; + bool eq=true; + while (i >= 0 && j >= 0) + { + if (editor.Document.TextContent[i] != bracket[j]) + { + eq = false; + break; + } + i--; j--; + } + if (eq && j<0) + { + TextArea textArea = editor.ActiveTextAreaControl.TextArea; + int col = textArea.Caret.Column-bracket.Length; + textArea.InsertString("\n\n"+end_bracket); + textArea.Caret.Column = 0; + textArea.Caret.Line = textArea.Caret.Line-1; + textArea.Caret.Column = VisualPABCSingleton.MainForm.UserOptions.CursorTabCount+col; + return true; + } + } + } + }*/ + + return false; + } + + void CloseInsightWindow(object sender, EventArgs e) + { + if (insightWindow != null) + { + insightWindow.Closed -= new EventHandler(CloseInsightWindow); + insightWindow.Dispose(); + insightWindow = null; + } + } + + void CloseCodeCompletionWindow(object sender, EventArgs e) + { + if (codeCompletionWindow != null) + { + codeCompletionWindow.Closed -= new EventHandler(CloseCodeCompletionWindow); + CodeCompletionProvider.disp.Reset(); + CodeCompletion.AssemblyDocCache.Reset(); + CodeCompletion.UnitDocCache.Reset(); + codeCompletionWindow.Dispose(); + CodeCompletionNamesOnlyInModuleAction.comp_windows[editor.ActiveTextAreaControl.TextArea] = null; + codeCompletionWindow = null; + } + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionParserController.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionParserController.cs new file mode 100644 index 000000000..1d6870168 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionParserController.cs @@ -0,0 +1,283 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Document; + +namespace VisualPascalABC +{ + public delegate void ParseInformationUpdatedDelegate(object obj, string fileName); + + public class CodeCompletionParserController : VisualPascalABCPlugins.ICodeCompletionService + { + public static Hashtable open_files = new Hashtable(StringComparer.OrdinalIgnoreCase); + public VisualEnvironmentCompiler visualEnvironmentCompiler; + private System.Threading.Thread th = null; + private CodeCompletionProvider ccp; + public event ParseInformationUpdatedDelegate ParseInformationUpdated; + + public void StopParseThread() + { + try + { + if (th != null) + th.Abort(); + } + catch + { + } + } + + public CodeCompletionParserController() + { + this.th = new System.Threading.Thread(new System.Threading.ThreadStart(ParseInThread)); + ccp = new CodeCompletionProvider(); + } + + public PascalABCCompiler.Parsers.ICodeCompletionDomConverter GetConverter(string fileName) + { + return CodeCompletion.CodeCompletionController.comp_modules[fileName] as PascalABCCompiler.Parsers.ICodeCompletionDomConverter; + } + + public static string CurrentTwoLetterISO + { + get + { + return CodeCompletion.CodeCompletionController.currentLanguageISO; + } + set + { + CodeCompletion.CodeCompletionController.currentLanguageISO = value; + } + } + + public void Init() + { + CodeCompletion.CodeCompletionController.ParsersController.SourceFilesProvider = visualEnvironmentCompiler.SourceFilesProvider; + CodeCompletion.CodeCompletionController.currentLanguageISO = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + } + + public void RenameFile(string OldFileName, string NewFileName) + { + if (string.Compare(OldFileName, NewFileName, true) != 0) + { + CodeCompletion.CodeCompletionController.comp_modules[NewFileName] = CodeCompletion.CodeCompletionController.comp_modules[OldFileName]; + if (CodeCompletion.CodeCompletionController.comp_modules.ContainsKey(OldFileName)) + CodeCompletion.CodeCompletionController.comp_modules.Remove(OldFileName); + open_files[NewFileName] = open_files[OldFileName]; + if (open_files.ContainsKey(OldFileName)) + open_files.Remove(OldFileName); + } + } + + public void RegisterFileForParsing(string FileName) + { + open_files[FileName] = true; + CodeCompletion.CodeCompletionController.SetParser(System.IO.Path.GetExtension(FileName)); + //ParseAllFiles(); + } + + public void CloseFile(string FileName) + { + if (CodeCompletion.CodeCompletionController.comp_modules[FileName] != null) + CodeCompletion.CodeCompletionController.comp_modules.Remove(FileName); + if (open_files[FileName] != null) + open_files.Remove(FileName); + } + + public void SetAsChanged(string FileName) + { + if (FileName != null) + open_files[FileName] = true; + } + + public void SetAllInProjectChanged() + { + try + { + Hashtable open_files2 = open_files.Clone() as Hashtable; + foreach (string s in open_files2.Keys) + { + if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(s)) + open_files[s] = true; + } + } + catch (Exception e) + { + + } + } + + public void RunParseThread() + { + th = new System.Threading.Thread(InternalParsing); + th.Priority = System.Threading.ThreadPriority.BelowNormal; + th.IsBackground = true; + th.Start(); + } + + public void StopParsing() + { + try + { + VisualPABCSingleton.MainForm.StopTimer(); + } + catch + { + + } + } + + private void InternalParsing() + { + while (true) + { + ParseInThread(); + System.Threading.Thread.Sleep(2000); + } + } + + private long mem_delta = 0; + + internal void ParseInThread() + { + try + { + Hashtable open_files2 = (Hashtable)open_files.Clone(); + Hashtable recomp_files = new Hashtable(StringComparer.OrdinalIgnoreCase); + bool is_comp = false; + foreach (string FileName in open_files2.Keys) + { + //(ssyy) 18.05.08 Вставил проверку на null + object o = open_files[FileName]; + if (o != null && (bool)o == true) + { + is_comp = true; + CodeCompletion.CodeCompletionController controller = new CodeCompletion.CodeCompletionController(); + string text = visualEnvironmentCompiler.SourceFilesProvider(FileName, PascalABCCompiler.SourceFileOperation.GetText) as string; + if (string.IsNullOrEmpty(text)) + text = "begin end."; + CodeCompletion.DomConverter tmp = CodeCompletion.CodeCompletionController.comp_modules[FileName] as CodeCompletion.DomConverter; + long cur_mem = Environment.WorkingSet; + CodeCompletion.DomConverter dc = controller.Compile(FileName, text); + mem_delta += Environment.WorkingSet - cur_mem; + open_files[FileName] = false; + if (dc.is_compiled) + { + //CodeCompletion.CodeCompletionController.comp_modules.Remove(FileName); + if (tmp != null && tmp.visitor.entry_scope != null) + { + tmp.visitor.entry_scope.Clear(); + if (tmp.visitor.cur_scope != null) + tmp.visitor.cur_scope.Clear(); + } + CodeCompletion.CodeCompletionController.comp_modules[FileName] = dc; + recomp_files[FileName] = FileName; + open_files[FileName] = false; + if (ParseInformationUpdated != null) + ParseInformationUpdated(dc.visitor.entry_scope, FileName); + } + else if (CodeCompletion.CodeCompletionController.comp_modules[FileName] == null) + CodeCompletion.CodeCompletionController.comp_modules[FileName] = dc; + } + } + foreach (string FileName in open_files2.Keys) + { + CodeCompletion.DomConverter dc = CodeCompletion.CodeCompletionController.comp_modules[FileName] as CodeCompletion.DomConverter; + CodeCompletion.SymScope ss = null; + if (dc != null) + { + if (dc.visitor.entry_scope != null) ss = dc.visitor.entry_scope; + else if (dc.visitor.impl_scope != null) ss = dc.visitor.impl_scope; + int j = 0; + while (j < 2) + { + if (j == 0) + { + ss = dc.visitor.entry_scope; + j++; + } + else + { + ss = dc.visitor.impl_scope; + j++; + } + if (ss != null) + { + for (int i = 0; i < ss.used_units.Count; i++) + { + string s = ss.used_units[i].file_name; + if (s != null && open_files2.ContainsKey(s) && recomp_files.ContainsKey(s)) + { + is_comp = true; + CodeCompletion.CodeCompletionController controller = new CodeCompletion.CodeCompletionController(); + string text = visualEnvironmentCompiler.SourceFilesProvider(FileName, PascalABCCompiler.SourceFileOperation.GetText) as string; + CodeCompletion.DomConverter tmp = CodeCompletion.CodeCompletionController.comp_modules[FileName] as CodeCompletion.DomConverter; + long cur_mem = Environment.WorkingSet; + dc = controller.Compile(FileName, text); + mem_delta += Environment.WorkingSet - cur_mem; + open_files[FileName] = false; + CodeCompletion.CodeCompletionController.comp_modules[FileName] = dc; + if (dc.is_compiled) + { + /*if (tmp != null && tmp.stv.entry_scope != null) + { + tmp.stv.entry_scope.Clear(); + if (tmp.stv.cur_scope != null) tmp.stv.cur_scope.Clear(); + }*/ + CodeCompletion.CodeCompletionController.comp_modules[FileName] = dc; + recomp_files[FileName] = FileName; + ss.used_units[i] = dc.visitor.entry_scope; + if (ParseInformationUpdated != null) + ParseInformationUpdated(dc.visitor.entry_scope, FileName); + } + else if (CodeCompletion.CodeCompletionController.comp_modules[FileName] == null) + CodeCompletion.CodeCompletionController.comp_modules[FileName] = dc; + } + } + } + } + } + } + if (is_comp && mem_delta > 20000000 /*&& mem_delta > 10000000*/) + //postavil delta dlja pamjati, posle kototoj delaetsja sborka musora + { + mem_delta = 0; + GC.Collect(); + } + } + catch (Exception e) + { + + } + + } + + public bool IsParsing() + { + return th != null && th.ThreadState == System.Threading.ThreadState.Running; + } + + public void ParseAllFiles() + { + if (visualEnvironmentCompiler.UserOptions.AllowCodeCompletion)// && visualEnvironmentCompiler.compilerLoaded) + { + if (th.ThreadState != System.Threading.ThreadState.Running) + { + th = new System.Threading.Thread(new System.Threading.ThreadStart(this.ParseInThread)); + th.Priority = System.Threading.ThreadPriority.BelowNormal; + //th.IsBackground = true; + th.Start(); + } + //if (th == null) + // RunParseThread(); + } + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionProvider.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionProvider.cs new file mode 100644 index 000000000..3fec12767 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeCompletionProvider.cs @@ -0,0 +1,639 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Document; +using PascalABCCompiler.Parsers; + +namespace VisualPascalABC +{ + + public class CodeCompletionProvider : ICompletionDataProvider + { + public string preSelection; + public static CodeCompletionImagesProvider ImagesProvider; + public static DefaultDispatcher disp; + public bool ByFirstChar; + + static CodeCompletionProvider() + { + ImagesProvider = new CodeCompletionImagesProvider(); + disp = new DefaultDispatcher(); + CodeCompletion.AssemblyDocCache.dispatcher = disp; + CodeCompletion.UnitDocCache.dispatcher = disp; + } + + public CodeCompletionProvider() + { + } + + public ImageList ImageList + { + get + { + return ImagesProvider.ImageList; + } + } + + public string PreSelection + { + get + { + return preSelection; + } + } + + public int DefaultIndex + { + get + { + return defaultIndex; + } + } + + public UserDefaultCompletionData DefaultCompletionElement + { + get + { + return defaultCompletionElement; + } + } + + private UserDefaultCompletionData defaultCompletionElement; + private int defaultIndex = -1; + + public CompletionDataProviderKeyResult ProcessKey(char key) + { + if (char.IsLetterOrDigit(key) || key == '_') + { + return CompletionDataProviderKeyResult.NormalKey; + } + else + { + // key triggers insertion of selected items + return CompletionDataProviderKeyResult.InsertionKey; + } + } + + /// + /// Called when entry should be inserted. Forward to the insertion action of the completion data. + /// + public bool InsertAction(ICompletionData data, TextArea textArea, int insertionOffset, char key) + { + textArea.Caret.Position = textArea.Document.OffsetToPosition(insertionOffset); + if (!(data as UserDefaultCompletionData).IsOnOverrideWindow) + { + int ind = data.Text.IndexOf('<'); + if (ind != -1 && data.Text.Length > ind + 1 && data.Text[ind + 1] == '>') + data.Text = data.Text.Substring(0, ind); + } + else + data.Text = data.Description; + + return data.InsertAction(textArea, key); + } + + public PascalABCCompiler.Parsers.KeywordKind keyword; + + public List GetDefinition(string expr, string fileName, int line, int column, bool only_check) + { + List Errors = new List(); + PascalABCCompiler.SyntaxTree.expression e = null; + List loc = null; + if (VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.compilerLoaded) + e = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + System.IO.Path.GetExtension(fileName), expr, Errors, new List()); + if (e is PascalABCCompiler.SyntaxTree.bin_expr && expr.Contains("<")) + { + expr = expr.Replace("<","&<"); + Errors.Clear(); + e = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + System.IO.Path.GetExtension(fileName), expr, Errors, new List()); + } + if (e == null) + return loc; + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + if (dconv == null) + return loc; + loc = dconv.GetDefinition(e, line, column, keyword, only_check); + return loc; + } + + private string construct_header(string meth, CodeCompletion.ProcScope ps, int tabCount) + { + //if (CodeCompletion.CodeCompletionController.currentParser != null) + return CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ConstructHeader(meth, ps, tabCount); + } + + private string construct_header(CodeCompletion.ProcRealization ps, int tabCount) + { + return CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.ConstructHeader(ps, tabCount); + } + + public CodeCompletion.SymScope FindScopeByLocation(string fileName, int line, int col) + { + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + if (dconv == null) return null; + return dconv.FindScopeByLocation(line, col); + } + + public string GetMethodImplementationTextToAdd(string fileName, int line, int col, ref PascalABCCompiler.Parsers.Position pos, TextArea textArea) + { + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + if (dconv == null) return null; + CodeCompletion.ProcScope[] procs = dconv.GetNotImplementedMethodHeaders(line, col, ref pos); + if (procs == null || procs.Length == 0) return null; + System.Text.StringBuilder sb = new StringBuilder(); + for (int i = 0; i < procs.Length; i++) + { + string meth = construct_header(procs[i] as CodeCompletion.ProcRealization, VisualPABCSingleton.MainForm.UserOptions.CursorTabCount); + sb.Append(meth); + //sb.Append('\n'); + } + return sb.ToString(); + } + + public string GetRealizationTextToAdd(string fileName, int line, int col, ref PascalABCCompiler.Parsers.Position pos, TextArea textArea) + { + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + if (dconv == null) return null; + CodeCompletion.ProcScope[] procs = dconv.GetNotImplementedMethods(line, col, ref pos); + if (procs == null) return null; + System.Text.StringBuilder sb = new StringBuilder(); + sb.Append("\n\n"); + for (int i = 0; i < procs.Length; i++) + { + int off = textArea.Document.PositionToOffset(new TextLocation(procs[i].GetPosition().column - 1, procs[i].GetPosition().line - 1)); + string meth = textArea.Document.GetText(off, textArea.Document.PositionToOffset(new TextLocation(procs[i].GetPosition().end_column - 1, procs[i].GetPosition().end_line - 1)) - off + 1); + meth = construct_header(meth, procs[i], VisualPABCSingleton.MainForm.UserOptions.CursorTabCount); + + if (i < procs.Length - 1) + { + sb.Append(meth); + sb.Append('\n'); + } + else + sb.Append(meth.Trim()); + + } + return sb.ToString(); + } + + public List GetRealization(string expr, string fileName, int line, int column) + { + List Errors = new List(); + PascalABCCompiler.SyntaxTree.expression e = null; + List loc = null; + if (VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.compilerLoaded) + e = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + System.IO.Path.GetExtension(fileName), expr, Errors, new List()); + if (e == null /*|| Errors.Count > 0*/) return loc; + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + if (dconv == null) return loc; + loc = dconv.GetRealization(e, line, column, keyword); + return loc; + } + + private RenameForm rf; + + public List Rename(string expr, string name, string fileName, int line, int column) + { + List refers = FindReferences(expr, fileName, line, column, true); + return refers; + } + + public List Rename(string expr, string name, string fileName, int line, int column, ref string new_val) + { + if (rf == null) + { + rf = new RenameForm(); + Form1StringResources.SetTextForAllControls(rf); + } + rf.EditValue = name.Trim(' ').Replace("&", ""); + DialogResult dr = rf.ShowDialog(); + if (dr == DialogResult.OK) + { + new_val = rf.EditValue; + + List refers = FindReferences(expr, fileName, line, column, true); + if (refers == null) return null; + return refers; + } + return null; + } + + + public List FindReferences(string expr, string fileName, int line, int column, bool for_refact) + { + List Errors = new List(); + PascalABCCompiler.SyntaxTree.expression e = null; + if (VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.compilerLoaded) + e = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + System.IO.Path.GetExtension(fileName), expr, Errors, new List()); + if (e == null) return new List(); + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + if (dconv == null) return new List(); + List lst = InternalFindReferences(fileName, e, line, column, for_refact); + //if (lst != null && expr != null && for_refact) + //lst.Insert(0,new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(fileName,line+1,column,line+1,column+expr.Length),ImagesProvider.IconNumberGotoText)); + return lst; + } + + private List InternalFindReferences(string fname, PascalABCCompiler.SyntaxTree.expression expr, int line, int col, bool for_refact) + { + List lst = new List(); + List svs_lst = new List(); + try + { + CodeCompletion.DomConverter dc = CodeCompletion.CodeCompletionController.comp_modules[fname] as CodeCompletion.DomConverter; + IBaseScope fnd_scope = null; + IBaseScope cur_sc = null; + if (dc != null) + { + fnd_scope = dc.GetSymDefinition(expr, line, col, keyword); + cur_sc = dc.FindScopeByLocation(line, col); + } + if (fnd_scope != null) + { + foreach (string FileName in CodeCompletionParserController.open_files.Keys) + { + CodeCompletion.CodeCompletionController controller = new CodeCompletion.CodeCompletionController(); + string text = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.SourceFilesProvider(FileName, PascalABCCompiler.SourceFileOperation.GetText) as string; + PascalABCCompiler.SyntaxTree.compilation_unit cu = controller.ParseOnlySyntaxTree(FileName, text); + if (cu != null) + { + dc = CodeCompletion.CodeCompletionController.comp_modules[FileName] as CodeCompletion.DomConverter; + CodeCompletion.ReferenceFinder rf = null; + if (dc != null && dc.visitor.entry_scope != null) + { + rf = new CodeCompletion.ReferenceFinder(fnd_scope, dc.visitor.entry_scope, cu, FileName, for_refact); + lst.AddRange(rf.FindPositions()); + } + } + } + PascalABCCompiler.Parsers.Position p = fnd_scope.GetPosition(); + bool need_add_def = !for_refact; // true + if (p.file_name != null && need_add_def) + svs_lst.Add(new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(p.file_name, p.line, p.column, p.end_line, p.end_column), ImagesProvider.GetPictureNum(fnd_scope.SymbolInfo))); + foreach (PascalABCCompiler.Parsers.Position pos in lst) + { + if (pos.file_name != null) + svs_lst.Add(new SymbolsViewerSymbol(new PascalABCCompiler.SourceLocation(pos.file_name, pos.line, pos.column, pos.end_line, pos.end_column), ImagesProvider.IconNumberGotoText)); + } + } + } + catch (Exception e) + { + + } + GC.Collect(); + return svs_lst; + //return svs_lst.ToArray(); + } + + public string FindExpression(int off, string Text, int line, int col) + { + if (CodeCompletion.CodeCompletionController.CurrentParser != null) + return CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindExpression(off, Text, line, col, out keyword); + return null; + } + + private string SkipNew(int off, string Text) + { + int tmp = off; + string expr = null; + while (off >= 0 && Char.IsLetterOrDigit(Text[off])) off--; + while (off >= 0 && (Text[off] == ' ' || char.IsControl(Text[off]))) off--; + if (off >= 1 && Text[off] == '=' && Text[off - 1] == ':') + { + off -= 2; + while (off >= 0 && (Text[off] == ' ' || char.IsControl(Text[off]))) off--; + if (off >= 0 && (Text[off] == '_' || char.IsLetterOrDigit(Text[off]) || Text[off] == ']')) + expr = FindExpression(off + 1, Text, 0, 0); + } + return expr; + } + + public ICompletionData[] GetCompletionDataByFirst(int off, string Text, int line, int col, char charTyped, PascalABCCompiler.Parsers.KeywordKind keyw) + { + List resultList = new List(); + List lst = new List(); + try + { + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[FileName]; + /*if (dconv == null && CodeCompletion.CodeCompletionNameHelper.system_unit_file_full_name != null + && (keyw == CodeCompletion.KeywordKind.kw_colon || keyw == CodeCompletion.KeywordKind.kw_of)) + { + dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[CodeCompletion.CodeCompletionNameHelper.system_unit_file_full_name]; + special_module = true; + }*/ + string pattern = charTyped.ToString(); + string[] keywords = CodeCompletion.CodeCompletionNameHelper.Helper.GetKeywords(); + if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsTypeAfterKeyword(keyw)) + { + keywords = CodeCompletion.CodeCompletionNameHelper.Helper.GetTypeKeywords(); + } + if (!CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsNamespaceAfterKeyword(keyw)) + foreach (string key in keywords) + { + //if (key.StartsWith(pattern, StringComparison.CurrentCultureIgnoreCase)) + resultList.Add(new UserDefaultCompletionData(key, null, ImagesProvider.IconNumberKeyword, false)); + } + PascalABCCompiler.Parsers.SymInfo[] mis = null; + if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsNamespaceAfterKeyword(keyw)) + { + mis = CodeCompletion.DomConverter.standard_units; + } + if (dconv != null) + { + //if (keyw == PascalABCCompiler.Parsers.KeywordKind.Colon || keyw == PascalABCCompiler.Parsers.KeywordKind.Of || keyw == PascalABCCompiler.Parsers.KeywordKind.TypeDecl) + if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsTypeAfterKeyword(keyw)) + mis = dconv.GetTypeByPattern(pattern, line, col, true, VisualPABCSingleton.MainForm.UserOptions.CodeCompletionNamespaceVisibleRange); + else if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsNamespaceAfterKeyword(keyw) && mis == null) + mis = dconv.GetNamespaces(); + else + mis = dconv.GetNameByPattern(null, line, col, true, VisualPABCSingleton.MainForm.UserOptions.CodeCompletionNamespaceVisibleRange); + } + Hashtable cache = new Hashtable(); + if (mis != null) + { + bool stop = false; + ICompletionData data = CompletionDataDispatcher.GetLastUsedItem(charTyped); + foreach (PascalABCCompiler.Parsers.SymInfo mi in mis) + { + if (mi.not_include) continue; + + if (cache.Contains(mi.name)) + continue; + + UserDefaultCompletionData ddd = new UserDefaultCompletionData(mi.name, mi.description, ImagesProvider.GetPictureNum(mi), false); + if (!stop && data != null && string.Compare(mi.name, data.Text, true) == 0) + { + defaultCompletionElement = ddd; + stop = true; + } + else if (!stop && data == null && mi.name.StartsWith(charTyped.ToString(), StringComparison.CurrentCultureIgnoreCase)) + { + //defaultCompletionElement = ddd; + lst.Add(ddd); + //stop = true; + } + disp.Add(mi, ddd); + resultList.Add(ddd); + cache[mi.name] = mi; + } + //resultList.Sort(); + //defaultCompletionElement = resultList[0] as DefaultCompletionData; + } + } + catch (Exception e) + { + + } + + lst.Sort(); + if (lst.Count > 0) defaultCompletionElement = lst[0] as UserDefaultCompletionData; + ICompletionData[] res_arr = resultList.ToArray(); + this.ByFirstChar = true; + return res_arr; + } + + public ICompletionData[] GetCompletionData(int off, string Text, int line, int col, char charTyped, PascalABCCompiler.Parsers.KeywordKind keyw) + { + List resultList = new List(); + try + { + string pattern = null; + string expr = null; + bool ctrl_space = charTyped == '\0' || charTyped == '_'; + bool shift_space = charTyped == '\0'; + bool inside_dot_pattern = false; + bool new_space = keyw == PascalABCCompiler.Parsers.KeywordKind.New; + if (ctrl_space) + { + bool is_pattern = false; + pattern = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindPattern(off, Text, out is_pattern); + if (is_pattern && Text[off - pattern.Length - 1] == '.') + { + inside_dot_pattern = true; + expr = FindExpression(off - pattern.Length - 1, Text, line, col); + } + + } + else if (new_space) + { + expr = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.SkipNew(off - 1, Text, ref keyword); + } + else + if (!new_space && keyw != PascalABCCompiler.Parsers.KeywordKind.Uses) + if (charTyped != '$') + expr = FindExpression(off, Text, line, col); + else + expr = FindExpression(off - 1, Text, line, col); + List Errors = new List(); + PascalABCCompiler.SyntaxTree.expression e = null; + if (ctrl_space && !shift_space && (pattern == null || pattern == "")) + { + string[] keywords = CodeCompletion.CodeCompletionNameHelper.Helper.GetKeywords(); + foreach (string key in keywords) + { + //if (key.StartsWith(pattern, StringComparison.CurrentCultureIgnoreCase)) + resultList.Add(new UserDefaultCompletionData(key, null, ImagesProvider.IconNumberKeyword, false)); + } + } + if ((!ctrl_space || inside_dot_pattern) && expr != null) + { + e = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetTypeAsExpression("test" + System.IO.Path.GetExtension(FileName), expr, Errors, new List()); + if (e == null) + { + Errors.Clear(); + e = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + System.IO.Path.GetExtension(FileName), expr, Errors, new List()); + } + if ((e == null || Errors.Count > 0) && !new_space) return null; + } + SymInfo[] mis = null; + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[FileName]; + if (dconv == null) + { + if (keyw == PascalABCCompiler.Parsers.KeywordKind.Uses) + mis = CodeCompletion.DomConverter.standard_units; + else if (!ctrl_space) + return new ICompletionData[0]; + } + string fname = FileName; + SymInfo sel_si = null; + string last_used_member = null; + if (dconv != null) + { + if (new_space) + mis = dconv.GetTypes(e, line, col, out sel_si); + else if (keyw == PascalABCCompiler.Parsers.KeywordKind.Uses && mis == null) + { + if (WorkbenchServiceFactory.Workbench.UserOptions.EnableSmartIntellisense) + mis = dconv.GetNamespaces(); + else + mis = CodeCompletion.DomConverter.standard_units; + } + + else + if (!ctrl_space) + { + CodeCompletion.SymScope dot_sc = null; + mis = dconv.GetName(e, expr, line, col, keyword, ref dot_sc); + if (dot_sc != null && VisualPABCSingleton.MainForm.UserOptions.EnableSmartIntellisense) + { + CompletionDataDispatcher.AddMemberBeforeDot(dot_sc); + last_used_member = CompletionDataDispatcher.GetRecentUsedMember(dot_sc); + } + } + else + { + CodeCompletion.SymScope dot_sc = null; + if (inside_dot_pattern) + { + List si_list = new List(); + SymInfo[] from_list = dconv.GetName(e, expr, line, col, keyword, ref dot_sc); + for (int i = 0; i < from_list.Length; i++) + { + if (from_list[i].name.StartsWith(pattern, StringComparison.OrdinalIgnoreCase)) + si_list.Add(from_list[i]); + } + mis = si_list.ToArray(); + } + + else + mis = dconv.GetNameByPattern(pattern, line, col, charTyped == '_', VisualPABCSingleton.MainForm.UserOptions.CodeCompletionNamespaceVisibleRange); + } + + } + Hashtable cache = null; + if (!CodeCompletion.CodeCompletionController.CurrentParser.CaseSensitive) + cache = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + else + cache = new Hashtable(); + int num = 0; + if (mis != null) + { + bool stop = false; + ICompletionData data = null; + + foreach (SymInfo mi in mis) + { + if (mi.not_include) continue; + if (cache.Contains(mi.name + mi.kind)) + continue; + + UserDefaultCompletionData ddd = new UserDefaultCompletionData(mi.addit_name != null ? mi.addit_name : mi.name, mi.description, ImagesProvider.GetPictureNum(mi), false); + + disp.Add(mi, ddd); + resultList.Add(ddd); + cache[mi.name + mi.kind] = mi; + /*if (VisualPABCSingleton.MainForm.UserOptions.EnableSmartIntellisense && mi.name != null && mi.name != "" && data == null) + { + data = CompletionDataDispatcher.GetLastUsedItem(mi.name[0]); + if (data != null && data.Text == ddd.Text) data = ddd; + }*/ + if (last_used_member != null && last_used_member == mi.name) + { + defaultCompletionElement = ddd; + } + if (sel_si != null && mi == sel_si) + { + defaultCompletionElement = ddd; + stop = true; + } + } + + if (defaultCompletionElement == null && data != null) + defaultCompletionElement = data as UserDefaultCompletionData; + } + } + catch (Exception e) + { + + } + return resultList.ToArray(); + } + + private CodeCompletion.CodeCompletionController controller; + private string FileName; + private string Text; + + public void CompileInThread() + { + controller.Compile(FileName, Text /*+ ")))));end."*/); + } + + public ICompletionData[] ddata; + + public ICompletionData[] GenerateCompletionDataWithKeyword(string fileName, TextArea textArea, char charTyped, PascalABCCompiler.Parsers.KeywordKind keyw) + { + controller = new CodeCompletion.CodeCompletionController(); + int off = textArea.Caret.Offset; + string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset); + //controller.Compile(fileName, text /*+ ")))));end."*/); + FileName = fileName; Text = text; + ICompletionData[] data = GetCompletionData(off, text, textArea.Caret.Line, textArea.Caret.Column, charTyped, keyw); + CodeCompletion.AssemblyDocCache.CompleteDocumentation(); + CodeCompletion.UnitDocCache.CompleteDocumentation(); + controller = null; + //GC.Collect(); + return data; + } + + public ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped) + { + return null; + } + + public ICompletionData[] GenerateCompletionDataForOverridableMethods(string fileName, TextArea textArea) + { + controller = new CodeCompletion.CodeCompletionController(); + List lst = new List(); + int line = textArea.Caret.Line; + int col = textArea.Caret.Column; + try + { + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + SymInfo[] mis = null; + if (dconv != null) + { + mis = dconv.GetOverridableMethods(line, col); + } + if (mis != null) + { + foreach (SymInfo mi in mis) + { + UserDefaultCompletionData ddd = new UserDefaultCompletionData(mi.name, mi.description, ImagesProvider.GetPictureNum(mi), true); + lst.Add(ddd); + } + } + } + catch (Exception e) + { + + } + + //lst.Sort(); + ICompletionData[] res_arr = lst.ToArray(); + controller = null; + return res_arr; + } + + public ICompletionData[] GenerateCompletionDataByFirstChar(string fileName, TextArea textArea, char charTyped, PascalABCCompiler.Parsers.KeywordKind keyw) + { + controller = new CodeCompletion.CodeCompletionController(); + int off = textArea.Caret.Offset; + string text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset); + //controller.Compile(fileName, text /*+ ")))));end."*/); + FileName = fileName; Text = text; + ICompletionData[] data = GetCompletionDataByFirst(off, text, textArea.Caret.Line, textArea.Caret.Column, charTyped, keyw); + CodeCompletion.AssemblyDocCache.CompleteDocumentation(); + CodeCompletion.UnitDocCache.CompleteDocumentation(); + controller = null; + //GC.Collect(); + return data; + } + } +} diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/CodeTemplateManager.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeTemplateManager.cs new file mode 100644 index 000000000..86fe33634 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/CodeTemplateManager.cs @@ -0,0 +1,97 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is `tributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace VisualPascalABC +{ + public class CodeTemplateManager + { + public Dictionary ht = new Dictionary(); + + public CodeTemplateManager(string filename = "template.pct", bool searchFromLocalDirectory = false) + { + try + { + StreamReader sr; + string PABCExeDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName); + if (!searchFromLocalDirectory) + { + sr = File.OpenText(Path.Combine(PABCExeDirectory, filename)); + } + else + { + if (File.Exists(filename)) + sr = File.OpenText(filename); + else + { + var ss = Path.Combine(@"..\", filename); + if (File.Exists(ss)) + sr = File.OpenText(ss); + else sr = File.OpenText(Path.Combine(PABCExeDirectory, filename)); + } + } + ParseFile(sr); + sr.Close(); + } + catch + { + + } + } + + private string get_minimal(List names) + { + string min = names[0]; + for (int i=1; i lst = new List(); + foreach (string s in ht.Keys) + if (string.Compare(name,s,true)==0) + return s; + else if (s.StartsWith(name, StringComparison.OrdinalIgnoreCase)) + lst.Add(s); + if (lst.Count == 1) + return lst[0]; + else + if (lst.Count > 1) + return get_minimal(lst); + else return null; + } + + public string GetTemplate(string name) + { + return ht[name] as string; + } + + private void ParseFile(StreamReader sr) + { + StringBuilder sb = new StringBuilder(); + string last_templ=null; + string tmp=null; + last_templ = sr.ReadLine().Trim('[',']',' ','\t'); + while (!sr.EndOfStream) + { + tmp = sr.ReadLine(); + if (tmp.StartsWith("[")) + { + ht[last_templ] = sb.ToString().TrimEnd('\r','\n'); + last_templ = tmp.Trim('[',']',' ','\t'); + sb.Remove(0,sb.Length); + } + else + sb.AppendLine(tmp); + } + ht[last_templ] = sb.ToString().TrimEnd('\r','\n'); + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/DefinitionByMouseClickManager.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/DefinitionByMouseClickManager.cs new file mode 100644 index 000000000..284a907e1 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/DefinitionByMouseClickManager.cs @@ -0,0 +1,136 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; + +namespace VisualPascalABC +{ + public static class DefinitionByMouseClickManager + { + private static bool gotoInProgress; + + public static void DefinitionByMouseClickManager_TextAreaMouseMove(object sender, MouseEventArgs e) + { + makeWordUnderline(sender, e); + } + + public static void DefinitionByMouseClickManager_TextAreaMouseDown(object sender, EventArgs e) + { + TextArea textArea = (TextArea)sender; + if (Control.ModifierKeys == Keys.Control && textArea.SelectionManager.SelectionCollection.Count == 0) + { + + gotoInProgress = true; + if (CodeCompletionActionsManager.CanGoToRealization(textArea)) + { + CodeCompletionActionsManager.GotoRealization(textArea); + } + else if (CodeCompletionActionsManager.CanGoTo(textArea)) + { + CodeCompletionActionsManager.GotoDefinition(textArea); + } + gotoInProgress = false; + } + } + + private static bool isIdentifier(string s) + { + s = s.Replace("&", ""); + if (s == "") + return false; + for (int i = 0; i < s.Length; i++) + { + if (!(char.IsLetter(s[i]) && s[i] != ' ' || s[i] == '_' || i > 0 && char.IsDigit(s[i]))) + return false; + } + return true; + } + + private static void makeWordUnderline(object sender, MouseEventArgs e) + { + try + { + TextArea textArea = (TextArea)sender; + if (gotoInProgress || textArea.SelectionManager.SelectionCollection.Count > 0) + return; + if (Control.ModifierKeys != Keys.Control && textArea.TextView.Cursor == Cursors.IBeam) + { + return; + } + //System.Threading.Thread.Sleep(10); + //if (textArea != curTextArea) return; + var markers = textArea.Document.MarkerStrategy.GetMarkers(0, textArea.Document.TextContent.Length); + List textMarkers = new List(); + foreach (var marker in markers) + { + if (marker is TextMarker && marker.TextMarkerType == TextMarkerType.Underlined) + textMarkers.Add(marker as TextMarker); + } + if (textMarkers.Count > 0 && Control.ModifierKeys != Keys.Control) + { + textArea.TextView.Cursor = Cursors.IBeam; + foreach (var textMarker in textMarkers) + { + textArea.Document.MarkerStrategy.RemoveMarker(textMarker); + } + textArea.Refresh(); + } + if (Control.ModifierKeys != Keys.Control) + { + textArea.TextView.Cursor = Cursors.IBeam; + textArea.Refresh(); + } + if (Control.ModifierKeys == Keys.Control) + { + ICSharpCode.TextEditor.TextLocation logicPos = textArea.TextView.GetLogicalPosition(Math.Max(0, e.X - textArea.TextView.DrawingPosition.X), + e.Y - textArea.TextView.DrawingPosition.Y); + IDocument doc = textArea.Document; + logicPos = textArea.Caret.ValidatePosition(logicPos); + LineSegment seg = doc.GetLineSegment(logicPos.Y); + if (logicPos.X <= seg.Length - 1) + { + foreach (TextWord tw in seg.Words) + { + if (tw.Offset <= logicPos.Column && tw.Offset + tw.Length >= logicPos.Column && isIdentifier(tw.Word)) + { + if (textArea.Document.MarkerStrategy.GetMarkers(seg.Offset + tw.Offset).Count == 0) + { + foreach (var textMarker in textMarkers) + { + textArea.Document.MarkerStrategy.RemoveMarker(textMarker); + } + textArea.Document.MarkerStrategy.AddMarker(new TextMarker(seg.Offset + tw.Offset, tw.Length, TextMarkerType.Underlined, Color.Blue)); + textArea.TextView.Cursor = Cursors.Hand; + textArea.Refresh(); + break; + } + } + } + } + else + { + foreach (var textMarker in textMarkers) + { + textArea.Document.MarkerStrategy.RemoveMarker(textMarker); + } + + textArea.TextView.Cursor = Cursors.IBeam; + textArea.Refresh(); + } + } + } + catch + { + + } + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/FoldingStrategy.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/FoldingStrategy.cs new file mode 100644 index 000000000..e33016957 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/FoldingStrategy.cs @@ -0,0 +1,116 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using CodeCompletion; +using PascalABCCompiler.Parsers; + +namespace VisualPascalABC +{ + public class RegionFoldMarker : FoldMarker + { + public RegionFoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn, FoldType foldType, string foldText): + base(document, startLine, startColumn, endLine, endColumn, foldType, foldText) + { + + } + } + + public class ParserFoldingStrategy : IFoldingStrategy + { + private List GetFoldMarkers(IDocument doc, IBaseScope root, string fileName) + { + List foldMarkers = new List(); + if (!(root is ITypeScope)) + { + Position pos = root.GetPosition(); + if (pos.file_name != null) + { + Position head_pos = root.GetHeaderPosition(); + FoldMarker newFoldMarker = null; + if (head_pos.file_name == null) + { + if (root is ImplementationUnitScope) + { + Position unit_pos = root.TopScope.GetPosition(); + newFoldMarker = new FoldMarker(doc, pos.line - 1, pos.column - 1, unit_pos.end_line - 1, unit_pos.end_column, FoldType.MemberBody); + } + else + newFoldMarker = new FoldMarker(doc, pos.line - 1, pos.column - 1, pos.end_line - 1, pos.end_column, FoldType.MemberBody); + } + else + newFoldMarker = new FoldMarker(doc, head_pos.end_line - 1, head_pos.end_column - 1, pos.end_line - 1, pos.end_column, FoldType.MemberBody); + if (newFoldMarker.Length > 0) + { + foldMarkers.Add(newFoldMarker); + } + } + if (root.Regions != null) + { + foreach (Position p in root.Regions) + { + foldMarkers.Add(new RegionFoldMarker(doc, p.line - 1, p.column, p.end_line - 1, p.end_column, FoldType.MemberBody, p.fold_text)); + } + } + Position body_pos = root.GetBodyPosition(); + if (body_pos.file_name != null) + { + FoldMarker newFoldMarker = null; + if (body_pos.line < pos.line && foldMarkers.Count > 0) + foldMarkers.RemoveAt(foldMarkers.Count - 1); + newFoldMarker = new FoldMarker(doc, body_pos.line - 1, body_pos.column - 1, body_pos.end_line - 1, body_pos.end_column, FoldType.MemberBody); + if (newFoldMarker.Length > 0) + { + foldMarkers.Add(newFoldMarker); + } + } + + } + foreach (IBaseScope ss in root.Members) + { + if (ss is ITypeScope) + { + Position body_pos = ss.GetBodyPosition(); + Position head_pos = ss.GetHeaderPosition(); + if (head_pos.file_name == null || body_pos.file_name == null) + continue; + FoldMarker newFoldMarker = new FoldMarker(doc, head_pos.end_line - 1, head_pos.end_column - 1, body_pos.end_line - 1, body_pos.end_column, FoldType.TypeBody); + if (newFoldMarker.Length > 0) + { + foldMarkers.Add(newFoldMarker); + } + foldMarkers.AddRange(GetFoldMarkers(doc, ss, fileName)); + } + else if (ss is IProcScope) + { + FoldType ft = FoldType.MemberBody; + Position head_pos = ss.GetHeaderPosition(); + Position body_pos = ss.GetBodyPosition(); + if (head_pos.file_name == null || body_pos.file_name == null) + continue; + FoldMarker newFoldMarker = new FoldMarker(doc, head_pos.end_line - 1, head_pos.end_column, body_pos.end_line - 1, body_pos.end_column, ft); + if (newFoldMarker.Length > 0) + { + foldMarkers.Add(newFoldMarker); + } + } + else if (ss is IImplementationUnitScope) + foldMarkers.AddRange(GetFoldMarkers(doc, ss, fileName)); + } + + return foldMarkers; + } + + public List GenerateFoldMarkers(IDocument document, string fileName, object parseInfo) + { + List foldMarkers = GetFoldMarkers(document, parseInfo as IBaseScope, fileName); + return foldMarkers; + } + + } +} diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/InsightProvider.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/InsightProvider.cs new file mode 100644 index 000000000..efed7da17 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/InsightProvider.cs @@ -0,0 +1,182 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using System.IO; +using System.Threading; + +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Gui; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; +using ICSharpCode.TextEditor.Gui.InsightWindow; + +namespace VisualPascalABC +{ + class DefaultInsightDataProvider : ICSharpCode.TextEditor.Gui.InsightWindow.IInsightDataProvider + { + private string fileName = null; + private ICSharpCode.TextEditor.Document.IDocument document = null; + private TextArea textArea = null; + private string[] methods; //= new List(); + private int lookupOffset; + private bool setupOnlyOnce; + private int initialOffset; + private char pressed_key; + public int defaultIndex = 0; + public int num_param = 1; + public int cur_param_num = 1; + public int param_count; + + public DefaultInsightDataProvider(int lookupOffset, bool setupOnlyOnce, char pressed_key) + { + this.lookupOffset = lookupOffset; + this.setupOnlyOnce = setupOnlyOnce; + this.pressed_key = pressed_key; + } + + private string FindExpression(int off, string Text, int line, int col) + { + if (CodeCompletion.CodeCompletionController.CurrentParser != null) + return CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindExpressionForMethod(off, Text, line, col, pressed_key, ref num_param); + return null; + } + + public void SetupDataProvider(string fileName, TextArea textArea) + { + try + { + if (setupOnlyOnce && this.textArea != null) + { + if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsMethodCallParameterSeparator(pressed_key)) + { + FindExpression(textArea.Caret.Offset, textArea.Document.TextContent.Substring(0, textArea.Caret.Offset), + textArea.Caret.Line, textArea.Caret.Column); + num_param++; + return; + } + else return; + } + this.fileName = fileName; + this.textArea = textArea; + this.document = textArea.Document; + int useOffset = (lookupOffset < 0) ? textArea.Caret.Offset : lookupOffset; + initialOffset = useOffset; + int i = initialOffset - 1; + int off = textArea.Caret.Offset; + string Text = textArea.Document.TextContent.Substring(0, textArea.Caret.Offset); + int line = textArea.Caret.Line; + int col = textArea.Caret.Column; + + string expr = FindExpression(off, Text, line, col); + List Errors = new List(); + PascalABCCompiler.SyntaxTree.expression e = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test.pas", expr, Errors, new List()); + if (e == null || Errors.Count > 0) return; + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[fileName]; + string fname = fileName; + if (dconv != null) + { + //if (pressed_key == '(' || pressed_key == ',') + if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsOpenBracketForMethodCall(pressed_key) || CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsMethodCallParameterSeparator(pressed_key)) + methods = dconv.GetNameOfMethod(e, expr, line, col, num_param, ref defaultIndex, cur_param_num, out param_count); + else if (CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.IsOpenBracketForIndex(pressed_key)) + methods = dconv.GetIndex(e, line, col); + } + } + catch (Exception e) + { + + } + } + + public bool CaretOffsetChanged() + { + bool closeDataProvider = textArea.Caret.Offset <= initialOffset; + int brackets = 0; + if (!closeDataProvider) + { + bool insideChar = false; + bool insideString = false; + for (int offset = initialOffset; offset < Math.Min(textArea.Caret.Offset, document.TextLength); ++offset) + { + char ch = document.GetCharAt(offset); + switch (ch) + { + case '\'': + insideChar = !insideChar; + break; + case '[': + if (!(insideChar || insideString)) + { + ++brackets; + } + break; + case ']': + if (!(insideChar || insideString)) + { + --brackets; + } + if (brackets <= 0) + { + return true; + } + break; + case '(': + if (!(insideChar || insideString)) + { + ++brackets; + } + break; + case ')': + if (!(insideChar || insideString)) + { + --brackets; + } + if (brackets <= 0) + { + return true; + } + break; + case ';': + if (!(insideChar || insideString)) + { + return true; + } + break; + } + } + } + + return closeDataProvider; + } + + public string GetInsightData(int number) + { + if (number >= methods.Length) + number = methods.Length - 1; + return methods[number]; + } + + public int InsightDataCount + { + get + { + if (methods != null) + return methods.Length; + return 0; + } + } + + public int DefaultIndex + { + get + { + return Math.Min(defaultIndex, InsightDataCount-1); + } + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.cs new file mode 100644 index 000000000..db97ca316 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.cs @@ -0,0 +1,896 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Drawing; +using System.IO; +using System.Windows.Forms; +using System.Collections.Generic; +using CodeCompletion; +using System.Threading; +using PascalABCCompiler.Parsers; + +namespace VisualPascalABC +{ + + public class QuickClassBrowserPanel : System.Windows.Forms.UserControl + { + private System.Windows.Forms.ComboBox classComboBox; + private System.Windows.Forms.ComboBox membersComboBox; + + IBaseScope currentCompilationUnit; + CodeFileDocumentTextEditorControl textAreaControl; + bool autoselect = true; + + class ComboBoxItem : System.IComparable + { + IBaseScope item; + string text; + int iconIndex; + bool isInCurrentPart; + Position pos; + bool is_global; + + public int IconIndex { + get { + return iconIndex; + } + } + + public IBaseScope Item { + get { + return item; + } + } + + public bool IsInCurrentPart { + get { + return isInCurrentPart; + } + } + + public Position ItemRegion { + get { + return pos; + } + } + + public int Line { + get { + return pos.line-1; + } + } + + public int Column { + get { + return pos.column-1; + } + } + + public int EndLine { + get { + return pos.end_line-1; + } + } + + public ComboBoxItem(IBaseScope item, string text, int iconIndex, bool isInCurrentPart, bool is_global) + { + this.item = item; + if (item != null) + pos = item.GetPosition(); + this.text = text; + this.iconIndex = iconIndex; + this.isInCurrentPart = true; + this.is_global = is_global; + } + + public bool IsInside(int lineNumber, int columnNumber) + { + if (item == null || is_global) return true; + if (pos.line < lineNumber+1 && pos.end_line > lineNumber+1) return true; + if (pos.line > lineNumber+1 || pos.end_line < lineNumber+1) return false; + if (pos.line == lineNumber+1 && pos.end_line == lineNumber+1) + { + if (pos.column <= columnNumber+1 && pos.end_column >= columnNumber+1) return true; + else return false; + } + else if (pos.end_line != lineNumber+1 && pos.column <= columnNumber+1) return true; + else if (pos.line != lineNumber+1 && pos.end_column >= columnNumber+1) return true; + return false; + } + + public int CompareItemTo(object obj) + { + ComboBoxItem boxItem = (ComboBoxItem)obj; + + if (boxItem.Item is IComparable) { + return ((IComparable)boxItem.Item).CompareTo(item); + } + if (boxItem.text != text || boxItem.Line != Line || boxItem.EndLine != EndLine || boxItem.iconIndex != iconIndex) { + return 1; + } + return 0; + } + + string cachedString; + + public override string ToString() + { + // ambience lookups can be expensive when the return type is + // resolved on the fly. + // Therefore, we need to cache the generated string because it is used + // very often for the sorting. + if (cachedString == null) + cachedString = ToStringInternal(); + return cachedString; + } + + string ToStringInternal() + { + if (text == null) return ""; + return text; + } + + #region System.IComparable interface implementation + public int CompareTo(object obj) + { + return ToString().CompareTo(obj.ToString()); + } + #endregion + + } + + public QuickClassBrowserPanel(CodeFileDocumentTextEditorControl textAreaControl) + { + InitializeComponent(); + this.membersComboBox.DropDownHeight = Convert.ToInt32(this.membersComboBox.DropDownHeight * ScreenScale.Calc()); + this.classComboBox.DropDownHeight = Convert.ToInt32(this.classComboBox.DropDownHeight * ScreenScale.Calc()); + + this.membersComboBox.MaxDropDownItems = 20; + + base.Dock = DockStyle.Top; + this.textAreaControl = textAreaControl; + this.textAreaControl.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(CaretPositionChanged); + if (VisualPABCSingleton.MainForm != null && !VisualPABCSingleton.MainForm.UserOptions.ShowQuickClassBrowserPanel) + { + this.Visible = false; + } + if (VisualPABCSingleton.MainForm != null) + { + th = new Thread(new ThreadStart(ChangeInternal)); + th.Priority = ThreadPriority.Lowest; + th.IsBackground = true; + th.Start(); + } + } + + new public bool Visible + { + get + { + return base.Visible; + } + set + { + if (value) + ShowPanel(); + else + HidePanel(); + } + } + + public void ShowPanel() + { + base.Visible = true; + } + + public void HidePanel() + { + base.Visible = false; + } + + private void PaintInternal(object sender, PaintEventArgs e) + { + //base.OnPaint(e); + //e.Graphics.DrawLine(new Pen(SystemColors.ControlLight,0.1F),e.ClipRectangle.Left,e.ClipRectangle.Bottom-3,e.ClipRectangle.Right,e.ClipRectangle.Bottom-3); + //e.Graphics.DrawLine(new Pen(SystemColors.ControlDark,0.1F),e.ClipRectangle.Left,e.ClipRectangle.Bottom-1,e.ClipRectangle.Right,e.ClipRectangle.Bottom-1); + } + + protected override void Dispose(bool disposing) + { + if (disposing) { + this.textAreaControl.ActiveTextAreaControl.Caret.PositionChanged -= new EventHandler(CaretPositionChanged); + this.membersComboBox.Dispose(); + this.classComboBox.Dispose(); + this.currentCompilationUnit = null; + th.Abort(); + } + base.Dispose(disposing); + } + + void ChangeInternal() + { + bool first_comp; + ICodeCompletionDomConverter dconv =null; + bool tmp = true; + while (true) + { + first_comp = false; + if (this.Visible) + try + { + if (currentCompilationUnit == null && textAreaControl.FileName != null) + { + dconv = WorkbenchServiceFactory.CodeCompletionParserController.GetConverter(textAreaControl.FileName); + if (dconv != null && dconv.IsCompiled) + { + currentCompilationUnit = dconv.EntryScope; + first_comp = true; + } + if (clicked || tmp) + { + FillClassComboBox(true); + //clicked = false; + tmp = false; + } + } + if (currentCompilationUnit != null && (clicked || first_comp)) + { + dconv = WorkbenchServiceFactory.CodeCompletionParserController.GetConverter(textAreaControl.FileName); + if (dconv != null && dconv.IsCompiled) + { + currentCompilationUnit = dconv.EntryScope; + FillClassComboBox(true); + } + } + //lock(clicked) + { + clicked = false; + } + } + catch (Exception ex) + { + //MessageService.ShowError(ex); + } + Thread.Sleep(300); + } + } + + Thread th; + bool clicked = false; + IAsyncResult ar; + + void CaretPositionChanged(object sender, EventArgs e) + { + // ignore simple movements + + if (e != EventArgs.Empty) { + return; + } + clicked = true; + } + + bool membersComboBoxSelectedMember = false; + + void UpdateMembersComboBox() + { + membersComboBox.Invoke(new Invoke_del(Member_Invoke_Refresh)); + autoselect = false; + try + { + if (currentCompilationUnit != null) + { + for (int i = 0; i < membersComboBox.Items.Count; ++i) + { + if (((ComboBoxItem)membersComboBox.Items[i]).IsInside(textAreaControl.ActiveTextAreaControl.Caret.Line, textAreaControl.ActiveTextAreaControl.Caret.Column)) + { + if ((int)membersComboBox.Invoke(new Invoke_del_with_ret(GetSelectedMemberInternal)) != i) + { + membersComboBox.Invoke(new Invoke_param_del(SetSelectedMemberItemInternal), i); + } + if (!membersComboBoxSelectedMember) + { + membersComboBox.Invoke(new Invoke_del(Member_Invoke_Refresh)); + } + membersComboBoxSelectedMember = true; + return; + } + } + } + membersComboBox.Invoke(new Invoke_param_del(SetSelectedMemberItemInternal), -1); + if (membersComboBoxSelectedMember) + { + membersComboBox.Invoke(new Invoke_del(Member_Invoke_Refresh)); + membersComboBoxSelectedMember = false; + } + } + catch (Exception e) + { + } + finally { + autoselect = true; + } + } + + bool classComboBoxSelectedMember = false; + void UpdateClassComboBox(bool need_fill_members) + { + // Still needed ? + /*if (currentCompilationUnit == null) { + currentCompilationUnit = (ICompilationUnit)ParserService.GetParseInformation(Path.GetFullPath(textAreaControl.FileName)).MostRecentCompilationUnit; + }*/ + + autoselect = false; + Dictionary ns_list = new Dictionary(); + try + { + for (int i = 0; i < classComboBox.Items.Count; i++) + { + if (((ComboBoxItem)classComboBox.Items[i]).IsInside(textAreaControl.ActiveTextAreaControl.Caret.Line, textAreaControl.ActiveTextAreaControl.Caret.Column)) + { + + bool innerClassContainsCaret = false; + if (((ComboBoxItem)classComboBox.Items[i]).Item == null || ((ComboBoxItem)classComboBox.Items[i]).Item.SymbolInfo.kind == SymbolKind.Namespace) + { + ns_list[(ComboBoxItem)classComboBox.Items[i]] = i; + continue; + } + if (!innerClassContainsCaret) + { + if ((int)classComboBox.Invoke(new Invoke_del_with_ret(GetSelectedClassInternal)) != i) + { + //classComboBox.SelectedIndex = i; + classComboBox.Invoke(new Invoke_param_del(SetSelectedClassItemInternal), i); + if (need_fill_members) + FillMembersComboBox(); + } + if (!classComboBoxSelectedMember) + { + classComboBox.Invoke(new Invoke_del(Invoke_Refresh)); + } + classComboBoxSelectedMember = true; + + return; + } + } + } + foreach (ComboBoxItem cbi in ns_list.Keys) + { + if (cbi.Item is ImplementationUnitScope && cbi.IsInside(textAreaControl.ActiveTextAreaControl.Caret.Line, textAreaControl.ActiveTextAreaControl.Caret.Column)) + { + //classComboBox.SelectedIndex = (int)ns_list[cbi]; + classComboBox.Invoke(new Invoke_param_del(SetSelectedClassItemInternal), ns_list[cbi]); + if (need_fill_members) + FillMembersComboBox(); + classComboBox.Invoke(new Invoke_del(Invoke_Refresh)); + classComboBoxSelectedMember = true; + return; + } + else + { + //classComboBox.SelectedIndex = (int)ns_list[cbi]; + classComboBox.Invoke(new Invoke_param_del(SetSelectedClassItemInternal), ns_list[cbi]); + classComboBoxSelectedMember = true; + } + } + if (need_fill_members) + FillMembersComboBox(); + classComboBox.Invoke(new Invoke_del(Invoke_Refresh)); + return; + } + finally + { + autoselect = true; + } + // classComboBox.SelectedIndex = -1; + } + + IBaseScope GetCurrentSelectedClass() + { + try + { + if ((int)classComboBox.Invoke(new Invoke_del_with_ret(GetSelectedClassInternal)) >= 0) + { + return (IBaseScope)((ComboBoxItem)classComboBox.Items[(int)classComboBox.Invoke(new Invoke_del_with_ret(GetSelectedClassInternal))]).Item; + } + } + catch (Exception ex) + { + + } + return null; + } + + IBaseScope GetCurrentSelectedMember() + { + if ((int)membersComboBox.Invoke(new Invoke_del_with_ret(GetSelectedClassInternal)) >= 0) + { + return (IBaseScope)((ComboBoxItem)membersComboBox.Items[(int)membersComboBox.Invoke(new Invoke_del_with_ret(GetSelectedClassInternal))]).Item; + } + return null; + } + + bool NeedtoUpdate(ArrayList items, ComboBox comboBox) + { + if (items.Count != comboBox.Items.Count) + { + return true; + } + for (int i = 0; i < items.Count; ++i) + { + ComboBoxItem oldItem = (ComboBoxItem)comboBox.Items[i]; + ComboBoxItem newItem = (ComboBoxItem)items[i]; + if (oldItem.GetType() != newItem.GetType()) + { + return true; + } + if (newItem.CompareItemTo(oldItem) != 0) + { + return true; + } + } + return false; + } + + //IClass lastClassInMembersComboBox; + + void GetGlobalUnitMembers(ArrayList items) + { + foreach (IBaseScope ss in currentCompilationUnit.Members) + { + switch (ss.SymbolInfo.kind) + { + case SymbolKind.Method: + case SymbolKind.Constant: + case SymbolKind.Variable: + case SymbolKind.Event: + case SymbolKind.Field: + case SymbolKind.Parameter: + case SymbolKind.Property: + items.Add(new ComboBoxItem(ss, ss.GetDescriptionWithoutDoc(), CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); + break; + } + } + int ind = items.Count; + items.Sort(0, items.Count, new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + + if ((currentCompilationUnit as IInterfaceUnitScope).ImplementationUnitScope != null) + { + IImplementationUnitScope us = (currentCompilationUnit as IInterfaceUnitScope).ImplementationUnitScope; + //items.Add(new ComboBoxItem(us,"implementation",CodeCompletionProvider.ImagesProvider.GetPictureNum(us.si),true)); + foreach (IBaseScope ss in us.Members) + { + switch (ss.SymbolInfo.kind) + { + case SymbolKind.Method: + case SymbolKind.Constant: + case SymbolKind.Variable: + case SymbolKind.Event: + case SymbolKind.Field: + case SymbolKind.Parameter: + case SymbolKind.Property: + items.Add(new ComboBoxItem(ss, ss.GetDescriptionWithoutDoc(), CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); + break; + } + } + items.Sort(ind, items.Count - ind, new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + } + } + + void GetClassMembers(IBaseScope scope, ArrayList items) + { + if (scope != null && scope.Members != null) + { + ArrayList meths = new ArrayList(); + ArrayList fields = new ArrayList(); + ArrayList events = new ArrayList(); + ArrayList vars = new ArrayList(); + ArrayList props = new ArrayList(); + ArrayList consts = new ArrayList(); + foreach (IBaseScope el in scope.Members) + if (el.GetPosition().file_name != null && !el.SymbolInfo.not_include) + { + ComboBoxItem cbi = new ComboBoxItem(el, el.GetDescriptionWithoutDoc(), CodeCompletionProvider.ImagesProvider.GetPictureNum(el.SymbolInfo), true, false); + switch (el.SymbolInfo.kind) + { + case SymbolKind.Method: meths.Add(cbi); break; + case SymbolKind.Field: fields.Add(cbi); break; + case SymbolKind.Property: props.Add(cbi); break; + case SymbolKind.Variable: vars.Add(cbi); break; + case SymbolKind.Event: events.Add(cbi); break; + case SymbolKind.Constant: consts.Add(cbi); break; + } + //items.Add(new ComboBoxItem(el,el.GetDescriptionWithoutDoc(),CodeCompletionProvider.ImagesProvider.GetPictureNum(el.si),true)); + } + meths.Sort(new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + items.AddRange(meths); + props.Sort(new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + items.AddRange(props); + fields.Sort(new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + items.AddRange(fields); + vars.Sort(new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + items.AddRange(vars); + consts.Sort(new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + items.AddRange(consts); + events.Sort(new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + items.AddRange(events); + } + } + + void FillMembersComboBox() + { + ArrayList items = new ArrayList(); + IBaseScope scope = GetCurrentSelectedClass(); + if (scope == null) + { + GetGlobalUnitMembers(items); + //items.Sort(0,items.Count,new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + } + else + { + GetClassMembers(scope, items); + //items.Sort(0,items.Count,new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + } + if (NeedtoUpdate(items, membersComboBox)) + { + membersComboBox.Invoke(new Invoke_del(Member_Invoke_Update)); + membersComboBox.Invoke(new Invoke_del(Member_Invoke_Clear)); + //membersComboBox.Items.AddRange(items.ToArray()); + membersComboBox.Invoke(new Invoke_param_del(AddItemsToMembersComboboxInternal), items); + UpdateMembersComboBox(); + membersComboBox.Invoke(new Invoke_del(Member_Invoke_EndUpdate)); + } + else + { + membersComboBox.Invoke(new Invoke_del(Member_Invoke_Update)); + UpdateMembersComboBox(); + membersComboBox.Invoke(new Invoke_del(Member_Invoke_EndUpdate)); + } + } + + void AddClasses(ArrayList items) + { + IImplementationUnitScope impl = null; + int ind = 0; + if (currentCompilationUnit == null) + { + //items.Add(new ComboBoxItem(currentCompilationUnit,PascalABCCompiler.StringResources.Get("CODE_COMPLETION_GLOBAL"),CodeCompletionProvider.ImagesProvider.IconNumberUnitNamespace,true,true)); + return; + } + if ((currentCompilationUnit as InterfaceUnitScope).impl_scope != null) + { + items.Add(new ComboBoxItem(currentCompilationUnit, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_INTERFACE"), CodeCompletionProvider.ImagesProvider.GetPictureNum(currentCompilationUnit.SymbolInfo), true, false)); + impl = (currentCompilationUnit as IInterfaceUnitScope).ImplementationUnitScope; + items.Add(new ComboBoxItem(impl, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_IMPLEMENTATION"), CodeCompletionProvider.ImagesProvider.GetPictureNum(impl.SymbolInfo), true, false)); + ind = 2; + } + else + { + items.Add(new ComboBoxItem(currentCompilationUnit, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_GLOBAL"), CodeCompletionProvider.ImagesProvider.IconNumberUnitNamespace, true, true)); + ind = 1; + } + foreach (IBaseScope ss in currentCompilationUnit.Members) + { + switch (ss.SymbolInfo.kind) + { + case SymbolKind.Class: + case SymbolKind.Struct: + case SymbolKind.Type: + case SymbolKind.Enum: + case SymbolKind.Interface: + case SymbolKind.Delegate: + if (ss.GetPosition().file_name != null && !ss.SymbolInfo.name.Contains("$") && !ss.SymbolInfo.name.StartsWith("<")) + items.Add(new ComboBoxItem(ss, ss.SymbolInfo.name, CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); + break; + } + } + if (impl != null) + foreach (IBaseScope ss in impl.Members) + { + switch (ss.SymbolInfo.kind) + { + case SymbolKind.Class: + case SymbolKind.Struct: + case SymbolKind.Type: + case SymbolKind.Enum: + case SymbolKind.Interface: + case SymbolKind.Delegate: + if (ss.GetPosition().file_name != null && !ss.SymbolInfo.name.Contains("$") && !ss.SymbolInfo.name.StartsWith("<")) + items.Add(new ComboBoxItem(ss, ss.SymbolInfo.name, CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); + break; + } + } + items.Sort(ind, items.Count - ind, new Comparer(System.Globalization.CultureInfo.InvariantCulture)); + } + + delegate void Invoke_del(); + delegate void Invoke_param_del(object obj); + delegate object Invoke_del_with_ret(); + + void Invoke_Update() + { + classComboBox.BeginUpdate(); + } + + void Invoke_EndUpdate() + { + classComboBox.EndUpdate(); + } + + void Invoke_Clear() + { + classComboBox.Items.Clear(); + } + + void Invoke_Refresh() + { + classComboBox.Refresh(); + } + + void Member_Invoke_Update() + { + membersComboBox.BeginUpdate(); + } + + void Member_Invoke_EndUpdate() + { + membersComboBox.EndUpdate(); + } + + void Member_Invoke_Clear() + { + membersComboBox.Items.Clear(); + } + + void Member_Invoke_Refresh() + { + membersComboBox.Refresh(); + } + + void AddItemsToClassComboboxInternal(object items) + { + lock(classComboBox) + { + classComboBox.Items.AddRange(((ArrayList)items).ToArray()); + } + } + + void AddItemsToMembersComboboxInternal(object items) + { + lock (membersComboBox) + { + membersComboBox.Items.AddRange(((ArrayList)items).ToArray()); + } + } + + void SetSelectedClassItemInternal(object item) + { + classComboBox.SelectedIndex = (int)item; + } + + void SetSelectedMemberItemInternal(object item) + { + membersComboBox.SelectedIndex = (int)item; + } + + object GetSelectedClassInternal() + { + return classComboBox.SelectedIndex; + } + + object GetSelectedMemberInternal() + { + return membersComboBox.SelectedIndex; + } + + void FillClassComboBox(bool isUpdateRequired) + { + try //временно, исправть ошибку + { + if (isUpdateRequired) + { + classComboBox.Invoke(new Invoke_del(Invoke_Update)); + } + ArrayList items = new ArrayList(); + bool only_global = false; + AddClasses(items); + if (items.Count == 0) + { + items.Add(new ComboBoxItem(currentCompilationUnit, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_GLOBAL"), CodeCompletionProvider.ImagesProvider.IconNumberUnitNamespace, true, true)); + only_global = true; + } + classComboBox.Invoke(new Invoke_del(Invoke_Clear)); + //здесь ошибка доступа из другого потока [DSRE0001] + //classComboBox.Items.AddRange(items.ToArray()); + classComboBox.Invoke(new Invoke_param_del(AddItemsToClassComboboxInternal), items); + if (items.Count == 1) + { + try + { + autoselect = false; + //classComboBox.SelectedIndex = 0; + + //FillMembersComboBox(); + } + finally + { + autoselect = true; + } + } + UpdateClassComboBox(!only_global); + if (isUpdateRequired) + { + classComboBox.Invoke(new Invoke_del(Invoke_EndUpdate)); + } + } + catch (Exception ) + { + } + } + + + // THIS METHOD IS MAINTAINED BY THE FORM DESIGNER + // DO NOT EDIT IT MANUALLY! YOUR CHANGES ARE LIKELY TO BE LOST + void InitializeComponent() { + this.membersComboBox = new System.Windows.Forms.ComboBox(); + this.classComboBox = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // membersComboBox + // + this.membersComboBox.Dock = System.Windows.Forms.DockStyle.Right; + this.membersComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.membersComboBox.DropDownHeight = 250; + this.membersComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.membersComboBox.Font = new System.Drawing.Font("Arial", 9F); + this.membersComboBox.IntegralHeight = false; + this.membersComboBox.Location = new System.Drawing.Point(198, 0); + this.membersComboBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 1); + this.membersComboBox.Name = "membersComboBox"; + this.membersComboBox.Size = new System.Drawing.Size(212, 22); + this.membersComboBox.TabIndex = 1; + this.membersComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBoxDrawItem); + this.membersComboBox.DropDown += new System.EventHandler(this.ComboBoxDropDown); + this.membersComboBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.MeasureComboBoxItem); + this.membersComboBox.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectedIndexChanged); + // + // classComboBox + // + this.classComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.classComboBox.DropDownHeight = 150; + this.classComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.classComboBox.Font = new System.Drawing.Font("Arial", 9F); + this.classComboBox.IntegralHeight = false; + this.classComboBox.Location = new System.Drawing.Point(1, 0); + this.classComboBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 1); + this.classComboBox.Name = "classComboBox"; + this.classComboBox.Size = new System.Drawing.Size(189, 22); + this.classComboBox.TabIndex = 0; + this.classComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBoxDrawItem); + this.classComboBox.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.MeasureComboBoxItem); + this.classComboBox.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectedIndexChanged); + // + // QuickClassBrowserPanel + // + this.AutoSize = true; + this.Controls.Add(this.membersComboBox); + this.Controls.Add(this.classComboBox); + this.Name = "QuickClassBrowserPanel"; + this.Size = new System.Drawing.Size(410, 23); + this.Resize += new System.EventHandler(this.QuickClassBrowserPanelResize); + this.ResumeLayout(false); + + } + + void ComboBoxDropDown(object sender, System.EventArgs e) + { + + } + + void ComboBoxSelectedIndexChanged(object sender, System.EventArgs e) + { + try + { + ComboBox comboBox = (ComboBox)sender; + if (autoselect) + { + ComboBoxItem item = null; + if (comboBox == classComboBox) + item = (ComboBoxItem)comboBox.Items[(int)comboBox.Invoke(new Invoke_del_with_ret(GetSelectedClassInternal))]; + else + item = (ComboBoxItem)comboBox.Items[(int)comboBox.Invoke(new Invoke_del_with_ret(GetSelectedMemberInternal))]; + if (item.IsInCurrentPart) + { + //textAreaControl.ActiveTextAreaControl.Caret.Position = new ICSharpCode.TextEditor.TextLocation(item.Column, item.Line); + //textAreaControl.ActiveTextAreaControl.TextArea.Focus(); + //VisualPABCSingleton.MainForm.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(textAreaControl.FileName,item.Line+1,item.Column, + // item.EndLine+1,item.Column),VisualPascalABCPlugins.SourceLocationAction.NavigationGoto); + VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.ExecuteSourceLocationAction( + new PascalABCCompiler.SourceLocation(textAreaControl.FileName, item.Line + 1, item.Column + 1, item.Line + 1, item.Column + 1), VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + else + { + + } + if (comboBox == classComboBox) + { + FillMembersComboBox(); + UpdateMembersComboBox(); + } + } + } + catch (Exception) + { + + } + } + + // font - has to be static - don't create on each draw + static Font font = font = new Font("Tahoma", 8.5f); + static StringFormat drawStringFormat = new StringFormat(StringFormatFlags.NoWrap); + + void ComboBoxDrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + ComboBox comboBox = (ComboBox)sender; + lock (comboBox) + { + e.DrawBackground(); + if (e.Index >= 0) + { + + ComboBoxItem item = (ComboBoxItem)comboBox.Items[e.Index]; + var dx = Convert.ToInt32(Math.Round(2 * ScreenScale.Calc())); + e.Graphics.DrawImage(CodeCompletionProvider.ImagesProvider.ImageList.Images[item.IconIndex], + e.Bounds.X + dx, e.Bounds.Y, // + (e.Bounds.Height - CodeCompletionProvider.ImagesProvider.ImageList.ImageSize.Height) / 2 + e.Bounds.Height, e.Bounds.Height + ); + Rectangle drawingRect = new Rectangle(e.Bounds.X + dx + e.Bounds.Height/*CodeCompletionProvider.ImagesProvider.ImageList.ImageSize.Width*/, + e.Bounds.Y, + e.Bounds.Width - dx - e.Bounds.Height/*CodeCompletionProvider.ImagesProvider.ImageList.ImageSize.Width*/, + e.Bounds.Height); + + Brush drawItemBrush = SystemBrushes.WindowText; + if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) + { + drawItemBrush = SystemBrushes.HighlightText; + } + if (!item.IsInCurrentPart) + { + drawItemBrush = SystemBrushes.ControlDark; + } + else if (e.State == DrawItemState.ComboBoxEdit && !item.IsInside(textAreaControl.ActiveTextAreaControl.Caret.Line, textAreaControl.ActiveTextAreaControl.Caret.Column)) + { + drawItemBrush = SystemBrushes.ControlDark; + } + e.Graphics.DrawString(item.ToString(), + font, + drawItemBrush, + drawingRect, + drawStringFormat); + + } + //e.DrawFocusRectangle(); + } + } + + void QuickClassBrowserPanelResize(object sender, System.EventArgs e) + { + Size comboBoxSize = new Size(Width / 2 - 1, classComboBox.Size.Height); + classComboBox.Size = comboBoxSize; + membersComboBox.Location = new Point(classComboBox.Bounds.Right + 2, classComboBox.Bounds.Top); + membersComboBox.Size = comboBoxSize; + } + + void MeasureComboBoxItem(object sender, System.Windows.Forms.MeasureItemEventArgs e) + { + ComboBox comboBox = (ComboBox)sender; + if (e.Index >= 0) { + ComboBoxItem item = (ComboBoxItem)comboBox.Items[e.Index]; + SizeF size = e.Graphics.MeasureString(item.ToString(), font); + e.ItemWidth = (int)size.Width; + + e.ItemHeight = (int)Math.Max(size.Height, CodeCompletionProvider.ImagesProvider.ImageList.ImageSize.Height); + } + } + } +} diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.resx b/VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/QuickClassBrowserPanel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/CodeCompletion/TooltipServiceManager.cs b/VisualPascalABCNETLinux/IB/CodeCompletion/TooltipServiceManager.cs new file mode 100644 index 000000000..edbf4849c --- /dev/null +++ b/VisualPascalABCNETLinux/IB/CodeCompletion/TooltipServiceManager.cs @@ -0,0 +1,179 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using ICSharpCode.TextEditor.Gui.CompletionWindow; + +namespace VisualPascalABC +{ + public class TooltipServiceManager + { + static DeclarationViewWindow dvw; + + private static string GetPopupHintText(TextArea textArea, ToolTipRequestEventArgs e) + { + ICSharpCode.TextEditor.TextLocation logicPos = e.LogicalPosition; + IDocument doc = textArea.Document; + LineSegment seg = doc.GetLineSegment(logicPos.Y); + string FileName = textArea.MotherTextEditorControl.FileName; + PascalABCCompiler.Parsers.KeywordKind keyw = PascalABCCompiler.Parsers.KeywordKind.None; + if (logicPos.X > seg.Length - 1) + return null; + //string expr = FindFullExpression(doc.TextContent, seg.Offset + logicPos.X,e.LogicalPosition.Line,e.LogicalPosition.Column); + string expr_without_brackets = null; + string expr = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindExpressionFromAnyPosition(seg.Offset + logicPos.X, doc.TextContent, e.LogicalPosition.Line, e.LogicalPosition.Column, out keyw, out expr_without_brackets); + if (expr == null) + expr = expr_without_brackets; + if (expr_without_brackets == null) + return null; + List Errors = new List(); + PascalABCCompiler.SyntaxTree.expression tree = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + Path.GetExtension(FileName), expr, Errors, new List()); + bool header = false; + if (Errors.Count > 0) + { + if (expr.IndexOf('<') != -1 && expr.IndexOf('>') != -1) + { + Errors.Clear(); + tree = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + Path.GetExtension(FileName), expr.Replace("<", "&<"), Errors, new List()); + } + else + { + string s = expr.TrimStart(); + if (s.Length > 0 && s[0] == '^') + { + Errors.Clear(); + expr_without_brackets = expr_without_brackets.TrimStart().Substring(1); + tree = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + Path.GetExtension(FileName), s.Substring(1), Errors, new List()); + } + } + } + if (tree == null || Errors.Count > 0) + { + Errors.Clear(); + tree = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + Path.GetExtension(FileName), expr_without_brackets, Errors, new List()); + header = true; + if (tree == null || Errors.Count > 0) + return null; + } + else + { + Errors.Clear(); + PascalABCCompiler.SyntaxTree.expression tree2 = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController.GetExpression("test" + Path.GetExtension(FileName), expr_without_brackets, Errors, new List()); + //header = true; + if (tree2 == null || Errors.Count > 0) + return null; + //if (tree is PascalABCCompiler.SyntaxTree.new_expr && (tree as PascalABCCompiler.SyntaxTree.new_expr).params_list == null) + // tree = tree2; + } + CodeCompletion.DomConverter dconv = (CodeCompletion.DomConverter)CodeCompletion.CodeCompletionController.comp_modules[FileName]; + if (dconv == null) return null; + return dconv.GetDescription(tree, FileName, expr_without_brackets, WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.StandartCompiler.ParsersController, e.LogicalPosition.Line, e.LogicalPosition.Column, keyw, header); + } + + static int _mouse_hint_x = 0, _mouse_hint_y = 0; + static int _hint_hide_d = 0; + static bool toolTipVisible = false; + + public static void ToolTipService_TextAreaMouseMove(object sender, MouseEventArgs e) + { + //System.IO.File.AppendAllText("d:\\logP.txt", "TextAreaMouseMove" + $" {toolTipVisible} {DateTime.Now}\n"); + if (toolTipVisible) + { + if (Math.Sqrt((_mouse_hint_x - e.X) * (_mouse_hint_x - e.X) + (_mouse_hint_y - e.Y) * (_mouse_hint_y - e.Y)) > _hint_hide_d) + hideToolTip(); + } + } + + public static void ToolTipService_TextAreaKeyDown(object sender, KeyEventArgs e) + { + hideToolTip(); + } + + public static void ToolTipService_TextAreaMouseEvent_HideToolTip(object sender, MouseEventArgs e) + { + hideToolTip(); + } + + public static void hideToolTip() + { + if (dvw != null) + { + dvw.Description = null; + toolTipVisible = false; + } + } + + public static void ToolTipService_TextAreaToolTipRequest(object sender, ToolTipRequestEventArgs e) + { + if (!VisualPABCSingleton.MainForm.UserOptions.CodeCompletionHint) + return; + if (CodeCompletion.CodeCompletionController.CurrentParser == null) + return; + try + { + TextArea textArea = sender as TextArea; + if (dvw != null && dvw.Description != null) + { + hideToolTip(); + return; + } + if (e.ToolTipShown && dvw != null) + { + hideToolTip(); + return; + } + if (e.InDocument) + { + + if (dvw == null) + { + dvw = new DeclarationWindow(VisualPABCSingleton.MainForm); + dvw.Font = new System.Drawing.Font(Constants.CompletionWindowDeclarationViewWindowFontName, dvw.Font.Size); + + dvw.HideOnClick = true; + //dvw.ShowDeclarationViewWindow(); + } + int ypos = (textArea.Document.GetVisibleLine(e.LogicalPosition.Y) + 1) * textArea.TextView.FontHeight - textArea.VirtualTop.Y; + System.Drawing.Point p = new System.Drawing.Point(0, ypos); + p = textArea.PointToScreen(p); + p.X = Control.MousePosition.X + 3; + p.Y += 5; + string txt = GetPopupHintText(textArea, e); + dvw.Location = choose_location(p, txt); + dvw.Description = txt; + + _hint_hide_d = dvw.Font.Height / 2; + _mouse_hint_x = e.MousePosition.X; + _mouse_hint_y = e.MousePosition.Y; + toolTipVisible = true; + } + } + catch (System.Exception ex) + { + //VisualPABCSingleton.MainForm.WriteToOutputBox(ex.Message);// ICSharpCode.Core.MessageService.ShowError(ex); + } + finally + { + + } + } + + private static System.Drawing.Point choose_location(System.Drawing.Point p, string desc) + { + Graphics g = Graphics.FromHwnd(dvw.Handle); + Size sz = Size.Ceiling(g.MeasureString(desc, dvw.Font, Screen.PrimaryScreen.WorkingArea.Width)); + if (p.X + sz.Width > Screen.PrimaryScreen.WorkingArea.Width) + { + p.X -= sz.Width - Screen.PrimaryScreen.WorkingArea.Width + p.X; + } + return p; + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/Actions.cs b/VisualPascalABCNETLinux/IB/Debugger/Actions.cs new file mode 100644 index 000000000..db806a732 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/Actions.cs @@ -0,0 +1,47 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using ICSharpCode.TextEditor; + +namespace VisualPascalABC +{ + public class AddToWatchAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + + public override void Execute(TextArea textArea) + { + try + { + int num_line = 0; + + string var = null; + if (!textArea.SelectionManager.HasSomethingSelected) + var = WorkbenchServiceFactory.DebuggerManager.GetVariable(textArea, out num_line); + else + { + var = textArea.SelectionManager.SelectedText; + //num_line = textArea.SelectionManager.SelectionStart.Line; + } + if (var == null || var == "") + { + WorkbenchServiceFactory.DebuggerOperationsService.GotoWatch(); + return; + //VisualPABCSingleton.MainForm.SetCursorInWatch(); + } + ValueItem vi = WorkbenchServiceFactory.DebuggerManager.FindVarByName(var, num_line) as ValueItem; + if (vi != null) + { + VisualPABCSingleton.MainForm.AddVariable(vi); + } + else + { + WorkbenchServiceFactory.DebuggerOperationsService.AddVariable(var, true); + } + } + catch (System.Exception) + { + WorkbenchServiceFactory.DebuggerOperationsService.GotoWatch(); + } + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.Designer.cs b/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.Designer.cs new file mode 100644 index 000000000..b600fb92b --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.Designer.cs @@ -0,0 +1,89 @@ + +namespace VisualPascalABC +{ + partial class AddWatchForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.tbName = new System.Windows.Forms.TextBox(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // tbName + // + this.tbName.Location = new System.Drawing.Point(12, 22); + this.tbName.Name = "tbName"; + this.tbName.Size = new System.Drawing.Size(274, 20); + this.tbName.TabIndex = 0; + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(53, 68); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(75, 23); + this.btnOk.TabIndex = 1; + this.btnOk.Text = "RF_OK"; + this.btnOk.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(171, 68); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // AddWatchForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(298, 103); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.tbName); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AddWatchForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "M_ADD_EXPR"; + this.ResumeLayout(false); + this.PerformLayout(); + } + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.TextBox tbName; + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.cs b/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.cs new file mode 100644 index 000000000..1e05d04f8 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.cs @@ -0,0 +1,40 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + /// + /// Description of AddWatchForm. + /// + public partial class AddWatchForm : Form + { + public AddWatchForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + + public string EditValue + { + get + { + return this.tbName.Text; + } + set + { + this.tbName.Text = value; + this.tbName.Select(); + } + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.resx b/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.resx new file mode 100644 index 000000000..7080a7d11 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/AddWatchForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/Debugger/Bookmarks.cs b/VisualPascalABCNETLinux/IB/Debugger/Bookmarks.cs new file mode 100644 index 000000000..647e2e881 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/Bookmarks.cs @@ -0,0 +1,758 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +// This is a modified file from SharpDevelop project (Copyright (c) AlphaSierraPapa) +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using Debugger; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; + +namespace VisualPascalABC +{ + public class SDBookmark : Bookmark + { + public SDBookmark(string fileName, IDocument document, int lineNumber) + : base(document, lineNumber) + { + this.fileName = fileName; + } + + string fileName; + + public string FileName + { + get + { + return fileName; + } + set + { + if (fileName != value) + { + fileName = value; + OnFileNameChanged(EventArgs.Empty); + } + } + } + + public event EventHandler FileNameChanged; + + protected virtual void OnFileNameChanged(EventArgs e) + { + if (FileNameChanged != null) + { + FileNameChanged(this, e); + } + } + + bool isSaved = true; + + /// + /// Gets/Sets if the bookmark should be saved to the project memento file. + /// + /// + /// Default is true, set this property to false if you are using the bookmark for + /// something special like like "CurrentLineBookmark" in the debugger. + /// + public bool IsSaved + { + get + { + return isSaved; + } + set + { + isSaved = value; + } + } + + bool isVisibleInBookmarkPad = true; + + /// + /// Gets/Sets if the bookmark is shown in the bookmark pad. + /// + /// + /// Default is true, set this property to false if you are using the bookmark for + /// something special like like "CurrentLineBookmark" in the debugger. + /// + public bool IsVisibleInBookmarkPad + { + get + { + return isVisibleInBookmarkPad; + } + set + { + isVisibleInBookmarkPad = value; + } + } + } + + public abstract class SDMarkerBookmark : SDBookmark + { + public SDMarkerBookmark(string fileName, IDocument document, int lineNumber) + : base(fileName, document, lineNumber) + { + SetMarker(); + } + + IDocument oldDocument; + TextMarker oldMarker; + + protected abstract TextMarker CreateMarker(); + + void SetMarker() + { + RemoveMarker(); + if (Document != null) + { + TextMarker marker = CreateMarker(); + // Perform editor update + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + Document.CommitUpdate(); + oldMarker = marker; + } + oldDocument = Document; + } + + protected override void OnDocumentChanged(EventArgs e) + { + base.OnDocumentChanged(e); + SetMarker(); + } + + public void RemoveMarker() + { + if (oldDocument != null) + { + oldDocument.MarkerStrategy.RemoveMarker(oldMarker); + oldDocument.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + oldDocument.CommitUpdate(); + } + oldDocument = null; + oldMarker = null; + } + } + public class CurrentBreakpointBookmark : SDMarkerBookmark + { + static CurrentBreakpointBookmark instance; + + static int startLine; + static int startColumn; + static int endLine; + static int endColumn; + bool willBeHit; + static readonly Color defaultColor = Color.FromArgb(180, 38, 38); + /*public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider; + if (tecp != null) + SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn); + else + Remove(); + }*/ + private bool isOnCondition = false; + + public bool IsOnCondition + { + get + { + return isOnCondition; + } + set + { + isOnCondition = value; + if (Document != null) + { + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + Document.CommitUpdate(); + } + } + } + + public virtual bool WillBeHit + { + get + { + return willBeHit; + } + set + { + willBeHit = value; + if (Document != null) + { + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + Document.CommitUpdate(); + } + } + } + + public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + Remove(); + + startLine = makerStartLine; + startColumn = makerStartColumn; + endLine = makerEndLine; + endColumn = makerEndColumn; + + LineSegment line = document.GetLineSegment(startLine - 1); + instance = new CurrentBreakpointBookmark(fileName, document, startLine - 1); + document.BookmarkManager.AddMark(instance); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, endLine - 1)); + document.CommitUpdate(); + } + + public static void Remove() + { + if (instance != null) + { + instance.Document.BookmarkManager.RemoveMark(instance); + instance.RemoveMarker(); + instance = null; + } + } + + public override bool CanToggle + { + get + { + return false; + } + } + + public CurrentBreakpointBookmark(string fileName, IDocument document, int startLine) + : base(fileName, document, startLine) + { + this.IsSaved = false; + this.IsVisibleInBookmarkPad = false; + } + + public override void Draw(IconBarMargin margin, Graphics g, Point p) + { + margin.DrawBreakpoint(g, p.Y, IsEnabled, WillBeHit,IsOnCondition); + } + + protected override TextMarker CreateMarker() + { + if (LineNumber >= Document.TotalNumberOfLines) + LineNumber = Document.TotalNumberOfLines - 1; + LineSegment lineSeg = Document.GetLineSegment(LineNumber); + TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, defaultColor, Color.White); + Document.MarkerStrategy.InsertMarker(0, marker); + return marker; + } + } + + public class RuntimeErrorBookmark : SDMarkerBookmark + { + public RuntimeErrorBookmark(string fileName, IDocument document, int startLine): + base(fileName, document, startLine) + { + this.IsSaved = false; + this.IsVisibleInBookmarkPad = false; + } + + static RuntimeErrorBookmark instance; + + static int startLine; + static int startColumn; + static int endLine; + static int endColumn; + + //public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerEndLine) + public static void SetPosition(TextEditorControl ctrl, int makerStartLine) + { + try + { + Remove(); + IDocument document = ctrl.Document; + string fileName = ctrl.FileName; + startLine = makerStartLine; + endLine = makerStartLine; + startColumn=1; + LineSegment line = document.GetLineSegment(startLine - 1); + endColumn = line.Length+1; + instance = new RuntimeErrorBookmark(fileName, document, startLine - 1); + document.BookmarkManager.AddMark(instance); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, startLine - 1)); + document.CommitUpdate(); + } + catch + { + + } + } + + public static void Remove() + { + try + { + if (instance != null) + { + instance.Document.BookmarkManager.RemoveMark(instance); + instance.RemoveMarker(); + instance = null; + } + } + catch + { + + } + } + + public override void Draw(IconBarMargin margin, Graphics g, Point p) + { + //margin.DrawArrow(g, p.Y); + } + + public override bool CanToggle + { + get + { + return false; + } + } + + protected override TextMarker CreateMarker() + { + LineSegment lineSeg = Document.GetLineSegment(startLine - 1); + //TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); + TextMarker marker = new TextMarker(lineSeg.Offset+startColumn - 1, Math.Max(endColumn-startColumn, 1), TextMarkerType.SolidBlock, Color.OrangeRed, Color.White); + Document.MarkerStrategy.InsertMarker(0, marker); + return marker; + } + } + + public class ErrorLineBookmark : SDMarkerBookmark + { + static ErrorLineBookmark instance; + + static int startLine; + static int startColumn; + static int endLine; + static int endColumn; + + //public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerEndLine) + public static void SetPosition(TextEditorControl ctrl, int makerStartLine) + { + try + { + Remove(); + IDocument document = ctrl.Document; + string fileName = ctrl.FileName; + startLine = makerStartLine; + endLine = makerStartLine; + startColumn=1; + LineSegment line = document.GetLineSegment(startLine - 1); + endColumn = line.Length+1; + instance = new ErrorLineBookmark(fileName, document, startLine - 1); + document.BookmarkManager.AddMark(instance); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, startLine - 1)); + document.CommitUpdate(); + } + catch + { + + } + } + + public static void Remove() + { + try + { + if (instance != null) + { + instance.Document.BookmarkManager.RemoveMark(instance); + instance.RemoveMarker(); + instance = null; + } + } + catch + { + + } + } + + public override bool CanToggle + { + get + { + return false; + } + } + + public ErrorLineBookmark(string fileName, IDocument document, int startLine) + : base(fileName, document, startLine) + { + this.IsSaved = false; + this.IsVisibleInBookmarkPad = false; + } + + public override void Draw(IconBarMargin margin, Graphics g, Point p) + { + //margin.DrawArrow(g, p.Y); + } + + protected override TextMarker CreateMarker() + { + LineSegment lineSeg = Document.GetLineSegment(startLine - 1); + //TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); + TextMarker marker = new TextMarker(lineSeg.Offset+startColumn - 1, Math.Max(endColumn-startColumn, 1), TextMarkerType.SolidBlock, Color.Red, Color.White); + Document.MarkerStrategy.InsertMarker(0, marker); + return marker; + } + } + + public class CurrentLineBookmark : SDMarkerBookmark + { + static CurrentLineBookmark instance; + + static int startLine; + static int startColumn; + static int endLine; + static int endColumn; + + /*public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider; + if (tecp != null) + SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn); + else + Remove(); + }*/ + + public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + Remove(); + + startLine = makerStartLine; + startColumn = makerStartColumn; + endLine = makerEndLine; + endColumn = makerEndColumn; + + LineSegment line = document.GetLineSegment(startLine - 1); + instance = new CurrentLineBookmark(fileName, document, startLine - 1); + document.BookmarkManager.AddMark(instance); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, endLine - 1)); + document.CommitUpdate(); + } + + public static void Remove() + { + if (instance != null) + { + instance.Document.BookmarkManager.RemoveMark(instance); + instance.RemoveMarker(); + instance = null; + } + } + + public override bool CanToggle + { + get + { + return false; + } + } + + public CurrentLineBookmark(string fileName, IDocument document, int startLine) + : base(fileName, document, startLine) + { + this.IsSaved = false; + this.IsVisibleInBookmarkPad = false; + } + + public override void Draw(IconBarMargin margin, Graphics g, Point p) + { + margin.DrawArrow(g, p.Y); + } + + protected override TextMarker CreateMarker() + { + LineSegment lineSeg = Document.GetLineSegment(startLine - 1); + //TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); + TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); + Document.MarkerStrategy.InsertMarker(0, marker); + return marker; + } + } + + public enum DebugStatus + { + None, + StepOver, + StepIn + } + + public enum hit_kind + { + is_true, + changed + } + + public class BreakpointInfo + { + public bool enabled=true; + public string condition; + public hit_kind kind= hit_kind.is_true; + public RetValue val; + } + + public class BreakPointFactory + { + public static Dictionary breakpoints = new Dictionary(); + public static Dictionary breakpoints_conditions = new Dictionary(); + static BreakPointFactory() + { + + } + + private static BreakpointConditionForm bcf; + + public static bool MustHit(Breakpoint br) + { + BreakpointInfo bi = null; + if (breakpoints_conditions.TryGetValue(br,out bi)) + { + if (!bi.enabled) + return true; + string cond = bi.condition.Trim(' ','\t'); + if (string.IsNullOrEmpty(cond)) + return true; + try + { + RetValue res = WorkbenchServiceFactory.DebuggerManager.Evaluate(cond); + if (bi.kind == hit_kind.is_true) + { + if (res.prim_val != null && res.prim_val is bool) + { + if ((bool)res.prim_val) + return true; + else + return false; + } + else if (res.obj_val != null && res.obj_val.IsPrimitive && res.obj_val.PrimitiveValue is bool) + { + if ((bool)res.obj_val.PrimitiveValue) + return true; + else + return false; + } + else + return true; + } + else + { + if (res.obj_val != null && res.obj_val.IsPrimitive) + { + res.prim_val = res.obj_val.PrimitiveValue; + res.obj_val = null; + } + if (!WorkbenchServiceFactory.DebuggerManager.evaluator.IsEqual(res,bi.val)) + { + bi.val = res; + return true; + } + else + return false; + } + } + catch + { + return true; + } + } + else + return true; + } + + public static void InvokeAddCondition() + { + if (bcf == null) + { + bcf = new BreakpointConditionForm(); + Form1StringResources.SetTextForAllControls(bcf); + } + BreakpointInfo bi = null; + Breakpoint br = breakpoints[cur_bookmark]; + if (breakpoints_conditions.TryGetValue(br,out bi)) + { + bcf.IsConditionEnabled = bi.enabled; + bcf.Condition = bi.condition; + if (bi.kind == hit_kind.is_true) + bcf.IfTrue = true; + else + bcf.IfChanged = true; + } + else + { + bcf.IsConditionEnabled = true; + bcf.Condition = ""; + bcf.IfTrue = true; + } + if (bcf.ShowDialog() == DialogResult.OK) + { + if (bi == null) + { + bi = new BreakpointInfo(); + breakpoints_conditions.Add(br,bi); + } + bi.enabled = bcf.IsConditionEnabled; + bi.condition = bcf.Condition; + if (bcf.IfTrue) + bi.kind = hit_kind.is_true; + else + bi.kind = hit_kind.changed; + cur_bookmark.IsOnCondition = bi.enabled && !string.IsNullOrEmpty(bi.condition.Trim(' ','\t')); + + } + } + + public static void AddBreakpoints(string FileName, TextArea text_area) + { + List br_list = WorkbenchServiceFactory.DebuggerManager.GetBreakpointsInFile(FileName); + foreach (Breakpoint br in br_list) + { + ToggleBreakpointAtByOpen(text_area.Document, br.SourcecodeSegment.SourceFullFilename, br.SourcecodeSegment.StartLine-1, br); + } + } + + public static void ToggleBreakpointAtByOpen(IDocument document, string fileName, int lineNumber, Breakpoint br) + { + foreach (char ch in document.GetText(document.GetLineSegment(lineNumber))) + { + if (!char.IsWhiteSpace(ch)) + { + CurrentBreakpointBookmark cbb = new CurrentBreakpointBookmark(fileName, document, lineNumber); + breakpoints.Add(cbb, br); + document.BookmarkManager.AddMark(cbb); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, lineNumber)); + document.CommitUpdate(); + break; + } + } + } + + public static CurrentBreakpointBookmark IsOnBreakpoint(IDocument document, int lineNumber) + { + foreach (Bookmark m in document.BookmarkManager.Marks) + { + CurrentBreakpointBookmark breakpoint = m as CurrentBreakpointBookmark; + if (breakpoint != null) + { + if (breakpoint.LineNumber == lineNumber) + { + return breakpoint; + } + } + } + return null; + } + + public static bool HasBreakpoints() + { + return breakpoints.Count > 0; + } + + public static void ToggleBreakpointAt(IDocument document, string fileName, int lineNumber) + { + foreach (Bookmark m in document.BookmarkManager.Marks) + { + CurrentBreakpointBookmark breakpoint = m as CurrentBreakpointBookmark; + if (breakpoint != null) + { + if (breakpoint.LineNumber == lineNumber) + { + document.BookmarkManager.RemoveMark(m); + try + { + if (breakpoints_conditions.ContainsKey(breakpoints[breakpoint])) + breakpoints_conditions.Remove(breakpoints[breakpoint]); + WorkbenchServiceFactory.DebuggerManager.RemoveBreakpoint(breakpoints[breakpoint]); + } + catch (System.Exception) + { + } + breakpoints.Remove(breakpoint); + breakpoint.RemoveMarker(); + return; + } + } + } + foreach (char ch in document.GetText(document.GetLineSegment(lineNumber))) + { + if (!char.IsWhiteSpace(ch)) + { + CurrentBreakpointBookmark cbb = new CurrentBreakpointBookmark(fileName, document, lineNumber); + breakpoints.Add(cbb, WorkbenchServiceFactory.DebuggerManager.AddBreakPoint(fileName, lineNumber + 1,true)); + document.BookmarkManager.AddMark(cbb); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, lineNumber)); + document.CommitUpdate(); + break; + } + } + } + + public static CurrentBreakpointBookmark cur_bookmark = null; + + public static void DeleteCurrentBreakpoint() + { + if (cur_bookmark != null) + { + ToggleBreakpointAt(cur_bookmark.Document,cur_bookmark.FileName,cur_bookmark.LineNumber); + } + } + + public static void IconBarMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons) + { + try + { + if (mouseButtons != MouseButtons.Left) + { + if (mouseButtons == MouseButtons.Right) + { + iconBar.TextArea.MotherTextEditorControl.ContextMenuStrip = null; + Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition; + ICSharpCode.TextEditor.TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); + if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) + { + cur_bookmark = IsOnBreakpoint(iconBar.TextArea.Document,logicPos.Y); + if (cur_bookmark != null) + { + iconBar.TextArea.MotherTextEditorControl.ContextMenuStrip = VisualPABCSingleton.MainForm.BreakpointMenuStrip; + } + } + } + return; + } + else + { + Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition; + //Point logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); + ICSharpCode.TextEditor.TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); + if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) + { + string s = iconBar.TextArea.MotherTextEditorControl.FileName; + if (s == null) s = TextAreaHelper.GetFileNameByTextArea(iconBar.TextArea); + ToggleBreakpointAt(iconBar.TextArea.Document, s, logicPos.Y); + iconBar.TextArea.Refresh(iconBar); + } + } + } + catch (System.Exception e) + { + } + } + } + +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.Designer.cs b/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.Designer.cs new file mode 100644 index 000000000..8ae41a310 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.Designer.cs @@ -0,0 +1,130 @@ + +namespace VisualPascalABC +{ + partial class BreakpointConditionForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.chbCondtionEnabled = new System.Windows.Forms.CheckBox(); + this.tbCondition = new System.Windows.Forms.TextBox(); + this.rbTrue = new System.Windows.Forms.RadioButton(); + this.rbChanged = new System.Windows.Forms.RadioButton(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // chbCondtionEnabled + // + this.chbCondtionEnabled.Checked = true; + this.chbCondtionEnabled.CheckState = System.Windows.Forms.CheckState.Checked; + this.chbCondtionEnabled.Location = new System.Drawing.Point(12, 12); + this.chbCondtionEnabled.Name = "chbCondtionEnabled"; + this.chbCondtionEnabled.Size = new System.Drawing.Size(122, 24); + this.chbCondtionEnabled.TabIndex = 1; + this.chbCondtionEnabled.Text = "M_CONDITION2"; + this.chbCondtionEnabled.UseVisualStyleBackColor = true; + this.chbCondtionEnabled.CheckedChanged += new System.EventHandler(this.ChbCondtionEnabledCheckedChanged); + // + // tbCondition + // + this.tbCondition.Location = new System.Drawing.Point(30, 33); + this.tbCondition.Name = "tbCondition"; + this.tbCondition.Size = new System.Drawing.Size(279, 20); + this.tbCondition.TabIndex = 2; + // + // rbTrue + // + this.rbTrue.Checked = true; + this.rbTrue.Location = new System.Drawing.Point(30, 59); + this.rbTrue.Name = "rbTrue"; + this.rbTrue.Size = new System.Drawing.Size(104, 24); + this.rbTrue.TabIndex = 3; + this.rbTrue.TabStop = true; + this.rbTrue.Text = "M_IF_TRUE"; + this.rbTrue.UseVisualStyleBackColor = true; + // + // rbChanged + // + this.rbChanged.Location = new System.Drawing.Point(30, 80); + this.rbChanged.Name = "rbChanged"; + this.rbChanged.Size = new System.Drawing.Size(104, 24); + this.rbChanged.TabIndex = 4; + this.rbChanged.Text = "M_IF_CHANGED"; + this.rbChanged.UseVisualStyleBackColor = true; + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(136, 110); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(83, 23); + this.btnOk.TabIndex = 5; + this.btnOk.Text = "RF_OK"; + this.btnOk.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(225, 110); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(84, 23); + this.btnCancel.TabIndex = 6; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // BreakpointConditionForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(314, 142); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.rbChanged); + this.Controls.Add(this.rbTrue); + this.Controls.Add(this.tbCondition); + this.Controls.Add(this.chbCondtionEnabled); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "BreakpointConditionForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "M_BREAKPOINT_CONDITION_FORM"; + this.ResumeLayout(false); + this.PerformLayout(); + } + private System.Windows.Forms.CheckBox chbCondtionEnabled; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.RadioButton rbChanged; + private System.Windows.Forms.RadioButton rbTrue; + private System.Windows.Forms.TextBox tbCondition; + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.cs b/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.cs new file mode 100644 index 000000000..9d02c6da2 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.cs @@ -0,0 +1,92 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + /// + /// Description of BreakpointCondition. + /// + public partial class BreakpointConditionForm : Form + { + public BreakpointConditionForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + + public bool IsConditionEnabled + { + get + { + return this.chbCondtionEnabled.Checked; + } + set + { + this.chbCondtionEnabled.Checked = value; + } + } + + public string Condition + { + get + { + return this.tbCondition.Text; + } + set + { + this.tbCondition.Text = value; + this.tbCondition.Select(); + } + } + + public bool IfTrue + { + get + { + return this.rbTrue.Checked; + } + set + { + this.rbTrue.Checked = value; + } + } + + public bool IfChanged + { + get + { + return this.rbChanged.Checked; + } + set + { + this.rbChanged.Checked = value; + } + } + + void ChbCondtionEnabledCheckedChanged(object sender, EventArgs e) + { + if (this.chbCondtionEnabled.Checked) + { + this.tbCondition.Enabled = true; + this.rbTrue.Enabled = true; + this.rbChanged.Enabled = true; + } + else + { + this.tbCondition.Enabled = false; + this.rbTrue.Enabled = false; + this.rbChanged.Enabled = false; + } + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.resx b/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.resx new file mode 100644 index 000000000..7080a7d11 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/BreakpointCondition.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs new file mode 100644 index 000000000..65e9f9a5c --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs @@ -0,0 +1,1842 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using Debugger; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using System.Runtime.ExceptionServices; + +namespace VisualPascalABC +{ + + //Klass predostavljaushij informaciju ob otlazhivaemoj programme + public class AssemblyHelper + { + private static System.Reflection.Assembly a; + private static List ref_modules = new List(); + private static Hashtable ns_ht = new Hashtable(); + private static Hashtable stand_types = new Hashtable(StringComparer.OrdinalIgnoreCase); + private static List unit_types = new List();//spisok tipov-obertok nad moduljami + private static List unit_debug_types;//to zhe samoe, no tipy Debugger.Core + private static DebugType pabc_system_type = null; + + static AssemblyHelper() + { + stand_types["integer"] = typeof(int); + stand_types["byte"] = typeof(byte); + stand_types["shortint"] = typeof(sbyte); + stand_types["word"] = typeof(ushort); + stand_types["smallint"] = typeof(short); + stand_types["longint"] = typeof(int); + stand_types["longword"] = typeof(uint); + stand_types["int64"] = typeof(long); + stand_types["uint64"] = typeof(ulong); + stand_types["real"] = typeof(double); + stand_types["single"] = typeof(float); + stand_types["char"] = typeof(char); + stand_types["string"] = typeof(string); + stand_types["boolean"] = typeof(bool); + stand_types["object"] = typeof(object); + } + + public static bool Is32BitAssembly() + { + if (!Environment.Is64BitProcess) + return false; + System.Reflection.PortableExecutableKinds peKind; + System.Reflection.ImageFileMachine machine; + a.ManifestModule.GetPEKind(out peKind, out machine); + return peKind == System.Reflection.PortableExecutableKinds.Required32Bit; + } + + public static void LoadAssembly(string file_name) + { + //ad = AppDomain.CreateDomain("DebugDomain",null,Path.GetDirectoryName(file_name),Path.GetDirectoryName(file_name),false); + try + { + FileStream fs = File.OpenRead(file_name); + byte[] buf = new byte[fs.Length]; + fs.Read(buf, 0, (int)fs.Length); + fs.Close(); + a = System.Reflection.Assembly.Load(buf); + + Type[] tt = a.GetTypes(); + foreach (Type t in tt) + { + if (t.Namespace != null) + ns_ht[t.Namespace] = t.Namespace; + if (t.Namespace == t.Name) + { + unit_types.Add(t); + } + try + { + object[] attrs = t.GetCustomAttributes(false); + foreach (Attribute attr in attrs) + { + Type attr_t = attr.GetType(); + if (attr_t.Name == "$UsedNsAttr") + { + int count = (int)attr_t.GetField("count").GetValue(attr); + string ns = attr_t.GetField("ns").GetValue(attr) as string; + int j = 0; + for (int i = 0; i < count; i++) + { + byte str_len = (byte)ns[j]; + string ns_s = ns.Substring(j + 1, str_len); + ns_ht[ns_s] = ns_s; + j += str_len + 1; + } + break; + } + } + } + catch + { + + } + } + } + catch (System.Exception e) + { + + } + } + + [HandleProcessCorruptedStateExceptionsAttribute] + public static bool IsDebuggerStepThrough(Function f) + { + if (f == null) + return false; + try + { + System.Reflection.MethodBase mb = a.ManifestModule.ResolveMethod((int)f.Token); + if (mb != null) + return mb.GetCustomAttributes(typeof(System.Diagnostics.DebuggerStepThroughAttribute), false).Length > 0; + } + catch + { + } + return false; + } + + + public static DebugType GetPABCSystemType() + { + if (pabc_system_type == null) + { + string file_name = PascalABCCompiler.Compiler.GetReferenceFileName("PABCRtl.dll"); + System.Reflection.Assembly assm = PascalABCCompiler.NetHelper.NetHelper.LoadAssembly(file_name); + PascalABCCompiler.NetHelper.NetHelper.init_namespaces(assm); + pabc_system_type = DebugUtils.GetDebugType(PascalABCCompiler.NetHelper.NetHelper.PABCSystemType); + } + return pabc_system_type; + } + + public static Type GetTypeForStatic(string name) + { + Type t = null; + foreach (string s in ns_ht.Keys) + { + t = a.GetType(s + "." + name, false, true); + if (t != null) + return t; + } + t = stand_types[name] as Type; + if (t != null) return t; + t = PascalABCCompiler.NetHelper.NetHelper.FindType(name); + if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType("System." + name); + if (t == null) + foreach (string s in ns_ht.Keys) + { + t = PascalABCCompiler.NetHelper.NetHelper.FindType(s + "." + name); + if (t != null) + break; + } + return t; + } + + public static Type GetTypeForStatic(string name, List gen_types) + { + Type t = null; + foreach (string s in ns_ht.Keys) + { + t = a.GetType(s+"."+name+"`"+gen_types.Count,false,true); + if (t != null) + { + //t = t.MakeGenericType(gen_types.ToArray()); + return t; + } + } + t = PascalABCCompiler.NetHelper.NetHelper.FindType(name+"`"+gen_types.Count); + if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType("System."+name+"`"+gen_types.Count); + if (t == null) + foreach (string s in ns_ht.Keys) + { + t = PascalABCCompiler.NetHelper.NetHelper.FindType(s+"."+name+"`"+gen_types.Count); + if (t != null) + break; + } + + //if (t != null) + // t = t.MakeGenericType(gen_types.ToArray()); + return t; + } + + public static Type GetType(string name) + { + Type t = stand_types[name] as Type; + if (t != null) return t; + t = a.GetType(name,false,true); + if (t == null) + foreach (string s in ns_ht.Keys) + { + t = a.GetType(s+"."+name,false,true); + if (t != null) break; + } + if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType(name); + if (t == null) t = PascalABCCompiler.NetHelper.NetHelper.FindType("System."+name); + if (t == null) + foreach (string s in ns_ht.Keys) + { + t = PascalABCCompiler.NetHelper.NetHelper.FindType(s+"."+name); + if (t != null) + break; + } +// if (t == null) t = Type.GetType(name,false,true); +// if (t == null) t = Type.GetType("System."+name,false,true); +// if (t == null) +// foreach(System.Reflection.Assembly ass in ref_modules) +// { +// t = ass.GetType(name); +// if (t != null) +// break; +// } + return t; + } + + public static List GetUsesTypes(Process p, DebugType dt) + { + if (unit_debug_types == null) + { + unit_debug_types = new List(); + foreach (Type t in unit_types) + unit_debug_types.Add(DebugType.Create(p.GetModule(t.Assembly.ManifestModule.ScopeName),(uint)t.MetadataToken)); + } + return unit_debug_types; + } + + public static void Unload() + { + //if (ad != null) AppDomain.Unload(ad); + //GC.Collect(); + ns_ht.Clear(); + unit_types.Clear(); + if (unit_debug_types != null) + unit_debug_types.Clear(); + unit_debug_types = null; + } + } + + public class ProcessDelegator : IProcess + { + private Process process; + + public ProcessDelegator(Process process) + { + this.process = process; + } + + public bool HasExited + { + get + { + return process.HasExited; + } + } + } + + public class ProcessEventArgsDelegator : EventArgs, IProcessEventArgs + { + private ProcessDelegator process; + + public ProcessEventArgsDelegator(ProcessDelegator process) + { + this.process = process; + } + + public IProcess Process + { + get + { + return process; + } + } + } + + /// + /// Класс для отладки программ + /// + public class DebugHelper : IDebuggerManager + { + private NDebugger dbg; + private Process debuggedProcess; + private IWorkbench workbench; + private string FileName; + private string FullFileName; + private string PrevFullFileName; + private Breakpoint brPoint; + private Breakpoint currentBreakpoint; + private int CurrentLine; + public DebugStatus Status; + private bool MustDebug = false; + public bool IsRunning = false; + public string ExeFileName; + public bool ShowDebugTabs=true; + public PascalABCCompiler.Parsers.IParser parser = null; + EventHandler debuggerStateEvent; + + public DebugHelper() + { + //System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.MTA); + dbg = new NDebugger(); + //th = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(frm.RefreshPad)); + this.workbench = WorkbenchServiceFactory.Workbench; + } + + public Process DebuggedProcess + { + get + { + return debuggedProcess; + } + } + + event EventHandler IDebuggerManager.DebuggeeStateChanged + { + add + { + debuggerStateEvent += value; + } + + remove + { + debuggerStateEvent -= value; + } + } + + public Breakpoint CurrentBreakpoint + { + get { return currentBreakpoint; } + set { currentBreakpoint = value; } + } + + /// + /// Добавить Breakpoint в файл fileName строку line + /// + public Breakpoint AddBreakPoint(string fileName, int line, bool commonBreakpoint) + { + Breakpoint br = null; + bool added = false; + if (!workbench.UserOptions.AlwaysAttachDebuggerAtStart && handle != 0 && commonBreakpoint && this.debuggedProcess == null) + { + Attach(handle, ExeFileName, true,true); + } + foreach (Breakpoint bp in dbg.Breakpoints) + { + if (bp.SourcecodeSegment.SourceFullFilename == fileName && bp.SourcecodeSegment.StartLine == line) + { + added = true; + br = bp; + } + } + if (!added) + br = dbg.AddBreakpoint(fileName, line); + + return br; + } + + /// + /// Получить список Breakpointov в файле fileName + /// + public List GetBreakpointsInFile(string fileName) + { + List lst = new List(); + foreach (Breakpoint bp in dbg.Breakpoints) + { + if (bp.SourcecodeSegment.SourceFullFilename == fileName) + { + lst.Add(bp); + } + } + return lst; + } + + /// + /// Удалить Breakpoint + /// + public void RemoveBreakpoint(Breakpoint br) + { + dbg.RemoveBreakpoint(br); + } + + public delegate void DebugHelperActionDelegate(string FileName); + public event DebugHelperActionDelegate Exited; + public event DebugHelperActionDelegate Starting; + + /// + /// Запуск процесса на отладку + /// + /// Имя ехе-файла + /// Имя исходного файла + /// Каталог файла + /// Аргументы командной строки + /// Флаг, нужно ли устанавливать Breakpoint на первом операторе (F8, F7) + /// Временно не используется + public void Start(string fileName, string sourceFileName, string workingDirectory, string arguments, bool need_first_brpt, bool redirectOutput) + { + if (Starting != null) + Starting(fileName); + //dbg = new NDebugger(); + dbg.ProcessStarted += debugProcessStarted; + dbg.ProcessExited += debugProcessExit; + dbg.BreakpointHit += debugBreakpointHit; + //if (brPoint != null) dbg.RemoveBreakpoint(brPoint); + this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas"; + this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName); + this.ExeFileName = fileName; + this.PrevFullFileName = FullFileName; + if (need_first_brpt) brPoint = dbg.AddBreakpoint(FileName, workbench.VisualEnvironmentCompiler.Compiler.BeginOffset); + AssemblyHelper.LoadAssembly(fileName); + debuggedProcess = dbg.Start(fileName, workingDirectory, arguments); + SelectProcess(debuggedProcess); + } + + private uint handle=0; + + public void NullProcessHandleIfNeed(string fileName) + { + if (string.Compare(fileName,this.ExeFileName,true)==0) + { + FileName = null; + handle = 0; + if (debuggedProcess == null) + { + IsRunning = false; + ExeFileName = null; + WorkbenchServiceFactory.OperationsService.ClearTabStack(); + WorkbenchServiceFactory.DebuggerOperationsService.ClearDebugTabs(); + WorkbenchServiceFactory.Workbench.DisassemblyWindow.ClearWindow(); + } + } + } + + public void Attach(uint handle, string fileName, bool real_attach, bool late_attach) + { + if (!real_attach) + { + this.handle = handle; + this.ExeFileName = fileName; + IsRunning = true; + return; + } + if (handle == 0) + return; + if (Starting != null) + Starting(fileName); + + string sourceFileName = null; + if (!ProjectFactory.Instance.ProjectLoaded) + sourceFileName = workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName; + else + sourceFileName = ProjectFactory.Instance.CurrentProject.MainFile; + this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas"; + this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName); + this.ExeFileName = fileName; + CurrentLine = 0; + this.parser = CodeCompletion.CodeCompletionController.ParsersController.selectParser(Path.GetExtension(FullFileName).ToLower()); + this.PrevFullFileName = FullFileName; + AssemblyHelper.LoadAssembly(fileName); + dbg.ProcessStarted += debugProcessStarted; + dbg.ProcessExited += debugProcessExit; + //brPoint = dbg.AddBreakpoint(FileName, frm.VisualEnvironmentCompiler.Compiler.BeginOffset); + try + { + debuggedProcess = dbg.DebugActiveProcess(handle, fileName); + } + catch (System.Exception ex) + { + return; + } + SelectProcess(debuggedProcess); + //debuggedProcess.Break(); + } + + Function currentFunction; + Dictionary sourceMap; + + public void UpdateBreakpoints() + { + try + { + Dictionary> dict = new Dictionary>(); + List toRemove = new List(); + foreach (CurrentBreakpointBookmark b in BreakPointFactory.breakpoints.Keys) + { + try + { + if (dbg.GetBreakpoint(b.FileName, b.LineNumber + 1) == null) + dbg.AddBreakpoint(b.FileName, b.LineNumber + 1); + if (!dict.ContainsKey(b.FileName)) + dict.Add(b.FileName, new List()); + if (!dict[b.FileName].Contains(b.LineNumber + 1)) + dict[b.FileName].Add(b.LineNumber + 1); + } + catch + { + if (!dict.ContainsKey(b.FileName)) + dict.Add(b.FileName, new List()); + } + } + + foreach (Breakpoint b in dbg.Breakpoints) + if (dict.ContainsKey(b.SourcecodeSegment.SourceFullFilename) && !dict[b.SourcecodeSegment.SourceFullFilename].Contains(b.SourcecodeSegment.StartLine)) + toRemove.Add(b); + foreach (Breakpoint b in toRemove) + dbg.RemoveBreakpoint(b); + } + catch + { + + } + } + + void debuggedProcess_DebuggeeStateChanged(object sender, ProcessEventArgs e) + { + if (currentBreakpoint != null) + { + dbg.RemoveBreakpoint(currentBreakpoint); + RemoveGotoBreakpoints(); + currentBreakpoint = null; //RemoveBreakpoints(); + } + JumpToCurrentLine(); + //ChangeLocalVars(e.Process); + //if (e.Process.IsPaused) + WorkbenchServiceFactory.DebuggerOperationsService.RefreshPad(new FunctionItem(e.Process.SelectedFunction).SubItems); + workbench.WidgetController.SetStartDebugEnabled(); + if (currentFunction != e.Process.SelectedFunction) + { + if (WorkbenchServiceFactory.Workbench.DisassemblyWindow.IsVisible) + { + var tp = GetNativeCodeOfSelectedFunction(e.Process.SelectedFunction); + WorkbenchServiceFactory.DebuggerOperationsService.DisplayDisassembledCode(tp.Item1); + sourceMap = tp.Item2; + currentFunction = e.Process.SelectedFunction; + } + } + if (debuggerStateEvent != null) + debuggerStateEvent(this, new ProcessEventArgsDelegator(new ProcessDelegator(this.debuggedProcess))); + } + + private void debugBreakpointHit(object sender, BreakpointEventArgs e) + { + + } + + public void SetFirstBreakpoint(string fileName, int line) + { + brPoint = dbg.AddBreakpoint(fileName, line); + } + + private void SelectProcess(Debugger.Process process) + { + if (debuggedProcess != null) + { + //debuggedProcess.DebuggingPaused -= debuggedProcess_DebuggingPaused; + //debuggedProcess.ExceptionThrown -= debuggedProcess_ExceptionThrown; + debuggedProcess.DebuggeeStateChanged -= debuggedProcess_DebuggeeStateChanged; + debuggedProcess.DebuggingResumed -= debuggedProcess_DebuggingResumed; + debuggedProcess.DebuggingPaused -= debuggedProcess_DebuggingPaused; + debuggedProcess.ExceptionThrown -= debuggedProcess_ExceptionThrown; + debuggedProcess.Expired -= debuggedProcess_Expired; + //debuggedProcess.LogMessage -= debuggedProcess_logMessage; + } + debuggedProcess = process; + if (debuggedProcess != null) + { + //debuggedProcess.DebuggingPaused += debuggedProcess_DebuggingPaused; + //debuggedProcess.ExceptionThrown += debuggedProcess_ExceptionThrown; + debuggedProcess.DebuggeeStateChanged += debuggedProcess_DebuggeeStateChanged; + debuggedProcess.DebuggingResumed += debuggedProcess_DebuggingResumed; + debuggedProcess.DebuggingPaused += debuggedProcess_DebuggingPaused; + debuggedProcess.ExceptionThrown += debuggedProcess_ExceptionThrown; + debuggedProcess.Expired += debuggedProcess_Expired; + //debuggedProcess.LogMessage += debuggedProcess_logMessage; + } + JumpToCurrentLine(); + OnProcessSelected(new ProcessEventArgs(process)); + } + + private void debuggerTraceMessage(object sender, MessageEventArgs e) + { + //frm.WriteToOutputBox(e.Message); + } + + private void debuggedProcess_logMessage(object sender, MessageEventArgs e) + { + WorkbenchServiceFactory.OperationsService.WriteToOutputBox(e.Message, false); + //debuggedProcess.TraceMessage("kkkk"); + } + + private void debuggedProcess_Expired(object sender, EventArgs e) + { + workbench.WidgetController.SetStartDebugEnabled(); + } + + private void debuggedProcess_ExceptionThrown(object sender, ExceptionEventArgs e) + { + if (e.Exception.Message == "System.StackOverflowException") + WorkbenchServiceFactory.OperationsService.WriteToOutputBox(RuntimeExceptionsStringResources.Get("Process is terminated due to StackOverflowException."), true); + else + WorkbenchServiceFactory.OperationsService.WriteToOutputBox(e.Exception.Message, true); + } + + private void debuggedProcess_DebuggingPaused(object sender, ProcessEventArgs e) + { + if (MustDebug && e.Process.PausedReason != PausedReason.Exception) + { + //System.Threading.Thread.Sleep(10); + if (Status == DebugStatus.StepOver) + e.Process.StepOver(); + else + e.Process.StepInto(); + MustDebug = false; + } + workbench.WidgetController.SetDebugPausedDisabled(); + } + + protected virtual void OnProcessSelected(ProcessEventArgs e) + { + } + + void RemoveBreakpoints() + { + if (brPoint != null) + { + dbg.RemoveBreakpoint(brPoint); + brPoint = null; + } + } + + void debugProcessExit(object sender, ProcessEventArgs e) + { + if (Exited != null && ExeFileName != null) + Exited(ExeFileName); + curPage = null; + ShowDebugTabs = true; + workbench.WidgetController.SetPlayButtonsVisible(false); + workbench.WidgetController.SetAddExprMenuVisible(false); + workbench.WidgetController.SetDisassemblyMenuVisible(false); + DebugWatchListWindowForm.WatchWindow.ClearAllSubTrees(); + IsRunning = false; + workbench.WidgetController.SetDebugStopDisabled(); + workbench.WidgetController.ChangeContinueDebugNameOnStart(); + CurrentLineBookmark.Remove(); + WorkbenchServiceFactory.DebuggerOperationsService.ClearLocalVarTree(); + WorkbenchServiceFactory.DebuggerOperationsService.ClearDebugTabs(); + WorkbenchServiceFactory.DebuggerOperationsService.ClearWatch(); + WorkbenchServiceFactory.Workbench.DisassemblyWindow.ClearWindow(); + workbench.WidgetController.SetDebugTabsVisible(false); + WorkbenchServiceFactory.OperationsService.ClearTabStack(); + workbench.WidgetController.EnableCodeCompletionToolTips(true); + RemoveGotoBreakpoints(); + AssemblyHelper.Unload(); + CloseOldToolTip(); + workbench.ServiceContainer.EditorService.SetEditorDisabled(false); + //RemoveMarker(frm.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Document); + evaluator = null; + parser= null; + FileName = null; + handle = 0; + ExeFileName = null; + FullFileName = null; + PrevFullFileName = null; + Status = DebugStatus.None; + dbg.ProcessStarted -= debugProcessStarted; + dbg.ProcessExited -= debugProcessExit; + dbg.BreakpointHit -= debugBreakpointHit; + debuggedProcess = null; + //GC.Collect(); + //dbg = null; + } + + void debuggedProcess_DebuggingResumed(object sender, ProcessEventArgs e) + { + //CurrentLineBookmark.Remove(); + //frm.SetDebugStopDisabled(); + } + + public ExpressionEvaluator evaluator; + + void debugProcessStarted(object sender, ProcessEventArgs e) + { + workbench.WidgetController.SetDebugTabsVisible(true); + workbench.WidgetController.SetPlayButtonsVisible(true); + workbench.WidgetController.SetDebugStopEnabled();//e.Process.LogMessage += messageEventProc; + workbench.WidgetController.SetStartDebugDisabled(); + workbench.WidgetController.ChangeStartDebugNameOnContinue(); + workbench.WidgetController.EnableCodeCompletionToolTips(false); + workbench.WidgetController.SetAddExprMenuVisible(true); + workbench.WidgetController.SetDisassemblyMenuVisible(true); + workbench.ServiceContainer.EditorService.SetEditorDisabled(true); + TooltipServiceManager.hideToolTip(); + IsRunning = true; + evaluator = new ExpressionEvaluator(e.Process,workbench.VisualEnvironmentCompiler, FileName); + } + + /// + /// Вычисляет значение выражения (WATCH) + /// + public RetValue Evaluate(string expr) + { + if (evaluator != null) + return evaluator.Evaluate(expr, false); + else return new RetValue(); + } + + private NamedValue GetNullBasedArray(Value val) + { + IList flds = val.Type.GetFields(); + if (flds.Count != 3) return null; + foreach (FieldInfo fi in flds) + if (fi.Name == "NullBasedArray") return fi.GetValue(val); + return null; + } + + /// + /// Возвращает текстовое представление для значения val + /// + public string MakeValueView(Value val) + { + bool by_ref = false; + if ((val.Type.IsByRef() && !val.Type.IsPrimitive)) + { + by_ref = true; + val = val.Dereference; + } + int v = 0; + NamedValue nv = GetNullBasedArray(val);//mozhet eto massiv + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + if (nv != null)//staticheskij massiv + { + sb.Append('('); + NamedValueCollection nvc = nv.GetArrayElements(); + for (int i = 0; i < nvc.Count; i++) + { + if (i > 10) + { + sb.Append("..."); + break; + } + sb.Append(MakeValueView(nvc[i])); + if (i < nvc.Count - 1) sb.Append(','); + } + sb.Append(')'); + //sb.AppendLine(); + //sb.Remove( + } + else if (val.IsPrimitive) + { + if (val.Type.ManagedType == typeof(string) || val.Type.ManagedType == typeof(char)) + sb.Append("'" + val.AsString + "'"); + else + sb.Append(val.AsString); + } + else if (val.IsNull) + { + sb.Append("nil"); + } + else if (DebugUtils.IsEnum(val, out v)) + { + sb.Append(ValueItem.MakeEnumText(val)); + } + else if (val.Type.IsValueType && val.Type.GetMembers().Count <= 7) + { + sb.Append('{'); + NamedValueCollection nvc = val.GetMembers(); + for (int i = 0; i < nvc.Count; i++) + { + sb.Append(nvc[i].Name + ": " + MakeValueView(nvc[i])); + if (i < nvc.Count - 1) sb.Append("; "); + } + sb.Append('}'); + } + else if (val.IsArray)//dinamicheskij massiv + { + NamedValueCollection nvc = val.GetArrayElements(); + sb.Append('('); + for (int i = 0; i < nvc.Count; i++) + { + if (i > 10) + { + sb.Append("..."); + break; + } + sb.Append(MakeValueView(nvc[i])); + if (i < nvc.Count - 1) sb.Append(','); + } + sb.Append(')'); + //sb.AppendLine(); + } + else if (val.IsObject) + { + if (val.Type.FullName == "PABCSystem.TypedSet") + sb.Append((val.Type.GetMember("ToString", BindingFlags.All)[0] as MethodInfo).Invoke(val, new Value[0] { }).AsString); + else + if (!val.Type.IsPrimitive) + { + if (DebugUtils.CheckForCollection(val.Type)) + return DebugUtils.MakeViewForCollection(val);//esli eto kollekcija, to vyvodim ee po osobomu + bool is_failed = false; + string s = ExpressionEvaluator.GetToString(val, out is_failed); + if (s != null) return s; + else return val.AsString; + } + else + return val.AsString; + } + else return val.AsString; + return sb.ToString(); + } + + private void OnAddBreakpoint(object sender, EventArgs e) + { + + } + + private TextArea curTextArea = null; + private ICodeFileDocument curPage; + + private bool is_out = false; + private SourcecodeSegment stepin_stmt = null; + private bool tab_changed=false; + + /// + /// Перейти к следующей строке при отладке + /// + private void JumpToCurrentLine() + { + workbench.MainForm.Activate(); + CurrentLineBookmark.Remove();//udalajem zheltyj kursor otladki + //System.Threading.Thread.Sleep(70); + if (debuggedProcess != null) + { + SourcecodeSegment nextStatement = debuggedProcess.NextStatement; + //debuggedProcess.Modules[0].SymReader.GetMethod(debuggedProcess.SelectedFunction.Token); + if (nextStatement != null) + { + string save_PrevFullFileName = PrevFullFileName; + //CodeFileDocumentControl page = null; + //DebuggerService.JumpToCurrentLine(nextStatement.SourceFullFilename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn); + if (!ShowDebugTabs)//esli eshe ne pokazany watch i lokal, pokazyvaem + { + ShowDebugTabs = true; + workbench.WidgetController.SetDebugTabsVisible(true); + workbench.WidgetController.SetAddExprMenuVisible(true); + } + if (debuggedProcess.NextStatement.StartLine == 0xFFFFFF) + { + //sjuda popadem, esli vyzyvaem Test(arr), gde arr - massiv peredavaemyj po znacheniju + //metod $Copy ne imeet sequence pointov, poetomu chtoby vojti v proceduru vyzovy $Copy my pomechaem 0xFFFFFFF + //dolgo s etoj badjagoj muchalsja + is_out = true; + debuggedProcess.StepInto();//vhodim neposredstvenno v proceduru + return; + } + else if (AssemblyHelper.IsDebuggerStepThrough(debuggedProcess.SelectedFunction)) + { + MustDebug = true; + debuggedProcess.StepOut(); + + return; + } + else if (is_out) + { + is_out = false; + if (stepin_stmt.SourceFullFilename == debuggedProcess.NextStatement.SourceFullFilename && stepin_stmt.StartLine != debuggedProcess.NextStatement.StartLine) + stepin_stmt = debuggedProcess.NextStatement; + else + { + debuggedProcess.StepInto(); + return; + } + } + if (debuggedProcess.NextStatement.SourceFullFilename != this.PrevFullFileName || !WorkbenchServiceFactory.DocumentService.ContainsTab(debuggedProcess.NextStatement.SourceFullFilename)) + { + tab_changed = true; + curPage = WorkbenchServiceFactory.FileService.OpenFileForDebug(debuggedProcess.NextStatement.SourceFullFilename); + if (curPage == null) + { + MustDebug = true; + return; + } + PrevFullFileName = debuggedProcess.NextStatement.SourceFullFilename; + } + else if (curPage != WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument) + WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument = curPage; + bool remove_breakpoints = true; + IDocument doc = curPage.TextEditor.Document; + curTextArea = curPage.TextEditor.ActiveTextAreaControl.TextArea; + LineSegment lseg = curPage.TextEditor.ActiveTextAreaControl.Document.GetLineSegment(debuggedProcess.NextStatement.StartLine - 1); + int len = lseg.Length + 1; + /*if (lseg.Words.Count == 1 && string.Compare(lseg.Words[0].Word,"begin",true)==0) + { + debuggedProcess.StepOver(); + return; + }*/ + //eto badjaga prepjatstvuet popadaniju na begin + //luchshego sposoba naverno net + bool in_comm = false; + bool beg = false; + bool in_str = false; + for (int i = 0; i < lseg.Words.Count; i++) + { + if (lseg.Words[i].Type == TextWordType.Word) + { + string word = lseg.Words[i].Word; + if (string.Compare(word, "begin", true) == 0 && !in_str && !in_comm) + beg = true; + else if (string.Compare(word, "{") == 0) + { + if (!in_str) in_comm = true; + } + else if (string.Compare(word, "}") == 0) + { + if (!in_str && in_comm) in_comm = false; + } + else if (string.Compare(word, "'") == 0) + in_str = !in_str; + else if (string.Compare(word, "/") == 0) + { + if (i < lseg.Words.Count - 1 && string.Compare(lseg.Words[i + 1].Word, "/") == 0) + break; + } + else if (string.Compare(word, "(") == 0) + { + if (i < lseg.Words.Count - 1 && string.Compare(lseg.Words[i + 1].Word, "*") == 0) + { + beg = false; + break; + } + } + else if (!in_str && !in_comm) + { + beg = false; + break; + } + } + } + if (beg) + { + if (debuggedProcess.PausedReason != PausedReason.Exception) + debuggedProcess.StepOver(); + return; + } + if (debuggedProcess.PausedReason == PausedReason.Breakpoint) + { + Breakpoint br = dbg.GetBreakpoint(debuggedProcess.NextStatement.SourceFullFilename, nextStatement.StartLine); + if (br != null && !BreakPointFactory.MustHit(br)) + { + if (Status == DebugStatus.StepOver || Status == DebugStatus.StepIn) + { + remove_breakpoints = false; + } + else + { + debuggedProcess.Continue(); + return; + } + } + } + //for (int i=0; i> GetNativeCodeOfSelectedFunction(Function selectedFunction=null) + { + if (selectedFunction == null) + selectedFunction = debuggedProcess.SelectedFunction; + uint size = selectedFunction.CorFunction.NativeCode.Size; + byte[] buffer = new byte[size]; + uint mapSize; + COR_DEBUG_IL_TO_NATIVE_MAP[] mapBuffer = new COR_DEBUG_IL_TO_NATIVE_MAP[selectedFunction.CorFunction.ILCode.Size]; + unsafe + { + fixed (byte* ptr = &buffer[0]) + { + IntPtr iptr = new IntPtr((void*)ptr); + selectedFunction.CorFunction.NativeCode.GetCode(0, size, size, iptr); + } + fixed (void* ptr = &mapBuffer[0]) + { + IntPtr iptr = new IntPtr(ptr); + selectedFunction.CorFunction.NativeCode.GetILToNativeMapping((uint)mapBuffer.Length, out mapSize, iptr); + } + } + Dictionary il2asm = new Dictionary(); + for (int i = 0; i < mapSize; i++) + { + if (i < mapBuffer.Length) + il2asm.Add(mapBuffer[i].nativeStartOffset, mapBuffer[i].ilOffset); + } + SharpDisasm.Disassembler disasm = new SharpDisasm.Disassembler(buffer, AssemblyHelper.Is32BitAssembly()?SharpDisasm.ArchitectureMode.x86_32: SharpDisasm.ArchitectureMode.x86_64); + IEnumerable instructions = disasm.Disassemble(); + StringBuilder sb = new StringBuilder(); + int linesNum = 0; + Dictionary sourceMap = new Dictionary(); + Dictionary linesDict = new Dictionary(); + bool firstLine = true; + foreach (var instruction in instructions) + { + linesNum++; + + uint ilOffset; + if (il2asm.TryGetValue((uint)instruction.Offset, out ilOffset)) + { + var segment = selectedFunction.GetSegmentForOffet(ilOffset); + + if (segment != null && !linesDict.ContainsKey(segment.StartLine)) + { + if (ilOffset > 2000000000) + { + if (firstLine) + continue; + } + else + firstLine = false; + int line = segment.StartLine; + string text = curPage.TextEditor.Document.GetText(curPage.TextEditor.Document.GetLineSegment(line - 1)); + sb.AppendLine((segment.StartLine+":").PadRight(10, ' ') + text.Trim()); + linesDict.Add(segment.StartLine, segment.StartLine); + } + } + sb.Append("///"+selectedFunction.CorFunction.NativeCode.Address.ToString("X") + "+0x"+instruction.Offset.ToString("X") + ": " + instruction.ToString()); + sb.AppendLine(); + + } + return new Tuple>(sb.ToString(),sourceMap); + } + + public void DoInPausedState(MethodInvoker action) + { + Debugger.Process process = debuggedProcess; + if (process.IsPaused) + { + //System.Threading.Thread th = new System.Threading.Thread(new System.Threading.ThreadStart(delegate{action();})); + //th.Start(); + action(); + } + else + { + EventHandler onDebuggingPaused = null; + onDebuggingPaused = delegate + { + action(); + process.DebuggingPaused -= onDebuggingPaused; + }; + process.DebuggingPaused += onDebuggingPaused; + } + } + + private NamedValue GetVariableFromName(string variableName) + { + if (debuggedProcess == null || debuggedProcess.IsRunning) + { + return null; + } + else + { + return debuggedProcess.GetValue(variableName); + } + } + + DebuggerGridControl oldToolTipControl; + + void TextAreaMouseLeave(object source, EventArgs e) + { + if (CanCloseOldToolTip && !oldToolTipControl.IsMouseOver) + CloseOldToolTip(); + } + + /// + /// Получить выражение под курсором + /// + public string GetVariable(TextArea textArea, out int num_line) + { + IDocument doc = textArea.Document; + string textContent = doc.TextContent; + num_line = textArea.Caret.Line; + int start_off = 0; + int end_off = 0; + string expressionResult = FindFullExpression(textContent, textArea.Caret.Offset,doc, out start_off, out end_off); + return expressionResult; + } + + private string GetVariable(ToolTipRequestEventArgs e, TextArea textArea, out int num_line, out int start_off, out int end_off) + { + //Point logicPos = e.LogicalPosition; + ICSharpCode.TextEditor.TextLocation logicPos = e.LogicalPosition; + IDocument doc = textArea.Document; + LineSegment seg = doc.GetLineSegment(logicPos.Y); + num_line = seg.LineNumber; + start_off = 0; + end_off = 0; + if (logicPos.X > seg.Length - 1) + return null; + string textContent = doc.TextContent; + string expressionResult = FindFullExpression(textContent, seg.Offset + logicPos.X,doc, out start_off, out end_off); + return expressionResult; + } + + private string FindFullExpression(string text, int offset, IDocument doc, out int start_off, out int end_off) + { + int i = offset; + int beg_line = 1; + int off = 0; + start_off = 0; + end_off = 0; + if (debuggedProcess != null) + { + beg_line = (int)debuggedProcess.SelectedFunction.symMethod.SequencePoints[0].Line; + off = doc.LineSegmentCollection[beg_line - 1].Offset; + } + //int lll = doc.GetLineNumberForOffset(offset) - 1; + int cur_str_off = doc.LineSegmentCollection[doc.GetLineNumberForOffset(offset)].Offset; + List strs = new List(); + i = cur_str_off; + int cur_sk = 0; + //while (i >= 0 && text[i] != '\n') + //int len = text.Length; + bool format_str = false; + bool var_in_format_str = false; + while (text[i] != '\n') + if (text[i] == '\'') + { + if (i == offset) return null; + if (i > 0 && text[i - 1] == '$') + format_str = true; + cur_sk = (cur_sk == 0) ? 1 : 0; + i++; + } + //else if (i == offset && cur_sk == 1) return null; + else i++; + i = offset; + bool new_line = false; + while (i >= off) + if (text[i] == '\n') { new_line = true; i--; } + else + if (text[i] == '/' && i > 0 && text[i - 1] == '/') if (!new_line) return null; else i--; + else if (text[i] == '}') break; + else if (text[i] == '{') + { + if (!format_str) + return null; + else + { + var_in_format_str = true; + i--; + } + + } + + else i--; + i = offset; + if (format_str && !var_in_format_str) + return null; + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + + if (i >= 0 && !(Char.IsLetterOrDigit(text[i]) || text[i] == '_')) i--; + while (i >= 0 && (Char.IsLetterOrDigit(text[i]) || text[i] == '_')) + i--; + bool is_dot = false; + if (i >= 0) + { + if (text[i] == '.') is_dot = true; + int j = i + 1; + while (j < text.Length && (Char.IsLetterOrDigit(text[j]) || text[j] == '_')) + sb.Append(text[j++]); + if (j < text.Length && text[j] == '(') + return null; + end_off = j - 1; + start_off = i + 1; + } + else + { + int j = i + 1; + while (j < text.Length && (Char.IsLetterOrDigit(text[j]) || text[j] == '_')) + sb.Append(text[j++]); + if (j < text.Length && text[j] == '(') + return null; + end_off = j - 1; + start_off = i + 1; + } + + if (is_dot) + { + sb.Insert(0, '.'); + PascalABCCompiler.Parsers.KeywordKind keyw = PascalABCCompiler.Parsers.KeywordKind.None; + string s = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation. + FindExpression(i, text, 0, 0, out keyw); + if (s != null) + { + sb.Insert(0, s); + string tmp = s.TrimStart(' ', '\n', '\t', '\r'); + start_off = i - tmp.Length; + } + } + else + { + string s = sb.ToString().Trim(' ', '\n', '\t', '\r'); + if (string.Compare(s, "array", true) == 0) + return ""; + } + return sb.ToString(); + } + + /// + /// Возвращает значение переменной при отладке + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public ListItem FindVarByName(string var, int num_line) + { + try + { + if (!var.Contains(".")) + { + List unit_vars = new List(); + NamedValueCollection nvc = null; + NamedValue global_nv = null; + NamedValue disp_nv = null; + NamedValue ret_nv = null; + nvc = debuggedProcess.SelectedFunction.LocalVariables; + List val_list = new List(); + foreach (NamedValue nv in nvc)//smotrim sredi lokalnyh peremennyh + { + if (nv.Name.IndexOf("<>local_variables") == -1) + val_list.Add(nv); + else + { + foreach (NamedValue nv2 in nv.GetMembers())//smotrim sredi lokalnyh peremennyh + { + val_list.Add(nv2); + } + } + } + foreach (NamedValue nv in val_list)//smotrim sredi lokalnyh peremennyh + { + if (nv.Name.IndexOf(':') != -1) + { + int pos = nv.Name.IndexOf(':'); + string name = nv.Name.Substring(0, pos); + if (string.Compare(name, var, true) == 0) + { + int start_line = Convert.ToInt32(nv.Name.Substring(pos + 1, nv.Name.LastIndexOf(':') - pos - 1)); + int end_line = Convert.ToInt32(nv.Name.Substring(nv.Name.LastIndexOf(':') + 1)); + if (num_line >= start_line - 1 && num_line <= end_line - 1) + return new ValueItem(nv, null); + } + } + if (string.Compare(nv.Name, var, true) == 0) + { + return new ValueItem(nv, null); + } + else if (string.Compare(nv.Name, "self", true) == 0 && debuggedProcess.SelectedFunction.ThisValue != null) + return new ValueItem(debuggedProcess.SelectedFunction.ThisValue, null); + else if (nv.Name.Contains("$class_var")) global_nv = nv; + else if (nv.Name.Contains("$unit_var")) unit_vars.Add(nv); + else if (nv.Name == "$disp$") disp_nv = nv;//vo vlozhennyh procedurah ssylka na verh zapis aktivacii + else if (nv.Name.StartsWith("$rv")) ret_nv = nv;//vozvrashaemoe znachenie + } + nvc = debuggedProcess.SelectedFunction.Arguments; + NamedValue self_nv = null; + foreach (NamedValue nv in nvc) + { + if (string.Compare(nv.Name, var, true) == 0) return new ValueItem(nv, null); + if (nv.Name == "$obj$") + self_nv = nv; + } + if (var.ToLower() == "self") + { + try + { + return new ValueItem(debuggedProcess.SelectedFunction.ThisValue, null); + } + catch + { + if (self_nv != null) + return new ValueItem(self_nv, null); + } + } + if (disp_nv != null)//prohodimsja po vlozhennym podprogrammam + { + NamedValue parent_val = null; + IList fields = disp_nv.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return new ValueItem(fi.GetValue(disp_nv), fi.DeclaringType); + else if (fi.Name == "$parent$") parent_val = fi.GetValue(disp_nv); + NamedValue pv = parent_val; + while (!pv.IsNull) + { + fields = parent_val.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return new ValueItem(fi.GetValue(parent_val), fi.DeclaringType); + else if (fi.Name == "$parent$") pv = fi.GetValue(parent_val); + if (!pv.IsNull) parent_val = pv; + } + } + // nvc = debuggedProcess.SelectedFunction.ContaingClassVariables; + // foreach (NamedValue nv in nvc) + // { + // if (string.Compare(nv.Name, var, true) == 0) return new ValueItem(nv,null); + // } + // try + // { + // if (debuggedProcess.SelectedFunction.ThisValue != null) + // { + // NamedValue nv = debuggedProcess.SelectedFunction.ThisValue.GetMember(var); + // if (nv != null) return new ValueItem(nv,null); + // } + // } + // catch(System.Exception e) + // { + // + // } + nvc = debuggedProcess.SelectedFunction.ContaingClassVariables; + foreach (NamedValue nv in nvc)//chleny klassa + { + if (string.Compare(nv.Name, var, true) == 0) return new ValueItem(nv, nv.Type); + } + if (self_nv != null) + { + IList fields = self_nv.Dereference.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) + return new ValueItem(fi.GetValue(self_nv.Dereference), fi.DeclaringType); + } + if (global_nv != null) + { + IList fields = global_nv.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return new ValueItem(fi.GetValue(global_nv), fi.DeclaringType); + Type global_type = AssemblyHelper.GetType(global_nv.Type.FullName); + if (global_type != null) + { + System.Reflection.FieldInfo fi = global_type.GetField(var, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.IgnoreCase); + if (fi != null && fi.IsLiteral) + return new ValueItem(DebugUtils.MakeValue(fi.GetRawConstantValue()), var, global_nv.Type); + } + } + + Type t = AssemblyHelper.GetTypeForStatic(var); + if (t != null) + { + DebugType dt = DebugUtils.GetDebugType(t);//DebugType.Create(this.debuggedProcess.GetModule(var),(uint)t.MetadataToken); + return new BaseTypeItem(dt, t); + } + + List types = AssemblyHelper.GetUsesTypes(debuggedProcess, debuggedProcess.SelectedFunction.DeclaringType); + foreach (DebugType dt in types) + { + IList fields = dt.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (fi.IsStatic && string.Compare(fi.Name, var, true) == 0) + return new ValueItem(fi.GetValue(null), fi.DeclaringType); + Type unit_type = AssemblyHelper.GetType(dt.FullName); + if (unit_type != null) + { + System.Reflection.FieldInfo fi = unit_type.GetField(var, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.IgnoreCase); + if (fi != null && fi.IsLiteral) + return new ValueItem(DebugUtils.MakeValue(fi.GetRawConstantValue()), var, dt); + } + } + + /*foreach (NamedValue nv in unit_vars) + { + IList fields = nv.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return new ValueItem(fi.GetValue(nv),fi.DeclaringType); + }*/ + + if (ret_nv != null && string.Compare(var, "Result", true) == 0) + return new ValueItem(ret_nv, null); + + } + else + { + if (evaluator == null) return null; + Debugger.Wrappers.CorSym.ISymUnmanagedMethod sym_meth = debuggedProcess.SelectedFunction.symMethod; + // if (sym_meth == null) return null; + // if (sym_meth.SequencePoints.Length > 0) + // if (num_line < sym_meth.SequencePoints[0].Line || num_line > sym_meth.SequencePoints[sym_meth.SequencePoints.Length - 1].EndLine) + // return null; + string preformat; + RetValue rv = evaluator.GetValueForExpression(var, out preformat); + if (rv.obj_val != null && rv.obj_val is NamedValue) + { + Value v = rv.obj_val; + ValueItem vi = new ValueItem(v, var, evaluator.declaringType); + vi.SpecialName = preformat; + return vi; + } + else if (rv.prim_val != null) + { + ValueItem vi = new ValueItem(DebugUtils.MakeValue(rv.prim_val), var, evaluator.declaringType); + vi.SpecialName = preformat; + return vi; + } + else if (rv.type != null) + { + return new BaseTypeItem(rv.type, rv.managed_type); + } + } + } + catch (System.Exception e) + { + + } + return null; + } + + private TextMarker oldMarker; + + public void RemoveMarker(IDocument doc) + { + try + { + if (oldMarker != null && doc != null && doc.TextLength >= oldMarker.Offset) + { + doc.MarkerStrategy.RemoveMarker(oldMarker); + doc.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine,doc.GetLineNumberForOffset(oldMarker.Offset))); + doc.CommitUpdate(); + } + } + catch(System.Exception e) + { + + } + } + + public bool HasBreakpoints() + { + return BreakPointFactory.HasBreakpoints(); + } + + /// + /// Обработчик события запроса на подсказку значения переменной + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void TextAreaToolTipRequest(object sender, ToolTipRequestEventArgs e) + { + DebuggerGridControl toolTipControl = null; + TextMarker marker = null; + //RemoveMarker((sender as TextArea).Document); + if (debuggedProcess == null) return; + if (debuggedProcess.SelectedFunction == null || !debuggedProcess.IsPaused) return; + try + { + TextArea textArea = (TextArea)sender; + + if (textArea != curTextArea) return; + if (e.ToolTipShown) return; + if (oldToolTipControl != null && !oldToolTipControl.AllowClose) return; + if (!IsRunning) return; + + if (e.InDocument) + { + ToolTipInfo ti = null; + int num_line = 0; + int start_off = 0; + int end_off = 0; + string var = GetVariable(e,textArea,out num_line, out start_off, out end_off); + if (var == null || var == "") return; + //if (debuggedProcess.SelectedFunction.LocalVariables.Count > 0) + { + //NamedValue nv = FindVarByName(var, num_line); + ListItem nv = FindVarByName(var, num_line); + if (nv != null) + { + System.Threading.Thread.Sleep(50); + DebuggerGridControl dgc = new DebuggerGridControl(new DynamicTreeDebuggerRow(nv)); + dgc.doc = textArea.Document; + ti = new ToolTipInfo(dgc); + ICSharpCode.TextEditor.TextLocation logicPos = e.LogicalPosition; + LineSegment seg = textArea.Document.GetLineSegment(logicPos.Y); + marker = new TextMarker(start_off, end_off-start_off+1, TextMarkerType.Cant, Color.Black, Color.White); + textArea.Document.MarkerStrategy.AddMarker(marker); + textArea.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine,seg.LineNumber)); + textArea.Document.CommitUpdate(); + } + } + if (ti != null) + { + toolTipControl = ti.ToolTipControl as DebuggerGridControl; + if (ti.ToolTipText != null) + { + e.ShowToolTip(ti.ToolTipText); + } + } + CloseOldToolTip(); + if (toolTipControl != null) + { + toolTipControl.ShowForm(textArea, e.LogicalPosition); + } + oldToolTipControl = toolTipControl; + RemoveMarker(textArea.Document); + oldMarker = marker; + + } + } + catch (System.Exception ex) + { + //frm.WriteToOutputBox(ex.Message);// ICSharpCode.Core.MessageService.ShowError(ex); + } + finally + { + if (toolTipControl == null && CanCloseOldToolTip) + { + CloseOldToolTip(); + RemoveMarker((sender as TextArea).Document); + } + } + } + + bool CanCloseOldToolTip + { + get + { + return oldToolTipControl != null && oldToolTipControl.AllowClose; + } + } + + void CloseOldToolTip() + { + if (oldToolTipControl != null) + { + Form frm = oldToolTipControl.FindForm(); + if (frm != null) frm.Close(); + oldToolTipControl = null; + } + + } + + /// + /// Завершить процесс + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void Stop(string ExeFileName) + { + try + { + workbench.WidgetController.SetStartDebugEnabled(); + dbg.Processes[0].Terminate(); + } + catch (System.Exception e) + { + } + } + + /// + /// Прервать процесс + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void DebugBreak() + { + try + { + workbench.WidgetController.SetStartDebugEnabled(); + dbg.Processes[0].Break(); + } + catch (System.Exception e) + { + } + } + + /// + /// Проверяет, запущен ли процесс с именем ExeFileName на отладку + /// + public bool IsRun(string ExeFileName) + { + return IsRunning && string.Compare(this.ExeFileName,ExeFileName,true)==0; + } + + public bool IsRun(string ExeFileName, string SourceFileName) + { + return IsRunning && string.Compare(this.ExeFileName, ExeFileName, true) == 0 && string.Compare(this.FullFileName, SourceFileName, true) == 0; + } + + /// + /// Проверяет, запущен ли процесс с именем ExeFileName на отладку + /// + public bool IsRunAndInThisTabPage(string ExeFileName, ICodeFileDocument cfdc) + { + if (WorkbenchServiceFactory.DocumentService.ContainsTab(cfdc)) + return true; + return IsRunning && (/*string.Compare(this.ExeFileName,ExeFileName,true)==0 || */WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument == this.curPage); + } + + public void SetAsPossibleDebugPage(CodeFileDocumentControl ctrl) + { + if (IsRunning && tab_changed && ctrl != this.curPage) + { + curPage = ctrl; + } + tab_changed = false; + } + + public CodeFileDocumentControl CurPage + { + get + { + return curPage as CodeFileDocumentControl; + } + } + + public void SetAsDebugPage(ICodeFileDocument ctrl) + { + curPage = ctrl; + } + + public bool IsRunAndInThisTabPage() + { + return IsRunning && (WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument == this.curPage || WorkbenchServiceFactory.DocumentService.ContainsTab(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument)); + } + + /// + /// Шаг без входа в подпрограмму + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void StepOver() + { + try + { + workbench.WidgetController.SetStartDebugDisabled(); + if (debuggedProcess.SelectedFunction.Name == ".cctor") + { + var sequencePoints = debuggedProcess.SelectedFunction.symMethod.SequencePoints; + if (sequencePoints != null && debuggedProcess.NextStatement.StartLine == sequencePoints[sequencePoints.Length-1].Line) + { + debuggedProcess.StepOut(); + } + else + debuggedProcess.StepOver(); + } + else + debuggedProcess.StepOver(); + CurrentLineBookmark.Remove(); + } + catch (System.Exception e) + { + } + } + + /// + /// Продолжить выполнение процесса + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void Continue() + { + try + { + workbench.WidgetController.SetStartDebugDisabled(); + dbg.Processes[0].Continue(); + CurrentLineBookmark.Remove(); + } + catch (System.Exception e) + { + } + } + + /// + /// Шаг с входом в подпрограмму + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void StepInto() + { + try + { + workbench.WidgetController.SetStartDebugDisabled(); + stepin_stmt = dbg.Processes[0].NextStatement; + dbg.Processes[0].StepInto(); + CurrentLineBookmark.Remove(); + } + catch (System.Exception e) + { + } + } + + /// + /// Шаг с входом из подпрограммы + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void StepOut() + { + try + { + if (IsRunning) + { + workbench.WidgetController.SetStartDebugDisabled(); + dbg.Processes[0].StepOut(); + CurrentLineBookmark.Remove(); + } + } + catch (System.Exception e) + { + } + } + + /// + /// Идти к курсору + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public void RunToCursor() + { + try + { + //cur_brpt = dbg.AddBreakpoint(new SourcecodeSegment((frm.CurrentTabPage.ag as CodeFileDocumentControl).FileName,(frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Line + 1,(frm.CurrentTabPage.Tag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column + 1, + // (frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column+100), true); + workbench.WidgetController.SetStartDebugDisabled(); + currentBreakpoint = dbg.AddBreakpoint(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName, WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line + 1); + AddGoToBreakPoint(currentBreakpoint); + Status = DebugStatus.None; + dbg.Processes[0].Continue(); + //dbg.RemoveBreakpoint(cur_brpt); + CurrentLineBookmark.Remove(); + } + catch (System.Exception e) + { + } + } + + private Stack goto_brs = new Stack(); + + /// + /// Добавляет Breakpoint по F4 + /// + public void AddGoToBreakPoint(Breakpoint br) + { + goto_brs.Push(br); + } + + public string ExecuteImmediate(string stmt) + { + RetValue rv = evaluator.Evaluate(stmt, true); + if (rv.prim_val != null) + return rv.prim_val.ToString(); + if (rv.obj_val != null) + return rv.obj_val.AsString; + if (rv.err_mes != null) + return rv.err_mes; + if (rv.syn_err) + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_SYNTAX_ERROR_IN_EXPR"); + else + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_ERROR_IN_EXPR"); + } + + public void AddGoToBreakPoint(string fileName, int line) + { + goto_brs.Push(dbg.AddBreakpoint(fileName, line)); + } + + /// + /// Удаляет все F4-Breakpoint + /// + [HandleProcessCorruptedStateExceptionsAttribute] + private void RemoveGotoBreakpoints() + { + while (goto_brs.Count > 0) + { + Breakpoint br = goto_brs.Pop(); + try + { + + dbg.RemoveBreakpoint(br); + } + catch (System.Exception e) + { + } + } + } + + IRetValue IDebuggerManager.Evaluate(string expr) + { + return Evaluate(expr); + } + + string IDebuggerManager.MakeValueView(IValue value) + { + return MakeValueView(value as Value); + } + + bool IDebuggerManager.IsRunning + { + get + { + return IsRunning; + } + } + } + +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs b/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs new file mode 100644 index 000000000..5041333ba --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs @@ -0,0 +1,2788 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Drawing; +using System.ComponentModel; +using System.Drawing.Drawing2D; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using ICSharpCode.TextEditor.Document; +using Debugger; + +namespace VisualPascalABC +{ + public static class ScreenScale + { + private static double scale = -1; + public static void FirstCalcScale(Form f) + { + var gr = f.CreateGraphics(); + scale = (double)gr.DpiX / 96; + gr.Dispose(); + } + public static double Calc() + { + if (scale > 0) + return scale; + return 1.5; + //var gr = Graphics.FromHwnd(Handle); + /*var dpiXProperty = typeof(System.Windows.SystemParameters).GetProperty("DpiX", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); + var dpiX = (int)dpiXProperty.GetValue(null, null);*/ + //scale = (double)gr.DpiX / 96; + //return scale; + } + } + + public class DynamicTreeDebuggerRow : DynamicTreeRow + { + // Columns: + // 0 = plus sign + // 1 = icon + // 2 = text + // 3 = value + + ListItem listItem; + + Image image; + bool populated = false; + bool visible = true; + + public ListItem ListItem + { + get + { + return listItem; + } + } + + public DynamicTreeDebuggerRow(NamedValue val) + : this(new ValueItem(val,null)) + { + + } + + public DynamicTreeDebuggerRow(ListItem listItem) + { + if (listItem == null) throw new ArgumentNullException("listItem"); + + this.listItem = listItem; + this.listItem.Changed += delegate { Update(true); }; + this.Shown += delegate + { + visible = true; + WorkbenchServiceFactory.DebuggerManager.DoInPausedState(delegate { Update(true); }); + }; + this.Hidden += delegate + { + visible = false; + }; + + DebuggerGridControl.AddColumns(this.ChildColumns); + + this[1].Paint += OnIconPaint; + this[3].FinishLabelEdit += OnLabelEdited; + this[3].MouseDown += OnMouseDown; + + Update(true); + } + + void Update(bool show_val) + { + if (!visible) return; + this[1].Text = ""; // Icon + if (listItem.SpecialName != null) + this[2].Text = listItem.SpecialName; + else + this[2].Text = listItem.Name; + if (!show_val) return; + this.image = listItem.Image; + + if (this[2].Text == "" || this[2].Text == null) + if (!(listItem is BaseTypeItem && listItem.ImageIndex != -1)) + this[2].Text = "base"; + else + this[2].Text = listItem.Type; + if (listItem.Name == "" || this.ListItem == null) this[3].Text = "{" + listItem.Type + "}"; + else + this[3].Text = listItem.Text; + this[3].AllowLabelEdit = listItem.CanEditText; + + this.ShowPlus = listItem.HasSubItems; + this.ShowMinusWhileExpanded = true; + } + + void OnIconPaint(object sender, ItemPaintEventArgs e) + { + if (image != null) + { + // SSM 21.01.19 High dpi + e.Graphics.DrawImage/*Unscaled*/(image, e.ClipRectangle); + } + } + + void OnLabelEdited(object sender, DynamicListEventArgs e) + { + try + { + listItem.SetText(((DynamicListItem)sender).Text); + } + catch + { + + } + } + + void OnMouseDown(object sender, DynamicListMouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + ContextMenuStrip menu = listItem.GetContextMenu(); + if (menu != null) + { + menu.Show(e.List, e.Location); + } + } + } + + /// + /// Called when plus is pressed in debugger tooltip. + /// Sets the data to be show in the next level. + /// + protected override void OnExpanding(DynamicListEventArgs e) + { + if (!populated) + { + WorkbenchServiceFactory.DebuggerManager.DoInPausedState(delegate { Populate(); }); + } + } + + void Populate() + { + this.ChildRows.Clear(); + foreach (ListItem subItem in listItem.SubItems) + { + this.ChildRows.Add(new DynamicTreeDebuggerRow(subItem)); + } + populated = true; + } + } + + public class ToolTipInfo + { + object toolTipObject; + + /// + /// Gets the tool tip text to be displayed. + /// May be null. + /// + public string ToolTipText + { + get + { + return this.toolTipObject as string; + } + } + + /// + /// Gets the DebuggerGridControl to be shown as tooltip. + /// May be null. + /// + public Control ToolTipControl + { + get + { + return this.toolTipObject as Control; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// The tooltip text to be displayed. + public ToolTipInfo(string toolTipText) + { + this.toolTipObject = toolTipText; + } + + /// + /// Initializes a new instance of the class. + /// + /// The DebuggerGridControl to be shown as tooltip. + public ToolTipInfo(Control toolTipControl) + { + this.toolTipObject = toolTipControl; + } + } + public class DebuggerGridControl : DynamicList + { + // Columns: + // 0 = plus sign + // 1 = icon + // 2 = text + // 3 = value + + DynamicTreeRow row; + + public static void AddColumns(IList columns) + { + columns.Add(new DynamicListColumn()); + columns.Add(new DynamicListColumn()); + columns.Add(new DynamicListColumn()); + columns.Add(new DynamicListColumn()); + columns[0].BackgroundBrush = Brushes.White; + columns[0].BackgroundBrushInactive = Brushes.White; + columns[0].RowHighlightBrush = null; + + // default is allowgrow = true and autosize = false + columns[0].AllowGrow = false; + columns[1].AllowGrow = false; + // SSM 21.01.19 High DPI + columns[1].Width = 16 + Convert.ToInt32(16 * (ScreenScale.Calc()-1)); + columns[1].ColumnSeperatorColor = Color.Transparent; + columns[1].ColumnSeperatorColorInactive = Color.Transparent; + columns[2].AutoSize = true; + columns[2].MinimumWidth = 75; + columns[2].ColumnSeperatorColor = Color.White; + columns[2].ColumnSeperatorColorInactive = Color.FromArgb(172, 168, 153); + columns[3].AutoSize = true; + columns[3].MinimumWidth = 75; + } + + public DebuggerGridControl(DynamicTreeRow row) + { + this.row = row; + + BeginUpdate(); + + AddColumns(Columns); + + Rows.Add(row); + + row.Expanded += delegate { isExpanded = true; }; + row.Collapsed += delegate { isExpanded = false; }; + + CreateControl(); + using (Graphics g = CreateGraphics()) + { + this.Width = GetRequiredWidth(g); + } + this.Height = row.Height; + EndUpdate(); + } + + DynamicTreeRow.ChildForm frm; + + public void ShowForm(ICSharpCode.TextEditor.TextArea textArea, /*Point*/ICSharpCode.TextEditor.TextLocation logicTextPos) + { + frm = new DynamicTreeRow.ChildForm(); + frm.AllowResizing = false; + frm.Owner = textArea.FindForm(); + int ypos = (textArea.Document.GetVisibleLine(logicTextPos.Y) + 1) * textArea.TextView.FontHeight - textArea.VirtualTop.Y; + Point p = new Point(0, ypos); + p = textArea.PointToScreen(p); + p.X = Control.MousePosition.X - 16; + p.Y -= 1; + frm.StartPosition = FormStartPosition.Manual; + frm.ShowInTaskbar = false; + frm.Location = p; + frm.ClientSize = new Size(Width + 2, row.Height + 2); + Dock = DockStyle.Fill; + frm.Controls.Add(this); + frm.ShowWindowWithoutActivation = true; + frm.Show(); + textArea.Click += OnTextAreaClick; + textArea.KeyDown += OnTextAreaClick; + frm.ClientSize = new Size(frm.ClientSize.Width, row.Height + 2); + } + + public bool IsMouseOver + { + get + { + if (frm != null && !frm.IsDisposed) + { + return frm.ClientRectangle.Contains(frm.PointToClient(Control.MousePosition)); + } + return false; + } + } + + void OnTextAreaClick(object sender, EventArgs e) + { + ((ICSharpCode.TextEditor.TextArea)sender).KeyDown -= OnTextAreaClick; + ((ICSharpCode.TextEditor.TextArea)sender).Click -= OnTextAreaClick; + frm.Close(); + } + + bool isExpanded; + + public bool AllowClose + { + get + { + return !isExpanded; + } + } + } + + public class DynamicTreeRow : DynamicListRow + { + CollectionWithEvents childColumns = new CollectionWithEvents(); + CollectionWithEvents childRows = new CollectionWithEvents(); + + DynamicListItem plus; + + public DynamicTreeRow() + { + plus = this[0]; + ShowPlus = true; + } + + #region Plus painting + bool showPlus; + + public bool ShowPlus + { + get + { + return showPlus; + } + set + { + if (showPlus == value) + return; + showPlus = value; + plus.HighlightBrush = showPlus ? Brushes.AliceBlue : null; + //plus.Cursor = showPlus ? Cursors.Hand : null; + if (showPlus) + { + plus.Click += OnPlusClick; + plus.Paint += OnPlusPaint; + //plus.MouseHover += OnPlusMouseHover; + } + else + { + plus.Click -= OnPlusClick; + plus.Paint -= OnPlusPaint; + //plus.MouseHover -= OnPlusMouseHover; + } + OnShowPlusChanged(EventArgs.Empty); + } + } + + static readonly Color PlusBorder = Color.FromArgb(120, 152, 181); + static readonly Color LightPlusBorder = Color.FromArgb(176, 194, 221); + public static readonly Color DefaultExpandedRowColor = Color.FromArgb(235, 229, 209); + + public static void DrawPlusSign(Graphics graphics, Rectangle r, bool drawMinus) + { + using (Brush b = new LinearGradientBrush(r, Color.White, DynamicListColumn.DefaultRowHighlightBackColor, 66f)) + { + graphics.FillRectangle(b, r); + } + using (Pen p = new Pen(PlusBorder)) + { + graphics.DrawRectangle(p, r); + } + using (Brush b = new SolidBrush(LightPlusBorder)) + { + graphics.FillRectangle(b, new Rectangle(r.X, r.Y, 1, 1)); + graphics.FillRectangle(b, new Rectangle(r.Right, r.Y, 1, 1)); + graphics.FillRectangle(b, new Rectangle(r.X, r.Bottom, 1, 1)); + graphics.FillRectangle(b, new Rectangle(r.Right, r.Bottom, 1, 1)); + } + graphics.DrawLine(Pens.Black, r.Left + 2, r.Top + r.Height / 2, r.Right - 2, r.Top + r.Height / 2); + if (!drawMinus) + { + graphics.DrawLine(Pens.Black, r.Left + r.Width / 2, r.Top + 2, r.Left + r.Width / 2, r.Bottom - 2); + } + } + + protected virtual void OnPlusPaint(object sender, ItemPaintEventArgs e) + { + Rectangle r = e.ClipRectangle; + var sc = ScreenScale.Calc(); + var infl = Convert.ToInt32(4 * sc); + r.Inflate(-infl, -infl); + DrawPlusSign(e.Graphics, r, expandedIn != null && expandedIn.Contains(e.List)); + } + + protected override DynamicListItem CreateItem() + { + DynamicListItem item = base.CreateItem(); + item.Paint += delegate(object sender, ItemPaintEventArgs e) + { + if (e.Item != plus && expandedIn != null && !expandedRowColor.IsEmpty && expandedIn.Contains(e.List)) + { + using (Brush b = new SolidBrush(expandedRowColor)) + { + e.Graphics.FillRectangle(b, e.FillRectangle); + } + } + }; + return item; + } + + List expandedIn; + Color expandedRowColor = DefaultExpandedRowColor; + + public bool ShowMinusWhileExpanded + { + get + { + return expandedIn != null; + } + set + { + if (this.ShowMinusWhileExpanded == value) + return; + expandedIn = value ? new List() : null; + } + } + + /// + /// Gets/Sets the row color used when the row is expanded. Only works together with ShowMinusWhileExpanded. + /// + public Color ExpandedRowColor + { + get + { + return expandedRowColor; + } + set + { + expandedRowColor = value; + } + } + #endregion + + #region Events + public event EventHandler Expanding; + public event EventHandler Expanded; + public event EventHandler Collapsed; + public event EventHandler ShowPlusChanged; + + protected virtual void OnExpanding(DynamicListEventArgs e) + { + if (Expanding != null) + { + Expanding(this, e); + } + } + protected virtual void OnExpanded(DynamicListEventArgs e) + { + if (Expanded != null) + { + Expanded(this, e); + } + } + protected virtual void OnCollapsed(DynamicListEventArgs e) + { + if (Collapsed != null) + { + Collapsed(this, e); + } + } + public virtual void OnShowPlusChanged(EventArgs e) + { + if (ShowPlusChanged != null) + { + ShowPlusChanged(this, e); + } + } + #endregion + + #region Properties + public CollectionWithEvents ChildColumns + { + get + { + return childColumns; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + childColumns = value; + } + } + + public CollectionWithEvents ChildRows + { + get + { + return childRows; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + childRows = value; + } + } + + //public static readonly Color DefaultBorderColor = Color.FromArgb(195, 192, 175); + public static readonly Color DefaultBorderColor = Color.LightGray; + Color childBorderColor = DefaultBorderColor; + + public Color ChildBorderColor + { + get + { + return childBorderColor; + } + set + { + childBorderColor = value; + } + } + #endregion + + #region Child form + static bool isOpeningChild; + + /// + /// Block the next click event - used to ensure that a click on the "-" sign + /// does not cause the submenu to open again when the "-" sign becomes a "+" sign + /// before the click event is handled. + /// + bool blockClickEvent; + + protected virtual void OnPlusMouseHover(object sender, DynamicListEventArgs e) + { + OnPlusClick(sender, e); + } + + protected virtual void OnPlusClick(object sender, DynamicListEventArgs e) + { + if (blockClickEvent) + { + blockClickEvent = false; + return; + } + OnExpanding(e); + ChildForm frm = new ChildForm(); + frm.Closed += delegate + { + blockClickEvent = true; + if (expandedIn != null) + expandedIn.Remove(e.List); + OnCollapsed(e); + plus.RaiseItemChanged(); + Timer timer = new Timer(); + timer.Interval = 200; + timer.Tick += delegate(object sender2, EventArgs e2) + { + ((Timer)sender2).Stop(); + ((Timer)sender2).Dispose(); + blockClickEvent = false; + }; + timer.Start(); + }; + Point p = e.List.PointToScreen(e.List.GetPositionFromRow(this)); + p.Offset(e.List.Columns[0].Width, Height); + frm.StartPosition = FormStartPosition.Manual; + frm.BackColor = childBorderColor; + frm.Location = p; + frm.ShowInTaskbar = false; + frm.Owner = e.List.FindForm(); + + VerticalScrollContainer scrollContainer = new VerticalScrollContainer(); + scrollContainer.Dock = DockStyle.Fill; + + DynamicList childList = new DynamicList(childColumns, childRows); + childList.Dock = DockStyle.Fill; + childList.KeyDown += delegate(object sender2, KeyEventArgs e2) + { + if (e2.KeyData == Keys.Escape) + { + frm.Close(); + // workaround focus problem: sometimes the mainform gets focus after this + e.List.FindForm().Focus(); + } + }; + scrollContainer.Controls.Add(childList); + + frm.Controls.Add(scrollContainer); + + int screenHeight = Screen.FromPoint(p).WorkingArea.Bottom - p.Y; + screenHeight -= frm.Size.Height - frm.ClientSize.Height; + int requiredHeight = childList.TotalRowHeight + 4; + int formHeight = Math.Min(requiredHeight, Math.Min(300,screenHeight)); + if (formHeight < requiredHeight && formHeight < 100) + { + int missingHeight = Math.Min(200, requiredHeight - formHeight); + formHeight += missingHeight; + frm.Top -= missingHeight; + } + // Autosize child window + int formWidth; + using (Graphics g = childList.CreateGraphics()) + { + formWidth = 8 + childList.GetRequiredWidth(g); + } + int screenWidth = Screen.FromPoint(p).WorkingArea.Right - p.X; + if (formWidth > screenWidth) + { + int missingWidth = Math.Min(100, formWidth - screenWidth); + formWidth = screenWidth + missingWidth; + frm.Left -= missingWidth; + } + frm.ClientSize = new Size(formWidth, formHeight); + frm.MinimumSize = new Size(100, Math.Min(50, formHeight)); + isOpeningChild = true; + frm.Show(); + isOpeningChild = false; + childList.Focus(); + if (expandedIn != null) + expandedIn.Add(e.List); + OnExpanded(e); + plus.RaiseItemChanged(); + } + + public class ChildForm : Form, IActivatable + { + bool isActivated = true; + + public bool IsActivated + { + get + { + return isActivated; + } + } + + bool allowResizing = true; + + public bool AllowResizing + { + get + { + return allowResizing; + } + set + { + if (allowResizing == value) + return; + allowResizing = value; + this.DockPadding.All = value ? 2 : 1; + } + } + + public ChildForm() + { + this.FormBorderStyle = FormBorderStyle.None; + this.DockPadding.All = 1; + this.BackColor = DefaultBorderColor; + } + + bool showWindowWithoutActivation; + + /// + /// Gets/Sets whether the window will receive focus when it is shown. + /// + public bool ShowWindowWithoutActivation + { + get + { + return showWindowWithoutActivation; + } + set + { + showWindowWithoutActivation = value; + } + } + + protected override bool ShowWithoutActivation + { + get + { + return showWindowWithoutActivation; + } + } + + protected override CreateParams CreateParams + { + get + { + CreateParams p = base.CreateParams; + DesignHelper.AddShadowToWindow(p); + return p; + } + } + + #region Resizing the form + private enum MousePositionCodes + { + HTERROR = (-2), + HTTRANSPARENT = (-1), + HTNOWHERE = 0, + HTCLIENT = 1, + HTCAPTION = 2, + HTSYSMENU = 3, + HTGROWBOX = 4, + HTSIZE = HTGROWBOX, + 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 = HTMINBUTTON, + HTZOOM = HTMAXBUTTON, + HTSIZEFIRST = HTLEFT, + HTSIZELAST = HTBOTTOMRIGHT, + HTOBJECT = 19, + HTCLOSE = 20, + HTHELP = 21 + } + + protected override void WndProc(ref Message m) + { + base.WndProc(ref m); + if (m.Msg == 0x0084) // WM_NCHITTEST + HitTest(ref m); + } + + void HitTest(ref Message m) + { + if (!allowResizing) + return; + int mousePos = m.LParam.ToInt32(); + int mouseX = mousePos & 0xffff; + int mouseY = mousePos >> 16; + //System.Diagnostics.Debug.WriteLine(mouseX + " / " + mouseY); + Rectangle bounds = Bounds; + bool isLeft = mouseX == bounds.Left || mouseX + 1 == bounds.Left; + bool isTop = mouseY == bounds.Top || mouseY + 1 == bounds.Top; + bool isRight = mouseX == bounds.Right - 1 || mouseX == bounds.Right - 2; + bool isBottom = mouseY == bounds.Bottom - 1 || mouseY == bounds.Bottom - 2; + if (isLeft) + { + if (isTop) + m.Result = new IntPtr((int)MousePositionCodes.HTTOPLEFT); + else if (isBottom) + m.Result = new IntPtr((int)MousePositionCodes.HTBOTTOMLEFT); + else + m.Result = new IntPtr((int)MousePositionCodes.HTLEFT); + } + else if (isRight) + { + if (isTop) + m.Result = new IntPtr((int)MousePositionCodes.HTTOPRIGHT); + else if (isBottom) + m.Result = new IntPtr((int)MousePositionCodes.HTBOTTOMRIGHT); + else + m.Result = new IntPtr((int)MousePositionCodes.HTRIGHT); + } + else if (isTop) + { + m.Result = new IntPtr((int)MousePositionCodes.HTTOP); + } + else if (isBottom) + { + m.Result = new IntPtr((int)MousePositionCodes.HTBOTTOM); + } + } + #endregion + + protected override void OnActivated(EventArgs e) + { + isActivated = true; + base.OnActivated(e); + Refresh(); + } + + protected override void OnDeactivate(EventArgs e) + { + isActivated = false; + base.OnDeactivate(e); + if (isOpeningChild) + { + Refresh(); + return; + } + BeginInvoke(new MethodInvoker(CloseOnDeactivate)); + } + + void CloseOnDeactivate() + { + ChildForm owner = Owner as ChildForm; + if (owner != null) + { + if (owner.isActivated) + Close(); + else + owner.CloseOnDeactivate(); + } + else + { + Close(); + } + } + } + #endregion + } + + public static class DesignHelper + { + static int shadowStatus; + + /// + /// Adds a shadow to the create params if it is supported by the operating system. + /// + public static void AddShadowToWindow(CreateParams createParams) + { + if (shadowStatus == 0) + { + // Test OS version + shadowStatus = -1; // shadow not supported + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + Version ver = Environment.OSVersion.Version; + if (ver.Major > 5 || ver.Major == 5 && ver.Minor >= 1) + { + shadowStatus = 1; + } + } + } + if (shadowStatus == 1) + { + createParams.ClassStyle |= 0x00020000; // set CS_DROPSHADOW + } + } + } + public class DynamicListRow + { + int height = Convert.ToInt32(16 * ScreenScale.Calc()); + + public int Height + { + get + { + return height; + } + set + { + if (value < 2) + throw new ArgumentOutOfRangeException("value", value, "value must be at least 2"); + if (height != value) + { + height = value; + OnHeightChanged(EventArgs.Empty); + } + } + } + + public event EventHandler HeightChanged; + + protected virtual void OnHeightChanged(EventArgs e) + { + if (HeightChanged != null) + { + HeightChanged(this, e); + } + } + + public event EventHandler Shown; + public event EventHandler Hidden; + + protected virtual void OnShown(DynamicListEventArgs e) + { + if (Shown != null) + { + Shown(this, e); + } + } + + protected virtual void OnHidden(DynamicListEventArgs e) + { + if (Hidden != null) + { + Hidden(this, e); + } + } + + internal void NotifyListVisibilityChange(DynamicList list, bool visible) + { + if (visible) + OnShown(new DynamicListEventArgs(list)); + else + OnHidden(new DynamicListEventArgs(list)); + } + + /// + /// Fired when any item has changed. + /// + public event EventHandler ItemChanged; + + protected virtual void OnItemChanged(EventArgs e) + { + if (ItemChanged != null) + { + ItemChanged(this, e); + } + } + + internal void RaiseItemChanged(DynamicListItem item) + { + OnItemChanged(EventArgs.Empty); + } + + DynamicListItem[] items = new DynamicListItem[10]; + + public DynamicListItem this[int columnIndex] + { + [DebuggerStepThrough] + get + { + if (columnIndex < 0) + throw new ArgumentOutOfRangeException("columnIndex", columnIndex, "columnIndex must be >= 0"); + if (columnIndex > DynamicList.MaxColumnCount) + throw new ArgumentOutOfRangeException("columnIndex", columnIndex, "columnIndex must be <= " + DynamicList.MaxColumnCount); + if (columnIndex >= items.Length) + { + Array.Resize(ref items, columnIndex * 2 + 1); + } + DynamicListItem item = items[columnIndex]; + if (item == null) + { + items[columnIndex] = item = CreateItem(); + } + return item; + } + } + + protected virtual DynamicListItem CreateItem() + { + return new DynamicListItem(this); + } + } + + public class DynamicList : UserControl, VerticalScrollContainer.IScrollable + { + public const int MaxColumnCount = 1000; + + public IDocument doc; + + public DynamicList() + : this(new CollectionWithEvents(), new CollectionWithEvents()) + { + } + + public DynamicList(CollectionWithEvents columns, CollectionWithEvents rows) + { + inUpdate = true; + if (columns == null) + throw new ArgumentNullException("columns"); + if (rows == null) + throw new ArgumentNullException("rows"); + this.columns = columns; + this.rows = rows; + // we have to register our events on the existing items + foreach (DynamicListColumn column in columns) + { + OnColumnAdded(null, new CollectionItemEventArgs(column)); + } + foreach (DynamicListRow row in rows) + { + OnRowAdded(null, new CollectionItemEventArgs(row)); + } + columns.Added += OnColumnAdded; + columns.Removed += OnColumnRemoved; + rows.Added += OnRowAdded; + rows.Removed += OnRowRemoved; + this.BackColor = DefaultBackColor; + this.SetStyle(ControlStyles.UserPaint, true); + this.SetStyle(ControlStyles.Selectable, true); + this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + inUpdate = false; + RecalculateColumnWidths(); + } + + public new static readonly Color DefaultBackColor = Color.White; + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (disposing) + { + columns.Added -= OnColumnAdded; + columns.Removed -= OnColumnRemoved; + rows.Added -= OnRowAdded; + rows.Removed -= OnRowRemoved; + foreach (DynamicListColumn column in columns) + { + OnColumnRemoved(null, new CollectionItemEventArgs(column)); + } + foreach (DynamicListRow row in rows) + { + OnRowRemoved(null, new CollectionItemEventArgs(row)); + } + WorkbenchServiceFactory.DebuggerManager.RemoveMarker(doc); + } + } + + void OnColumnAdded(object sender, CollectionItemEventArgs e) + { + e.Item.MinimumWidthChanged += ColumnMinimumWidthChanged; + e.Item.WidthChanged += ColumnWidthChanged; + RecalculateColumnWidths(); + } + + void OnColumnRemoved(object sender, CollectionItemEventArgs e) + { + e.Item.MinimumWidthChanged -= ColumnMinimumWidthChanged; + e.Item.WidthChanged -= ColumnWidthChanged; + RecalculateColumnWidths(); + } + + void OnRowAdded(object sender, CollectionItemEventArgs e) + { + e.Item.HeightChanged += RowHeightChanged; + e.Item.ItemChanged += RowItemChanged; + if (Visible && Parent != null) + e.Item.NotifyListVisibilityChange(this, true); + } + + void OnRowRemoved(object sender, CollectionItemEventArgs e) + { + e.Item.HeightChanged -= RowHeightChanged; + e.Item.ItemChanged -= RowItemChanged; + if (Visible) + e.Item.NotifyListVisibilityChange(this, false); + } + + bool oldVisible = false; + + protected override void OnVisibleChanged(EventArgs e) + { + base.OnVisibleChanged(e); + bool visible = Visible && Parent != null; + if (visible == oldVisible) + return; + oldVisible = visible; + foreach (DynamicListRow row in Rows) + { + row.NotifyListVisibilityChange(this, visible); + } + } + + void ColumnMinimumWidthChanged(object sender, EventArgs e) + { + RecalculateColumnWidths(); + } + + void RowHeightChanged(object sender, EventArgs e) + { + Redraw(); + } + + void RowItemChanged(object sender, EventArgs e) + { + Redraw(); + } + + bool inRecalculateColumnWidths; + bool inRecalculateNeedsRedraw; + + void RecalculateColumnWidths() + { + if (inUpdate) return; + if (inRecalculateColumnWidths) return; + inRecalculateColumnWidths = true; + inRecalculateNeedsRedraw = false; + try + { + int availableWidth = ClientSize.Width; + int minRequiredWidth = 0; + foreach (DynamicListColumn c in columns) + { + if (c.AllowGrow) + minRequiredWidth += c.MinimumWidth; + else + availableWidth -= c.Width; + availableWidth -= 1; + } + // everyone gets c.MinimumWidth * availableWidth / minRequiredWidth + foreach (DynamicListColumn c in columns) + { + if (c.AllowGrow) + c.Width = Math.Max(2, c.MinimumWidth * availableWidth / minRequiredWidth); + } + } + finally + { + inRecalculateColumnWidths = false; + } + if (inRecalculateNeedsRedraw) + { + Redraw(); + } + } + + void ColumnWidthChanged(object sender, EventArgs e) + { + if (inRecalculateColumnWidths) + { + inRecalculateNeedsRedraw = true; + return; + } + Redraw(); + } + + bool inUpdate; + + public void BeginUpdate() + { + inUpdate = true; + } + + public void EndUpdate() + { + inUpdate = false; + RecalculateColumnWidths(); + } + + void Redraw() + { + if (inUpdate) return; + Invalidate(); + } + + List allowedControls = new List(); + List removedControls = new List(); + int scrollOffset = 0; + + public int ScrollOffset + { + get + { + return scrollOffset; + } + set + { + if (scrollOffset != value) + { + scrollOffset = value; + Redraw(); + } + } + } + + int VerticalScrollContainer.IScrollable.ScrollOffsetY + { + get + { + return this.ScrollOffset; + } + set + { + this.ScrollOffset = value; + } + } + + int VerticalScrollContainer.IScrollable.ScrollHeightY + { + get + { + return this.TotalRowHeight; + } + } + + public int GetRequiredWidth(Graphics graphics) + { + int width = 0; + for (int i = 0; i < columns.Count; i++) + { + if (columns[i].AutoSize) + { + int minimumWidth = DynamicListColumn.DefaultWidth; + foreach (DynamicListRow row in Rows) + { + DynamicListItem item = row[i]; + item.MeasureMinimumWidth(graphics, ref minimumWidth); + } + width += minimumWidth; + } + else + { + width += columns[i].Width; + } + width += 1; + } + return width; + } + + int lineMarginY = 0; + + public int LineMarginY + { + get + { + return lineMarginY; + } + set + { + if (lineMarginY == value) + return; + lineMarginY = value; + Redraw(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + //Debug.WriteLine("OnPaint"); + Graphics g = e.Graphics; + allowedControls.Clear(); + + int columnIndex = -1; + foreach (DynamicListColumn col in Columns) + { + columnIndex += 1; + if (!col.AutoSize) + continue; + int minimumWidth = DynamicListColumn.DefaultWidth; + foreach (DynamicListRow row in Rows) + { + DynamicListItem item = row[columnIndex]; + item.MeasureMinimumWidth(e.Graphics, ref minimumWidth); + } + col.MinimumWidth = minimumWidth; + } + + int controlIndex = 0; + int xPos; + int yPos = -scrollOffset; + Size clientSize = ClientSize; + foreach (DynamicListRow row in Rows) + { + if (yPos + row.Height > 0 && yPos < clientSize.Height) + { + xPos = 0; + for (columnIndex = 0; columnIndex < columns.Count; columnIndex++) + { + DynamicListColumn col = columns[columnIndex]; + Rectangle rect = new Rectangle(xPos, yPos, col.Width, row.Height); + if (columnIndex == columns.Count - 1) + rect.Width = clientSize.Width - 1 - rect.Left; + DynamicListItem item = row[columnIndex]; + Control ctl = item.Control; + if (ctl != null) + { + allowedControls.Add(ctl); + if (rect != ctl.Bounds) + ctl.Bounds = rect; + if (!this.Controls.Contains(ctl)) + { + this.Controls.Add(ctl); + this.Controls.SetChildIndex(ctl, controlIndex); + } + controlIndex += 1; + } + else + { + item.PaintTo(e.Graphics, rect, this, col, item == itemAtMousePosition); + } + xPos += col.Width + 1; + } + } + yPos += row.Height + lineMarginY; + } + xPos = 0; + Form containerForm = FindForm(); + bool isFocused; + if (containerForm is IActivatable) + isFocused = (containerForm as IActivatable).IsActivated; + else + isFocused = this.Focused; + for (columnIndex = 0; columnIndex < columns.Count - 1; columnIndex++) + { + DynamicListColumn col = columns[columnIndex]; + + xPos += col.Width + 1; + + Color separatorColor =Color.Empty; + //if (isFocused) + if (columnIndex == columns.Count-2) + { + separatorColor = Color.LightGray;//col.ColumnSeperatorColor; + if (separatorColor.IsEmpty) + separatorColor = col.ColumnSeperatorColorInactive; + } + /*else + { + separatorColor = col.ColumnSeperatorColorInactive; + if (separatorColor.IsEmpty) + separatorColor = col.ColumnSeperatorColor; + }*/ + if (separatorColor.IsEmpty) separatorColor = BackColor; + using (Pen separatorPen = new Pen(separatorColor)) + { + e.Graphics.DrawLine(separatorPen, xPos - 1, 1, xPos - 1, Math.Min(clientSize.Height, yPos) - 2); + } + } + removedControls.Clear(); + foreach (Control ctl in Controls) + { + if (!allowedControls.Contains(ctl)) + removedControls.Add(ctl); + } + foreach (Control ctl in removedControls) + { + Debug.WriteLine("Removing control"); + Controls.Remove(ctl); + Debug.WriteLine("Control removed"); + } + allowedControls.Clear(); + removedControls.Clear(); + base.OnPaint(e); + } + + /// + /// Gets if the parent form of this list is the active window. + /// + public bool IsActivated + { + get + { + Form containerForm = FindForm(); + if (containerForm is IActivatable) + return (containerForm as IActivatable).IsActivated; + else + return this.Focused; + } + } + + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + RecalculateColumnWidths(); + } + + public DynamicListRow GetRowFromPoint(int yPos) + { + int y = -scrollOffset; + foreach (DynamicListRow row in Rows) + { + if (yPos < y) + break; + if (yPos <= y + row.Height) + return row; + y += row.Height + lineMarginY; + } + return null; + } + + /// + /// Gets the upper left corner of the specified row. + /// + public Point GetPositionFromRow(DynamicListRow row) + { + int y = -scrollOffset; + foreach (DynamicListRow r in Rows) + { + if (r == row) + return new Point(0, y); + y += r.Height + lineMarginY; + } + throw new ArgumentException("The row in not in this list!"); + } + + /// + /// Gets the height of all rows. + /// + public int TotalRowHeight + { + get + { + int y = 0; + foreach (DynamicListRow r in Rows) + { + y += r.Height + lineMarginY; + } + return y; + } + } + + public int GetColumnIndexFromPoint(int xPos) + { + int columnIndex = 0; + int x = 0; + foreach (DynamicListColumn col in Columns) + { + if (xPos < x) + break; + if (xPos <= x + col.Width) + return columnIndex; + x += col.Width + 1; + columnIndex += 1; + } + return -1; + } + + public DynamicListItem GetItemFromPoint(Point position) + { + DynamicListRow row = GetRowFromPoint(position.Y); + if (row == null) + return null; + int columnIndex = GetColumnIndexFromPoint(position.X); + if (columnIndex < 0) + return null; + return row[columnIndex]; + } + + protected override void OnClick(EventArgs e) + { + base.OnClick(e); + DynamicListItem item = GetItemFromPoint(PointToClient(Control.MousePosition)); + if (item != null) item.PerformClick(this); + } + + protected override void OnDoubleClick(EventArgs e) + { + base.OnDoubleClick(e); + DynamicListItem item = GetItemFromPoint(PointToClient(Control.MousePosition)); + if (item != null) item.PerformDoubleClick(this); + } + + protected override void OnMouseHover(EventArgs e) + { + base.OnMouseHover(e); + DynamicListItem item = GetItemFromPoint(PointToClient(Control.MousePosition)); + if (item != null) + item.OnMouseHover(this); + } + + DynamicListItem itemAtMousePosition; + DynamicListRow rowAtMousePosition; + + public DynamicListItem ItemAtMousePosition + { + get + { + return itemAtMousePosition; + } + } + + public DynamicListRow RowAtMousePosition + { + get + { + return rowAtMousePosition; + } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + DynamicListRow row = GetRowFromPoint(e.Y); + if (rowAtMousePosition != row) + { + rowAtMousePosition = row; + Invalidate(); + } + if (row == null) + return; + int columnIndex = GetColumnIndexFromPoint(e.X); + if (columnIndex < 0) + return; + DynamicListItem item = row[columnIndex]; + if (itemAtMousePosition != item) + { + if (itemAtMousePosition != null) + { + OnLeaveItem(itemAtMousePosition); + } + ResetMouseEventArgs(); // raise hover again + itemAtMousePosition = item; + if (item != null) + { + if (item.Cursor != null) + this.Cursor = item.Cursor; + item.OnMouseEnter(this); + } + } + if (item != null) + { + item.OnMouseMove(new DynamicListMouseEventArgs(this, e)); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + DynamicListItem item = GetItemFromPoint(e.Location); + if (item != null) item.OnMouseDown(new DynamicListMouseEventArgs(this, e)); + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + DynamicListItem item = GetItemFromPoint(e.Location); + if (item != null) item.OnMouseUp(new DynamicListMouseEventArgs(this, e)); + } + + protected override void OnMouseLeave(EventArgs e) + { + rowAtMousePosition = null; + if (itemAtMousePosition != null) + { + OnLeaveItem(itemAtMousePosition); + itemAtMousePosition = null; + } + base.OnMouseLeave(e); + } + + protected virtual void OnLeaveItem(DynamicListItem item) + { + itemAtMousePosition.OnMouseLeave(this); + this.Cursor = Cursors.Default; + } + + readonly CollectionWithEvents columns; + readonly CollectionWithEvents rows; + + public CollectionWithEvents Columns + { + [DebuggerStepThrough] + get + { + return columns; + } + } + + [Browsable(false)] + public CollectionWithEvents Rows + { + [DebuggerStepThrough] + get + { + return rows; + } + } + } + + public interface IActivatable + { + bool IsActivated { get; } + event EventHandler Activated; + event EventHandler Deactivate; + } + + public sealed class DynamicListItem + { + DynamicListRow row; + + internal DynamicListItem(DynamicListRow row) + { + this.row = row; + } + + public void RaiseItemChanged() + { + row.RaiseItemChanged(this); + } + + Cursor cursor; + + public DynamicListRow Row + { + get + { + return row; + } + } + + public Cursor Cursor + { + get + { + return cursor; + } + set + { + cursor = value; + } + } + + #region BackgroundBrush / Control + Brush backgroundBrush; + + public Brush BackgroundBrush + { + get + { + return backgroundBrush; + } + set + { + if (backgroundBrush != value) + { + backgroundBrush = value; + RaiseItemChanged(); + } + } + } + + Brush backgroundBrushInactive; + + public Brush BackgroundBrushInactive + { + get + { + return backgroundBrushInactive; + } + set + { + if (backgroundBrushInactive != value) + { + backgroundBrushInactive = value; + RaiseItemChanged(); + } + } + } + + Brush highlightBrush; + + public Brush HighlightBrush + { + get + { + return highlightBrush; + } + set + { + if (highlightBrush != value) + { + highlightBrush = value; + RaiseItemChanged(); + } + } + } + + Control control; + + public Control Control + { + get + { + return control; + } + set + { + if (control != value) + { + control = value; + RaiseItemChanged(); + } + } + } + #endregion + + #region MeasureWidth / Paint + public event EventHandler MeasureWidth; + + internal void MeasureMinimumWidth(Graphics graphics, ref int minimumWidth) + { + if (MeasureWidth != null) + { + MeasureWidthEventArgs e = new MeasureWidthEventArgs(graphics); + MeasureWidth(this, e); + minimumWidth = Math.Max(minimumWidth, e.ItemWidth); + } + if (text.Length > 0) + { + // Prevent GDI exception (forum-12284) when text is very long + if (text.Length > short.MaxValue) + { + text = text.Substring(0, short.MaxValue - 1); + } + int width = 2 + (int)graphics.MeasureString(text, font, new PointF(0, 0), textFormat).Width; + minimumWidth = Math.Max(minimumWidth, width); + } + } + + public event EventHandler Paint; + + internal void PaintTo(Graphics g, Rectangle rectangle, DynamicList list, DynamicListColumn column, bool isMouseEntered) + { + Rectangle fillRectangle = rectangle; + fillRectangle.Width += 1; + if (highlightBrush != null && isMouseEntered) + { + g.FillRectangle(highlightBrush, fillRectangle); + } + else + { + bool isActivated = list.IsActivated; + Brush bgBrush = GetBrush(isActivated, backgroundBrush, backgroundBrushInactive); + if (bgBrush == null) + { + bgBrush = GetBrush(isActivated, column.BackgroundBrush, column.BackgroundBrushInactive); + if (isActivated && list.RowAtMousePosition == row && column.RowHighlightBrush != null) + bgBrush = column.RowHighlightBrush; + } + g.FillRectangle(bgBrush, fillRectangle); + } + if (Paint != null) + { + Paint(this, new ItemPaintEventArgs(g, rectangle, fillRectangle, list, column, this, isMouseEntered)); + } + if (text.Length > 0) + { + // SSM 21.01.19 High DPI + textFormat.LineAlignment = StringAlignment.Center; + g.DrawString(text, font, textBrush, rectangle, textFormat); + } + } + + Brush GetBrush(bool isActive, Brush activeBrush, Brush inactiveBrush) + { + return isActive ? (activeBrush ?? inactiveBrush) : (inactiveBrush ?? activeBrush); + } + #endregion + + #region Text drawing + string text = string.Empty; + + public string Text + { + get + { + return text; + } + set + { + if (value == null) + throw new ArgumentNullException("value", "Use string.Empty instead of null!"); + if (text != value) + { + text = value; + RaiseItemChanged(); + } + } + } + + Font font = Control.DefaultFont; + + public Font Font + { + get + { + return font; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + if (font != value) + { + font = value; + RaiseItemChanged(); + } + } + } + + Brush textBrush = SystemBrushes.ControlText; + + public Brush TextBrush + { + get + { + return textBrush; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + if (textBrush != value) + { + textBrush = value; + RaiseItemChanged(); + } + } + } + + static StringFormat defaultTextFormat; + + public static StringFormat DefaultTextFormat + { + get + { + if (defaultTextFormat == null) + { + defaultTextFormat = (StringFormat)StringFormat.GenericDefault.Clone(); + defaultTextFormat.FormatFlags |= StringFormatFlags.NoWrap; + } + return defaultTextFormat; + } + } + + StringFormat textFormat = DefaultTextFormat; + + public StringFormat TextFormat + { + get + { + return textFormat; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + if (textFormat != value) + { + textFormat = value; + RaiseItemChanged(); + } + } + } + #endregion + + #region Mouse Events + public event EventHandler Click; + + public void PerformClick(DynamicList list) + { + if (Click != null) + Click(this, new DynamicListEventArgs(list)); + HandleLabelEditClick(list); + } + + public event EventHandler DoubleClick; + + public void PerformDoubleClick(DynamicList list) + { + if (DoubleClick != null) + DoubleClick(this, new DynamicListEventArgs(list)); + } + + public event EventHandler MouseHover; + + internal void OnMouseHover(DynamicList list) + { + if (MouseHover != null) + { + MouseHover(this, new DynamicListEventArgs(list)); + } + } + + public event EventHandler MouseLeave; + + internal void OnMouseLeave(DynamicList list) + { + if (MouseLeave != null) + { + MouseLeave(this, new DynamicListEventArgs(list)); + } + if (highlightBrush != null) RaiseItemChanged(); + } + + public event EventHandler MouseEnter; + + internal void OnMouseEnter(DynamicList list) + { + if (MouseEnter != null) + { + MouseEnter(this, new DynamicListEventArgs(list)); + } + if (highlightBrush != null) RaiseItemChanged(); + } + + public event EventHandler MouseMove; + + internal void OnMouseMove(DynamicListMouseEventArgs e) + { + if (MouseMove != null) + { + MouseMove(this, e); + } + } + + public event EventHandler MouseDown; + + internal void OnMouseDown(DynamicListMouseEventArgs e) + { + if (MouseDown != null) + { + MouseDown(this, e); + } + } + + public event EventHandler MouseUp; + + internal void OnMouseUp(DynamicListMouseEventArgs e) + { + if (MouseUp != null) + { + MouseUp(this, e); + } + } + #endregion + + #region Label editing + bool allowLabelEdit; + + public bool AllowLabelEdit + { + get + { + return allowLabelEdit; + } + set + { + allowLabelEdit = value; + } + } + + public event EventHandler BeginLabelEdit; + public event EventHandler FinishLabelEdit; + public event EventHandler CanceledLabelEdit; + + void HandleLabelEditClick(DynamicList list) + { + if (!allowLabelEdit) + return; + TextBox txt = new TextBox(); + txt.Text = this.Text; + AssignControlUntilFocusChange(txt); + if (BeginLabelEdit != null) + BeginLabelEdit(this, new DynamicListEventArgs(list)); + bool escape = false; + txt.KeyDown += delegate(object sender2, KeyEventArgs e2) + { + if (e2.KeyData == Keys.Enter || e2.KeyData == Keys.Escape) + { + e2.Handled = true; + if (e2.KeyData == Keys.Escape) + { + if (CanceledLabelEdit != null) + CanceledLabelEdit(this, new DynamicListEventArgs(list)); + escape = true; + } + this.Control = null; + txt.Dispose(); + } + }; + txt.LostFocus += delegate + { + if (!escape) + { + this.Text = txt.Text; + if (FinishLabelEdit != null) + FinishLabelEdit(this, new DynamicListEventArgs(list)); + } + }; + } + + /// + /// Display the control for this item. Automatically assign focus to the control + /// and removes+disposes the control when it looses focus. + /// + public void AssignControlUntilFocusChange(Control control) + { + MethodInvoker method = delegate + { + if (!control.Focus()) + { + control.Focus(); + } + control.LostFocus += delegate + { + this.Control = null; + control.Dispose(); + }; + }; + + control.HandleCreated += delegate + { + control.BeginInvoke(method); + }; + this.Control = control; + } + #endregion + } + + public class DynamicListEventArgs : EventArgs + { + DynamicList list; + + public DynamicList List + { + [DebuggerStepThrough] + get + { + return list; + } + } + + public DynamicListEventArgs(DynamicList list) + { + if (list == null) throw new ArgumentNullException("list"); + this.list = list; + } + } + + public class DynamicListMouseEventArgs : MouseEventArgs + { + DynamicList list; + + public DynamicList List + { + [DebuggerStepThrough] + get + { + return list; + } + } + + public DynamicListMouseEventArgs(DynamicList list, MouseEventArgs me) + : base(me.Button, me.Clicks, me.X, me.Y, me.Delta) + { + if (list == null) throw new ArgumentNullException("list"); + this.list = list; + } + } + + public class MeasureWidthEventArgs : EventArgs + { + Graphics graphics; + + public Graphics Graphics + { + get + { + return graphics; + } + } + + int itemWidth; + + public int ItemWidth + { + get + { + return itemWidth; + } + set + { + itemWidth = value; + } + } + + public MeasureWidthEventArgs(Graphics graphics) + { + if (graphics == null) + throw new ArgumentNullException("graphics"); + this.graphics = graphics; + } + } + + public class ItemPaintEventArgs : PaintEventArgs + { + DynamicList list; + DynamicListColumn column; + DynamicListItem item; + bool isMouseEntered; + Rectangle fillRectangle; + + public Rectangle FillRectangle + { + get + { + return fillRectangle; + } + } + + public DynamicList List + { + get + { + return list; + } + } + + public DynamicListColumn Column + { + get + { + return column; + } + } + + public DynamicListRow Row + { + get + { + return item.Row; + } + } + + public DynamicListItem Item + { + get + { + return item; + } + } + + public bool IsMouseEntered + { + get + { + return isMouseEntered; + } + } + + public ItemPaintEventArgs(Graphics graphics, Rectangle rectangle, Rectangle fillRectangle, + DynamicList list, DynamicListColumn column, + DynamicListItem item, bool isMouseEntered) + : base(graphics, rectangle) + { + this.fillRectangle = fillRectangle; + this.list = list; + this.column = column; + this.item = item; + this.isMouseEntered = isMouseEntered; + } + } + + public class DynamicListColumn : ICloneable + { + // SSM 21.01.19 High DPI + public static int DefaultWidth = Convert.ToInt32(16 * ScreenScale.Calc()); + + int width = DefaultWidth; + int minimumWidth = DefaultWidth; + bool allowGrow = true; + bool autoSize = false; + + //public static readonly Color DefaultBackColor = Color.FromArgb(247, 245, 233); + public static readonly Color DefaultBackColor = SystemColors.Window; + public static readonly Brush DefaultBackBrush = new SolidBrush(DefaultBackColor); + public static readonly Color DefaultRowHighlightBackColor = Color.FromArgb(221, 218, 203); + //public static readonly Color DefaultRowHighlightBackColor = SystemColors.Highlight; + public static readonly Brush DefaultRowHighlightBrush = new SolidBrush(DefaultRowHighlightBackColor); + //public static readonly Color DefaultInactiveBackColor = Color.FromArgb(242, 240, 228); + public static readonly Color DefaultInactiveBackColor = SystemColors.Window; + public static readonly Brush DefaultInactiveBackBrush = new SolidBrush(DefaultInactiveBackColor); + + Brush backgroundBrush = DefaultBackBrush; + Brush backgroundBrushInactive = DefaultInactiveBackBrush; + Brush rowHighlightBrush = DefaultRowHighlightBrush; + + public virtual DynamicListColumn Clone() + { + return (DynamicListColumn)base.MemberwiseClone(); + } + + object ICloneable.Clone() + { + return this.Clone(); + } + + #region Properties + public int MinimumWidth + { + get + { + return minimumWidth; + } + set + { + if (value < 2) + throw new ArgumentOutOfRangeException("value", value, "MinimumWidth must be at least 2"); + if (minimumWidth != value) + { + minimumWidth = value; + if (MinimumWidthChanged != null) + { + MinimumWidthChanged(this, EventArgs.Empty); + } + } + } + } + + public event EventHandler MinimumWidthChanged; + + public int Width + { + get + { + return width; + } + set + { + if (value < 2) + throw new ArgumentOutOfRangeException("value", value, "Width must be at least 2"); + if (width != value) + { + width = value; + if (WidthChanged != null) + { + WidthChanged(this, EventArgs.Empty); + } + } + } + } + + public event EventHandler WidthChanged; + + public bool AllowGrow + { + get + { + return allowGrow; + } + set + { + allowGrow = value; + } + } + + public bool AutoSize + { + get + { + return autoSize; + } + set + { + autoSize = value; + } + } + + public Brush BackgroundBrush + { + get + { + return backgroundBrush; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + backgroundBrush = value; + } + } + + public Brush BackgroundBrushInactive + { + get + { + return backgroundBrushInactive; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + backgroundBrushInactive = value; + } + } + + public Brush RowHighlightBrush + { + get + { + return rowHighlightBrush; + } + set + { + rowHighlightBrush = value; + } + } + + Color columnSeperatorColor = Color.Empty; + + /// + /// Sets the color that is used to the right of this column as separator color. + /// + public Color ColumnSeperatorColor + { + get + { + return columnSeperatorColor; + } + set + { + columnSeperatorColor = value; + } + } + + Color columnSeperatorColorInactive = Color.Empty; + + /// + /// Sets the color that is used to the right of this column as separator color. + /// + public Color ColumnSeperatorColorInactive + { + get + { + return columnSeperatorColorInactive; + } + set + { + columnSeperatorColorInactive = value; + } + } + #endregion + } + + public sealed class CollectionWithEvents : IList + { + List list = new List(); + public event EventHandler> Added; + public event EventHandler> Removed; + + void OnAdded(T item) + { + if (Added != null) + Added(this, new CollectionItemEventArgs(item)); + } + void OnRemoved(T item) + { + if (Removed != null) + Removed(this, new CollectionItemEventArgs(item)); + } + + public T this[int index] + { + get + { + return list[index]; + } + set + { + T oldValue = list[index]; + if (!object.Equals(oldValue, value)) + { + list[index] = value; + OnRemoved(oldValue); + OnAdded(value); + } + } + } + + public int Count + { + [DebuggerStepThrough] + get + { + return list.Count; + } + } + + public bool IsReadOnly + { + get + { + return false; + } + } + + public int IndexOf(T item) + { + return list.IndexOf(item); + } + + public void Insert(int index, T item) + { + list.Insert(index, item); + OnAdded(item); + } + + public void RemoveAt(int index) + { + T item = list[index]; + list.RemoveAt(index); + OnRemoved(item); + } + + public void Add(T item) + { + list.Add(item); + OnAdded(item); + } + + public void AddRange(IEnumerable range) + { + foreach (T t in range) + { + Add(t); + } + } + + public void Clear() + { + List oldList = list; + list = new List(); + foreach (T item in oldList) + { + OnRemoved(item); + } + } + + public bool Contains(T item) + { + return list.Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + list.CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (list.Remove(item)) + { + OnRemoved(item); + return true; + } + return false; + } + + [DebuggerStepThrough] + public IEnumerator GetEnumerator() + { + return list.GetEnumerator(); + } + + [DebuggerStepThrough] + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return list.GetEnumerator(); + } + } + + public class CollectionItemEventArgs : EventArgs + { + T item; + + public T Item + { + get + { + return item; + } + } + + public CollectionItemEventArgs(T item) + { + this.item = item; + } + } + + public class VerticalScrollContainer : Control + { + public interface IScrollable + { + int ScrollOffsetY { get; set; } + int ScrollHeightY { get; } + int Height { get; } + event MouseEventHandler MouseWheel; + } + + IScrollable scrollable; + bool showButtonsOnlyIfRequired = true; + ScrollButtonControl down = new ScrollButtonControl(); + ScrollButtonControl up = new ScrollButtonControl(); + Timer timer = new Timer(); + + int scrollSpeed = 5; + + public int ScrollSpeed + { + get + { + return scrollSpeed; + } + set + { + scrollSpeed = value; + } + } + + public VerticalScrollContainer() + { + up.Arrow = ScrollButton.Up; + down.Arrow = ScrollButton.Down; + up.Dock = DockStyle.Top; + down.Dock = DockStyle.Bottom; + this.TabStop = false; + this.SetStyle(ControlStyles.Selectable, false); + Controls.Add(up); + Controls.Add(down); + UpdateEnabled(); + + timer.Interval = 50; + timer.Tick += delegate + { + ScrollBy((int)timer.Tag); + }; + up.MouseDown += delegate + { + timer.Tag = -scrollSpeed; + ScrollBy(-scrollSpeed); + timer.Start(); + }; + down.MouseDown += delegate + { + timer.Tag = scrollSpeed; + ScrollBy(scrollSpeed); + timer.Start(); + }; + up.MouseUp += StopTimer; + down.MouseUp += StopTimer; + } + + void StopTimer(object sender, MouseEventArgs e) + { + timer.Stop(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (disposing) + { + timer.Dispose(); + } + } + + void UpdateEnabled() + { + if (scrollable == null) + { + up.Visible = down.Visible = true; + up.Enabled = down.Enabled = false; + } + else + { + int scrollHeightY = scrollable.ScrollHeightY; + if (showButtonsOnlyIfRequired) + { + if (scrollHeightY <= this.Height) + { + scrollable.ScrollOffsetY = 0; + up.Visible = down.Visible = false; + return; + } + up.Visible = down.Visible = true; + } + else + { + up.Visible = down.Visible = true; + if (scrollable.ScrollHeightY <= scrollable.Height) + { + scrollable.ScrollOffsetY = 0; + up.Enabled = down.Enabled = false; + return; + } + } + // set enabled + up.Enabled = scrollable.ScrollOffsetY > 0; + down.Enabled = scrollable.ScrollOffsetY < scrollHeightY - scrollable.Height; + } + } + + void ScrollBy(int amount) + { + scrollable.ScrollOffsetY = Math.Max(0, Math.Min(scrollable.ScrollOffsetY + amount, scrollable.ScrollHeightY - scrollable.Height)); + UpdateEnabled(); + } + + public bool ShowButtonsOnlyIfRequired + { + get + { + return showButtonsOnlyIfRequired; + } + set + { + if (showButtonsOnlyIfRequired != value) + { + showButtonsOnlyIfRequired = value; + UpdateEnabled(); + } + } + } + + void ScrollableWheel(object sender, MouseEventArgs e) + { + ScrollBy(-e.Delta / 3); + } + + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + UpdateEnabled(); + } + + protected override void OnControlAdded(ControlEventArgs e) + { + base.OnControlAdded(e); + if (scrollable == null && !DesignMode) + { + scrollable = e.Control as IScrollable; + if (scrollable != null) + { + scrollable.MouseWheel += ScrollableWheel; + Controls.SetChildIndex(e.Control, 0); + UpdateEnabled(); + } + } + } + + protected override void OnControlRemoved(ControlEventArgs e) + { + base.OnControlRemoved(e); + if (scrollable == e.Control) + { + scrollable.MouseWheel -= ScrollableWheel; + scrollable = null; + UpdateEnabled(); + } + } + + protected override void OnHandleCreated(EventArgs e) + { + base.OnHandleCreated(e); + // HACK: Windows.Forms bug workaround + BeginInvoke(new MethodInvoker(PerformLayout)); + } + } + + public class ScrollButtonControl : Control + { + public ScrollButtonControl() + { + this.BackColor = DynamicListColumn.DefaultBackColor; + this.TabStop = false; + this.SetStyle(ControlStyles.Selectable, false); + this.SetStyle(ControlStyles.ResizeRedraw, true); + } + + protected override Size DefaultSize + { + get + { + return new Size(14, 14); + } + } + + ScrollButton arrow = ScrollButton.Down; + + public ScrollButton Arrow + { + get + { + return arrow; + } + set + { + arrow = value; + Invalidate(); + } + } + + bool drawSeparatorLine = true; + + public bool DrawSeparatorLine + { + get + { + return drawSeparatorLine; + } + set + { + drawSeparatorLine = value; + Invalidate(); + } + } + + Color highlightColor = SystemColors.Highlight; + + public Color HighlightColor + { + get + { + return highlightColor; + } + set + { + highlightColor = value; + Invalidate(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + const int margin = 2; + int height = this.ClientSize.Height; + int size = height - 2 * margin; + int width = this.ClientSize.Width; + int left = (width - size) / 2; + int right = (width + size) / 2; + Point[] triangle; + switch (arrow) + { + case ScrollButton.Down: + triangle = new Point[] { + new Point(left, margin), new Point(right, margin), new Point(width / 2, margin + size) + }; + if (drawSeparatorLine) + e.Graphics.DrawLine(SystemPens.GrayText, 0, 0, width, 0); + break; + case ScrollButton.Up: + triangle = new Point[] { + new Point(left, margin + size), new Point(right, margin + size), new Point(width / 2, margin) + }; + if (drawSeparatorLine) + e.Graphics.DrawLine(SystemPens.GrayText, 0, height - 1, width, height - 1); + break; + default: + return; + } + Color color; + if (Enabled) + color = cursorEntered ? HighlightColor : ForeColor; + else + color = SystemColors.GrayText; + using (Brush b = new SolidBrush(color)) + { + e.Graphics.FillPolygon(b, triangle); + } + } + + bool cursorEntered = false; + + protected override void OnMouseEnter(EventArgs e) + { + base.OnMouseEnter(e); + cursorEntered = true; + Invalidate(); + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + cursorEntered = false; + Invalidate(); + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs b/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs new file mode 100644 index 000000000..b23327a56 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs @@ -0,0 +1,7603 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using PascalABCCompiler.SyntaxTree; +using System.Text; +using Debugger; +using VisualPascalABCPlugins; +using System.Runtime.ExceptionServices; + +namespace VisualPascalABC +{ + public enum ValueKind + { + Integer, + + } + + public class ValueWrapper : IValue + { + private Value value; + + public ValueWrapper(Value value) + { + this.value = value; + } + } + + public struct RetValue : IRetValue + { + //private ValueKind kind; + public object prim_val; + public Value obj_val; + public DebugType type; + public Type managed_type; + public bool syn_err; + public string err_mes; + public bool is_null; + + #region IRetValue Member + + IValue IRetValue.ObjectValue + { + get { return new ValueWrapper(obj_val); } + } + + object IRetValue.PrimitiveValue + { + get { return prim_val; } + } + + #endregion + } + + public abstract class WatchEvaluationError : System.Exception + { + } + + public class CommonEvaluationError : WatchEvaluationError + { + private string mes; + + public CommonEvaluationError(System.Exception ex) + { + mes = ex.Message; + } + + public override string ToString() + { + return mes; + } + } + + public class IncompatibleTypesInExpression : WatchEvaluationError + { + public override string ToString() + { + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_INCOMPATIBLE_TYPES_IN_EXPRESSION"); + } + } + + public class VariableExpectedTypeFound : WatchEvaluationError + { + private string name; + + public VariableExpectedTypeFound(string name) + { + this.name = name; + } + + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_VARIABLE_EXPECTED_TYPE_{0}_FOUND"), name); + } + } + + public class NoSuitableMethod : WatchEvaluationError + { + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_NO_SUITABLE_METHOD")); + } + } + + public class NoOperatorForThisType : WatchEvaluationError + { + private string op; + public NoOperatorForThisType(string op) + { + this.op = op; + } + + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_OPERATOR_{0}_NOT_IN_TYPE"), op); + } + } + + public class WrongNumberArguments : WatchEvaluationError + { + private string name; + + public WrongNumberArguments(string name) + { + this.name = name; + } + + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_WRONG_NUMBER_ARGUMENTS_IN_{0}"), name); + } + } + + public class WrongTypeOfArgument : WatchEvaluationError + { + private string name; + + public WrongTypeOfArgument(string name) + { + this.name = name; + } + + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_WRONG_TYPE_OF_ARGUMENT_IN_{0}"), name); + } + } + + public class WrongTypeInIndexer : WatchEvaluationError + { + public override string ToString() + { + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_WRONG_TYPE_IN_INDEXER"); + } + } + + public class WrongIndexersNumber : WatchEvaluationError + { + public override string ToString() + { + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_WRONG_INDEXERS_NUMBER"); + } + } + + public class NoIndexerProperty : WatchEvaluationError + { + public override string ToString() + { + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_NO_INDEXER_PROPERTY"); + } + } + + public class NameIsNotStatic : WatchEvaluationError + { + private string name; + + public NameIsNotStatic(string name) + { + this.name = name; + } + + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_NAME_{0}_IS_NOT_STATIC"), name); + } + } + + public class InvalidRangesInDiapason : WatchEvaluationError + { + public override string ToString() + { + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_LOWER_BOUND_GREATER_THAN_UPPER_BOUND"); + } + } + + public class InvalidExpressionTypeInDiapason : WatchEvaluationError + { + public override string ToString() + { + return PascalABCCompiler.StringResources.Get("EXPR_VALUE_INVALID_EXPRESSION_TYPE_IN_DIAPASON"); + } + } + + public class UnknownName : WatchEvaluationError + { + private string name; + + public UnknownName(string name) + { + this.name = name; + } + + public override string ToString() + { + return string.Format(PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNKNOWN_NAME_{0}"), name); + } + } + + /// + /// Класс для вычисления выражений при отладке (WATCH) + /// + public class ExpressionEvaluator : PascalABCCompiler.SyntaxTree.AbstractVisitor + { + private Stack eval_stack = new Stack(); + private RetValue ret_val; + private Debugger.Process debuggedProcess; + private IVisualEnvironmentCompiler vec; + private string FileName; + private bool for_immediate = false; + + public ExpressionEvaluator(Debugger.Process debuggedProcess, IVisualEnvironmentCompiler vec, string FileName) + { + this.debuggedProcess = debuggedProcess; + this.vec = vec; + this.FileName = FileName; + } + + /// + /// Вычисляет значение выражения expr + /// + [HandleProcessCorruptedStateExceptionsAttribute] + public RetValue Evaluate(string expr, bool for_immediate=false) + { + //VisualEnvironmentCompilerCompiler.ParsersController.GetExpression + declaringType = null; + names.Clear(); + ret_val = default(RetValue); + this.for_immediate = for_immediate; + string fileName = "test" + System.IO.Path.GetExtension(this.FileName); + List Errors = new List(); + List Warnings = new List(); + syntax_tree_node e = null; + if (for_immediate) + { + e = vec.StandartCompiler.ParsersController.GetExpression(fileName, expr, Errors, Warnings); + if (e == null) + { + Errors.Clear(); + e = vec.StandartCompiler.ParsersController.GetStatement(fileName, expr, Errors, Warnings); + } + } + else + e = vec.StandartCompiler.ParsersController.GetExpression(fileName, expr, Errors, Warnings); + RetValue res = new RetValue(); res.syn_err = false; + try + { + if (e != null && Errors.Count == 0) + { + e.visit(this); + if (eval_stack.Count > 0) + { + res = eval_stack.Pop(); + if (res.prim_val == null && res.obj_val != null) + if (res.obj_val.IsObject && res.obj_val.Type.IsValueType) + { + Value tmp = res.obj_val; + res.obj_val = DebugUtils.unbox(res.obj_val); + if (res.obj_val != null && res.obj_val.IsPrimitive) + { + res.prim_val = res.obj_val.PrimitiveValue; + res.obj_val = null; + } + else + res.obj_val = tmp; + } + } + } + else if (Errors.Count > 0) + { + res.syn_err = true; + } + } + catch (WatchEvaluationError er) + { + res.err_mes = er.ToString(); + } + catch (System.Exception ex) + { + //throw new System.Exception(ex.Message); + } + finally + { + if (eval_stack.Count > 0) eval_stack.Clear(); + + } + return res; + } + + private bool need_declaring_type; + + public DebugType declaringType; + + private List names = new List(); + [HandleProcessCorruptedStateExceptionsAttribute] + public bool IsEqual(RetValue left, RetValue right) + { + try + { + if (left.obj_val == null && left.prim_val == null) + return false; + if (right.obj_val == null && right.prim_val == null) + return false; + eval_stack.Push(left); + eval_stack.Push(right); + EvalEqual(); + RetValue rv = eval_stack.Pop(); + if (rv.prim_val != null && rv.prim_val is bool) + { + return (bool)rv.prim_val == true; + } + else if (rv.obj_val != null && rv.obj_val.IsPrimitive && rv.obj_val.PrimitiveValue is bool) + { + return (bool)rv.obj_val.PrimitiveValue == true; + } + else return false; + } + catch + { + return false; + } + } + [HandleProcessCorruptedStateExceptionsAttribute] + public RetValue GetValueForExpression(string expr, out string preformat) + { + declaringType = null; + for_immediate = false; + ret_val = default(RetValue); + preformat = expr.Trim(' ', '\n', '\r', '\t'); + names.Clear(); + string fileName = "test" + System.IO.Path.GetExtension(this.FileName); + List Errors = new List(); + expression e = vec.StandartCompiler.ParsersController.GetExpression(fileName, expr, Errors, new List()); + RetValue res = new RetValue(); res.syn_err = false; + try + { + if (e != null && Errors.Count == 0) + { + e.visit(this); + if (eval_stack.Count > 0) + { + res = eval_stack.Pop(); + preformat = string.Join("", names.ToArray()); + return res; + } + } + } + catch (System.Exception ex) + { + //throw new System.Exception(ex.Message); + } + finally + { + if (eval_stack.Count > 0) eval_stack.Clear(); + } + return new RetValue(); + } + + public override void visit(template_type_name node) + { + throw new NotImplementedException(); + } + + public override void visit(syntax_tree_node _syntax_tree_node) + { + throw new NotImplementedException(); + } + + public override void visit(token_taginfo node) + { + } + + public override void visit(statement_list _statement_list) + { + throw new NotImplementedException(); + } + + public override void visit(default_operator node) + { + throw new NotImplementedException(); + } + + public override void visit(expression _expression) + { + throw new NotImplementedException(); + } + + public override void visit(assign _assign) + { + _assign.from.visit(this); + if (ret_val.prim_val == null && ret_val.obj_val == null && eval_stack.Count > 0) + { + ret_val = eval_stack.Peek(); + } + if (_assign.to is ident) + { + Value nv = GetValue((_assign.to as ident).name); + if (ret_val.prim_val != null) + nv.SetValue(DebugUtils.MakeValue(ret_val.prim_val)); + else if (ret_val.obj_val != null) + nv.SetValue(ret_val.obj_val); + } + } + + public void EvalPlus() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (int)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val + (System.Single)right.prim_val; break; + //case TypeCode.Decimal : res.prim_val = (double)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (byte)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val + (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int16)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (System.Int16)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val + (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int64)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (System.Int64)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Int32: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Double: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Int64: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.String: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Int16: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.SByte: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.UInt16: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.UInt32: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.UInt64: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Single: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Char: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + case TypeCode.Decimal: res.prim_val = (string)left.prim_val + right.prim_val.ToString(); break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val + (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.SByte)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (System.SByte)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (System.UInt16)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (System.UInt32)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val + (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt64)left.prim_val + (System.UInt64)((long)right.prim_val); break; + case TypeCode.String: res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val + (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val + (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (System.UInt64)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val + (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val + (System.UInt64)((long)right.prim_val); break; + case TypeCode.String: res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val + (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val + (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val + (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val + (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val + (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val + (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val + (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val + (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val + (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val + (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val + (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val + (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.String: res.prim_val = left.prim_val.ToString() + (string)right.prim_val; break; + case TypeCode.Char: res.prim_val = (string)left.prim_val + (string)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Object: + { + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("UnionSet", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + } + break; + default: throw new NoOperatorForThisType("+"); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("UnionSet", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name), "+"); + } + } + eval_stack.Push(res); + } + + private Value EvalCommonOperation(Value left, Value right, string op, string sn) + { + if (left.Type != right.Type) + { + Type left_type = AssemblyHelper.GetType(left.Type.FullName); + Type right_type = AssemblyHelper.GetType(right.Type.FullName); + System.Reflection.MethodInfo conv_meth = left_type.GetMethod("op_Implicit", new Type[1] { right_type }); + IList meths = null; + if (conv_meth != null) + { + meths = left.Type.GetMethods(BindingFlags.All); + foreach (MethodInfo mi in meths) + if (mi.MetadataToken == conv_meth.MetadataToken) + { + right = mi.Invoke(null, new Value[1] { right }); + break; + } + } + else + { + conv_meth = right_type.GetMethod("op_Implicit", new Type[1] { left_type }); + if (conv_meth != null) + { + meths = right.Type.GetMethods(BindingFlags.All); + foreach (MethodInfo mi in meths) + if (mi.MetadataToken == conv_meth.MetadataToken) + { + left = mi.Invoke(null, new Value[1] { left }); + break; + } + } + } + } + if (left.Type == right.Type) + { + IList mems = left.Type.GetMember(op, Debugger.BindingFlags.All); + if (mems != null && mems.Count == 1 && mems[0] is MethodInfo) + { + MethodInfo mi = mems[0] as MethodInfo; + return mi.Invoke(null, new Value[2] { left, right }); + } + else + throw new NoOperatorForThisType(sn); + } + else + throw new NoOperatorForThisType(sn); + } + + private void EvalMinus() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val - (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val - (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val - (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val - (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val - (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val - (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() - (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val - (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val - (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val - (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val - (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val - (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val - (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val - (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val - (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val - (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val - (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val - (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val - (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val - (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val - (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Object: + { + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("SubtractSet", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + } + break; + default: throw new NoOperatorForThisType("-"); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("SubtractSet", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.minus_name), "-"); + } + } + eval_stack.Push(res); + } + + private void EvalMult() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val * (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val * (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val * (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val * (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val * (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val * (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val * (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val * (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val * (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val * (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val * (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val * (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val * (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val * (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val * (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val * (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val * (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val * (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val * (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val * (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Object: + { + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("IntersectSet", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + } + break; + default: throw new NoOperatorForThisType("*"); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("IntersectSet", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.mul_name), "*"); + } + } + eval_stack.Push(res); + } + + private void EvalDiv() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val / (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val / (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val + (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val / (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val / (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val / (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val / (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val + (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val / (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("/"); + } + + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.div_name), "/"); + } + eval_stack.Push(res); + } + + private void EvalIDiv() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val / (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val / (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val / (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val / (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val / (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) / (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val / (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val / (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val / (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("div"); + } + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.idiv_name), "div"); + } + eval_stack.Push(res); + } + + private void EvalAnd() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val & (System.Int64)((System.UInt64)right.prim_val); break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val & (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val & (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val & (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val & (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val & (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) & (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val & (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val & (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val & (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val & (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val & (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (bool)left.prim_val && (bool)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("and"); + } + eval_stack.Push(res); + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.and_name), "and"); + } + } + + private void EvalOr() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((int)left.prim_val) | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val | (int)((System.UInt32)right.prim_val); break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) | (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val | (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) | (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val | (System.Int64)((System.UInt64)right.prim_val); break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) | (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val | (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val | (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val | (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val | (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val | (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val | (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val | (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) | (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val | (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val | (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val | (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val | (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val | (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (bool)left.prim_val || (bool)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("or"); + } + eval_stack.Push(res); + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.plus_name), "-"); + } + } + + private void EvalXor() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val ^ (System.Int64)((System.UInt64)right.prim_val); break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val ^ (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val ^ (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val ^ (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val ^ (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val ^ (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) ^ (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val ^ (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val ^ (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val ^ (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val ^ (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val ^ (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + default: throw new NoOperatorForThisType("xor"); + } + eval_stack.Push(res); + } + else throw new NoOperatorForThisType("xor"); + } + + private void EvalBitwiseLeft() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (long)((int)left.prim_val) << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val << (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val << (int)((System.UInt32)right.prim_val); break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt64 : res.prim_val = (System.UInt64)((int)left.prim_val) << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (long)((byte)left.prim_val) << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt32)((byte)left.prim_val) << (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt64)((byte)left.prim_val) << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (long)((System.Int16)left.prim_val) << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt32)((System.Int16)left.prim_val) << (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt64)((System.Int16)left.prim_val) << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (long)((System.Int64)left.prim_val) << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.Int64)left.prim_val << (System.Int64)((System.UInt32)right.prim_val); break; + //case TypeCode.UInt64 : res.prim_val = (System.Int64)left.prim_val << (System.Int64)((System.UInt64)right.prim_val); break; + //case TypeCode.Single : res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.SByte)left.prim_val << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt32)((System.SByte)left.prim_val) << (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt64)((System.SByte)left.prim_val) << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.UInt16)left.prim_val << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt16)left.prim_val << (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt16)left.prim_val << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.UInt32)left.prim_val << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt32)left.prim_val << (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt32)left.prim_val << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val << (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val << (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.UInt64)left.prim_val << (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val << (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val << (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val << (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt64)left.prim_val << (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt64)left.prim_val << (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + default: throw new NoOperatorForThisType("shl"); + } + + eval_stack.Push(res); + } + else throw new NoOperatorForThisType("shl"); + } + + private void EvalBitwiseRight() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (int)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (int)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (int)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (int)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (int)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (byte)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (byte)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (byte)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (byte)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (byte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int16)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.Int16)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val >> (System.UInt16)right.prim_val; break; + //case TypeCode.UInt32 : res.prim_val = (System.Int16)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int16)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.Int16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int64)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.Int64)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.Int64)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int64)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.Int64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.SByte)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.SByte)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.SByte)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.SByte)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.SByte)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt16)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.UInt16)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt16)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt16)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt16)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt32)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.UInt32)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt32)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt32)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt32)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val >> (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val >> (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val / (double)right.prim_val; break; + //case TypeCode.Int64 : res.prim_val = (System.UInt64)left.prim_val >> (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val >> (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val >> (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val >> (System.UInt16)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.UInt32 : res.prim_val = (System.UInt64)left.prim_val >> (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.UInt64)left.prim_val >> (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val / (System.Single)right.prim_val; break; + } + } + break; + default: throw new NoOperatorForThisType("shr"); + } + + eval_stack.Push(res); + } + else throw new NoOperatorForThisType("shr"); + } + + private void EvalEqual() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + else + left.prim_val = DebugUtils.GetEnumValue(left.obj_val); + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + else + right.prim_val = DebugUtils.GetEnumValue(right.obj_val); + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((int)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((double)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((byte)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Int16)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val == (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int16)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Int64)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val == (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int64)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.Int32: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.Double: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.Int64: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.String: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.Int16: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.SByte: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.UInt16: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.UInt32: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.UInt64: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.Single: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + case TypeCode.Char: res.prim_val = (string)left.prim_val == right.prim_val.ToString(); break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.SByte)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val == (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.SByte)left.prim_val + (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.UInt16)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.UInt32)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val == (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt64)left.prim_val == (System.UInt64)((long)right.prim_val); break; + case TypeCode.String: res.prim_val = ((System.UInt64)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val == (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val == (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val == (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (decimal)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val == (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val == (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val == (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val == (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (decimal)left.prim_val == (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val == (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val == (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val == (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val == (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Single)left.prim_val).ToString() == (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val == (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val == (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val == (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val == (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val == (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val == (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (bool)left.prim_val == (bool)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.Char: res.prim_val = (char)left.prim_val == (char)right.prim_val; break; + case TypeCode.String: res.prim_val = left.prim_val.ToString() == right.prim_val.ToString(); break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("="); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.is_null) + { + if (right.is_null) + res.prim_val = true; + else + res.prim_val = right.obj_val.IsNull; + } + else if (right.is_null) + { + res.prim_val = left.obj_val.IsNull; + } + else + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("CompareEquals", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.eq_name); + if (left.obj_val.Type != right.obj_val.Type) + { + Type left_type = AssemblyHelper.GetType(left.obj_val.Type.FullName); + Type right_type = AssemblyHelper.GetType(right.obj_val.Type.FullName); + System.Reflection.MethodInfo conv_meth = left_type.GetMethod("op_Implicit", new Type[1] { right_type }); + IList meths = null; + if (conv_meth != null) + { + meths = left.obj_val.Type.GetMethods(BindingFlags.All); + foreach (MethodInfo mi in meths) + if (mi.MetadataToken == conv_meth.MetadataToken) + { + right.obj_val = mi.Invoke(null, new Value[1] { right.obj_val }); + break; + } + } + else + { + conv_meth = right_type.GetMethod("op_Implicit", new Type[1] { left_type }); + if (conv_meth != null) + { + meths = right.obj_val.Type.GetMethods(BindingFlags.All); + foreach (MethodInfo mi in meths) + if (mi.MetadataToken == conv_meth.MetadataToken) + { + left.obj_val = mi.Invoke(null, new Value[1] { left.obj_val }); + break; + } + } + } + } + if (left.obj_val.Type == right.obj_val.Type) + { + IList mems = left.obj_val.Type.GetMember(op, Debugger.BindingFlags.All); + if (mems != null && mems.Count == 1 && mems[0] is MethodInfo) + { + MethodInfo mi = mems[0] as MethodInfo; + res.obj_val = mi.Invoke(null, new Value[2] { left.obj_val, right.obj_val }); + } + else + res.prim_val = left.obj_val.IsReferenceEqual(right.obj_val); + } + else + res.prim_val = left.obj_val.IsReferenceEqual(right.obj_val); + } + } + eval_stack.Push(res); + } + + private void EvalNotEqual() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + else + left.prim_val = DebugUtils.GetEnumValue(left.obj_val); + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + else + right.prim_val = DebugUtils.GetEnumValue(right.obj_val); + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((int)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((double)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((byte)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Int16)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val != (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int16)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Int64)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val != (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.Int64)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.Int32: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.Double: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.Int64: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.String: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.Int16: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.SByte: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.UInt16: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.UInt32: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.UInt64: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.Single: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + case TypeCode.Char: res.prim_val = (string)left.prim_val != right.prim_val.ToString(); break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.SByte)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val != (System.UInt32)right.prim_val; break; + //case TypeCode.UInt64 : res.prim_val = (System.SByte)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.UInt16)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.UInt32)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val != (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt64)left.prim_val != (System.UInt64)((long)right.prim_val); break; + case TypeCode.String: res.prim_val = ((System.UInt64)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val != (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val != (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val != (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (decimal)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val != (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val != (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val != (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val != (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (decimal)left.prim_val == (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val != (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val != (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val != (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val != (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val != (long)right.prim_val; break; + case TypeCode.String: res.prim_val = ((System.Single)left.prim_val).ToString() != (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val != (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val != (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val != (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val != (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val != (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val != (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (bool)left.prim_val != (bool)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.Char: res.prim_val = (char)left.prim_val != (char)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("<>"); + + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.is_null) + { + if (right.is_null) + res.prim_val = false; + else + res.prim_val = !right.obj_val.IsNull; + } + else if (right.is_null) + { + res.prim_val = !left.obj_val.IsNull; + } + else + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("CompareInEquals", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.noteq_name); + if (left.obj_val.Type != right.obj_val.Type) + { + Type left_type = AssemblyHelper.GetType(left.obj_val.Type.FullName); + Type right_type = AssemblyHelper.GetType(right.obj_val.Type.FullName); + System.Reflection.MethodInfo conv_meth = left_type.GetMethod("op_Implicit", new Type[1] { right_type }); + IList meths = null; + if (conv_meth != null) + { + meths = left.obj_val.Type.GetMethods(BindingFlags.All); + foreach (MethodInfo mi in meths) + if (mi.MetadataToken == conv_meth.MetadataToken) + { + right.obj_val = mi.Invoke(null, new Value[1] { right.obj_val }); + break; + } + } + else + { + conv_meth = right_type.GetMethod("op_Implicit", new Type[1] { left_type }); + if (conv_meth != null) + { + meths = right.obj_val.Type.GetMethods(BindingFlags.All); + foreach (MethodInfo mi in meths) + if (mi.MetadataToken == conv_meth.MetadataToken) + { + left.obj_val = mi.Invoke(null, new Value[1] { left.obj_val }); + break; + } + } + } + } + if (left.obj_val.Type == right.obj_val.Type) + { + IList mems = left.obj_val.Type.GetMember(op, Debugger.BindingFlags.All); + if (mems != null && mems.Count == 1 && mems[0] is MethodInfo) + { + MethodInfo mi = mems[0] as MethodInfo; + res.obj_val = mi.Invoke(null, new Value[2] { left.obj_val, right.obj_val }); + } + else + res.prim_val = !left.obj_val.IsReferenceEqual(right.obj_val); + } + else + res.prim_val = !left.obj_val.IsReferenceEqual(right.obj_val); + } + } + eval_stack.Push(res); + } + + private void EvalLess() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + else + left.prim_val = DebugUtils.GetEnumValue(left.obj_val); + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + else + right.prim_val = DebugUtils.GetEnumValue(right.obj_val); + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val < (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val < (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val < (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val < (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val < (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (decimal)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val < (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val < (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val < (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val < (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (decimal)left.prim_val == (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val < (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val < (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val < (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val < (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val < (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val < (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val < (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val < (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val < (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val < (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val < (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (int)left.prim_val < (int)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + if (rcode == TypeCode.String) + res.prim_val = string.Compare((string)left.prim_val, (string)right.prim_val) < 0; + else throw new IncompatibleTypesInExpression(); + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.Char: res.prim_val = (char)left.prim_val < (char)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("<"); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("CompareLess", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.sm_name), "<"); + } + } + eval_stack.Push(res); + } + + private void EvalLessEqual() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + else + left.prim_val = DebugUtils.GetEnumValue(left.obj_val); + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + else + right.prim_val = DebugUtils.GetEnumValue(right.obj_val); + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val <= (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val <= (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val <= (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val <= (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val <= (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val <= (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (decimal)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val <= (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val <= (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val <= (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val <= (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (decimal)left.prim_val == (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val <= (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val <= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val <= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val <= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val <= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val <= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val <= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val <= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val <= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val <= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val <= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (int)left.prim_val <= (int)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + if (rcode == TypeCode.String) + res.prim_val = string.Compare((string)left.prim_val, (string)right.prim_val) <= 0; + else throw new IncompatibleTypesInExpression(); + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.Char: res.prim_val = (char)left.prim_val <= (char)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType("<="); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("CompareLessEqual", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.smeq_name), "<="); + } + } + eval_stack.Push(res); + } + + private void EvalGreater() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + else + left.prim_val = DebugUtils.GetEnumValue(left.obj_val); + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + else + right.prim_val = DebugUtils.GetEnumValue(right.obj_val); + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val > (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val > (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val > (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val > (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val > (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (decimal)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val > (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val > (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val > (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val > (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (decimal)left.prim_val == (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val > (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val > (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val > (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val > (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val > (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val > (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val > (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val > (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val > (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val > (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val > (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (int)left.prim_val > (int)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + if (rcode == TypeCode.String) + res.prim_val = string.Compare((string)left.prim_val, (string)right.prim_val) > 0; + else throw new IncompatibleTypesInExpression(); + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.Char: res.prim_val = (char)left.prim_val > (char)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType(">"); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("CompareGreater", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.gr_name), ">"); + } + } + eval_stack.Push(res); + } + + private void EvalGreaterEqual() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + else + left.prim_val = DebugUtils.GetEnumValue(left.obj_val); + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + else + right.prim_val = DebugUtils.GetEnumValue(right.obj_val); + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (int)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (int)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Double: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (double)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (double)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (double)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (double)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((double)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (double)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (double)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (double)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (double)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (double)left.prim_val >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (double)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (byte)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (byte)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int16)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Int16)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Int64)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val >= (System.Int64)((System.UInt64)right.prim_val); break; + case TypeCode.Single: res.prim_val = (System.Int64)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.SByte)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.SByte)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt16)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt16)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.UInt32)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt32)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val >= (System.UInt64)((int)right.prim_val); break; + case TypeCode.Double: res.prim_val = (System.UInt64)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val >= (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val >= (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.UInt64)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Decimal: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (decimal)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (decimal)left.prim_val >= (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (decimal)left.prim_val == (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (decimal)left.prim_val >= (System.UInt64)((long)right.prim_val); break; + //case TypeCode.String : res.prim_val = ((decimal)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (decimal)left.prim_val >= (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (decimal)left.prim_val >= (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (decimal)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (decimal)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (decimal)left.prim_val >= (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (decimal)left.prim_val == (System.Single)right.prim_val; break; + case TypeCode.Decimal: res.prim_val = (decimal)left.prim_val >= (decimal)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Single: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Single)left.prim_val >= (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Single)left.prim_val >= (int)right.prim_val; break; + case TypeCode.Double: res.prim_val = (System.Single)left.prim_val >= (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Single)left.prim_val >= (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Single)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Single)left.prim_val >= (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Single)left.prim_val >= (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Single)left.prim_val >= (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Single)left.prim_val >= (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Single)left.prim_val >= (System.UInt64)right.prim_val; break; + case TypeCode.Single: res.prim_val = (System.Single)left.prim_val >= (System.Single)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.Boolean: + { + switch (rcode) + { + case TypeCode.Boolean: res.prim_val = (int)left.prim_val >= (int)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + case TypeCode.String: + { + if (rcode == TypeCode.String) + res.prim_val = string.Compare((string)left.prim_val, (string)right.prim_val) >= 0; + else throw new IncompatibleTypesInExpression(); + } + break; + case TypeCode.Char: + { + switch (rcode) + { + case TypeCode.Char: res.prim_val = (char)left.prim_val >= (char)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + } + } + break; + default: throw new NoOperatorForThisType(">="); + } + + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + if (left.obj_val.Type.FullName == "PABCSystem.TypedSet" && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + res.obj_val = (left.obj_val.Type.GetMember("CompareGreaterEqual", BindingFlags.All)[0] as MethodInfo).Invoke(left.obj_val, new Value[1] { right.obj_val }); + } + else + { + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.greq_name), ">="); + } + } + eval_stack.Push(res); + } + + private void EvalRem() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (right.prim_val == null && right.obj_val != null) + { + if (right.obj_val.IsPrimitive) + right.prim_val = right.obj_val.PrimitiveValue; + } + if (left.prim_val != null && right.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + TypeCode rcode = Type.GetTypeCode(right.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Int32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (int)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (int)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (int)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (int)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((int)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (int)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (int)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (int)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (int)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((int)left.prim_val) % (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (int)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Byte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (byte)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (byte)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (byte)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (byte)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((byte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (byte)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (byte)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (byte)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (byte)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (byte)left.prim_val % (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (byte)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int16)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int16)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int16)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int16)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int16)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int16)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int16)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int16)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.Int16)left.prim_val) % (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int16)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.Int64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.Int64)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.Int64)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.Int64)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.Int64)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.Int64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.Int64)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.Int64)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.Int64)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.Int64)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.Int64)left.prim_val % (System.Int64)((System.UInt64)right.prim_val); break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.Int64)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + + case TypeCode.SByte: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.SByte)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.SByte)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.SByte)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.SByte)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.SByte)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.SByte)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.SByte)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.SByte)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.SByte)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)((System.SByte)left.prim_val) % (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.SByte)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt16: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt16)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt16)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt16)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt16)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt16)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt16)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt16)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt16)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt16)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt16)left.prim_val % (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt16)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt32: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt32)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt32)left.prim_val % (int)right.prim_val; break; + //case TypeCode.Double : res.prim_val = (System.UInt32)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (System.UInt32)left.prim_val % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt32)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt32)left.prim_val % (System.Int16)right.prim_val; break; + case TypeCode.SByte: res.prim_val = (System.UInt32)left.prim_val % (sbyte)right.prim_val; break; + case TypeCode.UInt16: res.prim_val = (System.UInt32)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt32)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt32)left.prim_val % (System.UInt64)right.prim_val; break; + //case TypeCode.Single : res.prim_val = (System.UInt32)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + case TypeCode.UInt64: + { + switch (rcode) + { + case TypeCode.Byte: res.prim_val = (System.UInt64)left.prim_val % (byte)right.prim_val; break; + case TypeCode.Int32: res.prim_val = (System.UInt64)left.prim_val % (System.UInt64)((int)right.prim_val); break; + //case TypeCode.Double : res.prim_val = (System.UInt64)left.prim_val % (double)right.prim_val; break; + case TypeCode.Int64: res.prim_val = (long)((System.UInt64)left.prim_val) % (long)right.prim_val; break; + //case TypeCode.String : res.prim_val = ((System.UInt64)left.prim_val).ToString() + (string)right.prim_val; break; + case TypeCode.Int16: res.prim_val = (System.UInt64)left.prim_val % (System.UInt64)((System.Int16)right.prim_val); break; + case TypeCode.SByte: res.prim_val = (System.UInt64)left.prim_val % (System.UInt64)((sbyte)right.prim_val); break; + case TypeCode.UInt16: res.prim_val = (System.UInt64)left.prim_val % (System.UInt16)right.prim_val; break; + case TypeCode.UInt32: res.prim_val = (System.UInt64)left.prim_val % (System.UInt32)right.prim_val; break; + case TypeCode.UInt64: res.prim_val = (System.UInt64)left.prim_val % (System.UInt64)right.prim_val; break; + default: throw new IncompatibleTypesInExpression(); + //case TypeCode.Single : res.prim_val = (System.UInt64)left.prim_val % (System.Single)right.prim_val; break; + } + } + break; + default: throw new NoOperatorForThisType("rem"); + } + + eval_stack.Push(res); + } + else + { + if (left.obj_val == null && left.prim_val != null) + left.obj_val = DebugUtils.MakeValue(left.prim_val); + if (right.obj_val == null && right.prim_val != null) + right.obj_val = DebugUtils.MakeValue(right.prim_val); + res.obj_val = EvalCommonOperation(left.obj_val, right.obj_val, PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.mod_name), "mod"); + } + } + + private void EvalIs() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (right.type != null && (left.obj_val != null || left.prim_val != null)) + { + if (left.obj_val != null) + { + DebugType t = left.obj_val.Type; + while (t != null && t != right.type) + { + t = t.BaseType; + } + res.prim_val = t == right.type; + } + else if (right.managed_type != null) + res.prim_val = left.prim_val.GetType().IsSubclassOf(right.managed_type); + else + res.prim_val = false; + } + else if (left.managed_type != null) + throw new VariableExpectedTypeFound(left.managed_type.Name); + + eval_stack.Push(res); + } + + private void EvalAs() + { + throw new NotImplementedException(); + } + + public Value MakeValue(RetValue val) + { + if (val.obj_val != null) return val.obj_val; + return DebugUtils.MakeValue(val.prim_val); + } + + private Value box(Value v) + { + if (v.Type.IsPrimitive || v.Type.IsValueType) + { + return v.GetPermanentReference(); + } + return v; + } + + private void EvalIn() + { + RetValue right = eval_stack.Pop(); + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (right.obj_val != null && right.obj_val.Type.FullName == "PABCSystem.TypedSet") + { + MethodInfo mi = right.obj_val.Type.GetMember("Contains", BindingFlags.All)[0] as MethodInfo; + Value tmp = box(MakeValue(left)); + Value v = mi.Invoke(right.obj_val, new Value[1] { tmp }); + res.prim_val = v.PrimitiveValue; + //res.prim_val = MakeValue(left).PrimitiveValue;//v.PrimitiveValue; + //Value v = mi.Invoke(right.obj_val,new Value[1]{right.obj_val}); + //res.prim_val = MakeValue(left).PrimitiveValue; + } + else throw new NoOperatorForThisType("in"); + eval_stack.Push(res); + } + + public override void visit(bin_expr _bin_expr) + { + _bin_expr.left.visit(this); + switch (_bin_expr.operation_type) + { + case Operators.Plus: names.Add("+"); break; + case Operators.Minus: names.Add("-"); break; + case Operators.Multiplication: names.Add("*"); break; + case Operators.Division: names.Add("/"); break; + case Operators.IntegerDivision: names.Add(" div "); break; + case Operators.BitwiseAND: names.Add(" and "); break; + case Operators.BitwiseOR: names.Add(" or "); break; + case Operators.BitwiseXOR: names.Add(" xor "); break; + case Operators.BitwiseLeftShift: names.Add(" shl "); break; + case Operators.BitwiseRightShift: names.Add(" shr "); break; + case Operators.Equal: names.Add("="); break; + case Operators.NotEqual: names.Add("<>"); break; + case Operators.Less: names.Add("<"); break; + case Operators.LessEqual: names.Add("<="); break; + case Operators.Greater: names.Add(">"); break; + case Operators.GreaterEqual: names.Add(">="); break; + case Operators.LogicalAND: names.Add(" and "); break; + case Operators.LogicalOR: names.Add(" or "); break; + case Operators.ModulusRemainder: names.Add(" mod "); break; + case Operators.Is: names.Add(" is "); break; + case Operators.As: names.Add(" as "); break; + case Operators.In: names.Add(" in "); break; + } + _bin_expr.right.visit(this); + switch (_bin_expr.operation_type) + { + case Operators.Plus: EvalPlus(); break; + case Operators.Minus: EvalMinus(); break; + case Operators.Multiplication: EvalMult(); break; + case Operators.Division: EvalDiv(); break; + case Operators.IntegerDivision: EvalIDiv(); break; + case Operators.BitwiseAND: EvalAnd(); break; + case Operators.BitwiseOR: EvalOr(); break; + case Operators.BitwiseXOR: EvalXor(); break; + case Operators.BitwiseLeftShift: EvalBitwiseLeft(); break; + case Operators.BitwiseRightShift: EvalBitwiseRight(); break; + case Operators.Equal: EvalEqual(); break; + case Operators.NotEqual: EvalNotEqual(); break; + case Operators.Less: EvalLess(); break; + case Operators.LessEqual: EvalLessEqual(); break; + case Operators.Greater: EvalGreater(); break; + case Operators.GreaterEqual: EvalGreaterEqual(); break; + case Operators.LogicalAND: EvalAnd(); break; + case Operators.LogicalOR: EvalOr(); break; + case Operators.ModulusRemainder: EvalRem(); break; + case Operators.Is: EvalIs(); break; + case Operators.As: EvalAs(); break; + case Operators.In: EvalIn(); break; + case Operators.Assignment: throw new System.Exception(); + + } + } + + private void EvalNot() + { + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (left.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Boolean: res.prim_val = !(bool)left.prim_val; break; + case TypeCode.Byte: res.prim_val = ~(byte)left.prim_val; break; + case TypeCode.Int16: res.prim_val = ~(System.Int16)left.prim_val; break; + case TypeCode.Int32: res.prim_val = ~(System.Int32)left.prim_val; break; + case TypeCode.Int64: res.prim_val = ~(System.Int64)left.prim_val; break; + case TypeCode.SByte: res.prim_val = ~(sbyte)left.prim_val; break; + case TypeCode.UInt16: res.prim_val = ~(System.UInt16)left.prim_val; break; + case TypeCode.UInt32: res.prim_val = ~(System.UInt32)left.prim_val; break; + case TypeCode.UInt64: res.prim_val = ~(System.UInt64)left.prim_val; break; + default: throw new NoOperatorForThisType("not"); + } + eval_stack.Push(res); + } + else + { + string op = PascalABCCompiler.TreeConverter.compiler_string_consts.GetNETOperName(PascalABCCompiler.TreeConverter.compiler_string_consts.not_name); + { + IList mems = left.obj_val.Type.GetMember(op, Debugger.BindingFlags.All); + if (mems != null && mems.Count == 1 && mems[0] is MethodInfo) + { + MethodInfo mi = mems[0] as MethodInfo; + res.obj_val = mi.Invoke(null, new Value[1] { left.obj_val }); + } + else + throw new NoOperatorForThisType("not"); + } + } + } + + private void EvalUnmin() + { + RetValue left = eval_stack.Pop(); + RetValue res = new RetValue(); + if (left.prim_val == null && left.obj_val != null) + { + if (left.obj_val.IsPrimitive) + left.prim_val = left.obj_val.PrimitiveValue; + } + if (left.prim_val != null) + { + TypeCode lcode = Type.GetTypeCode(left.prim_val.GetType()); + switch (lcode) + { + case TypeCode.Byte: res.prim_val = -(byte)left.prim_val; break; + case TypeCode.Int16: res.prim_val = -(System.Int16)left.prim_val; break; + case TypeCode.Int32: res.prim_val = -(System.Int32)left.prim_val; break; + case TypeCode.Int64: res.prim_val = -(System.Int64)left.prim_val; break; + case TypeCode.SByte: res.prim_val = -(sbyte)left.prim_val; break; + case TypeCode.UInt16: res.prim_val = -(System.UInt16)left.prim_val; break; + case TypeCode.UInt32: res.prim_val = -(System.UInt32)left.prim_val; break; + //case TypeCode.UInt64: res.prim_val = -(System.UInt64)left.prim_val; break; + case TypeCode.Double: res.prim_val = -(double)left.prim_val; break; + case TypeCode.Single: res.prim_val = -(System.Single)left.prim_val; break; + default: throw new NoOperatorForThisType("-"); + } + eval_stack.Push(res); + } + } + + public override void visit(un_expr _un_expr) + { + _un_expr.subnode.visit(this); + switch (_un_expr.operation_type) + { + case Operators.BitwiseNOT: + names.Add("not "); + EvalNot(); break; + case Operators.LogicalNOT: + names.Add("not "); + EvalNot(); break; + case Operators.Minus: + names.Add("-"); + EvalUnmin(); break; + } + } + + public override void visit(const_node _const_node) + { + throw new NotImplementedException(); + } + + public override void visit(bool_const _bool_const) + { + RetValue val = new RetValue(); + val.prim_val = _bool_const.val; + names.Add(_bool_const.val.ToString()); + eval_stack.Push(val); + } + + public override void visit(int32_const _int32_const) + { + RetValue val = new RetValue(); + val.prim_val = _int32_const.val; + names.Add(_int32_const.val.ToString()); + eval_stack.Push(val); + } + + public override void visit(double_const _double_const) + { + RetValue val = new RetValue(); + val.prim_val = _double_const.val; + names.Add(_double_const.val.ToString()); + eval_stack.Push(val); + } + + public override void visit(statement _statement) + { + throw new NotImplementedException(); + } + + public override void visit(subprogram_body _subprogram_body) + { + throw new NotImplementedException(); + } + + public Value GetValue(string var) + { + try + { + List unit_vars = new List(); + NamedValueCollection nvc = null; + NamedValue ret_nv = null; + NamedValue global_nv = null; + NamedValue disp_nv = null; + nvc = debuggedProcess.SelectedFunction.LocalVariables; + List val_list = new List(); + foreach (NamedValue nv in nvc)//smotrim sredi lokalnyh peremennyh + { + if (nv.Name.IndexOf("<>local_variables") == -1) + val_list.Add(nv); + else + { + foreach (NamedValue nv2 in nv.GetMembers())//smotrim sredi lokalnyh peremennyh + { + val_list.Add(nv2); + } + } + } + foreach (NamedValue nv in val_list) + { + if (nv.Name.IndexOf(':') != -1) + { + int pos = nv.Name.IndexOf(':'); + string name = nv.Name.Substring(0, pos); + + if (string.Compare(name, var, true) == 0) + { + int num_line = debuggedProcess.SelectedFunction.NextStatement.StartLine; + int start_line = Convert.ToInt32(nv.Name.Substring(pos + 1, nv.Name.LastIndexOf(':') - pos - 1)); + int end_line = Convert.ToInt32(nv.Name.Substring(nv.Name.LastIndexOf(':') + 1)); + if (num_line >= start_line && num_line <= end_line) + return nv; + } + } + if (string.Compare(nv.Name, var, true) == 0) return nv; + else if (nv.Name.Contains("$class_var")) global_nv = nv; + else if (nv.Name.Contains("$unit_var")) unit_vars.Add(nv); + else if (nv.Name == "$disp$") disp_nv = nv; + else if (nv.Name.StartsWith("$rv_")) + ret_nv = nv; + } + nvc = debuggedProcess.SelectedFunction.Arguments; + NamedValue self_nv = null; + foreach (NamedValue nv in nvc) + { + if (string.Compare(nv.Name, var, true) == 0) return nv; + if (nv.Name == "$obj$") + self_nv = nv; + } + if (var.ToLower() == "result" && ret_nv != null) return ret_nv; + if (var.ToLower() == "self") + { + try + { + return debuggedProcess.SelectedFunction.ThisValue; + } + catch + { + if (self_nv != null) + return self_nv; + } + } + if (disp_nv != null) + { + NamedValue parent_val = null; + IList fields = disp_nv.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return fi.GetValue(disp_nv); + else if (fi.Name == "$parent$") parent_val = fi.GetValue(disp_nv); + NamedValue pv = parent_val; + while (!pv.IsNull) + { + fields = parent_val.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return fi.GetValue(parent_val); + else if (fi.Name == "$parent$") pv = fi.GetValue(parent_val); + if (!pv.IsNull) parent_val = pv; + } + } + nvc = debuggedProcess.SelectedFunction.ContaingClassVariables; + foreach (NamedValue nv in nvc) + { + if (string.Compare(nv.Name, var, true) == 0) return nv; + } + if (self_nv != null) + { + IList fields = self_nv.Dereference.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) + return fi.GetValue(self_nv.Dereference); + } + if (global_nv != null) + { + IList fields = global_nv.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return fi.GetValue(global_nv); + Type t = AssemblyHelper.GetType(global_nv.Type.FullName); + if (t != null) + { + System.Reflection.FieldInfo fi = t.GetField(var, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.IgnoreCase); + if (fi != null && fi.IsLiteral) + return DebugUtils.MakeValue(fi.GetRawConstantValue()); + } + } + + List types = AssemblyHelper.GetUsesTypes(debuggedProcess, debuggedProcess.SelectedFunction.DeclaringType); + foreach (DebugType dt in types) + { + IList fields = dt.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (fi.IsStatic && string.Compare(fi.Name, var, true) == 0) + return fi.GetValue(null); + Type t = AssemblyHelper.GetType(dt.FullName); + if (t != null) + { + System.Reflection.FieldInfo fi = t.GetField(var, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.IgnoreCase); + if (fi != null && fi.IsLiteral) + return DebugUtils.MakeValue(fi.GetRawConstantValue()); + } + } + /*foreach (NamedValue nv in unit_vars) + { + IList fields = nv.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (string.Compare(fi.Name, var, true) == 0) return fi.GetValue(nv); + }*/ + + IList funcs = debuggedProcess.SelectedThread.Callstack; + for (int i = 0; i < funcs.Count; i++) + { + nvc = funcs[i].ContaingClassVariables; + foreach (NamedValue nv in nvc) + { + if (string.Compare(nv.Name, var, true) == 0) return nv; + } + } + + } + catch (System.Exception e) + { + //System.Windows.Forms.MessageBox.Show(e.ToString()); + + } + return null; + //throw new UnknownName(var); + } + + private MethodInfo[] GetMethods(string name) + { + List meths = new List(); + IList mis = debuggedProcess.SelectedFunction.DeclaringType.GetMember(name, BindingFlags.All); + foreach (MemberInfo mi in mis) + { + if (mi is MethodInfo) + meths.Add(mi as MethodInfo); + } + DebugType pabc_system_type = AssemblyHelper.GetPABCSystemType(); + if (pabc_system_type != null) + { + mis = pabc_system_type.GetMember(name, BindingFlags.All); + foreach (MemberInfo mi in mis) + { + if (mi is MethodInfo) + meths.Add(mi as MethodInfo); + } + } + + return meths.ToArray(); + } + + private MethodInfo[] get_method(addressed_value av, out Value obj_val) + { + MethodInfo[] meths = null; + obj_val = null; + if (av is ident) + { + ident e = av as ident; + meths = GetMethods(e.name); + obj_val = null; + } + else if (av is dot_node) + { + dot_node e = av as dot_node; + string name = build_name(e.left); + ident id = e.right as ident; + if (name != null && id != null) + { + Type t = AssemblyHelper.GetType(name); + if (t != null) + { + //DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); + DebugType dt = DebugUtils.GetDebugType(t); + IList mis = new List(); + DebugType tmp = dt; + while (tmp != null && mis.Count == 0) + { + try + { + mis = tmp.GetMember(id.name, BindingFlags.All); + tmp = tmp.BaseType; + } + catch + { + + } + } + List meth_list = new List(); + + foreach (MemberInfo mi in mis) + { + if (mi is MethodInfo) + meth_list.Add(mi as MethodInfo); + } + meths = meth_list.ToArray(); + } + } + } + return meths; + } + + public override void visit(ident _ident) + { + RetValue val = new RetValue(); + if (string.Compare(_ident.name, "true", true) == 0) + { + val.prim_val = true; + } + else if (string.Compare(_ident.name, "false", true) == 0) + { + val.prim_val = false; + } + else + { + names.Add(_ident.name); + val.obj_val = GetValue(_ident.name); + if (val.obj_val == null) + { + val.prim_val = EvalStandFuncNoParam(_ident.name); + } + if (val.obj_val == null && val.prim_val == null) + { + Type t = AssemblyHelper.GetType(_ident.name); + if (t != null) + { + val.type = DebugUtils.GetDebugType(t);//DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); + val.managed_type = t; + } + } + if (val.obj_val == null && val.prim_val == null && val.type == null && !by_dot) + throw new UnknownName(_ident.name); + } + eval_stack.Push(val); + } + + private object EvalStandFuncNoParam(string name) + { + switch (name.ToLower()) + { + case "pi": return Math.PI; + case "e": return Math.E; + case "random": return new Random().NextDouble(); + case "maxshortint": return sbyte.MaxValue; + case "maxbyte": return byte.MaxValue; + case "maxsmallint": return short.MaxValue; + case "maxword": return ushort.MaxValue; + case "maxlongword": return uint.MaxValue; + case "maxint": return int.MaxValue; + case "maxint64": return long.MaxValue; + case "maxuint64": return ulong.MaxValue; + case "maxdouble": + case "maxreal": return double.MaxValue; + case "minreal": return double.MinValue; + case "maxsingle": return float.MaxValue; + case "minsingle": return float.MinValue; + case "getexefilename": return WorkbenchServiceFactory.DebuggerManager.ExeFileName; + case "paramcount": return param_count(); + case "getdir": + case "getcurrentdir": return current_directory(); + case "sign": + case "sin": + case "cos": + case "tan": + case "ln": + case "log10": + case "exp": + case "arctan": + case "arccos": + case "arcsin": + case "abs": + case "sqrt": + case "trunc": + case "round": + case "ceil": + case "floor": + case "int": + case "frac": + case "sqr": + case "chr": + case "ord": + case "odd": + case "sinh": + case "cosh": + case "tanh": + case "strtoint": + case "inttostr": + case "succ": + case "pred": + case "logn": + case "min": + case "max": + case "power": + throw new WrongNumberArguments(name); + default: + return null; + + } + return null; + } + + private object param_count() + { + DebugType t = DebugUtils.GetDebugType(typeof(System.Environment)); + MethodInfo mi = DebugUtils.GetMethod(t, "GetCommandLineArgs"); + Value args = mi.Invoke(null, new Value[0]); + return args.ArrayLenght - 2; + } + + private object param_str(int ind) + { + DebugType t = DebugUtils.GetDebugType(typeof(System.Environment)); + MethodInfo mi = DebugUtils.GetMethod(t, "GetCommandLineArgs"); + Value args = mi.Invoke(null, new Value[0]); + return args.GetArrayElement((uint)(ind + 1)).PrimitiveValue; + } + + private object current_directory() + { + DebugType t = DebugUtils.GetDebugType(typeof(System.Environment)); + PropertyInfo pi = DebugUtils.GetProperty(t, "CurrentDirectory"); + return pi.GetValue(null).PrimitiveValue; + } + + private object sign(object x) + { + return Math.Sign(Convert.ToDouble(x)); + } + + private double _int(double x) + { + return x >= 0 ? Math.Floor(x) : Math.Ceiling(x); + } + + private string left_str(string s, int count) + { + if (count > s.Length) + count = s.Length; + return s.Substring(0, count); + } + + private string right_str(string s, int count) + { + if (count > s.Length) + count = s.Length; + return s.Substring(s.Length - count, count); + } + + private string reverse_str(string s) + { + char[] ca = s.ToCharArray(); + Array.Reverse(ca); + return new string(ca); + } + + private const string FILE_NOT_ASSIGNED = "Ошибка ввода/вывода: для файловой переменной не выполнена процедура Assign"; + private const string FILE_NOT_OPENED = "Ошибка ввода/вывода: файл не открыт"; + + private int _low(Value v, string name) + { + if (v.IsArray) + { + MethodInfo mi = DebugUtils.GetMethod(v.Type, "GetLowerBound"); + return Convert.ToInt32(mi.Invoke(v, new Value[1] { DebugUtils.MakeValue(0) }).PrimitiveValue); + } + if (DebugUtils.GetNullBasedArray(v) != null) + { + System.Reflection.FieldInfo fi = AssemblyHelper.GetType(v.Type.FullName).GetField("LowerIndex"); + return Convert.ToInt32(fi.GetRawConstantValue()); + } + throw new WrongTypeOfArgument(name); + } + + private int _high(Value v, string name) + { + if (v.IsArray) + { + MethodInfo mi = DebugUtils.GetMethod(v.Type, "GetUpperBound"); + return Convert.ToInt32(mi.Invoke(v, new Value[1] { DebugUtils.MakeValue(0) }).PrimitiveValue); + } + if (DebugUtils.GetNullBasedArray(v) != null) + { + System.Reflection.FieldInfo fi = AssemblyHelper.GetType(v.Type.FullName).GetField("UpperIndex"); + return Convert.ToInt32(fi.GetRawConstantValue()); + } + throw new WrongTypeOfArgument(name); + } + + private bool _eof(Value v, string name) + { + if (v.Type.FullName == "PABCSystem.Text") + { + Value sr = v.GetMember("sr"); + Value sw = v.GetMember("sw"); + if (!sr.IsNull) + return Convert.ToBoolean(sr.GetMember("EndOfStream").PrimitiveValue); + else + if (!sw.IsNull) + throw new CommonEvaluationError(new System.Exception("Функция Eof не может быть вызвана для текстового файла, открытого на запись")); + else + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + } + else if (v.Type.FullName == "PABCSystem.BinaryFile" || v.Type.FullName == "PABCSystem.TypedFile") + { + Value fi = v.GetMember("fi"); + Value fs = v.GetMember("fs"); + if (fi.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_ASSIGNED)); + if (fs.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + return Convert.ToInt64(fs.GetMember("Position").PrimitiveValue) == Convert.ToInt64(fs.GetMember("Length").PrimitiveValue); + } + throw new WrongTypeOfArgument(name); + } + + private long file_pos(Value v, string name) + { + if (v.Type.FullName == "PABCSystem.TypedFile") + { + Value fi = v.GetMember("fi"); + Value fs = v.GetMember("fs"); + if (fi.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_ASSIGNED)); + if (fs.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + return Convert.ToInt64(fs.GetMember("Position").PrimitiveValue) / Convert.ToInt64(v.GetMember("ElementSize").PrimitiveValue); + } + else if (v.Type.FullName == "PABCSystem.BinaryFile") + { + Value fi = v.GetMember("fi"); + Value fs = v.GetMember("fs"); + if (fi.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_ASSIGNED)); + if (fs.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + return (long)fs.GetMember("Position").PrimitiveValue; + } + throw new WrongTypeOfArgument(name); + } + + private long file_size(Value v, string name) + { + if (v.Type.FullName == "PABCSystem.TypedFile") + { + Value fi = v.GetMember("fi"); + Value fs = v.GetMember("fs"); + if (fi.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_ASSIGNED)); + if (fs.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + return Convert.ToInt64(fs.GetMember("Length").PrimitiveValue) / Convert.ToInt64(v.GetMember("ElementSize").PrimitiveValue); + } + else if (v.Type.FullName == "PABCSystem.BinaryFile") + { + Value fi = v.GetMember("fi"); + Value fs = v.GetMember("fs"); + if (fi.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_ASSIGNED)); + if (fs.IsNull) + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + return Convert.ToInt64(fs.GetMember("Length").PrimitiveValue); + } + throw new WrongTypeOfArgument(name); + } + + private bool _eoln(Value v, string name) + { + if (v.Type.FullName == "PABCSystem.Text") + { + Value sr = v.GetMember("sr"); + Value sw = v.GetMember("sw"); + if (!sr.IsNull) + { + MethodInfo mi = DebugUtils.GetMethod(sr.Type, "Peek"); + int val = (int)mi.Invoke(sr, new Value[0]).PrimitiveValue; + return val == 13; + } + else + if (!sw.IsNull) + throw new CommonEvaluationError(new System.Exception("Функция Eoln не может быть вызвана для текстового файла, открытого на запись")); + else + throw new CommonEvaluationError(new System.Exception(FILE_NOT_OPENED)); + } + throw new WrongTypeOfArgument(name); + } + + private string extract_file_path(string fname) + { + string fpath = (new System.IO.FileInfo(fname)).DirectoryName; + if ((fpath.Length > 0) && (fpath[fpath.Length - 1] != '\\') && (fpath[fpath.Length - 1] != '/')) + fpath += '\\'; + return fpath; + } + + private string extract_file_drive(string fname) + { + string fpath = (new System.IO.FileInfo(fname)).DirectoryName; + int ind = fpath.IndexOf(':'); + if (ind != -1) + return fpath.Substring(0, ind + 1); + return ""; + } + + private string _copy(string s, int index, int count) + { + try + { + if (index - 1 >= s.Length) return ""; + else + return s.Substring(index - 1, count); + } + catch (System.Exception) + { + return s.Substring(index - 1, s.Length - index + 1); + } + } + + private System.Text.Encoding enc = System.Text.Encoding.GetEncoding(1251); + private System.Globalization.CultureInfo enCulture = new System.Globalization.CultureInfo("en-US"); + + private object EvalStandFuncWithParam(string name, params object[] pars) + { + switch (name.ToLower()) + { + case "sign": + case "sin": + case "cos": + case "tan": + case "ln": + case "logn": + case "log2": + case "log10": + case "exp": + case "arctan": + case "arccos": + case "arcsin": + case "abs": + case "sqrt": + case "trunc": + case "round": + case "ceil": + case "floor": + case "int": + case "frac": + case "sqr": + case "degtorad": + case "radtodeg": + case "chr": + case "chrunicode": + case "ord": + case "odd": + case "sinh": + case "cosh": + case "tanh": + case "reversestring": + case "lowercase": + case "uppercase": + case "lowcase": + case "upcase": + case "strtoint": + case "strtoint64": + case "strtofloat": + case "inttostr": + case "trim": + case "trimleft": + case "trimright": + case "floattostr": + case "succ": + case "low": + case "high": + case "eof": + case "eoln": + case "filepos": + case "filesize": + case "fileexists": + case "extractfilename": + case "extractfileext": + case "extractfilepath": + case "extractfiledir": + case "extractfiledrive": + case "expandfilename": + case "pred": + case "paramstr": + if (pars.Length != 1) + throw new WrongNumberArguments(name); + if (pars[0] == null) + throw new WrongTypeOfArgument(name); + break; + case "min": + case "pos": + case "leftstr": + case "rightstr": + case "stringofchar": + case "comparestr": + case "max": + case "power": + if (pars.Length != 2) + throw new WrongNumberArguments(name); + if (pars[0] == null || pars[1] == null) + throw new WrongTypeOfArgument(name); + break; + case "pi": + case "e": + throw new WrongNumberArguments(name); + case "random": + case "getexefilename": + case "paramcount": + case "getdir": + case "getcurrentdir": + if (pars.Length == 0) + return EvalStandFuncNoParam(name); + else + throw new WrongNumberArguments(name); + case "length": + if (pars.Length == 0 || pars.Length > 2) + throw new WrongNumberArguments(name); + break; + case "posex": + case "copy": + if (pars.Length != 3) + throw new WrongNumberArguments(name); + if (pars[0] == null || pars[1] == null || pars[2] == null) + throw new WrongTypeOfArgument(name); + break; + case "format": + if (pars.Length == 0) + throw new WrongNumberArguments(name); + break; + case "concat": + break; + case "integer": + case "byte": + case "shortint": + case "smallint": + case "word": + case "longword": + case "int64": + case "uint64": + case "real": + case "single": + case "char": + case "string": + case "boolean": + if (pars.Length != 1) + throw new WrongNumberArguments(name); + break; + + default: + Type t = AssemblyHelper.GetType(name); + if (t != null) + { + if (pars.Length != 1) + throw new WrongNumberArguments(name); + if (pars[0] is Value) + { + Value v = pars[0] as Value; + DebugType dt = DebugUtils.GetDebugType(t); + if (dt == v.Type || v.Type.IsSubclassOf(dt)) + return v; + else + throw new InvalidCastException(); + } + else + throw new InvalidCastException(); + } + throw new UnknownName(name); + } + try + { + switch (name.ToLower()) + { + case "sign": return sign(pars[0]); + case "sin": return Math.Sin(Convert.ToDouble(pars[0])); + case "cos": return Math.Cos(Convert.ToDouble(pars[0])); + case "tan": return Math.Tan(Convert.ToDouble(pars[0])); + case "ln": return Math.Log(Convert.ToDouble(pars[0])); + case "log10": return Math.Log10(Convert.ToDouble(pars[0])); + case "log2": return Math.Log(Convert.ToDouble(pars[0]), 2); + case "logn": return Math.Log(Convert.ToDouble(pars[1]), Convert.ToInt32(pars[0])); + case "exp": return Math.Exp(Convert.ToDouble(pars[0])); + case "arctan": return Math.Atan(Convert.ToDouble(pars[0])); + case "arccos": return Math.Acos(Convert.ToDouble(pars[0])); + case "arcsin": return Math.Asin(Convert.ToDouble(pars[0])); + case "min": return Math.Min(Convert.ToDouble(pars[0]), Convert.ToDouble(pars[1])); + case "max": return Math.Max(Convert.ToDouble(pars[0]), Convert.ToDouble(pars[1])); + case "abs": return Math.Abs(Convert.ToDouble(pars[0])); + case "sqrt": return Math.Sqrt(Convert.ToDouble(pars[0])); + case "trunc": return Math.Truncate(Convert.ToDouble(pars[0])); + case "round": return Math.Round(Convert.ToDouble(pars[0])); + case "power": return Math.Pow(Convert.ToDouble(pars[0]), Convert.ToDouble(pars[1])); + case "ceil": return Convert.ToInt32(Math.Ceiling(Convert.ToDouble(pars[0]))); + case "floor": return Math.Floor(Convert.ToDouble(pars[0])); + case "int": return _int(Convert.ToDouble(pars[0])); + case "frac": return Convert.ToDouble(pars[0]) - _int(Convert.ToDouble(pars[0])); + case "sqr": return Convert.ToDouble(pars[0]) * Convert.ToDouble(pars[0]); + case "degtorad": return Convert.ToDouble(pars[0]) * Math.PI / 180; + case "radtodeg": return Convert.ToDouble(pars[0]) * 180 / Math.PI; + case "chrunicode": return Convert.ToChar(pars[0]); + case "chr": + { + byte[] arr = new byte[1]; + arr[0] = Convert.ToByte(pars[0]); + return enc.GetChars(arr)[0]; + } + case "ord": + { + TypeCode tc = Type.GetTypeCode(pars[0].GetType()); + switch (tc) + { + case TypeCode.Boolean: return Convert.ToInt32(Convert.ToBoolean(pars[0])); + case TypeCode.Byte: return Convert.ToInt32(Convert.ToByte(pars[0])); + case TypeCode.SByte: return Convert.ToInt32(Convert.ToSByte(pars[0])); + case TypeCode.Int16: return Convert.ToInt32(Convert.ToInt16(pars[0])); + case TypeCode.UInt16: return Convert.ToInt32(Convert.ToUInt16(pars[0])); + case TypeCode.Int32: return Convert.ToInt32(pars[0]); + case TypeCode.UInt32: return Convert.ToUInt32(pars[0]); + case TypeCode.Int64: return Convert.ToInt64(pars[0]); + case TypeCode.UInt64: return Convert.ToUInt64(pars[0]); + case TypeCode.Char: + { + char[] arr = new char[1]; + arr[0] = Convert.ToChar(pars[0]); + return enc.GetBytes(arr)[0]; + } + default: + throw new WrongTypeOfArgument(name); + } + } + case "ordunicode": return Convert.ToUInt16(Convert.ToChar(pars[0])); + case "odd": return Convert.ToInt32(pars[0]) % 2 != 0; + case "sinh": return Math.Sinh(Convert.ToDouble(pars[0])); + case "cosh": return Math.Cosh(Convert.ToDouble(pars[0])); + case "tanh": return Math.Tanh(Convert.ToDouble(pars[0])); + case "strtoint": return Convert.ToInt32(Convert.ToString(pars[0])); + case "inttostr": return Convert.ToString(Convert.ToInt32(pars[0])); + case "floattostr": return Convert.ToString(Convert.ToDouble(pars[0])); + case "strtofloat": return Convert.ToDouble(Convert.ToString(pars[0])); + case "strtoint64": return Convert.ToInt64(Convert.ToString(pars[0])); + case "comparestr": return string.Compare(Convert.ToString(pars[0]), Convert.ToString(pars[1])); + case "stringofchar": return new string(Convert.ToChar(pars[0]), Convert.ToInt32(pars[1])); + case "leftstr": return left_str(Convert.ToString(pars[0]), Convert.ToInt32(pars[1])); + case "rightstr": return right_str(Convert.ToString(pars[0]), Convert.ToInt32(pars[1])); + case "reversestring": return reverse_str(Convert.ToString(pars[0])); + case "pos": return Convert.ToString(pars[1]).IndexOf(Convert.ToString(pars[0])) + 1; + case "posex": return Convert.ToString(pars[1]).IndexOf(Convert.ToString(pars[0]), Convert.ToInt32(pars[2]) - 1) + 1; + case "trim": return Convert.ToString(pars[0]).Trim(); + case "trimleft": return Convert.ToString(pars[0]).TrimStart(); + case "trimright": return Convert.ToString(pars[0]).TrimEnd(); + case "filepos": + if (pars[0] is Value) + return file_pos(pars[0] as Value, name); + else + throw new WrongTypeOfArgument(name); + case "filesize": + if (pars[0] is Value) + return file_size(pars[0] as Value, name); + else + throw new WrongTypeOfArgument(name); + case "fileexists": + return System.IO.File.Exists(Convert.ToString(pars[0])); + case "extractfilename": + return (new System.IO.FileInfo(Convert.ToString(pars[0]))).Name; + case "extractfileext": + return (new System.IO.FileInfo(Convert.ToString(pars[0]))).Extension; + case "extractfilepath": + return extract_file_path(Convert.ToString(pars[0])); + case "extractfiledir": + return (new System.IO.FileInfo(Convert.ToString(pars[0]))).DirectoryName; + case "extractfiledrive": + return extract_file_drive(Convert.ToString(pars[0])); + case "expandfilename": + return (new System.IO.FileInfo(Convert.ToString(pars[0]))).FullName; + case "copy": + return _copy(Convert.ToString(pars[0]), Convert.ToInt32(pars[1]), Convert.ToInt32(pars[2])); + case "format": + { + object[] prms = new object[pars.Length - 1]; + Array.ConstrainedCopy(pars, 1, prms, 0, pars.Length - 1); + return string.Format(enCulture, Convert.ToString(pars[0]), prms); + } + case "lowercase": + if (pars[0] is char) + return char.ToLower(Convert.ToChar(pars[0])); + else + return Convert.ToString(pars[0]).ToLower(); + case "uppercase": + if (pars[0] is char) + return char.ToUpper(Convert.ToChar(pars[0])); + else + return Convert.ToString(pars[0]).ToUpper(); + case "lowcase": + return char.ToLower(Convert.ToChar(pars[0])); + case "upcase": + return char.ToUpper(Convert.ToChar(pars[0])); + case "concat": + return string.Concat(pars); + case "paramstr": + return param_str(Convert.ToInt32(pars[0])); + case "length": + { + if (pars[0] is string) + if (pars.Length == 1) + return (pars[0] as string).Length; + else + throw new WrongNumberArguments(name); + if (pars[0] is Value) + { + Value v = pars[0] as Value; + if (!v.IsArray) + { + NamedValue nv = DebugUtils.GetNullBasedArray(v); + if (nv == null || !nv.IsArray) + throw new WrongTypeOfArgument(name); + if (pars.Length == 2) + throw new WrongNumberArguments(name); + return nv.ArrayLenght; + } + if (pars.Length > 1) + { + uint[] dims = v.ArrayDimensions; + int dim = Convert.ToInt32(pars[1]); + if (dim > dims.Length) + throw new RankException(); + return dims[dim]; + } + else + return v.ArrayLenght; + } + else + throw new WrongTypeOfArgument(name); + } + case "eof": + if (pars[0] is Value) + return _eof(pars[0] as Value, name); + else + throw new WrongTypeOfArgument(name); + case "eoln": + if (pars[0] is Value) + return _eoln(pars[0] as Value, name); + else + throw new WrongTypeOfArgument(name); + case "succ": + switch (Type.GetTypeCode(pars[0].GetType())) + { + case TypeCode.Boolean: return !Convert.ToBoolean(pars[0]); + case TypeCode.Int32: return Convert.ToInt32(pars[0]) + 1; + case TypeCode.Int16: return Convert.ToInt16(pars[0]) + 1; + case TypeCode.Byte: return Convert.ToByte(pars[0]) + 1; + case TypeCode.SByte: return Convert.ToSByte(pars[0]) + 1; + case TypeCode.UInt16: return Convert.ToUInt16(pars[0]) + 1; + case TypeCode.UInt32: return Convert.ToUInt32(pars[0]) + 1; + case TypeCode.Int64: return Convert.ToInt64(pars[0]) + 1; + case TypeCode.UInt64: return Convert.ToUInt64(pars[0]) + 1; + case TypeCode.Char: return Convert.ToChar(Convert.ToInt32(Convert.ToChar(pars[0])) + 1); + default: throw new WrongTypeOfArgument(name); + } + case "pred": + switch (Type.GetTypeCode(pars[0].GetType())) + { + case TypeCode.Boolean: return !Convert.ToBoolean(pars[0]); + case TypeCode.Int32: return Convert.ToInt32(pars[0]) - 1; + case TypeCode.Int16: return Convert.ToInt16(pars[0]) - 1; + case TypeCode.Byte: return Convert.ToByte(pars[0]) - 1; + case TypeCode.SByte: return Convert.ToSByte(pars[0]) - 1; + case TypeCode.UInt16: return Convert.ToUInt16(pars[0]) - 1; + case TypeCode.UInt32: return Convert.ToUInt32(pars[0]) - 1; + case TypeCode.Int64: return Convert.ToInt64(pars[0]) - 1; + case TypeCode.UInt64: return Convert.ToUInt64(pars[0]) - 1; + case TypeCode.Char: return Convert.ToChar(Convert.ToInt32(Convert.ToChar(pars[0])) - 1); + default: throw new WrongTypeOfArgument(name); + } + case "low": + { + if (pars[0] is Value) + return _low(pars[0] as Value, name); + else + throw new WrongTypeOfArgument(name); + } + case "high": + { + if (pars[0] is Value) + return _high(pars[0] as Value, name); + else + throw new WrongTypeOfArgument(name); + } + case "integer": + { + return Convert.ToInt32(pars[0]); + } + case "byte": + { + return Convert.ToByte(pars[0]); + } + case "shortint": + { + return Convert.ToSByte(pars[0]); + } + case "smallint": + { + return Convert.ToInt16(pars[0]); + } + case "word": + { + return Convert.ToUInt16(pars[0]); + } + case "longword": + { + return Convert.ToUInt32(pars[0]); + } + case "int64": + { + return Convert.ToInt64(pars[0]); + } + case "uint64": + { + return Convert.ToUInt64(pars[0]); + } + case "real": + { + return Convert.ToDouble(pars[0]); + } + case "single": + { + return Convert.ToSingle(pars[0]); + } + case "char": + { + return Convert.ToChar(pars[0]); + } + case "string": + { + return Convert.ToString(pars[0]); + } + case "boolean": + { + return Convert.ToBoolean(pars[0]); + } + //case "uppercase" : return char.ToUpper(Convert.ToChar(pars[0])); + //case "lowercase" : return char.ToLower(Convert.ToChar(pars[0])); + + } + } + catch (System.FormatException) + { + throw new WrongTypeOfArgument(name); + } + /*catch (System.InvalidCastException) + { + throw new WrongTypeOfArgument(name); + }*/ + return null; + } + + public override void visit(addressed_value _addressed_value) + { + throw new NotImplementedException(); + } + + public override void visit(type_definition _type_definition) + { + throw new NotImplementedException(); + } + + private DebugType make_debug_type(Type t, List gen_args) + { + string name; + if (t.Assembly == typeof(int).Assembly) + name = "mscorlib.dll"; + else + name = t.Assembly.ManifestModule.ScopeName; + return DebugType.Create(this.debuggedProcess.GetModule(name), (uint)t.MetadataToken, gen_args.ToArray()); + } + + public override void visit(named_type_reference _named_type_reference) + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < _named_type_reference.names.Count; i++) + { + sb.Append(_named_type_reference.names[i].name); + if (i < _named_type_reference.names.Count - 1) + sb.Append('.'); + } + RetValue res = new RetValue(); + res.managed_type = AssemblyHelper.GetTypeForStatic(sb.ToString()); + if (res.managed_type != null) + res.type = DebugUtils.GetDebugType(res.managed_type); + else + throw new UnknownName(sb.ToString()); + eval_stack.Push(res); + } + + public override void visit(variable_definitions _variable_definitions) + { + throw new NotImplementedException(); + } + + public override void visit(ident_list _ident_list) + { + throw new NotImplementedException(); + } + + public override void visit(var_def_statement _var_def_statement) + { + throw new NotImplementedException(); + } + + public override void visit(declaration _declaration) + { + throw new NotImplementedException(); + } + + public override void visit(declarations _declarations) + { + throw new NotImplementedException(); + } + + public override void visit(program_tree _program_tree) + { + throw new NotImplementedException(); + } + + public override void visit(program_name _program_name) + { + throw new NotImplementedException(); + } + + public override void visit(string_const _string_const) + { + RetValue val = new RetValue(); + val.prim_val = _string_const.Value; + eval_stack.Push(val); + names.Add("'" + _string_const.Value + "'"); + } + + public override void visit(expression_list _expression_list) + { + throw new NotImplementedException(); + } + + public override void visit(dereference _dereference) + { + //throw new NotImplementedException(); + + } + + public override void visit(roof_dereference _roof_dereference) + { + _roof_dereference.dereferencing_value.visit(this); + RetValue rv = eval_stack.Pop(); + Value v = rv.obj_val.GetPermanentReference(); + rv = new RetValue(); + rv.obj_val = v; + eval_stack.Push(rv); + } + + private void check_for_out_of_range(Value v) + { + if (v != null) + try + { + bool b = v.IsObject; + } + catch + { + throw new CommonEvaluationError(new IndexOutOfRangeException()); + } + } + + private Value last_obj = null; + + public override void visit(indexer _indexer) + { + bool tmp = by_dot; + by_dot = true; + _indexer.dereferencing_value.visit(this); + by_dot = tmp; + RetValue rv = eval_stack.Pop(); + List indices = new List(); + names.Add("["); + for (int i = 0; i < _indexer.indexes.expressions.Count; i++) + { + expression e = _indexer.indexes.expressions[i]; + by_dot = false; + e.visit(this); + if (i < _indexer.indexes.expressions.Count - 1) + names.Add(","); + RetValue val = eval_stack.Pop(); + if (val.prim_val == null && val.obj_val != null) + { + if (val.obj_val.IsPrimitive) + val.prim_val = val.obj_val.PrimitiveValue; + } + if (val.prim_val != null) + { + TypeCode code = Type.GetTypeCode(val.prim_val.GetType()); + switch (code) + { + //case TypeCode.Boolean : indices.Add((uint)((int)((bool)val.prim_val))); break; + case TypeCode.Byte: indices.Add((uint)((byte)val.prim_val)); break; + case TypeCode.Char: indices.Add((uint)((char)val.prim_val)); break; + case TypeCode.Int16: indices.Add((uint)((System.Int16)val.prim_val)); break; + case TypeCode.Int32: indices.Add((int)((System.Int32)val.prim_val)); break; + case TypeCode.Int64: indices.Add((uint)((System.Int64)val.prim_val)); break; + case TypeCode.SByte: indices.Add((uint)((sbyte)val.prim_val)); break; + case TypeCode.UInt16: indices.Add((uint)((System.UInt16)val.prim_val)); break; + case TypeCode.UInt32: indices.Add((uint)((System.UInt32)val.prim_val)); break; + case TypeCode.UInt64: indices.Add((uint)((System.UInt64)val.prim_val)); break; + default: indices.Add(val.prim_val); break; + } + } + else + { + indices.Add(val.obj_val); + } + + } + by_dot = tmp; + names.Add("]"); + if (rv.obj_val != null) + { + if (rv.obj_val is MemberValue && (rv.obj_val as MemberValue).MemberInfo is PropertyInfo) + { + PropertyInfo pi = (rv.obj_val as MemberValue).MemberInfo as PropertyInfo; + Type t = AssemblyHelper.GetType(last_obj.Type.FullName); + System.Reflection.PropertyInfo rpi = t.GetProperty(pi.Name, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance); + /*System.Reflection.MemberInfo[] props = t.GetMembers(System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Public|System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.CreateInstance); + System.Reflection.PropertyInfo rpi = null; + foreach (System.Reflection.MemberInfo p in props) + if (p is System.Reflection.PropertyInfo && p.Name == pi.Name) + { + rpi = p as System.Reflection.PropertyInfo; + break; + }*/ + RetValue res = new RetValue(); + res.obj_val = ((rv.obj_val as MemberValue).MemberInfo as PropertyInfo).GetValue(last_obj, + get_val_arr(indices, false, rpi.GetGetMethod(true))); + eval_stack.Push(res); + return; + } + if (rv.obj_val.IsArray) + { + RetValue res = new RetValue(); + res.obj_val = rv.obj_val.GetArrayElement(conv_to_uint_arr(indices)); + check_for_out_of_range(res.obj_val); + eval_stack.Push(res); + + } + else + { + IList mis = rv.obj_val.Type.GetMember("get_val", BindingFlags.All); + if (mis.Count > 0) + { + MethodInfo cur_mi = null; + int low_bound = 0; + foreach (MemberInfo mi in mis) + { + if (mi is MethodInfo) + { + cur_mi = mi as MethodInfo; + //FieldInfo fi = rv.obj_val.Type.GetMember("LowerIndex",BindingFlags.All)[0] as FieldInfo; + System.Reflection.FieldInfo fi = AssemblyHelper.GetType(rv.obj_val.Type.FullName).GetField("LowerIndex"); + low_bound = Convert.ToInt32(fi.GetRawConstantValue()); + } + } + RetValue res = new RetValue(); + uint[] tmp_indices = new uint[1]; + int j = 0; + try + { + object obj = indices[j++]; + int v = 0; + if (obj is Value && DebugUtils.IsEnum(obj as Value, out v)) + tmp_indices[0] = (uint)(v - low_bound); + else + tmp_indices[0] = (uint)(Convert.ToInt32(obj) - low_bound); + } + catch (System.FormatException) + { + throw new WrongTypeInIndexer(); + } + catch (System.InvalidCastException) + { + throw new WrongTypeInIndexer(); + } + //res.obj_val = cur_mi.Invoke(rv.obj_val,indices.ToArray()) as NamedValue; + Value nv = rv.obj_val.GetMember("NullBasedArray"); + res.obj_val = nv.GetArrayElement(tmp_indices); + check_for_out_of_range(res.obj_val); + nv = res.obj_val.GetMember("NullBasedArray"); + while (nv != null && j < indices.Count) + { + System.Reflection.FieldInfo tmp_fi = AssemblyHelper.GetType(res.obj_val.Type.FullName).GetField("LowerIndex"); + low_bound = Convert.ToInt32(tmp_fi.GetRawConstantValue()); + try + { + object obj = indices[j++]; + int v = 0; + if (obj is Value && DebugUtils.IsEnum(obj as Value, out v)) + tmp_indices[0] = (uint)(v - low_bound); + else + tmp_indices[0] = (uint)(Convert.ToInt32(obj) - low_bound); + } + catch (System.FormatException) + { + throw new WrongTypeInIndexer(); + } + catch (System.InvalidCastException) + { + throw new WrongTypeInIndexer(); + } + res.obj_val = nv.GetArrayElement(tmp_indices); + check_for_out_of_range(res.obj_val); + nv = res.obj_val.GetMember("NullBasedArray"); + + } + if (j < indices.Count) + throw new WrongIndexersNumber(); + eval_stack.Push(res); + } + else + { + string name = get_type_name(rv.obj_val.Type); + Type t = AssemblyHelper.GetType(name); + if (t == null && declaringType != null) + t = AssemblyHelper.GetType(declaringType.FullName + "+" + name); + DebugType[] gen_args = rv.obj_val.Type.GetGenericArguments(); + if (gen_args.Length > 0) + { + List gens = new List(); + for (int i = 0; i < gen_args.Length; i++) + gens.Add(AssemblyHelper.GetType(get_type_name(gen_args[i]))); + t = t.MakeGenericType(gens.ToArray()); + } + System.Reflection.MemberInfo[] def_members = t.GetDefaultMembers(); + System.Reflection.PropertyInfo _default_property = null; + if (def_members != null && def_members.Length > 0) + { + foreach (System.Reflection.MemberInfo mi in def_members) + { + System.Reflection.PropertyInfo pi = mi as System.Reflection.PropertyInfo; + if (pi != null) + { + _default_property = pi; + break; + } + } + } + if (_default_property != null) + { + if (_default_property.GetGetMethod().GetParameters().Length != indices.Count) + throw new WrongIndexersNumber(); + MethodInfo mi2 = rv.obj_val.Type.GetMember(_default_property.GetGetMethod().Name, Debugger.BindingFlags.All)[0] as MethodInfo; + RetValue res = new RetValue(); + res.obj_val = mi2.Invoke(rv.obj_val, get_val_arr(indices, _default_property.DeclaringType == typeof(string), _default_property.GetGetMethod())); + check_for_out_of_range(res.obj_val); + eval_stack.Push(res); + } + else + throw new NoIndexerProperty(); + + } + } + } + } + + public static string GetToString(Value v, out bool is_failed) + { + is_failed = false; + try + { + //if (v is ArrayElement || true ) + // return v.AsString != null?v.AsString.Replace("{", "").Replace("}", ""):""; + IList mis = v.Type.GetMember("ToString", Debugger.BindingFlags.All); + DebugType tmp = v.Type.BaseType; + while (mis.Count == 0 && tmp != null) + { + mis = tmp.GetMember("ToString", Debugger.BindingFlags.All); + tmp = tmp.BaseType; + if (tmp != null && tmp.BaseType.FullName == "System.Object") + break; + } + if (mis.Count == 0) + return v.AsString != null ? v.AsString.Replace("{", "").Replace("}", "") : ""; + MethodInfo mi = mis[0] as MethodInfo; + v = mi.Invoke(v, new Value[0]); + if (v != null) return v.PrimitiveValue as string; + } + catch (Debugger.TooLongEvaluation ex) + { + is_failed = true; + return PascalABCCompiler.StringResources.Get("DEBUG_VIEW_TOO_LONG_EVALUATION"); + } + catch (System.Exception) + { + + } + return null; + } + + private uint[] conv_to_uint_arr(List arr) + { + try + { + List l = new List(); + foreach (object i in arr) + l.Add(Convert.ToUInt32(i)); + return l.ToArray(); + } + catch + { + throw new WrongTypeInIndexer(); + } + } + + private Value[] get_val_arr(List arr, bool in_str, System.Reflection.MethodInfo mi) + { + List l = new List(); + for (int i = 0; i < arr.Count; i++) + { + object o = arr[i]; + if (o is Value) + { + if (mi.GetParameters()[i].ParameterType == typeof(object) && (o as Value).Type.IsValueType) + o = box(o as Value); + l.Add(o as Value); + } + else + if (!in_str) + { + if (mi.GetParameters()[i].ParameterType == typeof(object) && o.GetType().IsValueType) + { + if (o.GetType() == typeof(uint) || o.GetType() == typeof(int)) + o = Convert.ToInt32(o); + l.Add(box(DebugUtils.MakeValue(o))); + } + else + l.Add(DebugUtils.MakeValue(o)); + } + else + l.Add(DebugUtils.MakeValue((int)o - 1)); + } + return l.ToArray(); + } + + private string get_type_name(DebugType t) + { + string name = t.FullName; + int ind = name.IndexOf('<'); + if (ind != -1) + { + name = name.Substring(0, ind); + name += "`" + t.GetGenericArguments().Length.ToString(); + } + return name; + } + + public override void visit(for_node _for_node) + { + throw new NotImplementedException(); + } + + public override void visit(repeat_node _repeat_node) + { + throw new NotImplementedException(); + } + + public override void visit(while_node _while_node) + { + throw new NotImplementedException(); + } + + public override void visit(if_node _if_node) + { + throw new NotImplementedException(); + } + + public override void visit(ref_type _ref_type) + { + throw new NotImplementedException(); + } + + public override void visit(diapason _diapason) + { + + } + + public override void visit(indexers_types _indexers_types) + { + throw new NotImplementedException(); + } + + public override void visit(array_type _array_type) + { + throw new NotImplementedException(); + } + + public override void visit(label_definitions _label_definitions) + { + throw new NotImplementedException(); + } + + public override void visit(procedure_attribute _procedure_attribute) + { + throw new NotImplementedException(); + } + + public override void visit(typed_parameters _typed_parametres) + { + throw new NotImplementedException(); + } + + public override void visit(formal_parameters _formal_parametres) + { + throw new NotImplementedException(); + } + + public override void visit(procedure_attributes_list _procedure_attributes_list) + { + throw new NotImplementedException(); + } + + public override void visit(procedure_header _procedure_header) + { + throw new NotImplementedException(); + } + + public override void visit(function_header _function_header) + { + throw new NotImplementedException(); + } + + public override void visit(procedure_definition _procedure_definition) + { + throw new NotImplementedException(); + } + + public override void visit(type_declaration _type_declaration) + { + throw new NotImplementedException(); + } + + public override void visit(type_declarations _type_declarations) + { + throw new NotImplementedException(); + } + + public override void visit(simple_const_definition _simple_const_definition) + { + throw new NotImplementedException(); + } + + public override void visit(typed_const_definition _typed_const_definition) + { + throw new NotImplementedException(); + } + + public override void visit(const_definition _const_definition) + { + throw new NotImplementedException(); + } + + public override void visit(consts_definitions_list _consts_definitions_list) + { + throw new NotImplementedException(); + } + + public override void visit(unit_name _unit_name) + { + throw new NotImplementedException(); + } + + public override void visit(unit_or_namespace _unit_or_namespace) + { + throw new NotImplementedException(); + } + + public override void visit(uses_unit_in _uses_unit_in) + { + throw new NotImplementedException(); + } + + public override void visit(uses_list _uses_list) + { + throw new NotImplementedException(); + } + + public override void visit(program_body _program_body) + { + throw new NotImplementedException(); + } + + public override void visit(compilation_unit _compilation_unit) + { + throw new NotImplementedException(); + } + + public override void visit(unit_module _unit_module) + { + throw new NotImplementedException(); + } + + public override void visit(program_module _program_module) + { + throw new NotImplementedException(); + } + + public override void visit(hex_constant _hex_constant) + { + RetValue val = new RetValue(); + val.prim_val = _hex_constant.val; + eval_stack.Push(val); + } + + public override void visit(get_address _get_address) + { + throw new NotImplementedException(); + } + + public override void visit(case_variant _case_variant) + { + throw new NotImplementedException(); + } + + public override void visit(case_node _case_node) + { + throw new NotImplementedException(); + } + + public override void visit(method_name _method_name) + { + throw new NotImplementedException(); + } + + private bool by_dot; + + private void check_for_static(Value v, string name) + { + try + { + bool b = v.IsObject; + } + catch + { + throw new NameIsNotStatic(name); + } + } + + public override void visit(dot_node _dot_node) + { + bool tmp2 = by_dot; + by_dot = true; + _dot_node.left.visit(this); + by_dot = tmp2; + RetValue rv = eval_stack.Pop(); + RetValue res = new RetValue(); + if (rv.obj_val != null) + { + //if (rv.obj_val.Dereference != null) + // rv.obj_val = rv.obj_val.Dereference; + if (_dot_node.right is ident) + { + if (rv.obj_val.IsNull) + throw new CommonEvaluationError(new NullReferenceException()); + ident id = _dot_node.right as ident; + names.Add("." + id.name); + //IList members = rv.obj_val.Type.GetMember(id.name, BindingFlags.All); + if (rv.obj_val.IsArray) + { + if (string.Compare(id.name, "Length", true) == 0) + res.prim_val = rv.obj_val.ArrayLenght; + else + if (string.Compare(id.name, "Rank", true) == 0) + res.prim_val = rv.obj_val.ArrayRank; + } + else + { + res.obj_val = rv.obj_val.GetMember(id.name); + if (res.obj_val == null) + throw new UnknownName(id.name); + if (res.obj_val is MemberValue && (res.obj_val as MemberValue).MemberInfo is PropertyInfo) + last_obj = rv.obj_val; + } + declaringType = rv.obj_val.Type; + } + } + else if (_dot_node.right is ident) + { + ident id = _dot_node.right as ident; + names.Add("." + id.name); + string name = build_name(_dot_node.left); + if (name != null) + { + Type t = AssemblyHelper.GetType(name); + if (t != null) + { + //DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); + DebugType dt = DebugUtils.GetDebugType(t); + IList mis = new List();//dt.GetMember(id.name,BindingFlags.All); + declaringType = dt; + DebugType tmp = dt; + while (tmp != null && mis.Count == 0) + { + try + { + mis = tmp.GetMember(id.name, BindingFlags.All); + tmp = tmp.BaseType; + } + catch + { + + } + } + if (mis.Count > 0) + { + if (mis[0] is FieldInfo) + { + FieldInfo fi = mis[0] as FieldInfo; + res.obj_val = fi.GetValue(null); + if (res.obj_val == null) + throw new UnknownName(id.name); + check_for_static(res.obj_val, id.name); + } + else if (mis[0] is PropertyInfo) + { + PropertyInfo pi = mis[0] as PropertyInfo; + res.obj_val = pi.GetValue(null); + if (res.obj_val == null) + throw new UnknownName(id.name); + check_for_static(res.obj_val, id.name); + } + } + else + { + System.Reflection.FieldInfo fi = t.GetField(id.name); + if (fi != null) + res.prim_val = fi.GetRawConstantValue(); + else + throw new UnknownName(id.name); + } + } + else + { + t = AssemblyHelper.GetType(name + "." + id.name); + if (t != null) + { + res.type = DebugUtils.GetDebugType(t);//DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); + res.managed_type = t; + } + // else + // throw new UnknownName(id.name); + } + } + } + eval_stack.Push(res); + } + + private string build_name(expression e) + { + if (e is dot_node) + { + string s = build_name((e as dot_node).left); + if (s != null) + return s + "." + ((e as dot_node).right as ident).name; + else return s; + } + else if (e is ident) + return (e as ident).name; + return null; + } + + public override void visit(empty_statement _empty_statement) + { + throw new NotImplementedException(); + } + + public override void visit(goto_statement _goto_statement) + { + throw new NotImplementedException(); + } + + public override void visit(labeled_statement _labeled_statement) + { + throw new NotImplementedException(); + } + + public override void visit(with_statement _with_statement) + { + throw new NotImplementedException(); + } + + public object GetSimpleValue(RetValue rv) + { + if (rv.prim_val != null) return rv.prim_val; + else if (rv.obj_val != null && rv.obj_val.IsPrimitive) return rv.obj_val.PrimitiveValue; + else if (rv.obj_val != null) return rv.obj_val; + return null; + } + + public override void visit(method_call _method_call) + { + //throw new NotImplementedException(); + RetValue res = new RetValue(); + if (!for_immediate) + { + ident id = _method_call.dereferencing_value as ident; + List args = new List(); + if (id != null) + { + if (_method_call.parameters != null) + foreach (expression e in _method_call.parameters.expressions) + { + e.visit(this); + RetValue rv = eval_stack.Pop(); + args.Add(GetSimpleValue(rv)); + } + res.prim_val = EvalStandFuncWithParam(id.name, args.ToArray()); + if (res.prim_val is Value) + { + res.obj_val = res.prim_val as Value; + res.prim_val = null; + } + } + eval_stack.Push(res); + } + else + { + Value obj_val = null; + MethodInfo[] meths = get_method(_method_call.dereferencing_value, out obj_val); + //ret_val = eval_stack.Pop(); + //if (ret_val.obj_val == null && ret_val.prim_val == null) + // return; + List args = new List(); + if (_method_call.parameters != null) + foreach (expression e in _method_call.parameters.expressions) + { + e.visit(this); + RetValue rv = eval_stack.Pop(); + if (rv.obj_val != null) + args.Add(rv.obj_val); + else if (rv.prim_val != null) + args.Add(DebugUtils.MakeValue(rv.prim_val)); + + } + MethodInfo mi = select_method(meths, get_values_types(args)); + if (mi == null) + throw new NoSuitableMethod(); + res.obj_val = mi.Invoke(obj_val, args.ToArray()); + eval_stack.Push(res); + } + } + + private DebugType[] get_values_types(List values) + { + List types = new List(); + for (int i = 0; i < values.Count; i++) + types.Add(values[i].Type); + return types.ToArray(); + } + + private MethodInfo select_method(MethodInfo[] meths, DebugType[] args) + { + if (meths.Length > 0) + return meths[0]; + return null; + } + + public override void visit(pascal_set_constant _pascal_set_constant) + { + //throw new NotImplementedException(); + List args = new List(); + if (_pascal_set_constant.values != null) + { + foreach (expression e in _pascal_set_constant.values.expressions) + { + e.visit(this); + RetValue rv = eval_stack.Pop(); + if (rv.prim_val != null) + args.Add(rv.prim_val); + else if (rv.obj_val != null) + { + args.Add(rv.obj_val); + } + } + } + List vargs = new List(); + foreach (object o in args) + if (o is Value) vargs.Add(box(o as Value)); + else vargs.Add(box(DebugUtils.MakeValue(o))); + RetValue res = new RetValue(); + Type t = AssemblyHelper.GetType("PABCSystem.TypedSet"); + string name = t.Assembly.ManifestModule.ScopeName; + DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(name), (uint)t.MetadataToken); + res.obj_val = Eval.NewObject(this.debuggedProcess, dt.CorClass); + MethodInfo mi = res.obj_val.Type.GetMember("CreateIfNeed", BindingFlags.All)[0] as MethodInfo; + mi.Invoke(res.obj_val, new Value[0]); + mi = res.obj_val.Type.GetMember("IncludeElement", BindingFlags.All)[0] as MethodInfo; + foreach (Value v in vargs) + mi.Invoke(res.obj_val, new Value[] { v }); + eval_stack.Push(res); + } + + public override void visit(array_const _array_const) + { + throw new NotImplementedException(); + } + + public override void visit(write_accessor_name _write_accessor_name) + { + throw new NotImplementedException(); + } + + public override void visit(read_accessor_name _read_accessor_name) + { + throw new NotImplementedException(); + } + + public override void visit(property_accessors _property_accessors) + { + throw new NotImplementedException(); + } + + public override void visit(simple_property _simple_property) + { + throw new NotImplementedException(); + } + + public override void visit(index_property _index_property) + { + throw new NotImplementedException(); + } + + public override void visit(class_members _class_members) + { + throw new NotImplementedException(); + } + + public override void visit(access_modifer_node _access_modifer_node) + { + throw new NotImplementedException(); + } + + public override void visit(class_body_list _class_body) + { + throw new NotImplementedException(); + } + + public override void visit(class_definition _class_definition) + { + throw new NotImplementedException(); + } + + public override void visit(default_indexer_property_node _default_indexer_property_node) + { + throw new NotImplementedException(); + } + + public override void visit(known_type_definition _known_type_definition) + { + throw new NotImplementedException(); + } + + public override void visit(set_type_definition _set_type_definition) + { + throw new NotImplementedException(); + } + + public override void visit(record_const_definition _record_const_definition) + { + throw new NotImplementedException(); + } + + public override void visit(record_const _record_const) + { + throw new NotImplementedException(); + } + + public override void visit(record_type _record_type) + { + throw new NotImplementedException(); + } + + public override void visit(enum_type_definition _enum_type_definition) + { + throw new NotImplementedException(); + } + + public override void visit(char_const _char_const) + { + RetValue val = new RetValue(); + val.prim_val = _char_const.cconst; + eval_stack.Push(val); + names.Add("'" + _char_const.cconst.ToString() + "'"); + } + + public override void visit(raise_statement _raise_statement) + { + throw new NotImplementedException(); + } + + public override void visit(sharp_char_const _sharp_char_const) + { + RetValue val = new RetValue(); + val.prim_val = Convert.ToChar(_sharp_char_const.char_num); + eval_stack.Push(val); + names.Add("#" + _sharp_char_const.char_num.ToString()); + } + + public override void visit(literal_const_line _literal_const_line) + { + string s = ""; + string_const strc; + sharp_char_const sharpcharconst; + char_const charconst; + syntax_tree_node tnf = _literal_const_line.literals[0], tnl = null; + for (int i = 0; i < _literal_const_line.literals.Count; i++) + { + if ((strc = _literal_const_line.literals[i] as string_const) != null) + s = s + strc.Value; + else + if ((sharpcharconst = _literal_const_line.literals[i] as sharp_char_const) != null) + s = s + Convert.ToChar(sharpcharconst.char_num); + else + if ((charconst = _literal_const_line.literals[i] as char_const) != null) + s = s + charconst.cconst; + if (i == _literal_const_line.literals.Count - 1) + tnl = _literal_const_line.literals[i]; + } + RetValue val = new RetValue(); + val.prim_val = s; + eval_stack.Push(val); + } + + public override void visit(string_num_definition _string_num_definition) + { + throw new NotImplementedException(); + } + + public override void visit(variant _variant) + { + throw new NotImplementedException(); + } + + public override void visit(variant_list _variant_list) + { + throw new NotImplementedException(); + } + + public override void visit(variant_type _variant_type) + { + throw new NotImplementedException(); + } + + public override void visit(variant_types _variant_types) + { + throw new NotImplementedException(); + } + + public override void visit(variant_record_type _variant_record_type) + { + throw new NotImplementedException(); + } + + public override void visit(procedure_call _procedure_call) + { + throw new NotImplementedException(); + } + + public override void visit(class_predefinition _class_predefinition) + { + throw new NotImplementedException(); + } + + public override void visit(nil_const _nil_const) + { + RetValue res = new RetValue(); + res.is_null = true; + eval_stack.Push(res); + } + + public override void visit(file_type_definition _file_type_definition) + { + throw new NotImplementedException(); + } + + public override void visit(constructor _constructor) + { + throw new NotImplementedException(); + } + + public override void visit(destructor _destructor) + { + throw new NotImplementedException(); + } + + public override void visit(inherited_method_call _inherited_method_call) + { + throw new NotImplementedException(); + } + + public override void visit(typecast_node _typecast_node) + { + _typecast_node.expr.visit(this); + _typecast_node.type_def.visit(this); + if (_typecast_node.cast_op == op_typecast.is_op) + EvalIs(); + else if (_typecast_node.cast_op == op_typecast.as_op) + { + eval_stack.Pop(); + } + } + + public override void visit(interface_node _interface_node) + { + throw new NotImplementedException(); + } + + public override void visit(implementation_node _implementation_node) + { + throw new NotImplementedException(); + } + + public override void visit(diap_expr _diap_expr) + { + throw new NotImplementedException(); + } + + public override void visit(block _block) + { + throw new NotImplementedException(); + } + + public override void visit(proc_block _proc_block) + { + throw new NotImplementedException(); + } + + public override void visit(array_of_named_type_definition _array_of_named_type_definition) + { + throw new NotImplementedException(); + } + + public override void visit(array_of_const_type_definition _array_of_const_type_definition) + { + throw new NotImplementedException(); + } + + public override void visit(literal _literal) + { + throw new NotImplementedException(); + } + + public override void visit(case_variants _case_variants) + { + throw new NotImplementedException(); + } + + public override void visit(diapason_expr _diapason_expr) + { + RetValue res = new RetValue(); + _diapason_expr.left.visit(this); + RetValue left = eval_stack.Pop(); + _diapason_expr.right.visit(this); + RetValue right = eval_stack.Pop(); + Type t = AssemblyHelper.GetType("PABCSystem.PABCSystem"); + string name = t.Assembly.ManifestModule.ScopeName; + DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(name), (uint)AssemblyHelper.GetType("PABCSystem.PABCSystem").MetadataToken); + Value lv = null; + Value rv = null; + if (left.prim_val != null && right.prim_val != null) + { + Type left_type = left.prim_val.GetType(); + Type right_type = right.prim_val.GetType(); + if (left.prim_val is IComparable && right.prim_val is IComparable) + { + if ((left.prim_val as IComparable).CompareTo(right.prim_val) > 0) + throw new InvalidRangesInDiapason(); + switch (Type.GetTypeCode(left_type)) + { + case TypeCode.Boolean: + case TypeCode.Byte: + case TypeCode.Char: + case TypeCode.SByte: + case TypeCode.UInt16: + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.UInt32: + case TypeCode.Int64: + case TypeCode.UInt64: break; + default: + throw new InvalidExpressionTypeInDiapason(); + } + switch (Type.GetTypeCode(right_type)) + { + case TypeCode.Boolean: + case TypeCode.Byte: + case TypeCode.Char: + case TypeCode.SByte: + case TypeCode.UInt16: + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.UInt32: + case TypeCode.Int64: + case TypeCode.UInt64: break; + default: + throw new InvalidExpressionTypeInDiapason(); + } + } + else + throw new InvalidExpressionTypeInDiapason(); + } + if (left.prim_val != null) + lv = (DebugUtils.MakeValue(left.prim_val)); + else + lv = (left.obj_val); + if (right.prim_val != null) + rv = (DebugUtils.MakeValue(right.prim_val)); + else + rv = (right.obj_val); + MethodInfo mi = null; + if (lv.Type.ManagedType != typeof(char)) + { + mi = dt.GetMember("CreateDiapason", BindingFlags.All)[0] as MethodInfo; + } + else + { + mi = dt.GetMember("CreateObjDiapason", BindingFlags.All)[0] as MethodInfo; + lv = box(lv); + rv = box(rv); + } + res.obj_val = mi.Invoke(null, new Value[2] { lv, rv }); + eval_stack.Push(res); + } + + public override void visit(var_def_list_for_record _var_def_list) + { + throw new NotImplementedException(); + } + + public override void visit(record_type_parts _record_type_parts) + { + throw new NotImplementedException(); + } + + public override void visit(property_array_default _property_array_default) + { + throw new NotImplementedException(); + } + + public override void visit(property_interface _property_interface) + { + throw new NotImplementedException(); + } + + public override void visit(property_parameter _property_parameter) + { + throw new NotImplementedException(); + } + + public override void visit(property_parameter_list _property_parameter_list) + { + throw new NotImplementedException(); + } + + public override void visit(inherited_ident _inherited_ident) + { + throw new NotImplementedException(); + } + + public override void visit(format_expr _format_expr) + { + if (_format_expr.format2 == null) + throw new NotImplementedException(); + RetValue res = new RetValue(); + _format_expr.expr.visit(this); + RetValue expr = eval_stack.Pop(); + _format_expr.format1.visit(this); + RetValue format1 = eval_stack.Pop(); + RetValue format2 = new RetValue(); + if (_format_expr.format2 != null) + { + _format_expr.format2.visit(this); + format2 = eval_stack.Pop(); + } + Type t = AssemblyHelper.GetType("PABCSystem.PABCSystem"); + string name = t.Assembly.ManifestModule.ScopeName; + DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(name), (uint)AssemblyHelper.GetType("PABCSystem.PABCSystem").MetadataToken); + IList meths = dt.GetMember("FormatValue", BindingFlags.All); + MethodInfo mi = selectFormatMethod(meths, _format_expr.format2 == null ? 2 : 3); + if (_format_expr.format2 == null) + res.obj_val = mi.Invoke(null, new Value[2] { MakeValue(expr), MakeValue(format1) }); + else + res.obj_val = mi.Invoke(null, new Value[3] { MakeValue(expr), MakeValue(format1), MakeValue(format2) }); + eval_stack.Push(res); + } + + private MethodInfo selectFormatMethod(IList meths, int param_count) + { + foreach (MethodInfo mi in meths) + { + if (mi.ParameterCount == param_count) + return mi; + } + return null; + } + + public override void visit(initfinal_part _initfinal_part) + { + throw new NotImplementedException(); + } + + public override void visit(token_info _token_info) + { + throw new NotImplementedException(); + } + + public override void visit(raise_stmt _raise_stmt) + { + throw new NotImplementedException(); + } + + public override void visit(op_type_node _op_type_node) + { + throw new NotImplementedException(); + } + + public override void visit(file_type _file_type) + { + throw new NotImplementedException(); + } + + public override void visit(known_type_ident _known_type_ident) + { + throw new NotImplementedException(); + } + + public override void visit(exception_handler _exception_handler) + { + throw new NotImplementedException(); + } + + public override void visit(exception_ident _exception_ident) + { + throw new NotImplementedException(); + } + + public override void visit(exception_handler_list _exception_handler_list) + { + throw new NotImplementedException(); + } + + public override void visit(exception_block _exception_block) + { + throw new NotImplementedException(); + } + + public override void visit(try_handler _try_handler) + { + throw new NotImplementedException(); + } + + public override void visit(try_handler_finally _try_handler_finally) + { + throw new NotImplementedException(); + } + + public override void visit(try_handler_except _try_handler_except) + { + throw new NotImplementedException(); + } + + public override void visit(try_stmt _try_stmt) + { + throw new NotImplementedException(); + } + + public override void visit(inherited_message _inherited_message) + { + throw new NotImplementedException(); + } + + public override void visit(external_directive _external_directive) + { + throw new NotImplementedException(); + } + + public override void visit(using_list _using_list) + { + throw new NotImplementedException(); + } + + public override void visit(jump_stmt _jump_stmt) + { + throw new NotImplementedException(); + } + + public override void visit(loop_stmt _loop_stmt) + { + throw new NotImplementedException(); + } + + public override void visit(foreach_stmt _foreach_stmt) + { + throw new NotImplementedException(); + } + + public override void visit(addressed_value_funcname _addressed_RetValue_funcname) + { + throw new NotImplementedException(); + } + + public override void visit(named_type_reference_list _named_type_reference_list) + { + throw new NotImplementedException(); + } + + public override void visit(template_param_list _template_param_list) + { + throw new NotImplementedException(); + } + + public override void visit(template_type_reference _template_type_reference) + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < _template_type_reference.name.names.Count; i++) + { + sb.Append(_template_type_reference.name.names[i].name); + if (i < _template_type_reference.name.names.Count - 1) + sb.Append('.'); + } + List gen_args = new List(); + List gen_refl_args = new List(); + for (int i = 0; i < _template_type_reference.params_list.params_list.Count; i++) + { + _template_type_reference.params_list.params_list[i].visit(this); + RetValue rv = eval_stack.Pop(); + gen_args.Add(rv.type); + gen_refl_args.Add(rv.managed_type); + } + RetValue res = new RetValue(); + res.managed_type = AssemblyHelper.GetTypeForStatic(sb.ToString(), gen_refl_args); + if (res.managed_type != null) + { + res.type = DebugUtils.GetDebugType(res.managed_type, gen_args); + res.managed_type = res.managed_type.MakeGenericType(gen_refl_args.ToArray()); + } + else + throw new UnknownName(sb.ToString()); + eval_stack.Push(res); + } + + public override void visit(int64_const _int64_const) + { + RetValue val = new RetValue(); + val.prim_val = _int64_const.val; + names.Add(_int64_const.val.ToString()); + } + + public override void visit(uint64_const _uint64_const) + { + RetValue val = new RetValue(); + val.prim_val = _uint64_const.val; + names.Add(_uint64_const.val.ToString()); + } + + public override void visit(new_expr _new_expr) + { + throw new NotImplementedException(); + } + + public override void visit(where_type_specificator_list _type_definition_list) + { + throw new NotImplementedException(); + } + + public override void visit(where_definition _where_definition) + { + throw new NotImplementedException(); + } + + public override void visit(where_definition_list _where_definition_list) + { + throw new NotImplementedException(); + } + + public override void visit(sizeof_operator _sizeof_operator) + { + RetValue rv = new RetValue(); + StringBuilder sb = new StringBuilder(); + + if (_sizeof_operator.type_def != null && _sizeof_operator.type_def is named_type_reference) + { + named_type_reference ntr = _sizeof_operator.type_def as named_type_reference; + for (int i = 0; i < ntr.names.Count; i++) + { + sb.Append(ntr.names[i].name); + if (i < ntr.names.Count - 1) + sb.Append('.'); + } + } + Type t = AssemblyHelper.GetType(sb.ToString()); + if (t != null && t.FullName != null) + { + if (t == typeof(char)) + { + rv.prim_val = 2; + } + else if (t == typeof(bool)) + { + rv.prim_val = 1; + } + else + { + Value v = DebugUtils.MakeValue(t.FullName); + //DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(typeof(Type).Assembly.ManifestModule.ScopeName),(uint)typeof(Type).MetadataToken); + MethodInfo mi = MethodInfo.GetFromName(this.debuggedProcess, typeof(Type), "GetType", 1); + v = mi.Invoke(null, new Value[1] { v }); + t = typeof(System.Runtime.InteropServices.Marshal); + DebugType dt = DebugUtils.GetDebugType(t);//DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); + IList mis = dt.GetMethods(); + System.Reflection.MethodInfo rmi = t.GetMethod("SizeOf", new Type[1] { typeof(Type) }); + mi = null; + foreach (MethodInfo tmp_mi in mis) + if (tmp_mi.Name == "SizeOf" && rmi.MetadataToken == tmp_mi.MetadataToken) + { + mi = tmp_mi; + break; + } + if (mi != null) + rv.obj_val = mi.Invoke(null, new Value[1] { v }); + } + } + eval_stack.Push(rv); + } + + public override void visit(typeof_operator _typeof_operator) + { + RetValue rv = new RetValue(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < _typeof_operator.type_name.names.Count; i++) + { + sb.Append(_typeof_operator.type_name.names[i].name); + if (i < _typeof_operator.type_name.names.Count - 1) + sb.Append('.'); + } + Type t = AssemblyHelper.GetType(sb.ToString()); + if (t != null && t.FullName != null) + { + Value v = DebugUtils.MakeValue(t.FullName); + //DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(typeof(Type).Assembly.ManifestModule.ScopeName),(uint)typeof(Type).MetadataToken); + MethodInfo mi = MethodInfo.GetFromName(this.debuggedProcess, typeof(Type), "GetType", 1); + rv.obj_val = mi.Invoke(null, new Value[1] { v }); + } + eval_stack.Push(rv); + } + + public override void visit(compiler_directive _compiler_directive) + { + throw new NotImplementedException(); + } + + public override void visit(operator_name_ident _operator_name_ident) + { + throw new NotImplementedException(); + } + + public override void visit(var_statement _var_statement) + { + throw new NotImplementedException(); + } + + public override void visit(question_colon_expression _question_colon_expression) + { + _question_colon_expression.condition.visit(this); + RetValue cond_expr = eval_stack.Pop(); + _question_colon_expression.ret_if_true.visit(this); + RetValue true_expr = eval_stack.Pop(); + _question_colon_expression.ret_if_false.visit(this); + RetValue false_expr = eval_stack.Pop(); + if (cond_expr.prim_val != null) + { + if ((bool)cond_expr.prim_val) + eval_stack.Push(true_expr); + else + eval_stack.Push(false_expr); + } + else + throw new NotImplementedException(); + } + + public override void visit(expression_as_statement _expression_as_statement) + { + _expression_as_statement.expr.visit(this); + } + + public override void visit(c_scalar_type _c_scalar_type) + { + throw new NotImplementedException(); + } + + public override void visit(c_module _c_module) + { + throw new NotImplementedException(); + } + + public override void visit(declarations_as_statement _declarations_as_statement) + { + throw new NotImplementedException(); + } + + public override void visit(array_size _array_size) + { + throw new NotImplementedException(); + } + + public override void visit(enumerator _enumerator) + { + throw new NotImplementedException(); + } + + public override void visit(enumerator_list _enumerator_list) + { + throw new NotImplementedException(); + } + + public override void visit(c_for_cycle _c_for_cycle) + { + throw new NotImplementedException(); + } + + public override void visit(switch_stmt _switch_stmt) + { + throw new NotImplementedException(); + } + + public override void visit(type_definition_attr_list _type_definition_attr_list) + { + throw new NotImplementedException(); + } + + public override void visit(type_definition_attr _type_definition_attr) + { + throw new NotImplementedException(); + } + + public override void visit(lock_stmt _lock_stmt) + { + throw new NotImplementedException(); + } + public override void visit(compiler_directive_if node) + { + throw new NotImplementedException(); + } + public override void visit(compiler_directive_list node) + { + throw new NotImplementedException(); + } + public override void visit(documentation_comment_list node) + { + throw new NotImplementedException(); + } + public override void visit(documentation_comment_section node) + { + throw new NotImplementedException(); + } + public override void visit(documentation_comment_tag node) + { + throw new NotImplementedException(); + } + public override void visit(documentation_comment_tag_param node) + { + throw new NotImplementedException(); + } + public override void visit(declaration_specificator node) + { + throw new NotImplementedException(); + + } + public override void visit(ident_with_templateparams node) + { + throw new NotImplementedException(); + } + public override void visit(bracket_expr _bracket_expr) + { + _bracket_expr.expr.visit(this); + } + public override void visit(attribute _attribute) + { + + } + + public override void visit(attribute_list _attribute_list) + { + + } + + public override void visit(simple_attribute_list _simple_attribute_list) + { + + } + + public override void visit(function_lambda_definition _function_lambda_definition) + { + throw new NotImplementedException(); + } + + public override void visit(function_lambda_call _function_lambda_call) + { + throw new NotImplementedException(); + } + public override void visit(semantic_check _semantic_check) + { + throw new NotImplementedException(); + } + public override void visit(lambda_inferred_type lit) //lroman// + { + + } + public override void visit(same_type_node stn) //SS 22/06/13// + { + } + public override void visit(name_assign_expr _name_assign_expr) // SSM 27.06.13 + { + } + public override void visit(name_assign_expr_list _name_assign_expr_list) // SSM 27.06.13 + { + } + public override void visit(unnamed_type_object _unnamed_type_object) // SSM 27.06.13 + { + } + public override void visit(semantic_type_node stn) // SSM + { + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/Immediate.cs b/VisualPascalABCNETLinux/IB/Debugger/Immediate.cs new file mode 100644 index 000000000..cdf3e43f8 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/Immediate.cs @@ -0,0 +1,36 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using PascalABCCompiler.SyntaxTree; +using System.Text; +using Debugger; + +namespace VisualPascalABC +{ + public class ImmediateEvaluateAction : ICSharpCode.TextEditor.Actions.AbstractEditAction + { + public override void Execute(ICSharpCode.TextEditor.TextArea textArea) + { + if (WorkbenchServiceFactory.DebuggerManager.IsRunning) + { + int line = textArea.Caret.Line; + string val = WorkbenchServiceFactory.DebuggerManager.ExecuteImmediate + (textArea.Document.GetText(textArea.Document.GetLineSegment(textArea.Caret.Line))); + if (val != null) + { + textArea.Document.TextContent += Environment.NewLine+val+Environment.NewLine; + textArea.Caret.Line = line + 2; + textArea.Caret.Column = 0; + } + } + else + { + int line = textArea.Caret.Line; + textArea.Document.TextContent += Environment.NewLine; + textArea.Caret.Line = line + 1; + textArea.Caret.Column = 0; + } + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs new file mode 100644 index 000000000..f95fe9612 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs @@ -0,0 +1,1472 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using Debugger; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using System.Runtime.ExceptionServices; + +namespace VisualPascalABC +{ + + public static class DebuggerIcons + { + static ImageList imageList; + + public static ImageList ImageList + { + get + { + return imageList; + } + } + + static DebuggerIcons() + { + imageList = new ImageList(); + //System.Resources.ResourceManager rm = new System.Resources.ResourceManager("VisualPascalABCNET.BitmapResources", System.Reflection.Assembly.GetExecutingAssembly()); + imageList.Images.Add(new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Class.png"))); + imageList.Images.Add(new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Field.png"))); + imageList.Images.Add(new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Property.png"))); + + } + + public static Image GetImage(Value val) + { + return imageList.Images[GetImageListIndex(val)]; + } + [HandleProcessCorruptedStateExceptionsAttribute] + public static int GetImageListIndex(Value val) + { + try + { + if (val.IsObject) + { + return 0; // Class + } + else + { + return 1; // Field + } + } + catch (System.Exception e) + { + return 1; + } + } + } + + public abstract class ListItem : VisualPascalABCPlugins.IListItem + { + private string specialName; + + public event EventHandler Changed; + + public abstract int ImageIndex { get; } + public abstract string Name { get; } + public string SpecialName + { + get + { + return specialName; + } + set + { + specialName = value; + } + } + public abstract string Text { get; } + public abstract bool CanEditText { get; } + public abstract string Type { get; } + public abstract bool HasSubItems { get; } + public abstract IList SubItems { get; } + /*IList VisualPascalABCPlugins.IListItem.SubItems + { + get + { + List lst = new List(); + IList item_lst = SubItems; + foreach (ListItem li in item_lst) + lst.Add(li); + return lst; + } + }*/ + public abstract bool IsLiteral { get;} + public System.Drawing.Image Image + { + get + { + if (ImageIndex == -1) + { + return null; + } + else + { + //return (Image)DebuggerIcons.ImageList.Images[ImageIndex]; + return CodeCompletionProvider.ImagesProvider.ImageList.Images[ImageIndex]; + } + } + } + + protected virtual void OnChanged(ListItemEventArgs e) + { + if (Changed != null) + { + Changed(this, e); + } + } + + public virtual bool SetText(string newValue) + { + throw new NotImplementedException(); + } + + public virtual ContextMenuStrip GetContextMenu() + { + return null; + } + } + + + + public class ModuleItem : ListItem + { + private NamedValue val; + private string ns_name; + private Function func; + private List types; + + /*public ModuleItem(NamedValue val, Function func) + { + this.val = val; + ns_name = val.Type.FullName.Substring(0, val.Type.FullName.LastIndexOf('.')); + this.func = func; + this.func.Process.DebuggeeStateChanged += delegate + { + this.OnChanged(new ListItemEventArgs(this)); + }; + }*/ + + public ModuleItem(List types, Function func) + { + //this.val = val; + //ns_name = val.Type.FullName.Substring(0, val.Type.FullName.LastIndexOf('.')); + this.types = types; + this.func = func; + this.func.Process.DebuggeeStateChanged += delegate + { + this.OnChanged(new ListItemEventArgs(this)); + }; + } + + public override int ImageIndex + { + get + { + return -1; + } + } + + public override bool IsLiteral + { + get { return false; } + } + + public override string Name + { + get + { + //return ns_name; + return PascalABCCompiler.StringResources.Get("DEBUG_VIEW_MODULE");; + } + } + + public override string Text + { + get + { + return String.Empty; + } + } + + public override bool CanEditText + { + get + { + return false; + } + } + + public override string Type + { + get + { + return String.Empty; + } + } + + public override bool HasSubItems + { + get + { + return true; + } + } + + public override IList SubItems + { + get + { + List ret = new List(); + foreach (DebugType dt in types) + { + //IList fis = val.Type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + IList fis = dt.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + foreach (FieldInfo fi in fis) + if (!fi.Name.Contains("$")) ret.Add(new ValueItem(fi.GetValue(null),fi.DeclaringType)); + } + return ret; + } + } + } + + public class FunctionItem : ListItem + { + Function function; + + public Function Function + { + get + { + return function; + } + } + + public override bool IsLiteral + { + get + { + return false; + } + } + public override int ImageIndex + { + get + { + return -1; + } + } + + public override string Name + { + get + { + return function.Name; + } + } + + public override string Text + { + get + { + return String.Empty; + } + } + + public override bool CanEditText + { + get + { + return false; + } + } + + public override string Type + { + get + { + return String.Empty; + } + } + + public override bool HasSubItems + { + get + { + return true; + } + } + + public override IList SubItems + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + List ret = new List(); + Hashtable ht = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + foreach (NamedValue val in function.LocalVariables) + { + if (val.Name.Contains("$class_var") /*&& !val.Type.FullName.Contains("$")*/) + { + //IList fis = val.Type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + //if (fis.Count != 0) + List types = new List(); + try + { + if (val.Type.FullName.Contains(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)) + { + string interf_name = val.Type.FullName.Substring(0, val.Type.FullName.IndexOf(PascalABCCompiler.TreeConverter.compiler_string_consts.ImplementationSectionNamespaceName)); + Type t = AssemblyHelper.GetTypeForStatic(interf_name); + DebugType dt = DebugUtils.GetDebugType(t); + types.Add(dt); + } + types.Add(val.Type); + } + catch (System.Exception e) + { + + } + + ret.Add(new ModuleItem(types, function)); + //foreach (FieldInfo fi in fis) + // if (!fi.Name.Contains("$")) ret.Add(new ValueItem(fi.GetValue(val))); + } + } + foreach (NamedValue val in function.LocalVariables) + { + //if (val.IsObject) + + if (!val.Name.Contains("$")) + ret.Add(new ValueItem(val,null)); + else if (val.Name.Contains("$rv")) + { + ret.Add(new ValueItem(val,null)); + } + else if (val.Name == "$disp$") + { + IList fields = val.Type.GetFields(BindingFlags.All); + foreach (FieldInfo fi in fields) + if (!fi.Name.Contains("$")) + { + ret.Add(new ValueItem(fi.GetValue(val),fi.DeclaringType)); + ht[fi.Name] = fi.Name; + } + } + } + NamedValue self_nv = null; + try + { + foreach (NamedValue val in function.Arguments) + { + if (!val.Name.Contains("$") && !ht.ContainsKey(val.Name)) + ret.Add(new ValueItem(val, null)); + else if (val.Name == "$obj$") + self_nv = val; + } + } + catch + { + } + if (!function.IsStatic) ret.Add(new ValueItem(function.ThisValue,null)); + else if (self_nv != null) + ret.Add(new ValueItem(self_nv,"self",null)); + + /*foreach (NamedValue val in function.ContaingClassVariables) + { + if (!val.Name.Contains("$")) + ret.Add(new ValueItem(val)); + }*/ + return ret.AsReadOnly(); + } + } + + public FunctionItem(Function function) + { + this.function = function; + this.function.Process.DebuggeeStateChanged += delegate + { + this.OnChanged(new ListItemEventArgs(this)); + }; + } + } + + class PairValueItem : ValueItem + { + Value first; + Value second; + private string name; + + public PairValueItem(Value first, Value second, string name) + { + this.name = name; + this.first = first; + this.second = second; + } + + public override string Text { + get { + ValueItem vi = new ValueItem(first,"",first.Type); + ValueItem vi2 = new ValueItem(second,"",second.Type); + return "["+vi.Text+","+vi2.Text+"]"; + } + } + + public override string Type { + get { return ""; } + } + + public override bool CanEditText { + get { return false; } + } + + public override bool HasSubItems { + get { return false; } + } + + public override int ImageIndex { + get { return 1; } + } + + public override bool IsLiteral { + get { return false; } + } + + public override IList SubItems { + get { return new List(); } + } + + public override string Name { + get { return name; } + } + } + + class ValueItem : ListItem + { + Value val; + public DebugType declaringType; + + public ValueItem() {} + + public override bool IsLiteral + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + try + { + bool b = val.IsObject; + return false; + } + catch (System.Exception e) + { + return true; + } + } + } + + public Value Value + { + get + { + return val; + } + } + + public static bool ShowValuesInHexadecimal + { + get + { + return false;//return ((WindowsDebugger)DebuggerService.CurrentDebugger).Properties.Get("ShowValuesInHexadecimal", false); + } + set + { + //((WindowsDebugger)DebuggerService.CurrentDebugger).Properties.Set("ShowValuesInHexadecimal", value); + } + } + + private bool primitive = true; + private int imageIndex = -1; + private string name; + + public override int ImageIndex + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + if (!(val is NamedValue)) return 1; + if (imageIndex != -1) return imageIndex; + if (declaringType == null) return 1; + //Type declType = AssemblyHelper.GetType(declaringType.FullName); + //if (declType == null) return 1; + //System.Reflection.MemberInfo[] mis = declType.GetMembers(System.Reflection.BindingFlags.Public|System.Reflection.BindingFlags.NonPublic);//declType.GetMember(val.Name,System.Reflection.BindingFlags.Public|System.Reflection.BindingFlags.NonPublic); + IList mis = declaringType.GetMember((val is NamedValue)?(val as NamedValue).Name:name, BindingFlags.All); + if (mis == null || mis.Count == 0) + { + try + { + DebugType tmp = declaringType.BaseType; + while ((mis == null || mis.Count == 0) && tmp != null) + { + mis = tmp.GetMember((val is NamedValue) ? (val as NamedValue).Name : name, BindingFlags.All); + tmp = tmp.BaseType; + } + } + catch (System.Exception e) + { + + } + } + if (mis == null || mis.Count == 0) + { + + if (val.IsObject || val.Type.IsByRef() && !val.IsPrimitive) + { + imageIndex = -1; + return 1; // Class + } + else + { + imageIndex = 1; + return 1; // Field + } + } + else + { + if (mis[0] is FieldInfo) + { + FieldInfo fi = mis[0] as FieldInfo; + if (fi.IsPrivate) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberPrivateField; + } + else + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberField; + } + /*else if (fi.IsFamily || fi.IsFamilyAndAssembly) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberProtectedField; + } + else if (fi.IsAssembly || fi.IsFamilyOrAssembly) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberInternalField; + } + else if (fi.IsPrivate) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberPrivateField; + }*/ + } + else if (mis[0] is PropertyInfo) + { + MethodInfo fi = (mis[0] as PropertyInfo).GetGetMethod(); + if (fi == null) return -1; + if (fi.IsPrivate) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberPrivateProperty; + } + else + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberProperty; + } + /*else if (fi.IsFamily || fi.IsFamilyAndAssembly) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberProtectedProperty; + } + else if (fi.IsAssembly || fi.IsFamilyOrAssembly) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberInternalProperty; + } + else if (fi.IsPrivate) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberPrivateProperty; + }*/ + } + return imageIndex; + } + + //return 1; + } + } + + public override string Name + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + try + { + if (!string.IsNullOrEmpty(name)) + return name; + if (!((val is NamedValue) ? (val as NamedValue).Name : name).Contains("$rv")) + return (val is NamedValue) ? ((val as NamedValue).Name.IndexOf(':') != -1 ? (val as NamedValue).Name.Substring(0, (val as NamedValue).Name.IndexOf(':')) : (val as NamedValue).Name) : name; + return "Result"; + } + catch + { + return ""; + } + } + } + + public static string MakeEnumText(Value val) + { + FieldInfo val_fld = (FieldInfo)val.Type.GetMember("value__",BindingFlags.All)[0]; + MemberValue mv = val_fld.GetValue(val); + int v = (int)mv.PrimitiveValue; + Type t = AssemblyHelper.GetType(val.Type.FullName); + //System.Reflection.FieldInfo[] flds = t.GetFields(); + string s = Enum.GetName(t,v); + if (s != null) return s; + Array arr = Enum.GetValues(t); + StringBuilder sb = new StringBuilder(); + List lst = new List(); + foreach (int i in arr) + lst.Add(i); + bool is_first = false; + for (int i=0; i 40) + return DebugUtils.WrapTypeName(val.Type); + NamedValueCollection nvc = GetNullBasedArray().GetArrayElements(); + StringBuilder sb = new StringBuilder(); + sb.Append('('); + for (int i = 0; i < nvc.Count; i++) + { + if (i > 10) + { + sb.Append("..."); + break; + } + sb.Append(WorkbenchServiceFactory.DebuggerManager.MakeValueView(nvc[i])); + if (i < nvc.Count - 1) sb.Append(','); + } + sb.Append(')'); + return sb.ToString(); + } + else if (val.IsArray) + { + uint[] dims = val.Dereference.ArrayDimensions; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < dims.Length; i++) + { + sb.Append(dims[i].ToString()); + if (i < dims.Length - 1) + sb.Append(','); + } + return DebugUtils.WrapTypeName(val.Type.GetElementType()) + "[" + sb.ToString() + "]"; + } + else + if (val.IsNull) + if (WorkbenchServiceFactory.DebuggerManager.parser != null) + return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetKeyword(PascalABCCompiler.Parsers.SymbolKind.Null); + else + return "nil"; + else + if (string.Compare(this.Value.Type.FullName, "PABCSystem.TypedSet", true) == 0) + { + return WorkbenchServiceFactory.DebuggerManager.MakeValueView(this.Value); + } + else + if (val.Type.ManagedType == typeof(string)) + return "'" + val.AsString + "'"; + else + if (val.Type.ManagedType == typeof(char)) + return "'" + val.AsString + "'"; + else if (val.Type.ManagedType == typeof(double) || val.Type.ManagedType == typeof(float)) + return Convert.ToString(val.PrimitiveValue, System.Globalization.NumberFormatInfo.InvariantInfo); + else + if (!val.Type.IsPrimitive) + { + if (DebugUtils.CheckForCollection(val.Type)) + return DebugUtils.MakeViewForCollection(val); + bool failed = false; + string s = ExpressionEvaluator.GetToString(val, out failed); + this.failed = failed; + if (s != null) return s; + return val.AsString; + } + else + return val.AsString; + } + catch (System.Exception e) + { + return ""; + } + } + } + } + + private bool failed = false; + + public override bool CanEditText + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + return false; + try + { + if (!failed) + return val.IsInteger && !ShowValuesInHexadecimal || val.IsPrimitive; + else + return false; + } + catch + { + return false; + } + } + } + + public override string Type + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + try + { + if (val.Type != null) + { + return DebugUtils.WrapTypeName(val.Type); + } + else + { + return String.Empty; + } + } + catch(System.Exception e) + { + return ""; + } + } + } + [HandleProcessCorruptedStateExceptionsAttribute] + public bool IsObject() + { + try + { + return val.IsObject; + } + catch (System.Exception e) + { + return false; + } + } + + public override bool HasSubItems + { + [HandleProcessCorruptedStateExceptionsAttribute] + get + { + try + { + if (IsEnum() || val.Type.ManagedType == typeof(string)) return false; + return val.IsObject || val.IsArray; + } + catch (System.Exception e) + { + return false; + } + } + } + + public override IList SubItems + { + get + { + List list = new List(); + if (val.IsArray) + { + foreach (NamedValue element in val.GetArrayElements()) + { + list.Add(new ValueItem(element,null)); + } + } + if (val.IsObject || val.Type.IsByRef() && !val.IsPrimitive) + { + //if (IsArrayWrap()) + //{ + NamedValue nv = GetNullBasedArray(); + if (nv != null) + { + int i = 0; + foreach (NamedValue element in nv.GetArrayElements()) + { + list.Add(new ArrayValueItem(element, null, val, nv, i++)); + + } + } + //} + else + { + if (!val.Type.IsByRef()) + return new BaseTypeItem(val, val.Type).SubItems; + } + } + return list; + } + } + + private NamedValue GetNullBasedArray() + { + IList flds = val.Type.GetFields(); + if (flds.Count != 3) return null; + foreach (FieldInfo fi in flds) + if (fi.Name == "NullBasedArray") return fi.GetValue(val); + return null; + } + + private bool IsArrayWrap() + { + System.Reflection.FieldInfo fi = val.Type.ManagedType.GetField("NullBasedArray"); + if (fi != null && fi.FieldType.IsArray) + { + return true; + } + return false; + } + + public bool IsEnum() + { + if (IsObject()) + { + IList fields = val.Type.GetFields(BindingFlags.All); + bool is_enum = true; + foreach (FieldInfo fi in fields) + { + if (!(fi.IsStatic && fi.IsLiteral)) + { + if (fi.Name != "value__") + { + is_enum = false; + break; + } + } + } + if (fields.Count == 0) is_enum = false; + return is_enum; + } + return false; + } + + public ValueItem(Value val, string name, DebugType declaringType) + { + this.val = val; + this.declaringType = declaringType; + this.name = name; + val.Changed += delegate { OnChanged(new ListItemEventArgs(this)); }; + } + + public ValueItem(Value val, string name, DebugType declaringType, bool is_in_collect) + { + this.val = val; + this.declaringType = declaringType; + this.name = name; + if (is_in_collect) + this.imageIndex = 1; + val.Changed += delegate { OnChanged(new ListItemEventArgs(this)); }; + } + + public ValueItem(NamedValue val, DebugType declaringType) + { + this.val = val; + this.declaringType = declaringType; + + try + { + //this.primitive = val.IsPrimitive; + } + catch(System.Exception e) + { + if (val.Type.IsByRef()) this.primitive = false; + } + val.Changed += delegate { OnChanged(new ListItemEventArgs(this)); }; + } + [HandleProcessCorruptedStateExceptionsAttribute] + public override bool SetText(string newValue) + { + try + { + val.PrimitiveValue = newValue; + return true; + } + catch (NotSupportedException) + { + + } + catch (System.Runtime.InteropServices.COMException) + { + + } + return false; + } + + public override ContextMenuStrip GetContextMenu() + { + + return null; + } + } + + class ArrayValueItem : ValueItem + { + Value arr; + object low_bound; + int ind; + System.Text.Encoding enc = System.Text.Encoding.GetEncoding(1251); + + public ArrayValueItem(NamedValue val, DebugType type, Value arr, Value sz_arr, int ind):base(val,type) + { + this.arr = arr; + this.ind = ind; + System.Reflection.FieldInfo tmp_fi = AssemblyHelper.GetType(arr.Type.FullName).GetField("LowerIndex"); + if (!tmp_fi.FieldType.IsEnum) + low_bound = tmp_fi.GetRawConstantValue(); + else + low_bound = tmp_fi.GetValue(sz_arr); + } + + public override string Name + { + get + { + if (low_bound is int) + return "[" + (ind + (int)low_bound).ToString() + "]"; + else if (low_bound is byte) + return "[" + (ind + (byte)low_bound).ToString() + "]"; + else if (low_bound is sbyte) + return "[" + (ind + (sbyte)low_bound).ToString() + "]"; + else if (low_bound is short) + return "[" + (ind + (short)low_bound).ToString() + "]"; + else if (low_bound is ushort) + return "[" + (ind + (ushort)low_bound).ToString() + "]"; + else if (low_bound is uint) + return "[" + (ind + (uint)low_bound).ToString() + "]"; + else if (low_bound is long) + return "[" + (ind + (long)low_bound).ToString() + "]"; + else if (low_bound is char) + return "[" + "'" + enc.GetChars(new byte[] { (byte)(ind + enc.GetBytes(new char[] { (char)low_bound })[0]) })[0] + "'" + "]"; + else if (low_bound.GetType().IsEnum) + return "[" + Enum.GetName(low_bound.GetType(),ind+Convert.ToInt32(low_bound)) + "]"; + else + return base.Name; + } + } + } + + public class BaseTypeItem : ListItem + { + Value val; + DebugType type; + + public Value Value + { + get + { + return val; + } + } + + public override bool IsLiteral + { + get + { + return false; + } + } + + public DebugType DebugType + { + get + { + return type; + } + } + + public override int ImageIndex + { + get + { + return imageIndex; + } + } + + public override string Name + { + get + { + return "";// StringParser.Parse("${res:MainWindow.Windows.Debug.LocalVariables.BaseClass}"); + } + } + + public override string Text + { + get + { + + return ""; + } + } + + public override bool CanEditText + { + get + { + return false; + } + } + + public override string Type + { + get + { + return DebugUtils.WrapTypeName(type); + } + } + + private int has_sub_items=-1; + + public override bool HasSubItems + { + get + { + if (managed_type != null) + { + if (has_sub_items >= 0) + return has_sub_items == 1; + if (managed_type.GetFields(System.Reflection.BindingFlags.FlattenHierarchy|System.Reflection.BindingFlags.Public|System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Static).Length>0 + || managed_type.GetProperties(System.Reflection.BindingFlags.FlattenHierarchy|System.Reflection.BindingFlags.Public|System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Static).Length>0) + has_sub_items = 1; + else + has_sub_items = 0; + return has_sub_items == 1; + } + return true; + } + } + + public override IList SubItems + { + get + { + return GetSubItems(false); + } + } + + private int imageIndex = -1; + private Type managed_type; + + public BaseTypeItem(DebugType type, Type mt) + { + this.type = type; + this.managed_type = mt; +// if (mt.IsValueType) +// this.imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberStruct; +// else + this.imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberClass; + } + + public BaseTypeItem(Value val, DebugType type) + { + this.val = val; + this.type = type; + } + + public bool IsExtern() + { + return !type.Module.SymbolsLoaded; + } + [HandleProcessCorruptedStateExceptionsAttribute] + List GetMembers(BindingFlags flags) + { + List list = new List(); + if (val != null) + { + NamedValueCollection nvc = val.GetMembers(type, flags); + foreach (NamedValue v in nvc) + { + try + { + if (v is MemberValue && (v as MemberValue).MemberInfo is PropertyInfo && ((v as MemberValue).MemberInfo as PropertyInfo).GetGetMethod().ParameterCount > 0) + continue; + list.Add(new ValueItem(v,this.DebugType)); + } + catch (System.Exception) + { + } + } + } + else + { + IList mis = type.GetMembers(flags); + for (int i=0; i(); + return list; + } + [HandleProcessCorruptedStateExceptionsAttribute] + IList GetSubItemsForCollection() + { + List list = new List(); + if (val == null) return list; + try + { + int count = (int)val.GetMember("Count").PrimitiveValue; + if (DebugUtils.IsStack(type) || DebugUtils.IsQueue(type)) + { + Value nv = val.GetMember("_array"); + NamedValueCollection nvc = nv.GetArrayElements(); + count = (count < 10)?count:10; + for (int i=0; i 10) break; + count++; + } + } + } + else if (DebugUtils.IsSortedList(type)) + { + NamedValue nv_keys = val.GetMember("keys"); + NamedValue nv_values = val.GetMember("values"); + count = (int)val.GetMember("Count").PrimitiveValue; + NamedValueCollection nvc_keys = nv_keys.GetArrayElements(); + NamedValueCollection nvc_values = nv_values.GetArrayElements(); + for (int i=0; i 10) break; + } + } + else if (DebugUtils.IsSortedDictionary(type)) + { + NamedValue nv = val.GetMember("_set").GetMember("root"); + int i = 0; + while (i<=10 && !nv.IsNull) + { + NamedValue tmp = nv.GetMember("item"); + list.Add(new PairValueItem(tmp.GetMember("key"),tmp.GetMember("value"),"["+i.ToString()+"]")); + nv = nv.GetMember("right"); + i++; + } + } + else if (DebugUtils.IsLinkedList(type)) + { + NamedValue nv = val.GetMember("First"); + int i = 0; + while (i<=10 && !nv.IsNull) + { + list.Add(new ValueItem(nv.GetMember("Value"),"["+i.ToString()+"]",nv.Type,true)); + nv = nv.GetMember("Next"); + i++; + } + } + else + { + MethodInfo mi = type.GetMember("get_Item",BindingFlags.All)[0] as MethodInfo; + count = (count < 100)?count:100; + for (int i=0; i raw_items = GetSubItems(true); + list.Add(new FixedItem(-1,PascalABCCompiler.StringResources.Get("DEBUG_VIEW_RAW_VIEW"),string.Empty,string.Empty,true,raw_items)); + } + catch (System.Exception e) + { + return null; + } + return list; + } + [HandleProcessCorruptedStateExceptionsAttribute] + IList GetSubItems(bool is_raw) + { + List list = new List(); + try + { + if (DebugUtils.CheckForCollection(type) && !is_raw) + { + IList lst = GetSubItemsForCollection(); + if (lst != null) return lst; + } + string privateRes = PascalABCCompiler.StringResources.Get("DEBUG_VIEW_PRIVATE");//StringParser.Parse("${res:MainWindow.Windows.Debug.LocalVariables.PrivateMembers}"); + string staticRes = PascalABCCompiler.StringResources.Get("DEBUG_VIEW_STATIC");//StringParser.Parse("${res:MainWindow.Windows.Debug.LocalVariables.StaticMembers}"); + string privateStaticRes = PascalABCCompiler.StringResources.Get("DEBUG_VIEW_PRIVATE_STATIC");// StringParser.Parse("${res:MainWindow.Windows.Debug.LocalVariables.PrivateStaticMembers}"); + + List publicInstance = null; + List privateInstance = null; + + if (val != null) + { + publicInstance = GetMembers(BindingFlags.Public | BindingFlags.Instance); + privateInstance = GetMembers(BindingFlags.NonPublic | BindingFlags.Instance); + } + List publicStatic = GetMembers(BindingFlags.Public | BindingFlags.Static); + List privateStatic = GetMembers(BindingFlags.NonPublic | BindingFlags.Static); + + if (type.BaseType != null && type.BaseType.FullName != "System.Object" && type.BaseType.FullName != "System.ValueType") + { + list.Add(new BaseTypeItem(val, type.BaseType)); + } + if (val != null) + { + list.AddRange(publicInstance); + if (publicStatic.Count > 0) + { + list.Add(new FixedItem(-1, staticRes, String.Empty, String.Empty, true, publicStatic)); + } + + if (privateInstance.Count > 0 || privateStatic.Count > 0) + { + List nonPublicItems = new List(); + if (privateStatic.Count > 0) + { + nonPublicItems.Add(new FixedItem(-1, privateStaticRes, String.Empty, String.Empty, true, privateStatic)); + } + nonPublicItems.AddRange(privateInstance); + list.Add(new FixedItem(-1, privateRes, String.Empty, String.Empty, true, nonPublicItems)); + } + } + else + { + list.AddRange(publicStatic); + if (privateStatic.Count > 0) + list.Add(new FixedItem(-1, privateRes, String.Empty, String.Empty, true, privateStatic)); + } + } + catch (System.Exception e) + { + + } + return list; + } + } + + public class FixedItem : ListItem + { + public int imageIndex; + public string name; + public string text; + public string type; + bool hasSubItems; + IList subItems; + public Value val; + + public FixedItem(string name, string text, string type) + { + imageIndex = CodeCompletionProvider.ImagesProvider.IconNumberField; + this.name = name; + this.text = text; + this.type = type; + } + + public FixedItem(string text, Value v) + { + this.text = text; + this.val = v; + } + + public override bool IsLiteral + { + get + { + return false; + } + } + + public override int ImageIndex + { + get + { + return imageIndex; + } + } + + public override string Name + { + get + { + return name; + } + } + + public override string Text + { + get + { + return text; + } + } + + public override bool CanEditText + { + get + { + return false; + } + } + + public override string Type + { + get + { + return type; + } + } + + public override bool HasSubItems + { + get + { + return hasSubItems; + } + } + + public override IList SubItems + { + get + { + return subItems; + } + } + + public FixedItem(int imageIndex, string name, string text, string type, bool hasSubItems, IList subItems) + { + this.imageIndex = imageIndex; + this.name = name; + this.text = text; + this.type = type; + this.hasSubItems = hasSubItems; + this.subItems = subItems; + } + } + +} diff --git a/VisualPascalABCNETLinux/IB/Debugger/Utility.cs b/VisualPascalABCNETLinux/IB/Debugger/Utility.cs new file mode 100644 index 000000000..c7b2682bc --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Debugger/Utility.cs @@ -0,0 +1,260 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Text; +using System.IO; +using System.Threading; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using Debugger; +using System.Runtime.ExceptionServices; + +namespace VisualPascalABC +{ + public static class DebugUtils + { + private static Hashtable ht = new Hashtable(); + private static Dictionary type_cache = new Dictionary(); + + static DebugUtils() + { + ht["System.Collections.ArrayList"] = ht; + ht["System.Collections.Hashtable"] = ht; + ht["System.Collections.Queue"] = ht; + ht["System.Collections.Stack"] = ht; + ht["System.Collections.SortedList"] = ht; + ht["System.Collections.Generic.List"] = ht; + ht["System.Collections.Generic.Dictionary"] = ht; + ht["System.Collections.Generic.Stack"] = ht; + ht["System.Collections.Generic.Queue"] = ht; + ht["System.Collections.Generic.SortedList"] = ht; + ht["System.Collections.Generic.SortedDictionary"] = ht; + ht["System.Collections.Generic.LinkedList"] = ht; + } + + public static bool CheckForCollection(DebugType type) + { + string name = type.FullName; + int ind = name.IndexOf('<'); + if (ind != -1) name = name.Substring(0, ind); + return ht[name] != null; + } + + public static NamedValue GetNullBasedArray(Value val) + { + IList flds = val.Type.GetFields(); + if (flds.Count != 3) return null; + foreach (FieldInfo fi in flds) + if (fi.Name == "NullBasedArray") return fi.GetValue(val); + return null; + } + + public static MethodInfo GetMethod(DebugType t, string name) + { + return t.GetMember(name, Debugger.BindingFlags.All)[0] as MethodInfo; + } + + public static PropertyInfo GetProperty(DebugType t, string name) + { + return t.GetMember(name, Debugger.BindingFlags.All)[0] as PropertyInfo; + } + + public static DebugType GetDebugType(Type t) + { + Process p = WorkbenchServiceFactory.DebuggerManager.DebuggedProcess; + string name; + if (t.Assembly == typeof(int).Assembly) + name = "mscorlib.dll"; + else + name = t.Assembly.ManifestModule.ScopeName; + DebugType dt = DebugType.Create(p.GetModule(name), (uint)t.MetadataToken); + return dt; + } + + public static DebugType GetDebugType(Type t, List gen_args) + { + string name; + if (t.Assembly == typeof(int).Assembly) + name = "mscorlib.dll"; + else + name = t.Assembly.ManifestModule.ScopeName; + return DebugType.Create(WorkbenchServiceFactory.DebuggerManager.DebuggedProcess.GetModule(name), (uint)t.MetadataToken, gen_args.ToArray()); + } + + public static bool IsQueue(DebugType type) + { + return type.FullName == "System.Collections.Queue" || type.FullName.StartsWith("System.Collections.Generic.Queue"); + } + + public static bool IsHashtable(DebugType type) + { + return type.FullName == "System.Collections.Hashtable"; + } + + public static bool IsLinkedList(DebugType type) + { + return type.FullName.StartsWith("System.Collections.Generic.LinkedList"); + } + + public static bool IsDictionary(DebugType type) + { + return type.FullName.StartsWith("System.Collections.Generic.Dictionary"); + } + + public static bool IsStack(DebugType type) + { + return type.FullName == "System.Collections.Stack" || type.FullName.StartsWith("System.Collections.Generic.Stack"); + } + + public static bool IsSortedList(DebugType type) + { + return type.FullName == "System.Collections.SortedList" || type.FullName.StartsWith("System.Collections.Generic.SortedList"); + } + + public static bool IsSortedDictionary(DebugType type) + { + return type.FullName.StartsWith("System.Collections.Generic.SortedDictionary"); + } + + public static string WrapTypeName(DebugType type) + { + if (type.IsArray) + if (WorkbenchServiceFactory.DebuggerManager.parser != null) + return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetArrayDescription(WrapTypeName(type.GetElementType()), type.GetArrayRank()); + else + return "array of " + WrapTypeName(type.GetElementType()); + return internalWrapTypeName(type.FullName); + } + [HandleProcessCorruptedStateExceptionsAttribute] + public static bool IsObject(Value nv) + { + try + { + return nv.IsObject; + } + catch (System.Exception e) + { + return false; + } + } + [HandleProcessCorruptedStateExceptionsAttribute] + public static bool IsEnum(Value nv, out int val) + { + val = 0; + try + { + + if (IsObject(nv)) + { + IList fields = nv.Type.GetFields(BindingFlags.All); + bool is_enum = true; + foreach (FieldInfo fi in fields) + { + if (!(fi.IsStatic && fi.IsLiteral)) + { + if (fi.Name != "value__") + { + is_enum = false; + break; + } + else + val = (int)fi.GetValue(nv).PrimitiveValue; + } + } + if (fields.Count == 0) is_enum = false; + return is_enum; + } + return false; + } + catch + { + return false; + } + } + + public static string WrapTypeName(Type t) + { + return internalWrapTypeName(t.FullName); + } + + private static string internalWrapTypeName(string name) + { + if (WorkbenchServiceFactory.DebuggerManager.parser != null) + switch (name) + { + case "System.Boolean": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(bool)); + case "System.Int32": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(int)); + case "System.Byte": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(byte)); + case "System.Double": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(double)); + case "System.String": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(string)); + case "System.Char": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(char)); + case "System.SByte": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(sbyte)); + case "System.Int16": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(short)); + case "System.UInt16": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(ushort)); + case "System.UInt32": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(uint)); + case "System.Int64": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(long)); + case "System.UInt64": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(ulong)); + case "System.Float32": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(typeof(float)); + case "System.IntPtr": return WorkbenchServiceFactory.DebuggerManager.parser.LanguageInformation.GetShortTypeName(Type.GetType("System.Void*")); + default: return name; + } + else + switch (name) + { + case "System.Boolean": return "boolean"; + case "System.Int32": return "integer"; + case "System.Byte": return "byte"; + case "System.Double": return "real"; + case "System.String": return "string"; + case "System.Char": return "char"; + case "System.SByte": return "shortint"; + case "System.Int16": return "smallint"; + case "System.UInt16": return "word"; + case "System.UInt32": return "longword"; + case "System.Int64": return "int64"; + case "System.UInt64": return "uint64"; + case "System.Float32": return "single"; + case "System.IntPtr": return "pointer"; + default: return name; + } + } + + public static object GetEnumValue(Value v) + { + Value val = v.GetMember("value__"); + if (val != null && val.IsPrimitive) + return val.PrimitiveValue; + return null; + } + + public static Value unbox(Value v) + { + return v.GetMember("m_value"); + } + + public static string MakeViewForCollection(Value v) + { + object cnt = v.GetMember("Count").PrimitiveValue; + return "Count = " + cnt.ToString(); + } + + public static Value MakeValue(object obj) + { + Value v = null; + if (!(obj is string)) + { + v = Eval.CreateValue(WorkbenchServiceFactory.DebuggerManager.DebuggedProcess, obj); + v.SetPrimitiveValue(obj); + } + else + { + v = Eval.NewString(WorkbenchServiceFactory.DebuggerManager.DebuggedProcess, obj as string); + } + return v; + } + } +} + diff --git a/VisualPascalABCNETLinux/IB/FormExtensions.cs b/VisualPascalABCNETLinux/IB/FormExtensions.cs new file mode 100644 index 000000000..01f0ee764 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/FormExtensions.cs @@ -0,0 +1,583 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using Debugger; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +//using Aga.Controls.Tree; +//using Aga.Controls.Tree.NodeControls; + +namespace VisualPascalABC +{ + public class TextAreaHelper + { + public static Hashtable TextAreas = new Hashtable(); + + public static string GetFileNameByTextArea(TextArea ta) + { + return (string)TextAreas[ta]; + } + } + public partial class Form1 : Form, VisualPascalABCPlugins.IWorkbenchDebuggerOperationsService + { + //public DebugHelper WorkbenchServiceFactory.DebuggerManager; + private Hashtable DebugTabs = new Hashtable(); + + private ICodeFileDocument debuggedPage = null; + + IDebuggerManager IWorkbench.DebuggerManager + { + get + { + return WorkbenchServiceFactory.DebuggerManager; + } + } + + private void SetDebugTextOnPage(CodeFileDocumentControl tp) + { + SetTabPageText(tp); + } + + private void AddBreakPointHandler(CodeFileDocumentControl tp, string FileName) + { + string name = tp.FileName; + TextAreaHelper.TextAreas[tp.TextEditor.ActiveTextAreaControl.TextArea] = FileName; + tp.TextEditor.ActiveTextAreaControl.TextArea.IconBarMargin.MouseDown += BreakPointFactory.IconBarMouseDown; + } + + private void ShowAddedBreakpoints(CodeFileDocumentControl tp) + { + string name = tp.FileName; + BreakPointFactory.AddBreakpoints(name, tp.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void mDEBUGSTARTToolStripMenuItem_Click(object sender, EventArgs e) + { + if (!WorkbenchServiceFactory.DebuggerManager.IsRunning) + //Start(false,CurrentCodeFileDocument); + WorkbenchServiceFactory.RunService.Run(true, false, false); + else + WorkbenchServiceFactory.DebuggerManager.Continue(); + } + + public void StartTimer() + { + //timer.Start(); + } + + public void StopTimer() + { + //timer.Stop(); + } + + private bool row_exists(string expr) + { + for (int i=0; i"); + } + + public void AddArrayVariable(NamedValue lv) + { + //dgLocalVars.Rows.Add(lv.Name, lv.AsString); + } + + void IWorkbenchDebuggerOperationsService.AddDebugPage(ICodeFileDocument tabPage) + { + debuggedPage = tabPage; + AddDebugPage(debuggedPage as CodeFileDocumentControl); + WorkbenchServiceFactory.DebuggerManager.SetAsDebugPage(debuggedPage); + } + + private bool DebugStop() + { + WorkbenchServiceFactory.DebuggerManager.Stop(CurrentEXEFileName); + return true; + } + + private void mDEBUGSTOPToolStripMenuItem_Click(object sender, EventArgs e) + { + //DebugStop(); + WorkbenchServiceFactory.DebuggerManager.DebugBreak(); + } + + private bool clicked_stop_debug_in_menu = false; + + private void mDEBUGENDToolStripMenuItem_Click(object sender, EventArgs e) + { + clicked_stop_debug_in_menu = true; + DebugStop(); + } + + private void mSTEPToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.DebuggerManager.StepOut(); + } + + private void mSTEPINToolStripMenuItem_Click(object sender, EventArgs e) + { + if (WorkbenchServiceFactory.DebuggerManager.IsRunning) + { + WorkbenchServiceFactory.DebuggerManager.Status = DebugStatus.StepIn; + WorkbenchServiceFactory.DebuggerManager.StepInto(); + } + else + //Start(true,CurrentCodeFileDocument); + WorkbenchServiceFactory.RunService.Run(true, false, true); + } + + private void mRUNTOCURToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.DebuggerManager.Status = DebugStatus.None; + if (WorkbenchServiceFactory.DebuggerManager.IsRunning) + WorkbenchServiceFactory.DebuggerManager.RunToCursor(); + else + { + //StartWithGoto(CurrentCodeFileDocument); + WorkbenchServiceFactory.RunService.Run(true, true, false); + } + } + + private void mSTEPOVERToolStripMenuItem_Click(object sender, EventArgs e) + { + if (WorkbenchServiceFactory.DebuggerManager.IsRunning) + { + WorkbenchServiceFactory.DebuggerManager.Status = DebugStatus.StepOver; + WorkbenchServiceFactory.DebuggerManager.StepOver(); + } + else + WorkbenchServiceFactory.RunService.Run(true, false, true); + } + + private List search_debug_paths = new List(); + + public void AddSearchDebugPath(string path) + { + search_debug_paths.Add(path); + } + + internal List TabStack = new List(); + internal List OutputBoxStack = new List(); + + delegate void RefreshWatchDelegate (object sender, DataGridViewCellEventArgs e); + + private void InitForm() + { + /*this.PictColumn = new System.Windows.Forms.DataGridViewImageColumn(); + this.PictColumn.ValuesAreIcons = false; + this.PictColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.PictColumn.FillWeight = 20F; + this.PictColumn.Frozen = true; + //this.PictColumn.Name = "PictColumn"; + this.PictColumn.ReadOnly = true; + this.PictColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.PictColumn.Width = 25; + this.PictColumn.DefaultCellStyle.NullValue = null;*/ + + + //this.tpVarList.SuspendLayout(); + //this.BottomTabControl.TabPages.Add(this.tpWarningList); + //this.BottomTabControl.TabPages.Add(this.tpVarList); + + this.mShowVarsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mShowVarsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mDEBUGSTARTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mDEBUGSTOPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this._toolStripMenuItem10 = new System.Windows.Forms.ToolStripSeparator(); + this.mSTEPOVERToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mSTEPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mSTEPINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mRUNTOCURToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + + int ind = this.MainMenuStrip.Items.IndexOf(this.mrProgram); + //this.MainMenuStrip.Items.Insert(ind + 1, this.mShowVarsMenuItem); + this.mDEBUGSTARTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mDEBUGSTOPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this._toolStripMenuItem10 = new System.Windows.Forms.ToolStripSeparator(); + this.mSTEPOVERToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mSTEPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mSTEPINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mRUNTOCURToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mDEBUGENDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + + /*this.mShowVarsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mDEBUGSTARTToolStripMenuItem, + this.mDEBUGSTOPToolStripMenuItem, + this.mDEBUGENDToolStripMenuItem, + this._toolStripMenuItem10, + this.mSTEPOVERToolStripMenuItem, + this.mSTEPINToolStripMenuItem, + this.mSTEPToolStripMenuItem, + this.mRUNTOCURToolStripMenuItem});*/ + + this.mrProgram.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this._toolStripMenuItem10, + this.mSTEPOVERToolStripMenuItem, + this.mSTEPINToolStripMenuItem, + this.mSTEPToolStripMenuItem, + this.mRUNTOCURToolStripMenuItem}); + + this.mShowVarsMenuItem.Name = "mShowVarsMenuItem"; + this.mShowVarsMenuItem.Size = new System.Drawing.Size(73, 24); + this.mShowVarsMenuItem.Text = "MR_DEBUG"; + // + // mDEBUGSTARTToolStripMenuItem + // + this.mDEBUGSTARTToolStripMenuItem.Name = "mDEBUGSTARTToolStripMenuItem"; + this.mDEBUGSTARTToolStripMenuItem.Visible = false; + this.mDEBUGSTARTToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F8))); + this.mDEBUGSTARTToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mDEBUGSTARTToolStripMenuItem.Text = "M_DEBUGSTART"; + this.mDEBUGSTARTToolStripMenuItem.Click += new System.EventHandler(this.mDEBUGSTARTToolStripMenuItem_Click); + this.mDEBUGSTARTToolStripMenuItem.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.Continue.png")); + // + // mDEBUGSTOPToolStripMenuItem + // + this.mDEBUGSTOPToolStripMenuItem.Enabled = false; + this.mDEBUGSTOPToolStripMenuItem.Visible = false; + this.mDEBUGSTOPToolStripMenuItem.Name = "mDEBUGSTOPToolStripMenuItem"; + this.mDEBUGSTOPToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mDEBUGSTOPToolStripMenuItem.Text = "M_DEBUGSTOP"; + this.mDEBUGSTOPToolStripMenuItem.Click += new System.EventHandler(this.mDEBUGSTOPToolStripMenuItem_Click); + this.mDEBUGSTOPToolStripMenuItem.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.Break.png")); + + this.mDEBUGENDToolStripMenuItem.Enabled = false; + this.mDEBUGENDToolStripMenuItem.Visible = false; + this.mDEBUGENDToolStripMenuItem.Name = "mDEBUGENDToolStripMenuItem"; + this.mDEBUGENDToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mDEBUGENDToolStripMenuItem.Text = "M_ENDDEBUG"; + this.mDEBUGENDToolStripMenuItem.Click += new System.EventHandler(this.mDEBUGENDToolStripMenuItem_Click); + this.mDEBUGENDToolStripMenuItem.Image = global::VisualPascalABC.Properties.Resources.stop; + this.mDEBUGENDToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Maroon; + // + // toolStripMenuItem10 + // + this._toolStripMenuItem10.Name = "toolStripMenuItem10"; + this._toolStripMenuItem10.Size = new System.Drawing.Size(197, 6); + // + // mSTEPOVERToolStripMenuItem + // + this.mSTEPOVERToolStripMenuItem.Name = "mSTEPOVERToolStripMenuItem"; + this.mSTEPOVERToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F8; + this.mSTEPOVERToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mSTEPOVERToolStripMenuItem.Text = "M_STEPOVER"; + this.mSTEPOVERToolStripMenuItem.Click += new System.EventHandler(this.mSTEPOVERToolStripMenuItem_Click); + this.mSTEPOVERToolStripMenuItem.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.StepOver.png")); + // + // mSTEPToolStripMenuItem + // + this.mSTEPToolStripMenuItem.Name = "mSTEPToolStripMenuItem"; + this.mSTEPToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F10; + this.mSTEPToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mSTEPToolStripMenuItem.Text = "M_STEPOUT"; + this.mSTEPToolStripMenuItem.Click += new System.EventHandler(this.mSTEPToolStripMenuItem_Click); + this.mSTEPToolStripMenuItem.Enabled = false; + this.mSTEPToolStripMenuItem.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.StepOut.png")); + // + // mSTEPINToolStripMenuItem + // + this.mSTEPINToolStripMenuItem.Name = "mSTEPINToolStripMenuItem"; + this.mSTEPINToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F7; + this.mSTEPINToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mSTEPINToolStripMenuItem.Text = "M_STEPIN"; + this.mSTEPINToolStripMenuItem.Click += new System.EventHandler(this.mSTEPINToolStripMenuItem_Click); + this.mSTEPINToolStripMenuItem.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.StepInto.png")); + // + // mRUNTOCURToolStripMenuItem + // + this.mRUNTOCURToolStripMenuItem.Name = "mRUNTOCURToolStripMenuItem"; + this.mRUNTOCURToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F4; + this.mRUNTOCURToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.mRUNTOCURToolStripMenuItem.Text = "M_RUNTOCUR"; + this.mRUNTOCURToolStripMenuItem.Enabled = true; + this.mRUNTOCURToolStripMenuItem.Click += new System.EventHandler(this.mRUNTOCURToolStripMenuItem_Click); + //this.tpVarList.ResumeLayout(false); + //this.ResumeLayout(false); + //this.PerformLayout(); + this.StartDebugButton = new System.Windows.Forms.ToolStripButton(); + this.StartDebugButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StartDebugButton.Visible = true; + this.StartDebugButton.Enabled = true; + this.StartDebugButton.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.Continue.png")); + this.StartDebugButton.ImageTransparentColor = System.Drawing.Color.Red; + this.StartDebugButton.Name = "StartDebugButton"; + this.StartDebugButton.Size = new System.Drawing.Size(23, 22); + //this.StartDebugButton.Text = "Start Debug"; + this.StartDebugButton.ToolTipText = "M_DEBUGSTART"; + //this.StartDebugButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + this.StartDebugButton.Click += new System.EventHandler(this.mDEBUGSTARTToolStripMenuItem_Click); + + this.StopDebugButton = new System.Windows.Forms.ToolStripButton(); + this.StopDebugButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StopDebugButton.Enabled = false; + this.StopDebugButton.Visible = false; + this.StopDebugButton.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.Break.png")); + this.StopDebugButton.ImageTransparentColor = System.Drawing.Color.Red; + this.StopDebugButton.Name = "StopDebugButton"; + this.StopDebugButton.Size = new System.Drawing.Size(23, 22); + //this.StopDebugButton.Text = "Stop Debug"; + this.StopDebugButton.ToolTipText = "M_DEBUGSTOP"; + //this.StartDebugButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + this.StopDebugButton.Click += new System.EventHandler(this.mDEBUGSTOPToolStripMenuItem_Click); + + this.StepOverButton = new System.Windows.Forms.ToolStripButton(); + this.StepOverButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StepOverButton.Enabled = true; + this.StepOverButton.Visible = true; + this.StepOverButton.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.StepOver.png")); + this.StepOverButton.ImageTransparentColor = System.Drawing.Color.Red; + this.StepOverButton.Name = "StepOverButton"; + this.StepOverButton.Size = new System.Drawing.Size(23, 22); + //this.StopDebugButton.Text = "Stop Debug"; + this.StepOverButton.ToolTipText = "M_STEPOVER"; + //this.StartDebugButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + this.StepOverButton.Click += new System.EventHandler(this.mSTEPOVERToolStripMenuItem_Click); + + this.StepIntoButton = new System.Windows.Forms.ToolStripButton(); + this.StepIntoButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StepIntoButton.Enabled = true; + this.StepIntoButton.Visible = true; + this.StepIntoButton.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.StepInto.png")); + this.StepIntoButton.ImageTransparentColor = System.Drawing.Color.Red; + this.StepIntoButton.Name = "StepIntoButton"; + this.StepIntoButton.Size = new System.Drawing.Size(23, 22); + //this.StopDebugButton.Text = "Stop Debug"; + this.StepIntoButton.ToolTipText = "M_STEPIN"; + //this.StartDebugButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + this.StepIntoButton.Click += new System.EventHandler(this.mSTEPINToolStripMenuItem_Click); + + this.StepOutButton = new System.Windows.Forms.ToolStripButton(); + this.StepOutButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.StepOutButton.Enabled = false; + this.StepOutButton.Visible = false; + this.StepOutButton.Image = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.Icons.16x16.Debug.StepOut.png")); + this.StepOutButton.ImageTransparentColor = System.Drawing.Color.Red; + this.StepOutButton.Name = "StepOutButton"; + this.StepOutButton.Size = new System.Drawing.Size(23, 22); + //this.StopDebugButton.Text = "Stop Debug"; + this.StepOutButton.ToolTipText = "M_STEPOUT"; + //this.StartDebugButton.EnabledChanged += new System.EventHandler(this.ReCompileButton_EnabledChanged); + this.StepOutButton.Click += new System.EventHandler(this.mSTEPToolStripMenuItem_Click); + this.toolStrip1.Items.Insert(this.toolStrip1.Items.IndexOf(this.ReCompileButton), StepOutButton); + this.toolStrip1.Items.Insert(this.toolStrip1.Items.IndexOf(this.StepOutButton), StepIntoButton); + this.toolStrip1.Items.Insert(this.toolStrip1.Items.IndexOf(this.StepIntoButton), StepOverButton); + this.toolStrip1.Items.Insert(this.toolStrip1.Items.IndexOf(this.StepOverButton), StopDebugButton); + this.toolStrip1.Items.Insert(this.toolStrip1.Items.IndexOf(this.StopDebugButton), StartDebugButton); + this.toolStrip1.Items.Insert(this.toolStrip1.Items.IndexOf(this.StartDebugButton), new ToolStripSeparator()); + /*timer = new Timer(); + timer.Interval = 2000; + timer.Tick += TimerTicked;*/ + //timer.Start(); + WorkbenchServiceFactory.CodeCompletionParserController.RunParseThread(); + /*this.tsGotoRealization = new System.Windows.Forms.ToolStripMenuItem(); + this.tsGotoRealization.Enabled = false; + //this.tsGotoRealization.Image = ((System.Drawing.Image)(resources.GetObject("tsGotoDefinition.Image"))); + this.tsGotoRealization.Name = "tsGotoRealization"; + this.tsGotoRealization.Size = new System.Drawing.Size(193, 22); + this.tsGotoRealization.Text = "M_GOTO_REALIZATION"; + */ + this.cmGotoDefinition.Click += GotoDefinitionClicked; + this.cmGotoRealization.Click += GotoRealizationClicked; + this.tsGotoDefinition.Click += GotoDefinitionClicked; + this.tsGotoRealization.Click += GotoRealizationClicked; + //this.cmFindAllReferences.Click += FindReferencesClicked; + //this.tsGotoDefinition.Enabled = true; + this.cmEditor.Opening += OpeningContextMenu; + this.cmEditor.Closing += ClosingContextMenu; + this.mrService.DropDownOpened += new EventHandler(tsIntellisense_DropDownOpened); + this.cmEditor.Items.Insert(1,cmGotoRealization); + this.cmRename = new ToolStripMenuItem(); + this.cmRename.Enabled = true; + //this.cmRename.Image = ((System.Drawing.Image)(resources.GetObject("cmGotoRealization.Image"))); + this.cmRename.Name = "cmRename"; + this.cmRename.Size = new System.Drawing.Size(224, 22); + this.cmRename.Text = "M_RENAME"; + this.cmRename.Click += RenameClicked; + //this.cmRename.ShortcutKeys = Keys.F2; + this.cmEditor.Items.Insert(3,cmRename); + } + + void tsIntellisense_DropDownOpened(object sender, EventArgs e) + { + if (UserOptions.AllowCodeCompletion) + { + //GotoAction ga = new GotoAction(); + TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + this.tsGotoDefinition.Enabled = CodeCompletionActionsManager.CanGoTo(ta); + this.tsGotoRealization.Enabled = CodeCompletionActionsManager.CanGoToRealization(ta); + this.tsFindAllReferences.Enabled = CodeCompletionActionsManager.CanFindReferences(ta); + //this.cmFindAllReferences.Enabled = ga.CanFindReferences(ta); + this.miGenerateRealization.Enabled = CodeCompletionActionsManager.CanGenerateRealization(ta); + } + } + + private void OpeningContextMenu(object sender, CancelEventArgs args) + { + GotoAction ga = new GotoAction(); + TextArea ta = CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea; + this.cmGotoDefinition.Enabled = CodeCompletionActionsManager.CanGoTo(ta); + this.cmGotoRealization.Enabled = CodeCompletionActionsManager.CanGoToRealization(ta); + this.cmFindAllReferences.Enabled = CodeCompletionActionsManager.CanFindReferences(ta); + this.cmGenerateRealization.Enabled = CodeCompletionActionsManager.CanGenerateRealization(ta); + this.cmRename.Enabled = CodeCompletionActionsManager.CanGoTo(ta); + } + + private void ClosingContextMenu(object sender, CancelEventArgs args) + { + this.cmRename.Enabled = true; + } + private void GotoDefinitionClicked(object sender, EventArgs args) + { + //GotoAction ga = new GotoAction(); + CodeCompletionActionsManager.GotoDefinition(CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void GotoRealizationClicked(object sender, EventArgs args) + { + //GotoAction ga = new GotoAction(); + CodeCompletionActionsManager.GotoRealization(CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea); + } + + private void FindReferencesClicked(object sender, EventArgs args) + { + //GotoAction ga = new GotoAction(); + List syms = CodeCompletionActionsManager.FindReferences(CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea); + FindSymbolsResultWindow.FindSymbolResults.Show(syms); + } + + private void RenameClicked(object sender, EventArgs args) + { + //GotoAction ga = new GotoAction(); + if (CodeCompletionActionsManager.CanGoTo(CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea)) + CodeCompletionActionsManager.Rename(CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.TextArea); + } + + + private System.Windows.Forms.ToolStripMenuItem mShowVarsMenuItem; + private System.Windows.Forms.ToolStripMenuItem mDEBUGSTARTToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mDEBUGSTOPToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator _toolStripMenuItem10; + private System.Windows.Forms.ToolStripMenuItem mSTEPToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mSTEPINToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mRUNTOCURToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mSTEPOVERToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mDEBUGENDToolStripMenuItem; + private System.Windows.Forms.DataGridView localVarList + { + get + { + return DebugVariablesListWindow.watchList; + } + } + + private System.Windows.Forms.DataGridView WdataGridView1 + { + get + { + return DebugWatchListWindow.watchList; + } + } + //private System.Windows.Forms.DataGridViewImageColumn PictColumn; + //private System.Windows.Forms.TabPage tpVarList; + + private System.Windows.Forms.ToolStripButton StartDebugButton; + private System.Windows.Forms.ToolStripButton StopDebugButton; + private System.Windows.Forms.ToolStripButton StepOverButton; + private System.Windows.Forms.ToolStripButton StepIntoButton; + private System.Windows.Forms.ToolStripButton StepOutButton; + + private System.Windows.Forms.Timer timer; + private System.Windows.Forms.ToolStripMenuItem cmRename; + //private System.Windows.Forms.ToolStripMenuItem tsGotoRealization; + //internal ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry pcRegistry; + //internal ICSharpCode.SharpDevelop.Dom.DefaultProjectContent myProjectContent; + //internal ICSharpCode.SharpDevelop.Dom.ICompilationUnit lastCompilationUnit; + + } + + public class VisualPABCSingleton + { + private static Form1 mainForm=null; + + public static Form1 MainForm + { + get + { + return mainForm; + } + set + { + if (mainForm == null) + mainForm = value; + } + } + } + +} diff --git a/VisualPascalABCNETLinux/IB/Refactoring/Bookmarks.cs b/VisualPascalABCNETLinux/IB/Refactoring/Bookmarks.cs new file mode 100644 index 000000000..b417f357e --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Refactoring/Bookmarks.cs @@ -0,0 +1,410 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using VisualPascalABC.Utils; +using Debugger; +using ICSharpCode.TextEditor; +using ICSharpCode.TextEditor.Document; +using Aga.Controls.Tree; +using Aga.Controls.Tree.NodeControls; + +namespace VisualPascalABC +{ + public class SDBookmark : Bookmark + { + public SDBookmark(string fileName, IDocument document, int lineNumber) + : base(document, lineNumber) + { + this.fileName = fileName; + } + + string fileName; + + public string FileName + { + get + { + return fileName; + } + set + { + if (fileName != value) + { + fileName = value; + OnFileNameChanged(EventArgs.Empty); + } + } + } + + public event EventHandler FileNameChanged; + + protected virtual void OnFileNameChanged(EventArgs e) + { + if (FileNameChanged != null) + { + FileNameChanged(this, e); + } + } + + bool isSaved = true; + + /// + /// Gets/Sets if the bookmark should be saved to the project memento file. + /// + /// + /// Default is true, set this property to false if you are using the bookmark for + /// something special like like "CurrentLineBookmark" in the debugger. + /// + public bool IsSaved + { + get + { + return isSaved; + } + set + { + isSaved = value; + } + } + + bool isVisibleInBookmarkPad = true; + + /// + /// Gets/Sets if the bookmark is shown in the bookmark pad. + /// + /// + /// Default is true, set this property to false if you are using the bookmark for + /// something special like like "CurrentLineBookmark" in the debugger. + /// + public bool IsVisibleInBookmarkPad + { + get + { + return isVisibleInBookmarkPad; + } + set + { + isVisibleInBookmarkPad = value; + } + } + } + + public abstract class SDMarkerBookmark : SDBookmark + { + public SDMarkerBookmark(string fileName, IDocument document, int lineNumber) + : base(fileName, document, lineNumber) + { + SetMarker(); + } + + IDocument oldDocument; + TextMarker oldMarker; + + protected abstract TextMarker CreateMarker(); + + void SetMarker() + { + RemoveMarker(); + if (Document != null) + { + TextMarker marker = CreateMarker(); + // Perform editor update + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + Document.CommitUpdate(); + oldMarker = marker; + } + oldDocument = Document; + } + + protected override void OnDocumentChanged(EventArgs e) + { + base.OnDocumentChanged(e); + SetMarker(); + } + + public void RemoveMarker() + { + if (oldDocument != null) + { + oldDocument.MarkerStrategy.RemoveMarker(oldMarker); + oldDocument.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + oldDocument.CommitUpdate(); + } + oldDocument = null; + oldMarker = null; + } + } + public class CurrentBreakpointBookmark : SDMarkerBookmark + { + static CurrentBreakpointBookmark instance; + + static int startLine; + static int startColumn; + static int endLine; + static int endColumn; + bool willBeHit; + static readonly Color defaultColor = Color.FromArgb(180, 38, 38); + /*public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider; + if (tecp != null) + SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn); + else + Remove(); + }*/ + public virtual bool WillBeHit + { + get + { + return willBeHit; + } + set + { + willBeHit = value; + if (Document != null) + { + Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, LineNumber)); + Document.CommitUpdate(); + } + } + } + public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + Remove(); + + startLine = makerStartLine; + startColumn = makerStartColumn; + endLine = makerEndLine; + endColumn = makerEndColumn; + + LineSegment line = document.GetLineSegment(startLine - 1); + instance = new CurrentBreakpointBookmark(fileName, document, startLine - 1); + document.BookmarkManager.AddMark(instance); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, endLine - 1)); + document.CommitUpdate(); + } + + public static void Remove() + { + if (instance != null) + { + instance.Document.BookmarkManager.RemoveMark(instance); + instance.RemoveMarker(); + instance = null; + } + } + + public override bool CanToggle + { + get + { + return false; + } + } + + public CurrentBreakpointBookmark(string fileName, IDocument document, int startLine) + : base(fileName, document, startLine) + { + this.IsSaved = false; + this.IsVisibleInBookmarkPad = false; + } + + public override void Draw(IconBarMargin margin, Graphics g, Point p) + { + margin.DrawBreakpoint(g, p.Y, IsEnabled, WillBeHit); + } + + protected override TextMarker CreateMarker() + { + if (LineNumber >= Document.TotalNumberOfLines) + LineNumber = Document.TotalNumberOfLines - 1; + LineSegment lineSeg = Document.GetLineSegment(LineNumber); + TextMarker marker = new TextMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, defaultColor, Color.White); + Document.MarkerStrategy.InsertMarker(0, marker); + return marker; + } + } + + public class CurrentLineBookmark : SDMarkerBookmark + { + static CurrentLineBookmark instance; + + static int startLine; + static int startColumn; + static int endLine; + static int endColumn; + + /*public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider; + if (tecp != null) + SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn); + else + Remove(); + }*/ + + public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn) + { + Remove(); + + startLine = makerStartLine; + startColumn = makerStartColumn; + endLine = makerEndLine; + endColumn = makerEndColumn; + + LineSegment line = document.GetLineSegment(startLine - 1); + instance = new CurrentLineBookmark(fileName, document, startLine - 1); + document.BookmarkManager.AddMark(instance); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, endLine - 1)); + document.CommitUpdate(); + } + + public static void Remove() + { + if (instance != null) + { + instance.Document.BookmarkManager.RemoveMark(instance); + instance.RemoveMarker(); + instance = null; + } + } + + public override bool CanToggle + { + get + { + return false; + } + } + + public CurrentLineBookmark(string fileName, IDocument document, int startLine) + : base(fileName, document, startLine) + { + this.IsSaved = false; + this.IsVisibleInBookmarkPad = false; + } + + public override void Draw(IconBarMargin margin, Graphics g, Point p) + { + margin.DrawArrow(g, p.Y); + } + + protected override TextMarker CreateMarker() + { + LineSegment lineSeg = Document.GetLineSegment(startLine - 1); + //TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); + TextMarker marker = new TextMarker(lineSeg.Offset + startColumn - 1, Math.Max(endColumn - startColumn, 1), TextMarkerType.SolidBlock, Color.Yellow, Color.Blue); + Document.MarkerStrategy.InsertMarker(0, marker); + return marker; + } + } + + public enum DebugStatus + { + None, + StepOver, + StepIn + } + + public class BreakPointFactory + { + public static Dictionary breakpoints = new Dictionary(); + public static DebugHelper dbg_helper; + + static BreakPointFactory() + { + + } + + public static void AddBreakpoints(string FileName, TextArea text_area) + { + List br_list = dbg_helper.GetBreakpointsInFile(FileName); + foreach (Breakpoint br in br_list) + { + ToggleBreakpointAtByOpen(text_area.Document, br.SourcecodeSegment.SourceFullFilename, br.SourcecodeSegment.StartLine-1, br); + } + } + + public static void ToggleBreakpointAtByOpen(IDocument document, string fileName, int lineNumber, Breakpoint br) + { + foreach (char ch in document.GetText(document.GetLineSegment(lineNumber))) + { + if (!char.IsWhiteSpace(ch)) + { + CurrentBreakpointBookmark cbb = new CurrentBreakpointBookmark(fileName, document, lineNumber); + breakpoints.Add(cbb, br); + document.BookmarkManager.AddMark(cbb); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, lineNumber)); + document.CommitUpdate(); + break; + } + } + } + + public static void ToggleBreakpointAt(IDocument document, string fileName, int lineNumber) + { + foreach (Bookmark m in document.BookmarkManager.Marks) + { + CurrentBreakpointBookmark breakpoint = m as CurrentBreakpointBookmark; + if (breakpoint != null) + { + if (breakpoint.LineNumber == lineNumber) + { + document.BookmarkManager.RemoveMark(m); + try + { + dbg_helper.RemoveBreakpoint(breakpoints[breakpoint]); + } + catch (System.Exception e) + { + } + breakpoints.Remove(breakpoint); + breakpoint.RemoveMarker(); + return; + } + } + } + foreach (char ch in document.GetText(document.GetLineSegment(lineNumber))) + { + if (!char.IsWhiteSpace(ch)) + { + CurrentBreakpointBookmark cbb = new CurrentBreakpointBookmark(fileName, document, lineNumber); + breakpoints.Add(cbb, dbg_helper.AddBreakPoint(fileName, lineNumber + 1)); + document.BookmarkManager.AddMark(cbb); + document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, lineNumber)); + document.CommitUpdate(); + break; + } + } + } + + public static void IconBarMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons) + { + try + { + if (mouseButtons != MouseButtons.Left) return; + Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition; + //Point logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); + ICSharpCode.TextEditor.TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); + if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) + { + string s = iconBar.TextArea.MotherTextEditorControl.FileName; + if (s == null) s = TextAreaHelper.GetFileNameByTextArea(iconBar.TextArea); + ToggleBreakpointAt(iconBar.TextArea.Document, s, logicPos.Y); + iconBar.TextArea.Refresh(iconBar); + } + } + catch (System.Exception e) + { + } + } + } + +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.Designer.cs b/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.Designer.cs new file mode 100644 index 000000000..db52291c0 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.Designer.cs @@ -0,0 +1,100 @@ + +namespace VisualPascalABC +{ + partial class RenameForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.tbName = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(147, 68); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(75, 23); + this.btnOk.TabIndex = 0; + this.btnOk.Text = "RF_OK"; + this.btnOk.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(228, 68); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // tbName + // + this.tbName.Location = new System.Drawing.Point(12, 33); + this.tbName.Name = "tbName"; + this.tbName.Size = new System.Drawing.Size(291, 20); + this.tbName.TabIndex = 2; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(288, 23); + this.label1.TabIndex = 3; + this.label1.Text = "RF_ENTER_NEW_NAME"; + // + // RenameForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(312, 99); + this.Controls.Add(this.label1); + this.Controls.Add(this.tbName); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.HelpButton = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "RenameForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "RF_RENAME"; + this.ResumeLayout(false); + this.PerformLayout(); + } + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tbName; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOk; + } +} diff --git a/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.cs b/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.cs new file mode 100644 index 000000000..bab2b4881 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.cs @@ -0,0 +1,40 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + /// + /// Description of RenameForm. + /// + public partial class RenameForm : Form + { + public RenameForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + + public string EditValue + { + get + { + return this.tbName.Text; + } + set + { + this.tbName.Text = value; + this.tbName.Select(); + } + } + } +} diff --git a/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.resx b/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.resx new file mode 100644 index 000000000..7080a7d11 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Refactoring/RenameForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/Samples/CodeSampleManager.cs b/VisualPascalABCNETLinux/IB/Samples/CodeSampleManager.cs new file mode 100644 index 000000000..9b6211313 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/Samples/CodeSampleManager.cs @@ -0,0 +1,85 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace VisualPascalABC +{ + public class CodeSampleManager + { + private Hashtable ht = new Hashtable(); + + public CodeSampleManager() + { + try + { + StreamReader sr = File.OpenText(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName), "samples.pct")); + ParseFile(sr); + sr.Close(); + } + catch + { + + } + } + + private string get_minimal(List names) + { + string min = names[0]; + for (int i = 1; i < names.Count; i++) + if (names[i].Length < min.Length) + min = names[i]; + return min; + } + + public string GetSampleHeader(string name) + { + List lst = new List(); + foreach (string s in ht.Keys) + if (string.Compare(name, s, true) == 0) + return s; + else if (s.StartsWith(name, StringComparison.OrdinalIgnoreCase)) + lst.Add(s); + if (lst.Count == 1) + return lst[0]; + else + if (lst.Count > 1) + return get_minimal(lst); + else return null; + } + + public string GetSample(string name) + { + return ht[name] as string; + } + + public string[] GetSamples(string name) + { + return (ht[name] as string).Split('\n'); + } + + private void ParseFile(StreamReader sr) + { + StringBuilder sb = new StringBuilder(); + string last_sample = null; + string tmp = null; + last_sample = sr.ReadLine().Trim('[', ']', ' ', '\t'); + while (!sr.EndOfStream) + { + tmp = sr.ReadLine(); + if (tmp.StartsWith("[")) + { + ht[last_sample] = sb.ToString().TrimEnd('\r', '\n'); + last_sample = tmp.Trim('[', ']', ' ', '\t'); + sb.Remove(0, sb.Length); + } + else + sb.AppendLine(tmp); + } + ht[last_sample] = sb.ToString().TrimEnd('\r', '\n'); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/Samples/CodeSampleManager.cs b/VisualPascalABCNETLinux/IB/TreeGridView/Samples/CodeSampleManager.cs new file mode 100644 index 000000000..7b1d7da40 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/TreeGridView/Samples/CodeSampleManager.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace VisualPascalABC +{ + public class CodeSampleManager + { + private Hashtable ht = new Hashtable(); + + public CodeSampleManager() + { + try + { + StreamReader sr = File.OpenText(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName), "samples.pct")); + ParseFile(sr); + sr.Close(); + } + catch + { + + } + } + + private string get_minimal(List names) + { + string min = names[0]; + for (int i = 1; i < names.Count; i++) + if (names[i].Length < min.Length) + min = names[i]; + return min; + } + + public string GetSampleHeader(string name) + { + List lst = new List(); + foreach (string s in ht.Keys) + if (string.Compare(name, s, true) == 0) + return s; + else if (s.StartsWith(name, StringComparison.OrdinalIgnoreCase)) + lst.Add(s); + if (lst.Count == 1) + return lst[0]; + else + if (lst.Count > 1) + return get_minimal(lst); + else return null; + } + + public string GetSample(string name) + { + return ht[name] as string; + } + + public string[] GetSamples(string name) + { + return (ht[name] as string).Split('\n'); + } + + private void ParseFile(StreamReader sr) + { + StringBuilder sb = new StringBuilder(); + string last_sample = null; + string tmp = null; + last_sample = sr.ReadLine().Trim('[', ']', ' ', '\t'); + while (!sr.EndOfStream) + { + tmp = sr.ReadLine(); + if (tmp.StartsWith("[")) + { + ht[last_sample] = sb.ToString().TrimEnd('\r', '\n'); + last_sample = tmp.Trim('[', ']', ' ', '\t'); + sb.Remove(0, sb.Length); + } + else + sb.AppendLine(tmp); + } + ht[last_sample] = sb.ToString().TrimEnd('\r', '\n'); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridCell.cs b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridCell.cs new file mode 100644 index 000000000..335d3fa01 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridCell.cs @@ -0,0 +1,411 @@ +//--------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY +//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//PARTICULAR PURPOSE. +//--------------------------------------------------------------------- +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Windows.Forms.VisualStyles; +using System.Diagnostics; + +namespace AdvancedDataGridView +{ + /// + /// Summary description for TreeGridCell. + /// + public class TreeGridCell:DataGridViewTextBoxCell + { + private const int INDENT_WIDTH = 20; + private const int INDENT_MARGIN = 5; + private int glyphWidth; + private int calculatedLeftPadding; + internal bool IsSited; + private Padding _previousPadding; + private int _imageWidth = 0, _imageHeight = 0, _imageHeightOffset = 0; + private Rectangle _lastKnownGlyphRect; + + public TreeGridCell() + { + glyphWidth = 15; + calculatedLeftPadding = 0; + this.IsSited = false; + + } + + public override object Clone() + { + TreeGridCell c = (TreeGridCell)base.Clone(); + + c.glyphWidth = this.glyphWidth; + c.calculatedLeftPadding = this.calculatedLeftPadding; + + return c; + } + + internal protected virtual void UnSited() + { + // The row this cell is in is being removed from the grid. + this.IsSited = false; + //this.Style.Padding = this._previousPadding; + this.pad = this._previousPadding; + } + + internal protected virtual void Sited() + { + // when we are added to the DGV we can realize our style + this.IsSited = true; + + // remember what the previous padding size is so it can be restored when unsiting + this._previousPadding = this.pad; + + this.UpdateStyle(); + } + + public void RaiseClick() + { + this.RaiseCellClick(new DataGridViewCellEventArgs(this.ColumnIndex,this.RowIndex)); + } + + private Padding pad = Padding.Empty; + + internal protected virtual void UpdateStyle(){ + // styles shouldn't be modified when we are not sited. + if (this.IsSited == false) return; + + int level = this.Level; + if (level == 0) level++; + Padding p = this._previousPadding; + Size preferredSize; + if (this.OwningNode._grid == null) + return; + using (Graphics g = this.OwningNode._grid.CreateGraphics() ) { + preferredSize =this.GetPreferredSize(g, this.InheritedStyle, this.RowIndex, new Size(0, 0)); + } + + Image image = this.OwningNode.Image; + + if (image != null) + { + // calculate image size + _imageWidth = image.Width+2; + _imageHeight = image.Height+2; + + } + else + { + _imageWidth = glyphWidth; + _imageHeight = 0; + } + + +// // TODO: Make this cleaner +// if (preferredSize.Height < _imageHeight) +// { +// +// this.Style.Padding = new Padding(p.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, +// p.Top + (_imageHeight / 2), p.Right, p.Bottom + (_imageHeight / 2)); +// _imageHeightOffset = 2;// (_imageHeight - preferredSize.Height) / 2; +// } +// else +// { +// this.Style.Padding = new Padding(p.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, +// p.Top , p.Right, p.Bottom ); +// +// } + if (preferredSize.Height < _imageHeight) + { + + pad = new Padding(p.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, + p.Top + (_imageHeight / 2), p.Right, p.Bottom + (_imageHeight / 2)); + _imageHeightOffset = 2;// (_imageHeight - preferredSize.Height) / 2; + } + else + { + pad = new Padding(p.Left + (level * INDENT_WIDTH) + _imageWidth + INDENT_MARGIN, + p.Top , p.Right, p.Bottom ); + + } + if (_imageHeight == 0) + pad = new Padding(p.Left + INDENT_MARGIN, + p.Top, p.Right, p.Bottom); + calculatedLeftPadding = ((level - 1) * glyphWidth) + _imageWidth + INDENT_MARGIN; + } + + public int Level + { + get + { + TreeGridNode row = this.OwningNode; + if (row != null) + { + return row.Level; + } + else + return -1; + } + } + + protected virtual int GlyphMargin + { + get + { + if (this.Level == 0) return INDENT_MARGIN; +// if (this.Level == 1) + return ((this.Level - 1) * INDENT_WIDTH) + INDENT_MARGIN; +// else return ((this.Level - 2) * INDENT_WIDTH) + INDENT_MARGIN; + } + } + + protected virtual int GlyphOffset + { + get + { + if (this.Level == 0) return 0; +// if (this.Level == 1) + return ((this.Level - 1) * INDENT_WIDTH); +// else return ((this.Level - 2) * INDENT_WIDTH); + } + } + + + public override Rectangle PositionEditingPanel(Rectangle cellBounds, Rectangle cellClip, DataGridViewCellStyle cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow) + { + Rectangle r = base.PositionEditingPanel(cellBounds, cellClip, cellStyle, singleVerticalBorderAdded, singleHorizontalBorderAdded, isFirstDisplayedColumn, isFirstDisplayedRow); + return r; + } + + protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) + { + + TreeGridNode node = this.OwningNode; + //this.Style.Padding = _previousPadding; + if (node == null) return; + //node.FastUpdate(); + Image image = node.Image; + if (this._imageHeight == 0 && image != null) + this.UpdateStyle(); + cellStyle.Padding = pad; + base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); + + // TODO: Indent width needs to take image size into account + Rectangle glyphRect = new Rectangle(cellBounds.X + this.GlyphMargin, cellBounds.Y, INDENT_WIDTH, cellBounds.Height - 1); + int glyphHalf = glyphRect.Width / 2; + + //TODO: This painting code needs to be rehashed to be cleaner + int level = this.Level; + + //TODO: Rehash this to take different Imagelayouts into account. This will speed up drawing + // for images of the same size (ImageLayout.None) + + + // Paint tree lines + if (node._grid != null) + if (node._grid.ShowLines && (node.IsExpanded || node.InExpanding)) + { + using (Pen linePen = new Pen(SystemBrushes.ControlDark, 1.0f)) + { + linePen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; +// if (node._owner == null) +// node._owner = node._grid.Nodes; + if (node._owner != null) + { + bool isLastSibling = node.IsLastSibling; + bool isFirstSibling = node.IsFirstSibling; + if (node.IsExpanded && !node.InExpanding) + { + //isFirstSibling = true;//node.Index==1; + //graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); + // the Root nodes display their lines differently + if (node.IsExpanded) + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right-3, cellBounds.Top + cellBounds.Height / 2); + //graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.X + 4, cellBounds.Bottom); + /*if (isFirstSibling && isLastSibling) + { + // only node, both first and last. Just draw horizontal line + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); + } + else if (isLastSibling) + { + // last sibling doesn't draw the line extended below. Paint horizontal then vertical + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2); + } + else if (isFirstSibling) + { + // first sibling doesn't draw the line extended above. Paint horizontal then vertical + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.X + 4, cellBounds.Bottom); + } + else + { + // normal drawing draws extended from top to bottom. Paint horizontal then vertical + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right, cellBounds.Top + cellBounds.Height / 2); + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Bottom); + }*/ + } + else + { + if (isLastSibling) + { + // last sibling doesn't draw the line extended below. Paint horizontal then vertical + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right-3, cellBounds.Top + cellBounds.Height / 2); + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2); + } + else + { + // normal drawing draws extended from top to bottom. Paint horizontal then vertical + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top + cellBounds.Height / 2, glyphRect.Right-3, cellBounds.Top + cellBounds.Height / 2); + graphics.DrawLine(linePen, glyphRect.X + 4, cellBounds.Top, glyphRect.X + 4, cellBounds.Bottom); + } + + // paint lines of previous levels to the root + TreeGridNode previousNode = node.Parent; + if (previousNode != null) + { + int horizontalStop = (glyphRect.X + 4) - INDENT_WIDTH; + + while (previousNode != null && !previousNode.IsRoot) + { + if (previousNode.HasChildren && !previousNode.IsLastSibling) + { + // paint vertical line + graphics.DrawLine(linePen, horizontalStop, cellBounds.Top, horizontalStop, cellBounds.Bottom); + } + previousNode = previousNode.Parent; + horizontalStop = horizontalStop - INDENT_WIDTH; + } + } + } + + } + } + } + + if (image != null) + { + Point pp; + if (_imageHeight > cellBounds.Height) + pp = new Point(glyphRect.X + this.glyphWidth, cellBounds.Y + _imageHeightOffset); + else + pp = new Point(glyphRect.X + this.glyphWidth, (cellBounds.Height / 2 - _imageHeight / 2) + cellBounds.Y); + + + // Graphics container to push/pop changes. This enables us to set clipping when painting + // the cell's image -- keeps it from bleeding outsize of cells. + System.Drawing.Drawing2D.GraphicsContainer gc = graphics.BeginContainer(); + { + graphics.SetClip(cellBounds); + graphics.DrawImageUnscaled(image, pp); + } + graphics.EndContainer(gc); + } + + if (node._grid != null) + if (node.HasChildren || node._grid.VirtualNodes) + { + // Paint node glyphs + //if (node.IsExpanded) + // node._grid.rOpen.DrawBackground(graphics, new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 10, 10)); + //else + // node._grid.rClosed.DrawBackground(graphics, new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 10, 10)); + + using (Pen linePen = new Pen(SystemBrushes.ControlDark, 1.0f)) + { + using (Pen plusPen = new Pen(SystemBrushes.WindowText, 1.0f)) + { + graphics.FillRectangle(Brushes.White,new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 8, 8)); + if (node.IsExpanded) + { + graphics.DrawRectangle(linePen, new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 8, 8)); + //graphics.DrawLine(linePen, glyphRect.X + 4, glyphRect.Y + (glyphRect.Height / 2) - 4, glyphRect.X + 4, glyphRect.Y + (glyphRect.Height / 2)+6); + graphics.DrawLine(plusPen, glyphRect.X+2, glyphRect.Y + (glyphRect.Height / 2), glyphRect.X + 8-2, glyphRect.Y + (glyphRect.Height / 2)); + } + else + { + graphics.DrawRectangle(linePen, new Rectangle(glyphRect.X, glyphRect.Y + (glyphRect.Height / 2) - 4, 8, 8)); + graphics.DrawLine(plusPen, glyphRect.X + 4, glyphRect.Y + (glyphRect.Height / 2) - 4+2, glyphRect.X + 4, glyphRect.Y + (glyphRect.Height / 2) - 4 + 8-2); + graphics.DrawLine(plusPen, glyphRect.X+2, glyphRect.Y + (glyphRect.Height / 2), glyphRect.X + 8-2, glyphRect.Y + (glyphRect.Height / 2)); + } + } + } + } + + + } + + + protected override void OnMouseUp(DataGridViewCellMouseEventArgs e) + { + base.OnMouseUp(e); + + TreeGridNode node = this.OwningNode; + if (node != null && node._grid != null) + node._grid._inExpandCollapseMouseCapture = false; + } + + protected override void OnDoubleClick(DataGridViewCellEventArgs e) + { + if (on_name_click) + base.OnDoubleClick(e); + } + + public bool on_name_click=true; + protected override void OnMouseDown(DataGridViewCellMouseEventArgs e) + { + if (e.Location.X > this.pad.Left || this.IsInEditMode) + { + on_name_click = true; + base.OnMouseDown(e); + } + else + { + // Expand the node + //TODO: Calculate more precise location + TreeGridNode node = this.OwningNode; + on_name_click = false; + if (node != null && node._grid != null && node.HasChildren) + { + node._grid._inExpandCollapseMouseCapture = true; + if (node.IsExpanded) + node.Collapse(); + else + node.Expand(); + } + } + } + + public TreeGridNode OwningNode + { + get { return base.OwningRow as TreeGridNode; } + } + } + + public class TreeGridColumn : DataGridViewTextBoxColumn + { + internal Image _defaultNodeImage; + + public TreeGridColumn() + { + this.CellTemplate = new TreeGridCell(); + } + + // Need to override Clone for design-time support. + public override object Clone() + { + TreeGridColumn c = (TreeGridColumn)base.Clone(); + c._defaultNodeImage = this._defaultNodeImage; + return c; + } + + public Image DefaultNodeImage + { + get { return _defaultNodeImage; } + set { _defaultNodeImage = value; } + } + } +} diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridEvents.cs b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridEvents.cs new file mode 100644 index 000000000..fe6cea947 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridEvents.cs @@ -0,0 +1,82 @@ +//--------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY +//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//PARTICULAR PURPOSE. +//--------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace AdvancedDataGridView +{ + public class TreeGridNodeEventBase + { + private TreeGridNode _node; + + public TreeGridNodeEventBase(TreeGridNode node) + { + this._node = node; + } + + public TreeGridNode Node + { + get { return _node; } + } + } + public class CollapsingEventArgs : System.ComponentModel.CancelEventArgs + { + private TreeGridNode _node; + + private CollapsingEventArgs() { } + public CollapsingEventArgs(TreeGridNode node) + : base() + { + this._node = node; + } + public TreeGridNode Node + { + get { return _node; } + } + + } + public class CollapsedEventArgs : TreeGridNodeEventBase + { + public CollapsedEventArgs(TreeGridNode node) + : base(node) + { + } + } + + public class ExpandingEventArgs:System.ComponentModel.CancelEventArgs + { + private TreeGridNode _node; + + private ExpandingEventArgs() { } + public ExpandingEventArgs(TreeGridNode node):base() + { + this._node = node; + } + public TreeGridNode Node + { + get { return _node; } + } + + } + public class ExpandedEventArgs : TreeGridNodeEventBase + { + public ExpandedEventArgs(TreeGridNode node):base(node) + { + } + } + + public delegate void ExpandingEventHandler(object sender, ExpandingEventArgs e); + public delegate void ExpandedEventHandler(object sender, ExpandedEventArgs e); + + public delegate void CollapsingEventHandler(object sender, CollapsingEventArgs e); + public delegate void CollapsedEventHandler(object sender, CollapsedEventArgs e); + +} diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs new file mode 100644 index 000000000..d87bc89de --- /dev/null +++ b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs @@ -0,0 +1,890 @@ +//--------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY +//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//PARTICULAR PURPOSE. +//--------------------------------------------------------------------- +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Collections.Generic; +using System.Diagnostics; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.ComponentModel.Design.Serialization; +using System.Drawing.Design; +using System.Text; +using VisualPascalABC; +using VisualPascalABCPlugins; + +namespace AdvancedDataGridView +{ + [ + ToolboxItem(false), + DesignTimeVisible(false) + ] + public class TreeGridNode : DataGridViewRow//, IComponent + { + internal TreeGridView _grid; + internal TreeGridNode _parent; + internal TreeGridNodeCollection _owner; + internal bool IsExpanded; + internal bool IsRoot; + internal bool _isSited; + internal bool _isFirstSibling; + internal bool _isLastSibling; + internal Image _image; + internal int _imageIndex=1; + internal bool UserRow = true; + internal bool InExpanding; + private Random rndSeed = new Random(); + public int UniqueValue = -1; + TreeGridCell _treeCell; + TreeGridNodeCollection childrenNodes; + IListItem content; + private int _index; + private int _level; + private bool childCellsCreated = false; + private string text; + private string type; + private string name; + internal bool populated; + private bool canEditText; + + // needed for IComponent + private ISite site = null; + private EventHandler disposed = null; + + public TreeGridNode(TreeGridView owner) + : this() + { + this._grid = owner; + + //this.IsExpanded = true; + } + + public TreeGridNode(TreeGridView owner, IListItem content):this(owner) + { + this.content = content; + } + + public TreeGridNode() + { + _index = -1; + _level = -1; + this.MinimumHeight = 20; + //this.Frozen = true; + IsExpanded = false; + UniqueValue = this.rndSeed.Next(); + _isSited = false; + _isFirstSibling = false; + _isLastSibling = false; + _imageIndex = -1; + } + + public override object Clone() + { + TreeGridNode r = (TreeGridNode)base.Clone(); + r.UniqueValue = -1; + r._level = this._level; + r._grid = this._grid; + r._parent = this.Parent; + + r._imageIndex = this._imageIndex; + if (r._imageIndex == -1) + r.Image = this.Image; + + r.IsExpanded = this.IsExpanded; + //r.treeCell = new TreeGridCell(); + + return r; + } + + public override int GetPreferredHeight(int rowIndex, DataGridViewAutoSizeRowMode autoSizeRowMode, bool fixedWidth) + { + int h = base.GetPreferredHeight(rowIndex, autoSizeRowMode, fixedWidth); + return h; + } + + internal protected virtual void UnSited() + { + // This row is being removed from being displayed on the grid. + TreeGridCell cell; + foreach (DataGridViewCell DGVcell in this.Cells) + { + cell = DGVcell as TreeGridCell; + if (cell != null) + { + cell.UnSited(); + } + } + this._isSited = false; + } + + internal protected virtual void Sited() + { + // This row is being added to the grid. + this._isSited = true; + this.childCellsCreated = true; + //Debug.Assert(this._grid != null); + + TreeGridCell cell; + foreach (DataGridViewCell DGVcell in this.Cells) + { + cell = DGVcell as TreeGridCell; + if (cell != null) + { + cell.Sited();// Level = this.Level; + } + } + + } + + // Represents the index of this row in the Grid + [System.ComponentModel.Description("Represents the index of this row in the Grid. Advanced usage."), + System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced), + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int RowIndex{ + get{ + return base.Index; + } + } + + // Represents the index of this row based upon its position in the collection. + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int Index + { + get + { + if (_index == -1) + { + // get the index from the collection if unknown + _index = this._owner.IndexOf(this); + } + + return _index; + } + internal set + { + _index = value; + } + } + + [Browsable(false), + EditorBrowsable( EditorBrowsableState.Never), + DesignerSerializationVisibility( DesignerSerializationVisibility.Hidden)] + public ImageList ImageList + { + get + { + if (this._grid != null) + return this._grid.ImageList; + else + return null; + } + } + + private bool ShouldSerializeImageIndex() + { + return (this._imageIndex != -1 && this._image == null); + } + +// [Category("Appearance"), +// Description("..."), DefaultValue(-1), +// TypeConverter(typeof(ImageIndexConverter)), +// Editor("System.Windows.Forms.Design.ImageIndexEditor", typeof(UITypeEditor))] + public int ImageIndex + { + get { return _imageIndex; } + set + { + _imageIndex = value; + if (_imageIndex != -1) + { + // when a imageIndex is provided we do not store the image. + this._image = null; + } + if (this._isSited) + { + // when the image changes the cell's style must be updated + this._treeCell.UpdateStyle(); + if (this.Displayed) + this._grid.InvalidateRow(this.RowIndex); + } + } + } + + private bool ShouldSerializeImage() + { + return (this._imageIndex == -1 && this._image != null); + } + + public Image Image + { + get { + if (_image == null && _imageIndex != -1) + { + if (this.ImageList != null && this._imageIndex < this.ImageList.Images.Count) + { + // get image from image index + return this.ImageList.Images[this._imageIndex]; + } + else + return null; + } + else + { + // image from image property + return this._image; + }; + } + set + { + _image = value; + if (_image != null) + { + // when a image is provided we do not store the imageIndex. + this._imageIndex = -1; + } + if (this._isSited) + { + // when the image changes the cell's style must be updated + this._treeCell.UpdateStyle(); + if (this.Displayed) + this._grid.InvalidateRow(this.RowIndex); + } + } + } + + protected override DataGridViewCellCollection CreateCellsInstance() + { + DataGridViewCellCollection cells = base.CreateCellsInstance(); + cells.CollectionChanged += cells_CollectionChanged; + return cells; + } + + void cells_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) + { + // Exit if there already is a tree cell for this row + if (_treeCell != null) return; + + if (e.Action == System.ComponentModel.CollectionChangeAction.Add || e.Action == System.ComponentModel.CollectionChangeAction.Refresh) + { + TreeGridCell treeCell = null; + + if (e.Element == null) + { + foreach (DataGridViewCell cell in base.Cells) + { + if (cell.GetType().IsAssignableFrom(typeof(TreeGridCell))) + { + treeCell = (TreeGridCell)cell; + break; + } + + } + } + else + { + treeCell = e.Element as TreeGridCell; + } + + if (treeCell != null) + _treeCell = treeCell; + } + } + + public IListItem Content + { + get + { + return content; + } + set + { + if (content != null) + { + content.Changed -= OnContentChanged; + } + content = value; + if (content != null) + { + content.Changed += OnContentChanged; + } + Update(); + } + } + + void OnContentChanged(object sender, ListItemEventArgs e) + { + //Update(); + } + + public string Type + { + get { return type; } + } + + public string Text + { + get { return text; } + } + + private static void internalUpdateNodes(object prm) + { + object[] prms = prm as object[]; + TreeGridView tree = prms[0] as TreeGridView; + TreeGridNodeCollection collection = prms[1] as TreeGridNodeCollection; + IList contents = prms[2] as IList; + for (int i = 0; i < contents.Count; i++) + { + try + { + if (i < collection.Count) + { + // Overwrite + //if (!contents[i].IsLiteral) + ((TreeGridNode)collection[i]).Content = contents[i]; + } + else + { + // Add + //if (!contents[i].IsLiteral) + { + TreeGridNode tn = new TreeGridNode(tree,contents[i]); + tn.UserRow = false; + tn.Update(); + collection.Add(tn); + } + } + } + catch + { + + } + } + // Delete other nodes + while (collection.Count > contents.Count) + { + collection.RemoveAt(collection.Count - 1); + } + } + private static System.Threading.Thread th; + + public static void UpdateNodesForLocalList(TreeGridView tree, TreeGridNodeCollection collection, IList contents) + { + // Add or overwrite existing items + for (int i = 0; i < contents.Count; i++) + { + if (i < collection.Count) + { + // Overwrite + //if (!contents[i].IsLiteral) + ((TreeGridNode)collection[i]).Content = contents[i]; + } + else + { + // Add + //if (!contents[i].IsLiteral) + { + TreeGridNode tn = new TreeGridNode(tree,contents[i]); + tn.UserRow = false; + tn.Update(); + collection.Add(tn); + tree.Rows.Add(tn); + if (contents[i] is ModuleItem) + tn.Expand(); + } + } + } + // Delete other nodes + while (collection.Count > contents.Count) + { + collection.RemoveAt(collection.Count - 1); + tree.Rows.RemoveAt(tree.Rows.Count-1); + } + for (int i=0; i contents) + { + // Add or overwrite existing items + for (int i = 0; i < contents.Count; i++) + { + if (i < collection.Count) + { + // Overwrite + //if (!contents[i].IsLiteral) + ((TreeGridNode)collection[i]).Content = contents[i]; + } + else + { + // Add + //if (!contents[i].IsLiteral) + { + TreeGridNode tn = new TreeGridNode(tree,contents[i]); + tn.UserRow = false; + tn.Update(); + collection.Add(tn); + } + } + } + // Delete other nodes + while (collection.Count > contents.Count) + { + collection.RemoveAt(collection.Count - 1); + } + //tree.Update(); +// tree.UpdateSelection(); +// tree.FullUpdate(); + } + + private bool updated=true; + public bool is_changed=false; + + internal void FastUpdate() + { + if (this.content != null && !updated) + { + this._image = content.Image; + if (this._image == null) + this._image = CodeCompletionProvider.ImagesProvider.ImageList.Images[CodeCompletionProvider.ImagesProvider.IconNumberField]; + string o = content.Text; + if (o != "") + { + this.Cells[1].Value = o; + } + this.HasChildren = content.HasSubItems; + this.canEditText = content.CanEditText; + this.type = content.Type; + if (this.name == "base") + this.Cells[1].Value = "{" + content.Type + "}"; + if (this.Cells[2].Value == null) + this.Cells[2].Value = this.type; + if (o != "") + updated = true; + //if (this._grid != null) + //this._grid.InvalidateCell(this.Cells[1]); + } + + } + + [System.ComponentModel.EditorBrowsableAttribute()] + protected override void PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, int rowIndex, DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, DataGridViewPaintParts paintParts) + { + FastUpdate(); + base.PaintCells(graphics, clipBounds, rowBounds, rowIndex, rowState, isFirstDisplayedRow, isLastVisibleRow, paintParts); + } + + private void Update() + { + DateTime start = Debugger.Util.HighPrecisionTimer.Now; + updated = false; + //this.HasChildren = Content.HasSubItems; + //this._image = content.Image; + if (this._image == null) + this._image = CodeCompletionProvider.ImagesProvider.ImageList.Images[CodeCompletionProvider.ImagesProvider.IconNumberField]; + this.name = content.Name; +// this.text = content.Text; + + if (this.name == "" || this.name == null) + this.name = "base"; +// this.canEditText = content.CanEditText; +// this.type = content.Type; + +// if (this.name == "base") +// this.text = "{" + content.Type + "}"; + //DateTime time = Debugger.Util.HighPrecisionTimer.Now; + //this.type = time.ToLongTimeString() + "." + time.Millisecond.ToString(); + if (!this.UserRow) + this.Cells[0].Value = this.name; + //this.Cells[1].Value = null;//this.text; + if (this.Cells[2].Value == null) + this.Cells[2].Value = this.type; + //this.Cells[2].Value = this.type; + DateTime end = Debugger.Util.HighPrecisionTimer.Now; + + //LoggingService.InfoFormatted("Updated node {0} ({1} ms)", FullName, (end - start).TotalMilliseconds); + + if (this.IsExpanded) + { +// this.childrenNodes.Clear(); +// populated = false; +// this.Collapse(); + //return; + //this.Tree.FullUpdate(); + //populated = true; + if (content is ModuleItem) + { + UpdateNodes(this._grid, this.Nodes, Content.SubItems); +// this._grid.Update(); + //this.Tree.UpdateSelection(); + //this.Tree.FullUpdate(); + } + else + { + try + { + if (content is ValueItem || content is BaseTypeItem/*&& (content as ValueItem).Value.Type.Module.SymbolsLoaded*/) + { + UpdateNodes(this._grid, this.Nodes, Content.SubItems); + //this._grid.Update(); +// this.Tree.UpdateSelection(); +// this.Tree.FullUpdate(); + } + else + { + populated = false; +// this.Tree.FullUpdate(); + } + } + catch (System.Exception e) + { + populated = false; +// this.Tree.FullUpdate(); + } + } + // + } + else + { +// this.childrenNodes.Clear(); +//// this.Tree.UpdateSelection(); +//// this._grid.Update(); +// populated = false; + } + } + +// [Category("Data"), +// Description("The collection of root nodes in the treelist."), +// DesignerSerializationVisibility(DesignerSerializationVisibility.Content), +// Editor(typeof(CollectionEditor), typeof(UITypeEditor))] + public TreeGridNodeCollection Nodes + { + get + { + if (childrenNodes == null) + { + childrenNodes = new TreeGridNodeCollection(this); + } + return childrenNodes; + } + set { ;} + } + + // Create a new Cell property because by default a row is not in the grid and won't + // have any cells. We have to fabricate the cell collection ourself. + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new DataGridViewCellCollection Cells + { + get + { + if (!childCellsCreated && this.DataGridView == null) + { + if (this._grid == null) return null; + + this.CreateCells(this._grid); + childCellsCreated = true; + } + return base.Cells; + } + } + + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int Level + { + get { + if (this._level == -1) + { + // calculate level + int walk = 0; + TreeGridNode walkRow = this.Parent; + while (walkRow != null) + { + walk++; + walkRow = walkRow.Parent; + } + + this._level = walk+1; + } + return this._level; } + } + + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public TreeGridNode Parent + { + get + { + return this._parent; + } + } + + private bool hasChildren; + + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public virtual bool HasChildren + { + get + { + return hasChildren; + //return (this.childrenNodes != null && this.Nodes.Count != 0); + } + set + { + hasChildren = value; + } + } + + [Browsable(false)] + public bool IsSited + { + get + { + return this._isSited; + } + } + [Browsable(false)] + public bool IsFirstSibling + { + get + { + return (this.Index == 0); + } + } + + [Browsable(false)] + public bool IsLastSibling + { + get + { + TreeGridNode parent = this.Parent; + if (parent != null && parent.HasChildren) + { + return (this.Index == parent.Nodes.Count - 1); + } + else + return true; + } + } + + public virtual bool Collapse() + { + if (this._grid != null) + return this._grid.CollapseNode(this); + return false; + } + + public void OnExpanding() + { + try + { + if (!populated) + { + if (this._owner == null) + { + this._owner = this.Nodes; + } + + foreach (ListItem item in Content.SubItems) + { + TreeGridNode tn = new TreeGridNode(this._grid, item); + tn._owner = Nodes; + tn._parent = this; + tn.InExpanding = true; + tn.UserRow = false; + item.Changed += tn.OnContentChanged; + tn.Update(); + Nodes.Add(tn); + } + populated = true; + //this.IsExpandedOnce = true; +// this.Tree.UpdateSelection(); +// this.Tree.FullUpdate(); + } + } + catch (System.Exception e) + { + } + } + + public virtual bool Expand() + { + if (this._grid != null) + { + OnExpanding(); + bool b = this._grid.ExpandNode(this); + return b; + } + else + { + this.IsExpanded = true; + return true; + } + } + + internal protected virtual bool InsertChildNode(int index, TreeGridNode node) + { + node._parent = this; + node._grid = this._grid; + + // ensure that all children of this node has their grid set + if (this._grid != null) + UpdateChildNodes(node); + + //TODO: do we need to use index parameter? + if ((this._isSited || this.IsRoot) && this.IsExpanded) + this._grid.SiteNode(node); + return true; + } + + internal protected virtual bool InsertChildNodes(int index, params TreeGridNode[] nodes) + { + foreach (TreeGridNode node in nodes) + { + this.InsertChildNode(index, node); + } + return true; + } + + internal protected virtual bool AddChildNode(TreeGridNode node) + { + node._parent = this; + node._grid = this._grid; + + // ensure that all children of this node has their grid set + if (this._grid != null) + UpdateChildNodes(node); + + if ((this._isSited || this.IsRoot) && this.IsExpanded && !node._isSited) + this._grid.SiteNode(node); + + return true; + } + + internal protected virtual bool AddChildNodes(params TreeGridNode[] nodes) + { + //TODO: Convert the final call into an SiteNodes?? + foreach (TreeGridNode node in nodes) + { + this.AddChildNode(node); + } + return true; + + } + + internal protected virtual bool RemoveChildNode(TreeGridNode node) + { + if ((this.IsRoot || this._isSited) && this.IsExpanded ) + { + //We only unsite out child node if we are sited and expanded. + this._grid.UnSiteNode(node); + + } + node._grid = null; + node._parent = null; + return true; + + } + + internal protected virtual bool ClearNodes() + { + if (this.HasChildren) + { + for (int i = this.Nodes.Count - 1; i >= 0; i--) + { + this.Nodes.RemoveAt(i); + } + } + return true; + } + + [ + Browsable(false), + EditorBrowsable(EditorBrowsableState.Advanced) + ] + public event EventHandler Disposed + { + add + { + this.disposed += value; + } + remove + { + this.disposed -= value; + } + } + + [ + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public ISite Site + { + get + { + return this.site; + } + set + { + this.site = value; + } + } + + private void UpdateChildNodes(TreeGridNode node) + { + if (node.HasChildren) + { + foreach (TreeGridNode childNode in node.Nodes) + { + childNode._grid = node._grid; + this.UpdateChildNodes(childNode); + } + } + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(36); + sb.Append("TreeGridNode { Index="); + sb.Append(this.RowIndex.ToString(System.Globalization.CultureInfo.CurrentCulture)); + sb.Append(" }"); + return sb.ToString(); + } + + //protected override void Dispose(bool disposing) { + // if (disposing) + // { + // lock(this) + // { + // if (this.site != null && this.site.Container != null) + // { + // this.site.Container.Remove(this); + // } + + // if (this.disposed != null) + // { + // this.disposed(this, EventArgs.Empty); + // } + // } + // } + + // base.Dispose(disposing); + //} + } + +} diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNodeCollection.cs b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNodeCollection.cs new file mode 100644 index 000000000..5a9407f01 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNodeCollection.cs @@ -0,0 +1,252 @@ +//--------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY +//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//PARTICULAR PURPOSE. +//--------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace AdvancedDataGridView +{ + public class TreeGridNodeCollection : System.Collections.Generic.IList, System.Collections.IList + { + internal System.Collections.Generic.List _list; + internal TreeGridNode _owner; + internal TreeGridNodeCollection(TreeGridNode owner) + { + this._owner = owner; + this._list = new List(); + } + + #region Public Members + public void Add(TreeGridNode item) + { + // The row needs to exist in the child collection before the parent is notified. + item._grid = this._owner._grid; + + bool hadChildren = this._owner.HasChildren; + item._owner = this; + + this._list.Add(item); + //this._owner.Collapse(); + this._owner.AddChildNode(item); + + // if the owner didn't have children but now does (asserted) and it is sited update it + if (!hadChildren && this._owner.IsSited) + { + this._owner._grid.InvalidateRow(this._owner.RowIndex); + } + } + + public TreeGridNode Add(string text) + { + TreeGridNode node = new TreeGridNode(); + this.Add(node); + + node.Cells[0].Value = text; + return node; + } + + public TreeGridNode Add(params object[] values) + { + TreeGridNode node = new TreeGridNode(); + this.Add(node); + + int cell = 0; + + if (values.Length > node.Cells.Count ) + throw new ArgumentOutOfRangeException("values"); + + foreach (object o in values) + { + node.Cells[cell].Value = o; + cell++; + } + return node; + } + + public void Insert(int index, TreeGridNode item) + { + // The row needs to exist in the child collection before the parent is notified. + item._grid = this._owner._grid; + item._owner = this; + + this._list.Insert(index, item); + + this._owner.InsertChildNode(index, item); + } + + public bool Remove(TreeGridNode item) + { + // The parent is notified first then the row is removed from the child collection. + this._owner.RemoveChildNode(item); + item._grid = null; + return this._list.Remove(item); + } + + public void RemoveAt(int index) + { + TreeGridNode row = this._list[index]; + + // The parent is notified first then the row is removed from the child collection. + this._owner.RemoveChildNode(row); + row._grid = null; + this._list.RemoveAt(index); + } + + public void Clear() + { + // The parent is notified first then the row is removed from the child collection. + this._owner.ClearNodes(); + this._list.Clear(); + } + + public int IndexOf(TreeGridNode item) + { + return this._list.IndexOf(item); + } + + public TreeGridNode this[int index] + { + get + { + return this._list[index]; + } + set + { + throw new Exception("The method or operation is not implemented."); + } + } + + public bool Contains(TreeGridNode item) + { + return this._list.Contains(item); + } + + public void CopyTo(TreeGridNode[] array, int arrayIndex) + { + throw new Exception("The method or operation is not implemented."); + } + + public int Count + { + get{ return this._list.Count; } + } + + public bool IsReadOnly + { + get{ return false; } + } + #endregion + + #region IList Interface + void System.Collections.IList.Remove(object value) + { + this.Remove(value as TreeGridNode); + } + + + int System.Collections.IList.Add(object value) + { + TreeGridNode item = value as TreeGridNode; + this.Add(item); + return item.Index; + } + + void System.Collections.IList.RemoveAt(int index) + { + this.RemoveAt(index); + } + + + void System.Collections.IList.Clear() + { + this.Clear(); + } + + bool System.Collections.IList.IsReadOnly + { + get { return this.IsReadOnly;} + } + + bool System.Collections.IList.IsFixedSize + { + get { return false; } + } + + int System.Collections.IList.IndexOf(object item) + { + return this.IndexOf(item as TreeGridNode); + } + + void System.Collections.IList.Insert(int index, object value) + { + this.Insert(index, value as TreeGridNode); + } + int System.Collections.ICollection.Count + { + get { return this.Count; } + } + bool System.Collections.IList.Contains(object value) + { + return this.Contains(value as TreeGridNode); + } + void System.Collections.ICollection.CopyTo(Array array, int index) + { + throw new Exception("The method or operation is not implemented."); + } + object System.Collections.IList.this[int index] + { + get + { + return this[index]; + } + set + { + throw new Exception("The method or operation is not implemented."); + } + } + + + + #region IEnumerable Members + + public IEnumerator GetEnumerator() + { + return this._list.GetEnumerator(); + } + + #endregion + + + #region IEnumerable Members + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + #endregion + #endregion + + #region ICollection Members + + bool System.Collections.ICollection.IsSynchronized + { + get { throw new Exception("The method or operation is not implemented."); } + } + + object System.Collections.ICollection.SyncRoot + { + get { throw new Exception("The method or operation is not implemented."); } + } + + #endregion + } + +} diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridView.cs b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridView.cs new file mode 100644 index 000000000..294895fc9 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridView.cs @@ -0,0 +1,633 @@ +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms.VisualStyles; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.ComponentModel.Design.Serialization; +using System.Drawing.Design; + +namespace AdvancedDataGridView +{ + /// + /// Summary description for TreeGridView. + /// + [System.ComponentModel.DesignerCategory("code"), + Designer(typeof(System.Windows.Forms.Design.ControlDesigner)), + ComplexBindingProperties(), + Docking(DockingBehavior.Ask)] + public class TreeGridView:DataGridView + { + private int _indentWidth; + private TreeGridNode _root; + private TreeGridColumn _expandableColumn; + private bool _disposing = false; + internal ImageList _imageList; + private bool _inExpandCollapse = false; + internal bool _inExpandCollapseMouseCapture = false; + private Control hideScrollBarControl; + private bool _showLines = true; + private bool _virtualNodes = false; + + internal VisualStyleRenderer _rOpen; + internal VisualStyleRenderer _rClosed; + + public VisualStyleRenderer rOpen + { + get + { + if (_rOpen == null) + _rOpen = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened); + return _rOpen; + //rClosed = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed); + } + } + + public VisualStyleRenderer rClosed + { + get + { + if (_rClosed == null) + _rClosed = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed); + return _rClosed; + } + } + + + #region Constructor + public TreeGridView() + { + // Control when edit occurs because edit mode shouldn't start when expanding/collapsing + this.EditMode = DataGridViewEditMode.EditProgrammatically; + this.RowTemplate = new TreeGridNode() as DataGridViewRow; + // This sample does not support adding or deleting rows by the user. + + this._root = new TreeGridNode(this); + this._root.IsRoot = true; + this.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.None; + //rOpen = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened); + //rClosed = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed); + // Ensures that all rows are added unshared by listening to the CollectionChanged event. + base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){}; + } + #endregion + + #region Keyboard F2 to begin edit support + protected override void OnKeyDown(KeyEventArgs e) + { + // Cause edit mode to begin since edit mode is disabled to support + // expanding/collapsing + base.OnKeyDown(e); + if (!e.Handled) + { +// if (e.KeyCode == Keys.F2 && this.CurrentCellAddress.X > -1 && this.CurrentCellAddress.Y >-1) +// { +// if (!this.CurrentCell.Displayed) +// { +// this.FirstDisplayedScrollingRowIndex = this.CurrentCellAddress.Y; +// } +// else +// { +// // TODO:calculate if the cell is partially offscreen and if so scroll into view +// } +// this.SelectionMode = DataGridViewSelectionMode.CellSelect; +// this.BeginEdit(true); +// } +// else if (e.KeyCode == Keys.Enter && !this.IsCurrentCellInEditMode) +// { +// this.SelectionMode = DataGridViewSelectionMode.FullRowSelect; +// this.CurrentCell.OwningRow.Selected = true; +// } + } + } + #endregion + + #region Shadow and hide DGV properties + + // This sample does not support databinding + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + EditorBrowsable(EditorBrowsableState.Never)] + public new object DataSource + { + get { return null; } + set { throw new NotSupportedException("The TreeGridView does not support databinding"); } + } + + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + EditorBrowsable(EditorBrowsableState.Never)] + public new object DataMember + { + get { return null; } + set { throw new NotSupportedException("The TreeGridView does not support databinding"); } + } + + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + EditorBrowsable(EditorBrowsableState.Never)] + public new DataGridViewRowCollection Rows + { + get { return base.Rows; } + } + + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + EditorBrowsable(EditorBrowsableState.Never)] + public new bool VirtualMode + { + get { return false; } + set { throw new NotSupportedException("The TreeGridView does not support virtual mode"); } + } + + // none of the rows/nodes created use the row template, so it is hidden. + [Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + EditorBrowsable(EditorBrowsableState.Never)] + public new DataGridViewRow RowTemplate + { + get { return base.RowTemplate; } + set { base.RowTemplate = value; } + } + + #endregion + + #region Public methods + [Description("Returns the TreeGridNode for the given DataGridViewRow")] + public TreeGridNode GetNodeForRow(DataGridViewRow row) + { + return row as TreeGridNode; + } + + [Description("Returns the TreeGridNode for the given DataGridViewRow")] + public TreeGridNode GetNodeForRow(int index) + { + return GetNodeForRow(base.Rows[index]); + } + #endregion + + #region Public properties + [Category("Data"), + Description("The collection of root nodes in the treelist."), + DesignerSerializationVisibility(DesignerSerializationVisibility.Content), + Editor(typeof(CollectionEditor), typeof(UITypeEditor))] + public TreeGridNodeCollection Nodes + { + get + { + return this._root.Nodes; + } + } + + public new TreeGridNode CurrentRow + { + get + { + return base.CurrentRow as TreeGridNode; + } + } + + [DefaultValue(false), + Description("Causes nodes to always show as expandable. Use the NodeExpanding event to add nodes.")] + public bool VirtualNodes + { + get { return _virtualNodes; } + set { _virtualNodes = value; } + } + + public TreeGridNode CurrentNode + { + get + { + return this.CurrentRow; + } + } + + [DefaultValue(true)] + public bool ShowLines + { + get { return this._showLines; } + set { + if (value != this._showLines) { + this._showLines = value; + this.Invalidate(); + } + } + } + + public ImageList ImageList + { + get { return this._imageList; } + set { + this._imageList = value; + //TODO: should we invalidate cell styles when setting the image list? + + } + } + + public new int RowCount + { + get { return this.Nodes.Count; } + set + { + for (int i = 0; i < value; i++) + this.Nodes.Add(new TreeGridNode()); + + } + } + #endregion + + #region Site nodes and collapse/expand support + protected override void OnRowsAdded(DataGridViewRowsAddedEventArgs e) + { + base.OnRowsAdded(e); + // Notify the row when it is added to the base grid + int count = e.RowCount - 1; + TreeGridNode row; + while (count >= 0) + { + row = base.Rows[e.RowIndex + count] as TreeGridNode; + if (row != null) + { + row.Sited(); + } + count--; + } + } + + internal protected void UnSiteAll() + { + this.UnSiteNode(this._root); + } + + internal protected virtual void UnSiteNode(TreeGridNode node) + { + if (node.IsSited || node.IsRoot) + { + // remove child rows first + foreach (TreeGridNode childNode in node.Nodes) + { + this.UnSiteNode(childNode); + } + + // now remove this row except for the root + if (!node.IsRoot) + { + base.Rows.Remove(node); + // Row isn't sited in the grid anymore after remove. Note that we cannot + // Use the RowRemoved event since we cannot map from the row index to + // the index of the expandable row/node. + node.UnSited(); + } + } + } + + internal protected virtual bool CollapseNode(TreeGridNode node) + { + if (node.IsExpanded) + { + CollapsingEventArgs exp = new CollapsingEventArgs(node); + this.OnNodeCollapsing(exp); + + if (!exp.Cancel) + { + this.LockVerticalScrollBarUpdate(true); + this.SuspendLayout(); + _inExpandCollapse = true; + node.IsExpanded = false; + + foreach (TreeGridNode childNode in node.Nodes) + { + Debug.Assert(childNode.RowIndex != -1, "Row is NOT in the grid."); + this.UnSiteNode(childNode); + } + + CollapsedEventArgs exped = new CollapsedEventArgs(node); + this.OnNodeCollapsed(exped); + //TODO: Convert this to a specific NodeCell property + _inExpandCollapse = false; + this.LockVerticalScrollBarUpdate(false); + this.ResumeLayout(true); + this.InvalidateCell(node.Cells[0]); + + } + + return !exp.Cancel; + } + else + { + // row isn't expanded, so we didn't do anything. + return false; + } + } + + protected override void OnAllowUserToAddRowsChanged(EventArgs e) + { + base.OnAllowUserToAddRowsChanged(e); + //if (AllowUserToAddRows) + //{ + // TreeGridNode node = new TreeGridNode(this); + // this.Nodes.Add(node); + // SiteNode(node); + //} + } + + public void AddNewNode() + { + TreeGridNode node = new TreeGridNode(this); + this.Nodes.Add(node); + SiteNode(node); + } + + internal protected virtual void SiteNode(TreeGridNode node) + { + //TODO: Raise exception if parent node is not the root or is not sited. + int rowIndex = -1; + TreeGridNode currentRow; + node._grid = this; + + if (node.Parent != null && node.Parent.IsRoot == false) + { + // row is a child + //Debug.Assert(node.Parent != null && node.Parent.IsExpanded == true); + + if (node.Index > 0) + { + currentRow = node.Parent.Nodes[node.Index - 1]; + } + else + { + currentRow = node.Parent; + } + } + else + { + // row is being added to the root + if (node.Index > 0) + { + currentRow = node.Parent.Nodes[node.Index - 1]; + } + else + { + currentRow = null; + } + + } + + if (currentRow != null) + { + while (currentRow.Level >= node.Level) + { + if (currentRow.RowIndex < base.Rows.Count - 1) + { + currentRow = base.Rows[currentRow.RowIndex + 1] as TreeGridNode; + //Debug.Assert(currentRow != null); + } + else + // no more rows, site this node at the end. + break; + + } + if (currentRow == node.Parent) + rowIndex = currentRow.RowIndex + 1; + else if (currentRow.Level < node.Level) + rowIndex = currentRow.RowIndex; + else + rowIndex = currentRow.RowIndex + 1; + } + else + rowIndex = 0; + + + //Debug.Assert(rowIndex != -1); + this.SiteNode(node, rowIndex); + + //Debug.Assert(node.IsSited); + if (node.IsExpanded) + { + // add all child rows to display + foreach (TreeGridNode childNode in node.Nodes) + { + //TODO: could use the more efficient SiteRow with index. + this.SiteNode(childNode); + } + } + } + + + internal protected virtual void SiteNode(TreeGridNode node, int index) + { + if (index < base.Rows.Count) + { + base.Rows.Insert(index, node); + + } + else + { + // for the last item. + base.Rows.Add(node); + } + } + + internal protected virtual bool ExpandNode(TreeGridNode node) + { + if (!node.IsExpanded || this._virtualNodes) + { + ExpandingEventArgs exp = new ExpandingEventArgs(node); + this.OnNodeExpanding(exp); + + if (!exp.Cancel) + { + this.LockVerticalScrollBarUpdate(true); + this.SuspendLayout(); + _inExpandCollapse = true; + node.IsExpanded = true; + + //TODO Convert this to a InsertRange + foreach (TreeGridNode childNode in node.Nodes) + { + Debug.Assert(childNode.RowIndex == -1, "Row is already in the grid."); + + this.SiteNode(childNode); + //this.BaseRows.Insert(rowIndex + 1, childRow); + //TODO : remove -- just a test. + //childNode.Cells[0].Value = "child"; + } + + ExpandedEventArgs exped = new ExpandedEventArgs(node); + this.OnNodeExpanded(exped); + //TODO: Convert this to a specific NodeCell property + _inExpandCollapse = false; + this.LockVerticalScrollBarUpdate(false); + this.ResumeLayout(true); + this.InvalidateCell(node.Cells[0]); + } + + return !exp.Cancel; + } + else + { + // row is already expanded, so we didn't do anything. + return false; + } + } + + protected override void OnMouseUp(MouseEventArgs e) + { + // used to keep extra mouse moves from selecting more rows when collapsing + base.OnMouseUp(e); + this._inExpandCollapseMouseCapture = false; + } + + protected override void OnMouseMove(MouseEventArgs e) + { + // while we are expanding and collapsing a node mouse moves are + // supressed to keep selections from being messed up. + if (!this._inExpandCollapseMouseCapture) + base.OnMouseMove(e); + + } + #endregion + + #region Collapse/Expand events + public event ExpandingEventHandler NodeExpanding; + public event ExpandedEventHandler NodeExpanded; + public event CollapsingEventHandler NodeCollapsing; + public event CollapsedEventHandler NodeCollapsed; + + protected virtual void OnNodeExpanding(ExpandingEventArgs e) + { + if (this.NodeExpanding != null) + { + NodeExpanding(this, e); + } + } + protected virtual void OnNodeExpanded(ExpandedEventArgs e) + { + if (this.NodeExpanded != null) + { + NodeExpanded(this, e); + } + } + protected virtual void OnNodeCollapsing(CollapsingEventArgs e) + { + if (this.NodeCollapsing != null) + { + NodeCollapsing(this, e); + } + + } + protected virtual void OnNodeCollapsed(CollapsedEventArgs e) + { + if (this.NodeCollapsed != null) + { + NodeCollapsed(this, e); + } + } + #endregion + + #region Helper methods + protected override void Dispose(bool disposing) + { + this._disposing = true; + base.Dispose(Disposing); + this.UnSiteAll(); + } + + protected override void OnHandleCreated(EventArgs e) + { + base.OnHandleCreated(e); + + // this control is used to temporarly hide the vertical scroll bar + hideScrollBarControl = new Control(); + hideScrollBarControl.Visible = false; + hideScrollBarControl.Enabled = false; + hideScrollBarControl.TabStop = false; + // control is disposed automatically when the grid is disposed + this.Controls.Add(hideScrollBarControl); + } + + protected override void OnRowEnter(DataGridViewCellEventArgs e) + { + // ensure full row select + base.OnRowEnter(e); + if (this.SelectionMode == DataGridViewSelectionMode.CellSelect || + (this.SelectionMode == DataGridViewSelectionMode.FullRowSelect && + base.Rows[e.RowIndex].Selected == false)) + { + this.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + base.Rows[e.RowIndex].Selected = true; + } + } + + private void SetVerticalParent(Control ctrl) + { + this.VerticalScrollBar.Parent = ctrl; + } + + delegate void Func1(Control ctrl); + + private void LockVerticalScrollBarUpdate(bool lockUpdate/*, bool delayed*/) + { + // Temporarly hide/show the vertical scroll bar by changing its parent + if (!this._inExpandCollapse) + { + if (lockUpdate) + { + //this.VerticalScrollBar.Parent = hideScrollBarControl; + Func1 f = SetVerticalParent; + this.VerticalScrollBar.Invoke(f,hideScrollBarControl); + } + else + { + //this.VerticalScrollBar.Parent = this; + Func1 f = SetVerticalParent; + this.VerticalScrollBar.Invoke(f,this); + } + } + } + + protected override void OnColumnAdded(DataGridViewColumnEventArgs e) + { + if (typeof(TreeGridColumn).IsAssignableFrom(e.Column.GetType())) + { + if (_expandableColumn == null) + { + // identify the expanding column. + _expandableColumn = (TreeGridColumn)e.Column; + } + else + { + // this.Columns.Remove(e.Column); + //throw new InvalidOperationException("Only one TreeGridColumn per TreeGridView is supported."); + } + } + + // Expandable Grid doesn't support sorting. This is just a limitation of the sample. + e.Column.SortMode = DataGridViewColumnSortMode.NotSortable; + + base.OnColumnAdded(e); + } + + private static class Win32Helper + { + public const int WM_SYSKEYDOWN = 0x0104, + WM_KEYDOWN = 0x0100, + WM_SETREDRAW = 0x000B; + + [System.Runtime.InteropServices.DllImport("USER32.DLL", CharSet = System.Runtime.InteropServices.CharSet.Auto)] + public static extern IntPtr SendMessage(System.Runtime.InteropServices.HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam); + + [System.Runtime.InteropServices.DllImport("USER32.DLL", CharSet = System.Runtime.InteropServices.CharSet.Auto)] + public static extern IntPtr SendMessage(System.Runtime.InteropServices.HandleRef hWnd, int msg, int wParam, int lParam); + + [System.Runtime.InteropServices.DllImport("USER32.DLL", CharSet = System.Runtime.InteropServices.CharSet.Auto)] + public static extern bool PostMessage(System.Runtime.InteropServices.HandleRef hwnd, int msg, IntPtr wparam, IntPtr lparam); + + } + #endregion + + } +} + diff --git a/VisualPascalABCNETLinux/IB/VBComp/VBNETCompiler.cs b/VisualPascalABCNETLinux/IB/VBComp/VBNETCompiler.cs new file mode 100644 index 000000000..e7a8de4e8 --- /dev/null +++ b/VisualPascalABCNETLinux/IB/VBComp/VBNETCompiler.cs @@ -0,0 +1,49 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using VisualPascalABCPlugins; +using System.Threading; +using Microsoft.VisualBasic; +using System.CodeDom.Compiler; + +namespace VisualPascalABC +{ + /*public class VBNETCompiler + { + private static VBNETCompiler compiler; + public event PascalABCCompiler.ChangeCompilerStateEventDelegate OnChangeCompilerState; + + public static VBNETCompiler Compiler + { + get + { + if (compiler == null) + { + compiler = new VBNETCompiler(); + + } + return compiler; + } + } + + public void Compile(PascalABCCompiler.CompilerOptions options) + { + VBCodeProvider vbcp = new VBCodeProvider(); + string[] sources = new string[1]; + sources[0] = options.SourceFileName; + CompilerParameters comp_opt = new CompilerParameters(); + comp_opt.OutputAssembly = options.OutputFileName; + comp_opt.IncludeDebugInformation = options.Debug; + comp_opt.GenerateExecutable = true; + CompilerResults res = vbcp.CompileAssemblyFromFile(comp_opt,sources); + } + }*/ +} + diff --git a/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.Designer.cs b/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.Designer.cs new file mode 100644 index 000000000..114081216 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.Designer.cs @@ -0,0 +1,188 @@ +namespace VisualPascalABC.OptionsContent +{ + partial class CompilerOptionsContent + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btSelectOutpotDirectory = new System.Windows.Forms.Button(); + this.tbOutputDirectory = new System.Windows.Forms.TextBox(); + this.cbUseOutputDirectory = new System.Windows.Forms.CheckBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.cbUseDllForSystemUnits = new System.Windows.Forms.CheckBox(); + this.cbDeletePdb = new System.Windows.Forms.CheckBox(); + this.cbDeleteExe = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.fbSelectOutputDirectory = new System.Windows.Forms.FolderBrowserDialog(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // btSelectOutpotDirectory + // + this.btSelectOutpotDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.btSelectOutpotDirectory.Location = new System.Drawing.Point(222, 144); + this.btSelectOutpotDirectory.Name = "btSelectOutpotDirectory"; + this.btSelectOutpotDirectory.Size = new System.Drawing.Size(77, 21); + this.btSelectOutpotDirectory.TabIndex = 27; + this.btSelectOutpotDirectory.Text = "BROWSE"; + this.btSelectOutpotDirectory.UseVisualStyleBackColor = true; + this.btSelectOutpotDirectory.Click += new System.EventHandler(this.btSelectOutpotDirectory_Click); + // + // tbOutputDirectory + // + this.tbOutputDirectory.BackColor = System.Drawing.Color.White; + this.tbOutputDirectory.Location = new System.Drawing.Point(5, 144); + this.tbOutputDirectory.Name = "tbOutputDirectory"; + this.tbOutputDirectory.Size = new System.Drawing.Size(207, 20); + this.tbOutputDirectory.TabIndex = 26; + // + // cbUseOutputDirectory + // + this.cbUseOutputDirectory.AutoSize = true; + this.cbUseOutputDirectory.Location = new System.Drawing.Point(5, 120); + this.cbUseOutputDirectory.Name = "cbUseOutputDirectory"; + this.cbUseOutputDirectory.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.cbUseOutputDirectory.Size = new System.Drawing.Size(168, 17); + this.cbUseOutputDirectory.TabIndex = 25; + this.cbUseOutputDirectory.Text = "USE_OUTPUT_DIRECTORY"; + this.cbUseOutputDirectory.UseVisualStyleBackColor = true; + this.cbUseOutputDirectory.CheckedChanged += new System.EventHandler(this.cbUseOutputDirectory_CheckedChanged); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.cbUseDllForSystemUnits); + this.groupBox2.Controls.Add(this.cbDeletePdb); + this.groupBox2.Controls.Add(this.cbDeleteExe); + this.groupBox2.Location = new System.Drawing.Point(5, 26); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 88); + this.groupBox2.TabIndex = 24; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "ENVORIMENT_RUNMODE"; + // + // cbUseDllForSystemUnits + // + this.cbUseDllForSystemUnits.AutoSize = true; + this.cbUseDllForSystemUnits.Location = new System.Drawing.Point(6, 65); + this.cbUseDllForSystemUnits.Name = "cbUseDllForSystemUnits"; + this.cbUseDllForSystemUnits.Size = new System.Drawing.Size(191, 17); + this.cbUseDllForSystemUnits.TabIndex = 2; + this.cbUseDllForSystemUnits.Text = "USE_DLL_FOR_SYSTEM_UNITS"; + this.cbUseDllForSystemUnits.UseVisualStyleBackColor = true; + // + // cbDeletePdb + // + this.cbDeletePdb.AutoSize = true; + this.cbDeletePdb.Location = new System.Drawing.Point(6, 42); + this.cbDeletePdb.Name = "cbDeletePdb"; + this.cbDeletePdb.Size = new System.Drawing.Size(96, 17); + this.cbDeletePdb.TabIndex = 1; + this.cbDeletePdb.Text = "DELETE_PDB"; + this.cbDeletePdb.UseVisualStyleBackColor = true; + // + // cbDeleteExe + // + this.cbDeleteExe.AutoSize = true; + this.cbDeleteExe.Location = new System.Drawing.Point(6, 19); + this.cbDeleteExe.Name = "cbDeleteExe"; + this.cbDeleteExe.Size = new System.Drawing.Size(95, 17); + this.cbDeleteExe.TabIndex = 0; + this.cbDeleteExe.Text = "DELETE_EXE"; + this.cbDeleteExe.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox1.Location = new System.Drawing.Point(5, 5); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.checkBox1.Size = new System.Drawing.Size(148, 17); + this.checkBox1.TabIndex = 21; + this.checkBox1.Text = "GENERATE_PDP_FILES"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.Items.AddRange(new object[] { + "Console Application", + "Windows Application", + "Class Library"}); + this.comboBox1.Location = new System.Drawing.Point(134, 171); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(165, 21); + this.comboBox1.TabIndex = 20; + this.comboBox1.Visible = false; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 171); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(114, 13); + this.label1.TabIndex = 19; + this.label1.Text = "OUTPUT_FILE_TYPE"; + this.label1.Visible = false; + // + // CompilerOptionsContent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.btSelectOutpotDirectory); + this.Controls.Add(this.tbOutputDirectory); + this.Controls.Add(this.cbUseOutputDirectory); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.checkBox1); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.label1); + this.Name = "CompilerOptionsContent"; + this.Size = new System.Drawing.Size(482, 311); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btSelectOutpotDirectory; + private System.Windows.Forms.TextBox tbOutputDirectory; + private System.Windows.Forms.CheckBox cbUseOutputDirectory; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox cbDeletePdb; + private System.Windows.Forms.CheckBox cbDeleteExe; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.FolderBrowserDialog fbSelectOutputDirectory; + private System.Windows.Forms.CheckBox cbUseDllForSystemUnits; + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.cs b/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.cs new file mode 100644 index 000000000..4c4e69b07 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.cs @@ -0,0 +1,151 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace VisualPascalABC.OptionsContent +{ + public partial class CompilerOptionsContent : UserControl,IOptionsContent + { + Form1 MainForm; + string strprefix = "VP_OC_COMPILEROPTIONS_"; + public CompilerOptionsContent(Form1 MainForm) + { + this.MainForm = MainForm; + InitializeComponent(); + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + //this.cbUseDllForSystemUnits.Visible = false; + } + + #region IOptionsContent Members + + private bool alreadyShown; + + public string ContentName + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix+"NAME"); + } + } + public string Description + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix+"DESCRIPTION"); + } + } + + public UserControl Content + { + get { return this; } + } + + public void Action(OptionsContentAction action) + { + PascalABCCompiler.CompilerOptions CompOpt = WorkbenchServiceFactory.BuildService.CompilerOptions; + UserOptions opt = MainForm.UserOptions; + + switch (action) + { + case OptionsContentAction.Show: + //comboBox1.SelectedItem = comboBox1.Items[0]; + if (!alreadyShown) + { + comboBox1.Items.Clear(); + comboBox1.Items.Add(PascalABCCompiler.StringResources.Get("VP_MF_AT_CONSOLE")); + comboBox1.Items.Add(PascalABCCompiler.StringResources.Get("VP_MF_AT_WINDOWS")); + comboBox1.Items.Add(PascalABCCompiler.StringResources.Get("VP_MF_AT_DLL")); + switch (CompOpt.OutputFileType) + { + case PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton: + comboBox1.SelectedItem = comboBox1.Items[0]; + break; + case PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication: + comboBox1.SelectedItem = comboBox1.Items[1]; + break; + case PascalABCCompiler.CompilerOptions.OutputType.ClassLibrary: + comboBox1.SelectedItem = comboBox1.Items[2]; + break; + } + checkBox1.Checked = CompOpt.Debug; + cbDeleteExe.Checked = opt.DeleteEXEAfterExecute; + cbDeletePdb.Checked = opt.DeletePDBAfterExecute; + cbUseOutputDirectory.Checked = opt.UseOutputDirectory; + cbUseOutputDirectory_CheckedChanged(null, null); + tbOutputDirectory.Text = opt.OutputDirectory; + cbUseDllForSystemUnits.Checked = opt.UseDllForSystemUnits; + alreadyShown = true; + } + break; + + case OptionsContentAction.Ok: + /*switch (comboBox1.Items.IndexOf(comboBox1.SelectedItem)) + { + case 0: + CompOpt.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + break; + case 1: + CompOpt.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication; + break; + case 2: + CompOpt.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.ClassLibrary; + break; + }*/ + CompOpt.Debug = checkBox1.Checked; + MainForm.SelectAppType(CompOpt.OutputFileType); + opt.DeleteEXEAfterExecute = cbDeleteExe.Checked; + opt.DeletePDBAfterExecute = cbDeletePdb.Checked; + if (!Directory.Exists(tbOutputDirectory.Text)) + { + try + { + Directory.CreateDirectory(tbOutputDirectory.Text); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, PascalABCCompiler.StringResources.Get("!ERROR_ON_CREATE_DIRECTORY"), MessageBoxButtons.OK, MessageBoxIcon.Error); + ActiveControl = tbOutputDirectory; + return; + } + } + opt.UseOutputDirectory = cbUseOutputDirectory.Checked; + opt.OutputDirectory = tbOutputDirectory.Text; + opt.UseDllForSystemUnits = cbUseDllForSystemUnits.Checked; + if (opt.UseOutputDirectory) + WorkbenchStorage.StandartDirectories[Constants.OutputDirectoryIdent] = opt.OutputDirectory; + else + WorkbenchStorage.StandartDirectories[Constants.OutputDirectoryIdent] = null; + alreadyShown = false; + WorkbenchServiceFactory.OptionsService.SaveOptions(); + break; + case OptionsContentAction.Cancel: + alreadyShown = false; + break; + } + + + } + #endregion + + private void btSelectOutpotDirectory_Click(object sender, EventArgs e) + { + if (fbSelectOutputDirectory.ShowDialog() == DialogResult.OK) + tbOutputDirectory.Text = fbSelectOutputDirectory.SelectedPath; + + } + + private void cbUseOutputDirectory_CheckedChanged(object sender, EventArgs e) + { + tbOutputDirectory.Enabled = btSelectOutpotDirectory.Enabled = cbUseOutputDirectory.Checked; + } + + + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.resx b/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.resx new file mode 100644 index 000000000..442078e7c --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/CompilerOptionsContent.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.Designer.cs b/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.Designer.cs new file mode 100644 index 000000000..ef41e8acf --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.Designer.cs @@ -0,0 +1,209 @@ +namespace VisualPascalABC.OptionsContent +{ + partial class EditorOptionsContent + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.nudTabIndent = new System.Windows.Forms.NumericUpDown(); + this.cbConvertTabsToSpaces = new System.Windows.Forms.CheckBox(); + this.cbShowMathBracket = new System.Windows.Forms.CheckBox(); + this.cbEditorFontSize = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.cbShowLinesNum = new System.Windows.Forms.CheckBox(); + this.cbEnableFolding = new System.Windows.Forms.CheckBox(); + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); + this.cbEnableMatchOperBrackets = new System.Windows.Forms.CheckBox(); + this.fcbFont = new VisualPascalABC.FontComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.nudTabIndent)).BeginInit(); + this.SuspendLayout(); + // + // nudTabIndent + // + this.nudTabIndent.Location = new System.Drawing.Point(204, 152); + this.nudTabIndent.Maximum = new decimal(new int[] { + 16, + 0, + 0, + 0}); + this.nudTabIndent.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nudTabIndent.Name = "nudTabIndent"; + this.nudTabIndent.Size = new System.Drawing.Size(45, 20); + this.nudTabIndent.TabIndex = 21; + this.nudTabIndent.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // cbConvertTabsToSpaces + // + this.cbConvertTabsToSpaces.AutoSize = true; + this.cbConvertTabsToSpaces.Checked = true; + this.cbConvertTabsToSpaces.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbConvertTabsToSpaces.Enabled = false; + this.cbConvertTabsToSpaces.Location = new System.Drawing.Point(5, 151); + this.cbConvertTabsToSpaces.Name = "cbConvertTabsToSpaces"; + this.cbConvertTabsToSpaces.Size = new System.Drawing.Size(181, 17); + this.cbConvertTabsToSpaces.TabIndex = 26; + this.cbConvertTabsToSpaces.Text = "CONVERT_TABS_TO_SPACES"; + this.cbConvertTabsToSpaces.UseVisualStyleBackColor = true; + // + // cbShowMathBracket + // + this.cbShowMathBracket.AutoSize = true; + this.cbShowMathBracket.Location = new System.Drawing.Point(5, 83); + this.cbShowMathBracket.Name = "cbShowMathBracket"; + this.cbShowMathBracket.Size = new System.Drawing.Size(153, 17); + this.cbShowMathBracket.TabIndex = 25; + this.cbShowMathBracket.Text = "SHOW_MATH_BRACKET"; + this.cbShowMathBracket.UseVisualStyleBackColor = true; + // + // cbEditorFontSize + // + this.cbEditorFontSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbEditorFontSize.FormattingEnabled = true; + this.cbEditorFontSize.Location = new System.Drawing.Point(205, 21); + this.cbEditorFontSize.Name = "cbEditorFontSize"; + this.cbEditorFontSize.Size = new System.Drawing.Size(108, 21); + this.cbEditorFontSize.TabIndex = 24; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(204, 5); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(66, 13); + this.label3.TabIndex = 22; + this.label3.Text = "FONT_SIZE"; + // + // cbShowLinesNum + // + this.cbShowLinesNum.AutoSize = true; + this.cbShowLinesNum.Location = new System.Drawing.Point(5, 60); + this.cbShowLinesNum.Name = "cbShowLinesNum"; + this.cbShowLinesNum.Size = new System.Drawing.Size(128, 17); + this.cbShowLinesNum.TabIndex = 20; + this.cbShowLinesNum.Text = "SHOW_LINES_NUM"; + this.cbShowLinesNum.UseVisualStyleBackColor = true; + // + // cbEnableFolding + // + this.cbEnableFolding.AutoSize = true; + this.cbEnableFolding.Location = new System.Drawing.Point(5, 128); + this.cbEnableFolding.Name = "cbEnableFolding"; + this.cbEnableFolding.Size = new System.Drawing.Size(121, 17); + this.cbEnableFolding.TabIndex = 27; + this.cbEnableFolding.Text = "ENABLE_FOLDING"; + this.cbEnableFolding.UseVisualStyleBackColor = true; + // + // cbSkipStakTraceItemIfSourceFileInSystemDirectory + // + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.AutoSize = true; + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.Location = new System.Drawing.Point(5, 174); + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.Name = "cbSkipStakTraceItemIfSourceFileInSystemDirectory"; + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.Size = new System.Drawing.Size(265, 17); + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.TabIndex = 28; + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.Text = "GOTO_ERRORPOS_IN_STANDART_MODULES"; + this.cbSkipStakTraceItemIfSourceFileInSystemDirectory.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(5, 5); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(36, 13); + this.label1.TabIndex = 30; + this.label1.Text = "FONT"; + // + // cbEnableMatchOperBrackets + // + this.cbEnableMatchOperBrackets.AutoSize = true; + this.cbEnableMatchOperBrackets.Location = new System.Drawing.Point(5, 106); + this.cbEnableMatchOperBrackets.Name = "cbEnableMatchOperBrackets"; + this.cbEnableMatchOperBrackets.Size = new System.Drawing.Size(226, 17); + this.cbEnableMatchOperBrackets.TabIndex = 31; + this.cbEnableMatchOperBrackets.Text = "SHOW_MATCH_OPERATOR_BRACKET"; + this.cbEnableMatchOperBrackets.UseVisualStyleBackColor = true; + // + // fcbFont + // + this.fcbFont.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.fcbFont.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.fcbFont.FormattingEnabled = true; + this.fcbFont.IntegralHeight = false; + this.fcbFont.Location = new System.Drawing.Point(5, 21); + this.fcbFont.MaxDropDownItems = 20; + this.fcbFont.Name = "fcbFont"; + this.fcbFont.Size = new System.Drawing.Size(194, 21); + this.fcbFont.TabIndex = 29; + this.fcbFont.SelectedIndexChanged += new System.EventHandler(this.FcbFontSelectedIndexChanged); + // + // EditorOptionsContent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cbEnableMatchOperBrackets); + this.Controls.Add(this.label1); + this.Controls.Add(this.fcbFont); + this.Controls.Add(this.cbSkipStakTraceItemIfSourceFileInSystemDirectory); + this.Controls.Add(this.cbEnableFolding); + this.Controls.Add(this.nudTabIndent); + this.Controls.Add(this.cbConvertTabsToSpaces); + this.Controls.Add(this.cbShowMathBracket); + this.Controls.Add(this.cbEditorFontSize); + this.Controls.Add(this.label3); + this.Controls.Add(this.cbShowLinesNum); + this.Name = "EditorOptionsContent"; + this.Size = new System.Drawing.Size(323, 233); + this.Load += new System.EventHandler(this.EditorOptionsContentLoad); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.EditorOptionsContentPaint); + ((System.ComponentModel.ISupportInitialize)(this.nudTabIndent)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + private System.Windows.Forms.CheckBox cbEnableMatchOperBrackets; + private System.Windows.Forms.Label label1; + private VisualPascalABC.FontComboBox fcbFont; + + #endregion + + private System.Windows.Forms.NumericUpDown nudTabIndent; + private System.Windows.Forms.CheckBox cbConvertTabsToSpaces; + private System.Windows.Forms.CheckBox cbShowMathBracket; + private System.Windows.Forms.ComboBox cbEditorFontSize; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckBox cbShowLinesNum; + private System.Windows.Forms.CheckBox cbEnableFolding; + private System.Windows.Forms.CheckBox cbSkipStakTraceItemIfSourceFileInSystemDirectory; + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.cs b/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.cs new file mode 100644 index 000000000..64812aac0 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.cs @@ -0,0 +1,155 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using VisualPascalABCPlugins; + +namespace VisualPascalABC.OptionsContent +{ + public partial class EditorOptionsContent : UserControl,IOptionsContent + { + Form1 MainForm; + string strprefix = "VP_OC_EDITOROPTIONS_"; + public EditorOptionsContent(Form1 MainForm) + { + this.MainForm = MainForm; + InitializeComponent(); + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + cbEditorFontSize.Items.Add(8); + cbEditorFontSize.Items.Add(10); + cbEditorFontSize.Items.Add(12); + cbEditorFontSize.Items.Add(14); + cbEditorFontSize.Items.Add(16); + cbEditorFontSize.Items.Add(18); + cbEditorFontSize.Items.Add(20); + cbEditorFontSize.Items.Add(22); + cbEditorFontSize.Items.Add(24); + cbEditorFontSize.Items.Add(28); + cbEditorFontSize.Items.Add(32); + + } + /*private void AddcbErrorPosItem(SourceLocationAction sl, string Name) + { + ObjectLocalisator ol = new ObjectLocalisator(sl, Name); + cbErrorPos.Items.Add(ol); + if (MainForm.ErrorCursorPosStrategy == sl) + cbErrorPos.SelectedItem = ol; + }*/ + + private bool alreadyShown; + + #region IOptionsContent Members + + public string ContentName + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix + "NAME"); + } + } + public string Description + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix + "DESCRIPTION"); + } + } + + public UserControl Content + { + get { return this; } + } + + public void Action(OptionsContentAction action) + { + switch (action) + { + case OptionsContentAction.Show: + if (!alreadyShown) + { + cbShowLinesNum.Checked = MainForm.UserOptions.ShowLineNums; + cbEnableFolding.Checked = MainForm.UserOptions.EnableFolding; // SSM 4.09.08 + cbShowMathBracket.Checked = MainForm.UserOptions.ShowMathBraket; + cbConvertTabsToSpaces.Checked = MainForm.UserOptions.ConverTabsToSpaces; + cbEnableMatchOperBrackets.Checked = MainForm.UserOptions.HighlightOperatorBrackets; + nudTabIndent.Value = MainForm.UserOptions.TabIndent; + cbSkipStakTraceItemIfSourceFileInSystemDirectory.Checked = !MainForm.UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory; + //cbErrorPos.Items.Clear(); + //AddcbErrorPosItem(SourceLocationAction.GotoBeg, strprefix + "EP_BEGIN"); + //AddcbErrorPosItem(SourceLocationAction.GotoEnd, strprefix + "EP_END"); + //AddcbErrorPosItem(SourceLocationAction.SelectAndGotoBeg, strprefix + "EP_SELECTBEGIN"); + //AddcbErrorPosItem(SourceLocationAction.SelectAndGotoEnd, strprefix + "EP_SELECTEND"); + cbEditorFontSize.SelectedItem = null; + foreach (int size in cbEditorFontSize.Items) + if (size == MainForm.UserOptions.EditorFontSize) + { + cbEditorFontSize.SelectedItem = size; + break; + } + if (cbEditorFontSize.SelectedItem == null) + { + cbEditorFontSize.Items.Add(MainForm.UserOptions.EditorFontSize); + cbEditorFontSize.SelectedItem = MainForm.UserOptions.EditorFontSize; + } + /*if (MainForm.UserOptions.CurrentFontFamily != null) + { + MainForm.CurrentSyntaxEditor.TextEditor.Font = new Font(new FontFamily(MainForm.UserOptions.CurrentFontFamily),MainForm.CurrentSyntaxEditor.TextEditor.Font.Size); + }*/ + fcbFont.Populate(false, MainForm.CurrentSyntaxEditor.TextEditor.Font); + alreadyShown = true; + } + break; + + case OptionsContentAction.Ok: + MainForm.UserOptions.ConverTabsToSpaces = cbConvertTabsToSpaces.Checked; + MainForm.UserOptions.TabIndent = (int)nudTabIndent.Value; + MainForm.UserOptions.ShowLineNums = cbShowLinesNum.Checked; + MainForm.UserOptions.EnableFolding = cbEnableFolding.Checked; // SSM 4.09.08 + MainForm.UserOptions.ShowMathBraket = cbShowMathBracket.Checked; + MainForm.UserOptions.HighlightOperatorBrackets = cbEnableMatchOperBrackets.Checked; + MainForm.ErrorCursorPosStrategy = SourceLocationAction.GotoBeg;//(SourceLocationAction)(cbErrorPos.SelectedItem as ObjectLocalisator).Value; + if (fcbFont.SelectedItem != null) + { + MainForm.CurrentSyntaxEditor.TextEditor.Font = new Font(new FontFamily((string)fcbFont.SelectedItem),MainForm.CurrentSyntaxEditor.TextEditor.Font.Size); + MainForm.UserOptions.CurrentFontFamily = fcbFont.SelectedItem as string; + } + MainForm.UserOptions.EditorFontSize = Convert.ToInt32(cbEditorFontSize.Text); + MainForm.UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory = !cbSkipStakTraceItemIfSourceFileInSystemDirectory.Checked; + MainForm.UpdateUserOptions(); + WorkbenchServiceFactory.OptionsService.SaveOptions(); + alreadyShown = false; + break; + case OptionsContentAction.Cancel: + alreadyShown = false; + break; + } + + } + #endregion + + private void cbErrorPos_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + void EditorOptionsContentPaint(object sender, PaintEventArgs e) + { + + } + + void EditorOptionsContentLoad(object sender, EventArgs e) + { + + } + + void FcbFontSelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.resx b/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/EditorOptionsContent.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/OptionsContent/IOptionsContent.cs b/VisualPascalABCNETLinux/OptionsContent/IOptionsContent.cs new file mode 100644 index 000000000..edd46594c --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/IOptionsContent.cs @@ -0,0 +1,26 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC.OptionsContent +{ + public enum OptionsContentAction {Ok,Cancel,Show,Hide}; + public interface IOptionsContent + { + string ContentName + { + get; + } + string Description + { + get; + } + System.Windows.Forms.UserControl Content + { + get; + } + void Action(OptionsContentAction action); + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.Designer.cs b/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.Designer.cs new file mode 100644 index 000000000..f084c696a --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.Designer.cs @@ -0,0 +1,198 @@ +namespace VisualPascalABC.OptionsContent +{ + partial class IntelliseseOptionsContent + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.cbCodeCompletionKeyPressed = new System.Windows.Forms.CheckBox(); + this.label5 = new System.Windows.Forms.Label(); + this.nuNamespaceVisibleRange = new System.Windows.Forms.NumericUpDown(); + this.cbAllowCodeCompletion = new System.Windows.Forms.CheckBox(); + this.cbCodeCompletionParams = new System.Windows.Forms.CheckBox(); + this.cbCodeCompletionDot = new System.Windows.Forms.CheckBox(); + this.cbCodeCompletionHint = new System.Windows.Forms.CheckBox(); + this.cbIntellisencePanel = new System.Windows.Forms.CheckBox(); + this.cbUseSemanticIntellisense = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize)(this.nuNamespaceVisibleRange)).BeginInit(); + this.SuspendLayout(); + // + // cbCodeCompletionKeyPressed + // + this.cbCodeCompletionKeyPressed.AutoSize = true; + this.cbCodeCompletionKeyPressed.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbCodeCompletionKeyPressed.Checked = true; + this.cbCodeCompletionKeyPressed.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbCodeCompletionKeyPressed.Location = new System.Drawing.Point(17, 89); + this.cbCodeCompletionKeyPressed.Name = "cbCodeCompletionKeyPressed"; + this.cbCodeCompletionKeyPressed.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbCodeCompletionKeyPressed.Size = new System.Drawing.Size(210, 17); + this.cbCodeCompletionKeyPressed.TabIndex = 38; + this.cbCodeCompletionKeyPressed.Text = "CODE_COMPLETION_KEYPRESSED"; + this.cbCodeCompletionKeyPressed.UseVisualStyleBackColor = true; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(68, 138); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(163, 13); + this.label5.TabIndex = 37; + this.label5.Text = "NAMESPACE_VISIBLE_RANGE"; + // + // nuNamespaceVisibleRange + // + this.nuNamespaceVisibleRange.Location = new System.Drawing.Point(17, 134); + this.nuNamespaceVisibleRange.Maximum = new decimal(new int[] { + 32, + 0, + 0, + 0}); + this.nuNamespaceVisibleRange.Name = "nuNamespaceVisibleRange"; + this.nuNamespaceVisibleRange.Size = new System.Drawing.Size(48, 20); + this.nuNamespaceVisibleRange.TabIndex = 36; + this.nuNamespaceVisibleRange.Value = new decimal(new int[] { + 3, + 0, + 0, + 0}); + // + // cbAllowCodeCompletion + // + this.cbAllowCodeCompletion.AutoSize = true; + this.cbAllowCodeCompletion.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbAllowCodeCompletion.Checked = true; + this.cbAllowCodeCompletion.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbAllowCodeCompletion.Location = new System.Drawing.Point(5, 5); + this.cbAllowCodeCompletion.Name = "cbAllowCodeCompletion"; + this.cbAllowCodeCompletion.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbAllowCodeCompletion.Size = new System.Drawing.Size(176, 17); + this.cbAllowCodeCompletion.TabIndex = 35; + this.cbAllowCodeCompletion.Text = "ALLOW_CODE_COMPLETION"; + this.cbAllowCodeCompletion.UseVisualStyleBackColor = true; + this.cbAllowCodeCompletion.CheckedChanged += new System.EventHandler(this.cbAllowCodeCompletion_CheckedChanged); + // + // cbCodeCompletionParams + // + this.cbCodeCompletionParams.AutoSize = true; + this.cbCodeCompletionParams.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbCodeCompletionParams.Checked = true; + this.cbCodeCompletionParams.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbCodeCompletionParams.Location = new System.Drawing.Point(17, 68); + this.cbCodeCompletionParams.Name = "cbCodeCompletionParams"; + this.cbCodeCompletionParams.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbCodeCompletionParams.Size = new System.Drawing.Size(183, 17); + this.cbCodeCompletionParams.TabIndex = 34; + this.cbCodeCompletionParams.Text = "CODE_COMPLETION_PARAMS"; + this.cbCodeCompletionParams.UseVisualStyleBackColor = true; + // + // cbCodeCompletionDot + // + this.cbCodeCompletionDot.AutoSize = true; + this.cbCodeCompletionDot.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbCodeCompletionDot.Checked = true; + this.cbCodeCompletionDot.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbCodeCompletionDot.Location = new System.Drawing.Point(17, 47); + this.cbCodeCompletionDot.Name = "cbCodeCompletionDot"; + this.cbCodeCompletionDot.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbCodeCompletionDot.Size = new System.Drawing.Size(161, 17); + this.cbCodeCompletionDot.TabIndex = 33; + this.cbCodeCompletionDot.Text = "CODE_COMPLETION_DOT"; + this.cbCodeCompletionDot.UseVisualStyleBackColor = true; + // + // cbCodeCompletionHint + // + this.cbCodeCompletionHint.AutoSize = true; + this.cbCodeCompletionHint.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbCodeCompletionHint.Checked = true; + this.cbCodeCompletionHint.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbCodeCompletionHint.Location = new System.Drawing.Point(17, 26); + this.cbCodeCompletionHint.Name = "cbCodeCompletionHint"; + this.cbCodeCompletionHint.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbCodeCompletionHint.Size = new System.Drawing.Size(164, 17); + this.cbCodeCompletionHint.TabIndex = 32; + this.cbCodeCompletionHint.Text = "CODE_COMPLETION_HINT"; + this.cbCodeCompletionHint.UseVisualStyleBackColor = true; + // + // cbIntellisencePanel + // + this.cbIntellisencePanel.AutoSize = true; + this.cbIntellisencePanel.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbIntellisencePanel.Checked = true; + this.cbIntellisencePanel.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbIntellisencePanel.Location = new System.Drawing.Point(17, 110); + this.cbIntellisencePanel.Name = "cbIntellisencePanel"; + this.cbIntellisencePanel.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbIntellisencePanel.Size = new System.Drawing.Size(183, 17); + this.cbIntellisencePanel.TabIndex = 39; + this.cbIntellisencePanel.Text = "SHOW_INTELLISENCE_PANEL"; + this.cbIntellisencePanel.UseVisualStyleBackColor = true; + // + // cbUseSemanticIntellisense + // + this.cbUseSemanticIntellisense.AutoSize = true; + this.cbUseSemanticIntellisense.Location = new System.Drawing.Point(17, 161); + this.cbUseSemanticIntellisense.Name = "cbUseSemanticIntellisense"; + this.cbUseSemanticIntellisense.Size = new System.Drawing.Size(191, 17); + this.cbUseSemanticIntellisense.TabIndex = 40; + this.cbUseSemanticIntellisense.Text = "USE_SEMANTIC_INTELLISENSE"; + this.cbUseSemanticIntellisense.UseVisualStyleBackColor = true; + this.cbUseSemanticIntellisense.CheckedChanged += new System.EventHandler(this.cbUseSemanticIntellisense_CheckedChanged); + // + // IntelliseseOptionsContent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cbUseSemanticIntellisense); + this.Controls.Add(this.cbIntellisencePanel); + this.Controls.Add(this.cbCodeCompletionKeyPressed); + this.Controls.Add(this.label5); + this.Controls.Add(this.nuNamespaceVisibleRange); + this.Controls.Add(this.cbAllowCodeCompletion); + this.Controls.Add(this.cbCodeCompletionParams); + this.Controls.Add(this.cbCodeCompletionDot); + this.Controls.Add(this.cbCodeCompletionHint); + this.Name = "IntelliseseOptionsContent"; + this.Size = new System.Drawing.Size(526, 211); + ((System.ComponentModel.ISupportInitialize)(this.nuNamespaceVisibleRange)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox cbCodeCompletionKeyPressed; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.NumericUpDown nuNamespaceVisibleRange; + private System.Windows.Forms.CheckBox cbAllowCodeCompletion; + private System.Windows.Forms.CheckBox cbCodeCompletionParams; + private System.Windows.Forms.CheckBox cbCodeCompletionDot; + private System.Windows.Forms.CheckBox cbCodeCompletionHint; + private System.Windows.Forms.CheckBox cbIntellisencePanel; + private System.Windows.Forms.CheckBox cbUseSemanticIntellisense; + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.cs b/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.cs new file mode 100644 index 000000000..86dea0f48 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.cs @@ -0,0 +1,98 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC.OptionsContent +{ + public partial class IntelliseseOptionsContent : UserControl, IOptionsContent + { + Form1 MainForm; + string strprefix = "VP_OC_INTELLISENSEOPTIONS_"; + public IntelliseseOptionsContent(Form1 MainForm) + { + this.MainForm = MainForm; + InitializeComponent(); + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + } + + private bool alreadyShown; + + #region IOptionsContent Members + + public string ContentName + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix+"NAME"); + } + } + public string Description + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix+"DESCRIPTION"); + } + } + + public UserControl Content + { + get { return this; } + } + + public void Action(OptionsContentAction action) + { + switch (action) + { + case OptionsContentAction.Show: + if (!alreadyShown) + { + cbAllowCodeCompletion.Checked = MainForm.UserOptions.AllowCodeCompletion; + cbCodeCompletionDot.Checked = MainForm.UserOptions.CodeCompletionDot; + cbCodeCompletionHint.Checked = MainForm.UserOptions.CodeCompletionHint; + cbCodeCompletionParams.Checked = MainForm.UserOptions.CodeCompletionParams; + cbCodeCompletionKeyPressed.Checked = MainForm.UserOptions.EnableSmartIntellisense; + nuNamespaceVisibleRange.Value = MainForm.UserOptions.CodeCompletionNamespaceVisibleRange; + cbIntellisencePanel.Checked = MainForm.UserOptions.ShowQuickClassBrowserPanel; + cbUseSemanticIntellisense.Checked = MainForm.UserOptions.UseSemanticIntellisense; + alreadyShown = true; + } + break; + case OptionsContentAction.Ok: + MainForm.UserOptions.CodeCompletionDot = cbCodeCompletionDot.Checked; + MainForm.UserOptions.CodeCompletionHint = cbCodeCompletionHint.Checked; + MainForm.UserOptions.CodeCompletionParams = cbCodeCompletionParams.Checked; + MainForm.UserOptions.AllowCodeCompletion = cbAllowCodeCompletion.Checked; + MainForm.UserOptions.EnableSmartIntellisense = cbCodeCompletionKeyPressed.Checked; + MainForm.UserOptions.CodeCompletionNamespaceVisibleRange = Convert.ToInt32(nuNamespaceVisibleRange.Value); + MainForm.UserOptions.ShowQuickClassBrowserPanel = cbIntellisencePanel.Checked; + MainForm.UserOptions.UseSemanticIntellisense = cbUseSemanticIntellisense.Checked; + MainForm.UpdateUserOptions(); + alreadyShown = false; + WorkbenchServiceFactory.OptionsService.SaveOptions(); + break; + case OptionsContentAction.Cancel: + alreadyShown = false; + break; + } + + } + #endregion + + private void cbAllowCodeCompletion_CheckedChanged(object sender, EventArgs e) + { + cbIntellisencePanel.Checked = cbUseSemanticIntellisense.Checked = cbCodeCompletionKeyPressed.Checked = cbCodeCompletionDot.Checked = cbCodeCompletionHint.Checked = cbCodeCompletionParams.Checked = cbAllowCodeCompletion.Checked; + cbIntellisencePanel.Enabled = cbUseSemanticIntellisense.Enabled = cbCodeCompletionKeyPressed.Enabled = nuNamespaceVisibleRange.Enabled = cbCodeCompletionDot.Enabled = cbCodeCompletionHint.Enabled = cbCodeCompletionParams.Enabled = cbAllowCodeCompletion.Checked; + } + + private void cbUseSemanticIntellisense_CheckedChanged(object sender, EventArgs e) + { + CodeCompletion.DomSyntaxTreeVisitor.use_semantic_for_intellisense = cbUseSemanticIntellisense.Checked; + } + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.resx b/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.resx new file mode 100644 index 000000000..d58980a38 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/IntelliseseOptionsContent.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/OptionsContent/OptionsContentEngine.cs b/VisualPascalABCNETLinux/OptionsContent/OptionsContentEngine.cs new file mode 100644 index 000000000..8a22442a3 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/OptionsContentEngine.cs @@ -0,0 +1,60 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC.OptionsContent +{ + public class OptionsContentEngine + { + List contentList = new List(); + List showedContent = new List(); + public List ContentList + { + get + { + return contentList; + } + } + OptionsForm optionsWindow; + Form ownerForm; + public OptionsContentEngine(Form ownerForm) + { + this.ownerForm = ownerForm; + } + public void AddContent(IOptionsContent content) + { + contentList.Add(content); + } + public void ShowDialog() + { + if (optionsWindow == null) + { + optionsWindow = new OptionsForm(this); + optionsWindow.Owner = ownerForm; + } + optionsWindow.ShowDialog(); + } + public void UpdateOptionsForm() + { + if (optionsWindow != null) + optionsWindow.UpdateOptionsForm(); + } + internal void Action(IOptionsContent content, OptionsContentAction action) + { + content.Action(action); + if (action == OptionsContentAction.Show) + showedContent.Add(content); + } + internal void Action(OptionsContentAction action) + { + foreach (IOptionsContent c in showedContent) + c.Action(action); + if (action == OptionsContentAction.Ok || action == OptionsContentAction.Cancel) + showedContent.Clear(); + } + + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/OptionsForm.Designer.cs b/VisualPascalABCNETLinux/OptionsContent/OptionsForm.Designer.cs new file mode 100644 index 000000000..bdb16c768 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/OptionsForm.Designer.cs @@ -0,0 +1,130 @@ +namespace VisualPascalABC.OptionsContent +{ + partial class OptionsForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm)); + this.tvContentList = new System.Windows.Forms.TreeView(); + this.btCancel = new System.Windows.Forms.Button(); + this.btOk = new System.Windows.Forms.Button(); + this.contentContainer = new System.Windows.Forms.GroupBox(); + this.contentPanel = new System.Windows.Forms.Panel(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.contentContainer.SuspendLayout(); + this.SuspendLayout(); + // + // tvContentList + // + this.tvContentList.Location = new System.Drawing.Point(16, 15); + this.tvContentList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tvContentList.Name = "tvContentList"; + this.tvContentList.Size = new System.Drawing.Size(236, 334); + this.tvContentList.TabIndex = 0; + this.tvContentList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvContentList_AfterSelect); + // + // btCancel + // + this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btCancel.Location = new System.Drawing.Point(684, 357); + this.btCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(125, 28); + this.btCancel.TabIndex = 9; + this.btCancel.Text = "!CANCEL"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // + // btOk + // + this.btOk.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btOk.Location = new System.Drawing.Point(547, 357); + this.btOk.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btOk.Name = "btOk"; + this.btOk.Size = new System.Drawing.Size(125, 28); + this.btOk.TabIndex = 8; + this.btOk.Text = "!OK"; + this.btOk.UseVisualStyleBackColor = true; + this.btOk.Click += new System.EventHandler(this.btOk_Click); + // + // contentContainer + // + this.contentContainer.Controls.Add(this.contentPanel); + this.contentContainer.Location = new System.Drawing.Point(261, 15); + this.contentContainer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.contentContainer.Name = "contentContainer"; + this.contentContainer.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.contentContainer.Size = new System.Drawing.Size(548, 335); + this.contentContainer.TabIndex = 11; + this.contentContainer.TabStop = false; + // + // contentPanel + // + this.contentPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.contentPanel.Location = new System.Drawing.Point(4, 19); + this.contentPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.contentPanel.Name = "contentPanel"; + this.contentPanel.Size = new System.Drawing.Size(540, 312); + this.contentPanel.TabIndex = 0; + // + // OptionsForm + // + this.AcceptButton = this.btOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btCancel; + this.ClientSize = new System.Drawing.Size(823, 396); + this.Controls.Add(this.contentContainer); + this.Controls.Add(this.btCancel); + this.Controls.Add(this.btOk); + this.Controls.Add(this.tvContentList); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "OptionsForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FORMTEXT"; + this.Shown += new System.EventHandler(this.OptionsForm_Shown); + this.contentContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView tvContentList; + private System.Windows.Forms.Button btCancel; + private System.Windows.Forms.Button btOk; + private System.Windows.Forms.GroupBox contentContainer; + private System.Windows.Forms.Panel contentPanel; + private System.Windows.Forms.ToolTip toolTip1; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/OptionsContent/OptionsForm.cs b/VisualPascalABCNETLinux/OptionsContent/OptionsForm.cs new file mode 100644 index 000000000..41b896cff --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/OptionsForm.cs @@ -0,0 +1,87 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC.OptionsContent +{ + public partial class OptionsForm : Form + { + OptionsContentEngine contentEngine; + TreeNode lastSelectedNode = null; + Dictionary nodes = new Dictionary(); + string strprefix = "VP_OPTIONSFORM_"; + public OptionsForm(OptionsContentEngine contentEngine) + { + var sl = 50; + this.contentEngine = contentEngine; + InitializeComponent(); + foreach (IOptionsContent content in contentEngine.ContentList) + { + TreeNode tn = new TreeNode(content.ContentName); + tvContentList.Nodes.Add(tn); + nodes.Add(tn, content); + } + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + } + + private void btOk_Click(object sender, EventArgs e) + { + contentEngine.Action(OptionsContentAction.Ok); + Close(); + } + + private void OptionsForm_Shown(object sender, EventArgs e) + { + if (tvContentList.Nodes.Count > 0) + { + tvContentList.SelectedNode = tvContentList.Nodes[0]; + lastSelectedNode = tvContentList.SelectedNode; + } + } + + public void UpdateOptionsForm() + { + int i = 0; + foreach (IOptionsContent content in contentEngine.ContentList) + { + tvContentList.Nodes[i].Text = content.ContentName; + i++; + } + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + } + + private void tvContentList_AfterSelect(object sender, TreeViewEventArgs e) + { + IOptionsContent cont; + cont = nodes[e.Node]; + contentEngine.Action(cont, OptionsContentAction.Show); + contentPanel.Controls.Add(cont.Content); + contentContainer.Text = cont.Description; + cont.Content.Show(); + + if (lastSelectedNode != null && e.Node != lastSelectedNode) + { + cont = nodes[lastSelectedNode]; + contentEngine.Action(cont, OptionsContentAction.Hide); + contentPanel.Controls.Remove(cont.Content); + cont.Content.Hide(); + } + + + lastSelectedNode = e.Node; + } + + private void btCancel_Click(object sender, EventArgs e) + { + contentEngine.Action(OptionsContentAction.Cancel); + Close(); + } + + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/OptionsForm.resx b/VisualPascalABCNETLinux/OptionsContent/OptionsForm.resx new file mode 100644 index 000000000..06eb09bd6 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/OptionsForm.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAIAB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CYkP/w6OD/4ODg/+DY0P/AqKD/AAAAAAAAAAAAAAAAAAAAAAAA + AADQuLD/sJiQ/wAAAAAAAAAAAAAAANrc3P+woJD/8Pjw//Dw8P/AsKD/AAAAAAAAAAAAAAAAAAAAAAAA + AACwoJD/sKCQ/wAAAAAAAAAAAAAAAMm/vP/AqKD/4NjQ/9DAwP/QwLD/AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANDIwP/QwMD/0MjA/9DIwP/GvLn/AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAI/nAACHxwAAg48AAMEfAADgPwAA8H8AAPh5AADwOAAAgwEAAAcDAABngwAA5wcAAM4P + AAD8HwAA//8AAA== + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.Designer.cs b/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.Designer.cs new file mode 100644 index 000000000..b45fb2d01 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.Designer.cs @@ -0,0 +1,164 @@ +namespace VisualPascalABC.OptionsContent +{ + partial class ViewOptionsContent + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.cbSaveFilesIfComilationOk = new System.Windows.Forms.CheckBox(); + this.cbPauseInRunModeIfConsole = new System.Windows.Forms.CheckBox(); + this.cbShowDebugPlayPauseButtons = new System.Windows.Forms.CheckBox(); + this.cbErrorsStrategy = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.languageSelect = new System.Windows.Forms.ComboBox(); + this.cbAutoInsertCodeIsEnabledOnStartup = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // cbSaveFilesIfComilationOk + // + this.cbSaveFilesIfComilationOk.AutoSize = true; + this.cbSaveFilesIfComilationOk.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbSaveFilesIfComilationOk.Checked = true; + this.cbSaveFilesIfComilationOk.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbSaveFilesIfComilationOk.Location = new System.Drawing.Point(7, 128); + this.cbSaveFilesIfComilationOk.Name = "cbSaveFilesIfComilationOk"; + this.cbSaveFilesIfComilationOk.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbSaveFilesIfComilationOk.Size = new System.Drawing.Size(204, 17); + this.cbSaveFilesIfComilationOk.TabIndex = 25; + this.cbSaveFilesIfComilationOk.Text = "SAVE_FILES_IF_COMPILATOIN_OK"; + this.cbSaveFilesIfComilationOk.UseVisualStyleBackColor = true; + // + // cbPauseInRunModeIfConsole + // + this.cbPauseInRunModeIfConsole.AutoSize = true; + this.cbPauseInRunModeIfConsole.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbPauseInRunModeIfConsole.Checked = true; + this.cbPauseInRunModeIfConsole.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbPauseInRunModeIfConsole.Location = new System.Drawing.Point(7, 105); + this.cbPauseInRunModeIfConsole.Name = "cbPauseInRunModeIfConsole"; + this.cbPauseInRunModeIfConsole.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbPauseInRunModeIfConsole.Size = new System.Drawing.Size(220, 17); + this.cbPauseInRunModeIfConsole.TabIndex = 24; + this.cbPauseInRunModeIfConsole.Text = "PASUSE_IN_RUNMODE_IF_CONSOLE"; + this.cbPauseInRunModeIfConsole.UseVisualStyleBackColor = true; + // + // cbShowDebugPlayPauseButtons + // + this.cbShowDebugPlayPauseButtons.AutoSize = true; + this.cbShowDebugPlayPauseButtons.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cbShowDebugPlayPauseButtons.Checked = true; + this.cbShowDebugPlayPauseButtons.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbShowDebugPlayPauseButtons.Location = new System.Drawing.Point(7, 174); + this.cbShowDebugPlayPauseButtons.Name = "cbShowDebugPlayPauseButtons"; + this.cbShowDebugPlayPauseButtons.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cbShowDebugPlayPauseButtons.Size = new System.Drawing.Size(237, 17); + this.cbShowDebugPlayPauseButtons.TabIndex = 23; + this.cbShowDebugPlayPauseButtons.Text = "SHOW_DEBUG_PLAY_PAUSE_BUTTONS"; + this.cbShowDebugPlayPauseButtons.UseVisualStyleBackColor = true; + this.cbShowDebugPlayPauseButtons.Visible = false; + this.cbShowDebugPlayPauseButtons.CheckedChanged += new System.EventHandler(this.cbShowDebugPlayPauseButtons_CheckedChanged); + // + // cbErrorsStrategy + // + this.cbErrorsStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbErrorsStrategy.FormattingEnabled = true; + this.cbErrorsStrategy.Location = new System.Drawing.Point(7, 66); + this.cbErrorsStrategy.Name = "cbErrorsStrategy"; + this.cbErrorsStrategy.Size = new System.Drawing.Size(284, 21); + this.cbErrorsStrategy.TabIndex = 21; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(4, 50); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(117, 13); + this.label2.TabIndex = 20; + this.label2.Text = "ERRORS_STRATEGY"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(5, 5); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(66, 13); + this.label1.TabIndex = 19; + this.label1.Text = "LANGUAGE"; + // + // languageSelect + // + this.languageSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.languageSelect.FormattingEnabled = true; + this.languageSelect.Location = new System.Drawing.Point(7, 21); + this.languageSelect.Name = "languageSelect"; + this.languageSelect.Size = new System.Drawing.Size(195, 21); + this.languageSelect.TabIndex = 18; + this.languageSelect.SelectedIndexChanged += new System.EventHandler(this.languageSelect_SelectedIndexChanged); + // + // cbAutoInsertCodeIsEnabledOnStartup + // + this.cbAutoInsertCodeIsEnabledOnStartup.AutoSize = true; + this.cbAutoInsertCodeIsEnabledOnStartup.Checked = true; + this.cbAutoInsertCodeIsEnabledOnStartup.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbAutoInsertCodeIsEnabledOnStartup.Location = new System.Drawing.Point(7, 151); + this.cbAutoInsertCodeIsEnabledOnStartup.Name = "cbAutoInsertCodeIsEnabledOnStartup"; + this.cbAutoInsertCodeIsEnabledOnStartup.Size = new System.Drawing.Size(353, 17); + this.cbAutoInsertCodeIsEnabledOnStartup.TabIndex = 26; + this.cbAutoInsertCodeIsEnabledOnStartup.Text = "AUTO_INSERT_CODE_IS_ENABLED_ON_STARTUP"; + this.cbAutoInsertCodeIsEnabledOnStartup.UseVisualStyleBackColor = true; + // + // ViewOptionsContent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cbAutoInsertCodeIsEnabledOnStartup); + this.Controls.Add(this.cbSaveFilesIfComilationOk); + this.Controls.Add(this.cbPauseInRunModeIfConsole); + this.Controls.Add(this.cbShowDebugPlayPauseButtons); + this.Controls.Add(this.cbErrorsStrategy); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.languageSelect); + this.Name = "ViewOptionsContent"; + this.Size = new System.Drawing.Size(495, 246); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox cbSaveFilesIfComilationOk; + private System.Windows.Forms.CheckBox cbPauseInRunModeIfConsole; + private System.Windows.Forms.CheckBox cbShowDebugPlayPauseButtons; + private System.Windows.Forms.ComboBox cbErrorsStrategy; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox languageSelect; + private System.Windows.Forms.CheckBox cbAutoInsertCodeIsEnabledOnStartup; + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.cs b/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.cs new file mode 100644 index 000000000..7ce4cf6de --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.cs @@ -0,0 +1,152 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using VisualPascalABCPlugins; +using PascalABCCompiler.Errors; + +namespace VisualPascalABC.OptionsContent +{ + public partial class ViewOptionsContent : UserControl,IOptionsContent + { + Form1 MainForm; + string strprefix = "VP_OC_VIEWOPTIONS_"; + public ViewOptionsContent(Form1 MainForm) + { + this.MainForm = MainForm; + InitializeComponent(); + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + foreach (string lng in PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages) + { + languageSelect.Items.Add(lng); + } + if (PascalABCCompiler.StringResourcesLanguage.AccessibleLanguages.Count == 0) + languageSelect.Enabled = false; + } + + private bool alreadyShown; + #region IOptionsContent Members + + public string ContentName + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix + "NAME"); + } + } + public string Description + { + get + { + return PascalABCCompiler.StringResources.Get(strprefix + "DESCRIPTION"); + } + } + + public UserControl Content + { + get { return this; } + } + + public void Action(OptionsContentAction action) + { + switch (action) + { + case OptionsContentAction.Show: + if (!alreadyShown) + { + languageSelect.SelectedItem = PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName; + cbSaveFilesIfComilationOk.Checked = MainForm.UserOptions.SaveSourceFilesIfComilationOk; + cbPauseInRunModeIfConsole.Checked = MainForm.UserOptions.PauseInRunModeIfConsole; + cbAutoInsertCodeIsEnabledOnStartup.Checked = MainForm.UserOptions.AutoInsertCodeIsEnabledOnStartup; + addErrorStrategyComboBox(); + + cbShowDebugPlayPauseButtons.Checked = MainForm.PlayPauseButtonsVisibleInPanel; + alreadyShown = true; + } + break; + case OptionsContentAction.Ok: + UserOptions UsOpt = MainForm.UserOptions; + UsOpt.SaveSourceFilesIfComilationOk = cbSaveFilesIfComilationOk.Checked; + UsOpt.AutoInsertCodeIsEnabledOnStartup = cbAutoInsertCodeIsEnabledOnStartup.Checked; + MainForm.ErrorsManager.Strategy = (ErrorsStrategy)cbErrorsStrategy.Items.IndexOf(cbErrorsStrategy.SelectedItem); + switch (cbErrorsStrategy.Items.IndexOf(cbErrorsStrategy.SelectedItem)) + { + case 0: + MainForm.ErrorsManager.Strategy = ErrorsStrategy.FirstOnly; + break; + case 1: + MainForm.ErrorsManager.Strategy = ErrorsStrategy.FirstSemanticAndSyntax; + break; + } + /*switch (cbErrorsStrategy.Items.IndexOf(cbErrorsStrategy.SelectedItem)) + { + case 0: + MainForm.ErrorsManager.Strategy = ErrorsStrategy.All; + break; + case 1: + MainForm.ErrorsManager.Strategy = ErrorsStrategy.FirstOnly; + break; + case 2: + MainForm.ErrorsManager.Strategy = ErrorsStrategy.FirstSemanticAndSyntax; + break; + } + */ + UsOpt.PauseInRunModeIfConsole = cbPauseInRunModeIfConsole.Checked; + MainForm.UpdateUserOptions(); + MainForm.PlayPauseButtonsVisibleInPanel = cbShowDebugPlayPauseButtons.Checked; + alreadyShown = false; + WorkbenchServiceFactory.OptionsService.SaveOptions(); + //this.Enabled = true; + break; + case OptionsContentAction.Cancel: + alreadyShown = false; + break; + } + + } + #endregion + + private void addErrorStrategyComboBox() + { + cbErrorsStrategy.Items.Clear(); + //cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_ALL")); + cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_FIRSTONLY")); + cbErrorsStrategy.Items.Add(PascalABCCompiler.StringResources.Get(strprefix + "ES_FIRSTSEMANTICANDSYNTAX")); + switch (MainForm.ErrorsManager.Strategy) + { + /*case ErrorsStrategy.All: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; + break;*/ + case ErrorsStrategy.FirstOnly: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[0]; + break; + case ErrorsStrategy.FirstSemanticAndSyntax: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; + break; + default: + cbErrorsStrategy.SelectedItem = cbErrorsStrategy.Items[1]; + break; + } + } + + private void languageSelect_SelectedIndexChanged(object sender, EventArgs e) + { + PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = (string)languageSelect.SelectedItem; + CodeCompletionParserController.CurrentTwoLetterISO = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + PascalABCCompiler.StringResources.SetTextForAllObjects(this, strprefix); + addErrorStrategyComboBox(); + MainForm.UpdateOptionsForm(); + } + + private void cbShowDebugPlayPauseButtons_CheckedChanged(object sender, EventArgs e) + { + MainForm.PlayPauseButtonsVisibleInPanel = cbShowDebugPlayPauseButtons.Checked; + } + + } +} diff --git a/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.resx b/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/VisualPascalABCNETLinux/OptionsContent/ViewOptionsContent.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Program.cs b/VisualPascalABCNETLinux/Program.cs new file mode 100644 index 000000000..d9c2a907d --- /dev/null +++ b/VisualPascalABCNETLinux/Program.cs @@ -0,0 +1,120 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace VisualPascalABC +{ + struct COPYDATASTRUCT + { + public IntPtr dwData; + public uint cbData; + public string lpData; + } + + static class VisualPascalABCProgram + { + /// + /// The main entry point for the application. + /// + public static string[] CommandLineArgs; + public static Form1 MainForm; + public static Process CurrentProcess; + + [System.Runtime.InteropServices.DllImport("user32.dll")] + private static extern bool SetProcessDPIAware(); + + [DllImport("User32.dll")] + static extern IntPtr SetForegroundWindow(IntPtr hWnd); + [DllImport("User32.dll")] + static extern IntPtr ShowWindow(IntPtr hWnd, int nCmdShow); + [DllImport("User32.dll")] + static extern int SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, IntPtr lParam); + [DllImport("User32.dll")] + static extern int IsZoomed(IntPtr hWnd); + [DllImport("User32.dll")] + static extern int IsIconic(IntPtr hWnd); + + [STAThread] + static void Main(string[] args) + { + try + { + Process cur_proc = Process.GetCurrentProcess(); + CurrentProcess = cur_proc; + Process[] p = Process.GetProcessesByName(cur_proc.ProcessName); + IntPtr handle = IntPtr.Zero; + if (p.Length > 1) + { + for (int i = 0; i < p.Length; i++) + if (string.Compare(System.IO.Path.GetDirectoryName(p[i].MainModule.FileName), System.IO.Path.GetDirectoryName(cur_proc.MainModule.FileName), true) == 0 && p[i].Id != cur_proc.Id) + { + handle = p[i].MainWindowHandle; + /*if (handle == IntPtr.Zero) + { + System.Threading.Thread.Sleep(5000); + p[i].Refresh(); + if (!p[i].HasExited) + handle = p[i].MainWindowHandle; + }*/ + if (handle != IntPtr.Zero) + { + SetForegroundWindow(handle); + if (IsZoomed(handle) != 0) + ShowWindow(handle, 3/*SW_MAXIMIZE*/); + else + if (IsIconic(handle) != 0) + ShowWindow(handle, 9/*SW_RESTORE*/); + else + ShowWindow(handle, 5/*SW_SHOW*/); + if (args.Length > 0) + { + //for (int j = 0; j < args.Length; j++) + { + COPYDATASTRUCT ds = new COPYDATASTRUCT(); + IntPtr str_ptr = System.Runtime.InteropServices.Marshal.StringToHGlobalUni(args[0]); + ds.dwData = (IntPtr)32;//flag, zadaem sami, chtoby process znal, kakoe eto konkretno soobshenie + ds.cbData = (uint)(args[0].Length + 1); + ds.lpData = args[0];//str_ptr; + IntPtr ds_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(ds)); + Marshal.StructureToPtr(ds, ds_ptr, false); + SendMessage(handle, 74/*WM_COPYDATA*/, cur_proc.Handle, ds_ptr); + } + } + return; + } + return; + + } + } + } + catch + { + + } + try + { + + if (Environment.OSVersion.Version.Major >= 6) SetProcessDPIAware(); + CommandLineArgs = args; + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + MainForm = new Form1(); + Application.Run(MainForm); + } + catch (Exception e) + { + // ! - ! + MessageBox.Show(e.ToString()); + } + } + } + + public class MyForm : Form + { + + } +} diff --git a/VisualPascalABCNETLinux/Projects/FusionNative.cs b/VisualPascalABCNETLinux/Projects/FusionNative.cs new file mode 100644 index 000000000..0abbcd77a --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/FusionNative.cs @@ -0,0 +1,270 @@ +using System; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Text; + +namespace MSjogren.GacTool.FusionNative +{ + [ComImport(), Guid("E707DCDE-D1CD-11D2-BAB9-00C04F8ECEAE"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IAssemblyCache + { + [PreserveSig()] + int UninstallAssembly(uint dwFlags, + [MarshalAs(UnmanagedType.LPWStr)] string pszAssemblyName, + IntPtr pvReserved, + out uint pulDisposition); + + [PreserveSig()] + int QueryAssemblyInfo(uint dwFlags, + [MarshalAs(UnmanagedType.LPWStr)] string pszAssemblyName, + IntPtr pAsmInfo); + + [PreserveSig()] + int CreateAssemblyCacheItem(uint dwFlags, + IntPtr pvReserved, + out IAssemblyCacheItem ppAsmItem, + [MarshalAs(UnmanagedType.LPWStr)] string pszAssemblyName); + + [PreserveSig()] + int CreateAssemblyScavenger(out object ppAsmScavenger); + + [PreserveSig()] + int InstallAssembly(uint dwFlags, + [MarshalAs(UnmanagedType.LPWStr)] string pszManifestFilePath, + IntPtr pvReserved); + } + + [ComImport(), Guid("9E3AAEB4-D1CD-11D2-BAB9-00C04F8ECEAE"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IAssemblyCacheItem + { + void CreateStream([MarshalAs(UnmanagedType.LPWStr)] string pszName, + uint dwFormat, + uint dwFlags, + uint dwMaxSize, + out IStream ppStream); + + void IsNameEqual(IAssemblyName pName); + + void Commit(uint dwFlags); + + void MarkAssemblyVisible(uint dwFlags); + } + + [ComImport(), Guid("CD193BC0-B4BC-11D2-9833-00C04FC31D2E"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IAssemblyName + { + // + // Assembly name properties + // 0 = PublicKey, byte[]* ; ??? + // 1 = PublicKeyToken, byte[8]* + // 3 = Assembly Name, LPWSTR + // 4 = Major Version, ushort* + // 5 = Minor Version, ushort* + // 6 = Build Number, ushort* + // 7 = Revison Number, ushort* + // 8 = Culture, LPWSTR + // 9 = Processor Type, ??? ; ??? + // 10 = OS Type, ??? ; ??? + // 13 = Codebase, LPWSTR + // 14 = Modified Date, FILETIME* ; Only for Downloaded assemblies ? + // 17 = Custom, LPWSTR ; ZAP string, only for NGEN assemblies + // 19 = MVID, byte[16]* ; MVID value from __AssemblyInfo__.ini - what's this? + // + [PreserveSig()] + int Set(uint PropertyId, + IntPtr pvProperty, + uint cbProperty); + + [PreserveSig()] + int Get(uint PropertyId, + IntPtr pvProperty, + ref uint pcbProperty); + + [PreserveSig()] + int Finalize(); + + [PreserveSig()] + int GetDisplayName([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder szDisplayName, + ref uint pccDisplayName, + uint dwDisplayFlags); + + [PreserveSig()] + int BindToObject(object refIID, + object pAsmBindSink, + IApplicationContext pApplicationContext, + [MarshalAs(UnmanagedType.LPWStr)] string szCodeBase, + long llFlags, + int pvReserved, + uint cbReserved, + out int ppv); + + [PreserveSig()] + int GetName(ref uint lpcwBuffer, + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwzName); + + [PreserveSig()] + int GetVersion(out uint pdwVersionHi, + out uint pdwVersionLow); + + [PreserveSig()] + int IsEqual(IAssemblyName pName, + uint dwCmpFlags); + + [PreserveSig()] + int Clone(out IAssemblyName pName); + } + + [ComImport(), Guid("7C23FF90-33AF-11D3-95DA-00A024A85B51"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IApplicationContext + { + void SetContextNameObject(IAssemblyName pName); + + void GetContextNameObject(out IAssemblyName ppName); + + void Set([MarshalAs(UnmanagedType.LPWStr)] string szName, + int pvValue, + uint cbValue, + uint dwFlags); + + void Get([MarshalAs(UnmanagedType.LPWStr)] string szName, + out int pvValue, + ref uint pcbValue, + uint dwFlags); + + void GetDynamicDirectory(out int wzDynamicDir, + ref uint pdwSize); + } + + [ComImport(), Guid("21B8916C-F28E-11D2-A473-00C04F8EF448"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IAssemblyEnum + { + [PreserveSig()] + int GetNextAssembly(out IApplicationContext ppAppCtx, + out IAssemblyName ppName, + uint dwFlags); + + [PreserveSig()] + int Reset(); + + [PreserveSig()] + int Clone(out IAssemblyEnum ppEnum); + } + + + [ComImport(), Guid("1D23DF4D-A1E2-4B8B-93D6-6EA3DC285A54"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IHistoryReader + { + [PreserveSig()] + int GetFilePath([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder wzFilePath, + ref uint pdwSize); + + [PreserveSig()] + int GetApplicationName([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder wzAppName, + ref uint pdwSize); + + [PreserveSig()] + int GetEXEModulePath([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder wzExePath, + ref uint pdwSize); + + void GetNumActivations(out uint pdwNumActivations); + + void GetActivationDate(uint dwIdx, // One-based! + out long /* FILETIME */ pftDate); + + [PreserveSig()] + int GetRunTimeVersion(ref long /* FILETIME */ pftActivationDate, + [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder wzRunTimeVersion, + ref uint pdwSize); + + void GetNumAssemblies(ref long /* FILETIME */ pftActivationDate, + out uint pdwNumAsms); + + void GetHistoryAssembly(ref long /* FILETIME */ pftActivationDate, + uint dwIdx, // One-based! + [MarshalAs(UnmanagedType.IUnknown)] out object ppHistAsm); + + } + + internal class Fusion + { + [DllImport("fusion.dll", CharSet=CharSet.Auto)] + internal static extern int CreateAssemblyCache(out IAssemblyCache ppAsmCache, + uint dwReserved); + + + // + // dwFlags: 1 = Enumerate native image (NGEN) assemblies + // 2 = Enumerate GAC assemblies + // 4 = Enumerate Downloaded assemblies ??? + // + [DllImport("fusion.dll", CharSet=CharSet.Auto)] + internal static extern int CreateAssemblyEnum(out IAssemblyEnum ppEnum, + IApplicationContext pAppCtx, + IAssemblyName pName, + uint dwFlags, + int pvReserved); + + [DllImport("fusion.dll", CharSet=CharSet.Auto)] + internal static extern int CreateAssemblyNameObject(out IAssemblyName ppName, + string szAssemblyName, + uint dwFlags, + int pvReserved); + + [DllImport("fusion.dll", CharSet=CharSet.Auto)] + internal static extern int CreateHistoryReader(string wzFilePath, + out IHistoryReader ppHistReader); + + // Retrieves the path of the ApplicationHistory folder, typically + // Documents and Settings\\Local Settings\Application Data\ApplicationHistory + // containing .ini files that can be read with IHistoryReader. + // pwdSize appears to be the offset of the last backslash in the returned + // string after the call. + // Returns S_OK on success, error HRESULT on failure. + // + [DllImport("fusion.dll", CharSet=CharSet.Unicode)] + internal static extern int GetHistoryFileDirectory([MarshalAs(UnmanagedType.LPWStr)] StringBuilder wzDir, + ref uint pdwSize); + + [DllImport("fusion.dll")] + internal static extern int NukeDownloadedCache(); + + // ????? + [DllImport("fusion.dll")] + internal static extern int CreateApplicationContext(out IApplicationContext ppAppContext, + uint dw); + + [DllImport("fusion.dll")] + internal static extern int GetCachePath(uint flags, + [MarshalAs(UnmanagedType.LPWStr)] StringBuilder wzDir, + ref uint pdwSize); + + public static string GetGacPath() + { + const int size = 260; + StringBuilder b = new StringBuilder(size); + uint tmp = size; + GetCachePath(8, b, ref tmp); // flag 8 = GAC_ROOT_PATH + return b.ToString(); + } + + // _InstallCustomAssembly@16 + // _InstallCustomModule@8 + // _LookupHistoryAssembly@28 + // _PreBindAssembly@20 + // _CreateInstallReferenceEnum@16 + + + // + // Brings up the .NET Applicaion Restore wizard + // Returns S_OK, 0x80131075 (App not run) or 0x80131087 (Fix failed) + // + [DllImport("shfusion.dll", CharSet=CharSet.Unicode)] + internal static extern uint PolicyManager(IntPtr hWndParent, + string pwzFullyQualifiedAppPath, + string pwzAppName, + int dwFlags); + + } +} + + diff --git a/VisualPascalABCNETLinux/Projects/GacInterop.cs b/VisualPascalABCNETLinux/Projects/GacInterop.cs new file mode 100644 index 000000000..452c33966 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/GacInterop.cs @@ -0,0 +1,202 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +using MSjogren.GacTool.FusionNative; + +namespace VisualPascalABC +{ + /// + /// Class with static members to access the content of the global assembly + /// cache. + /// + public static class GacInterop + { + static string cachedGacPath; + + public static string GacRootPath { + get { + if (cachedGacPath == null) { + cachedGacPath = Fusion.GetGacPath(); + } + return cachedGacPath; + } + } + + public sealed class AssemblyListEntry + { + public readonly string FullName; + public readonly string Name; + public readonly string Version; + + internal AssemblyListEntry(string fullName) + { + this.FullName = fullName; + string[] info = fullName.Split(','); + this.Name = info[0]; + this.Version = info[1].Substring(info[1].LastIndexOf('=') + 1); + } + } + + public static List GetAssemblyList() + { + IApplicationContext applicationContext = null; + IAssemblyEnum assemblyEnum = null; + IAssemblyName assemblyName = null; + + List l = new List(); + Fusion.CreateAssemblyEnum(out assemblyEnum, null, null, 2, 0); + while (assemblyEnum.GetNextAssembly(out applicationContext, out assemblyName, 0) == 0) { + uint nChars = 0; + assemblyName.GetDisplayName(null, ref nChars, 0); + + StringBuilder sb = new StringBuilder((int)nChars); + assemblyName.GetDisplayName(sb, ref nChars, 0); + + l.Add(new AssemblyListEntry(sb.ToString())); + } + return l; + } + + /// + /// Gets the full display name of the GAC assembly of the specified short name + /// + public static GacAssemblyName FindBestMatchingAssemblyName(string name) + { + return FindBestMatchingAssemblyName(new GacAssemblyName(name)); + } + + public static GacAssemblyName FindBestMatchingAssemblyName(GacAssemblyName name) + { + string[] info; + string version = name.Version; + string publicKey = name.PublicKey; + + IApplicationContext applicationContext = null; + IAssemblyEnum assemblyEnum = null; + IAssemblyName assemblyName; + Fusion.CreateAssemblyNameObject(out assemblyName, name.Name, 0, 0); + Fusion.CreateAssemblyEnum(out assemblyEnum, null, assemblyName, 2, 0); + List names = new List(); + + while (assemblyEnum.GetNextAssembly(out applicationContext, out assemblyName, 0) == 0) { + uint nChars = 0; + assemblyName.GetDisplayName(null, ref nChars, 0); + + StringBuilder sb = new StringBuilder((int)nChars); + assemblyName.GetDisplayName(sb, ref nChars, 0); + + string fullName = sb.ToString(); + if (publicKey != null) { + info = fullName.Split(','); + if (publicKey != info[3].Substring(info[3].LastIndexOf('=') + 1)) { + // Assembly has wrong public key + continue; + } + } + names.Add(fullName); + } + if (names.Count == 0) + return null; + string best = null; + Version bestVersion = null; + Version currentVersion; + if (version != null) { + // use assembly with lowest version higher or equal to required version + Version requiredVersion = new Version(version); + for (int i = 0; i < names.Count; i++) { + info = names[i].Split(','); + currentVersion = new Version(info[1].Substring(info[1].LastIndexOf('=') + 1)); + if (currentVersion.CompareTo(requiredVersion) < 0) + continue; // version not good enough + if (best == null || currentVersion.CompareTo(bestVersion) < 0) { + bestVersion = currentVersion; + best = names[i]; + } + } + if (best != null) + return new GacAssemblyName(best); + } + // use assembly with highest version + best = names[0]; + info = names[0].Split(','); + bestVersion = new Version(info[1].Substring(info[1].LastIndexOf('=') + 1)); + for (int i = 1; i < names.Count; i++) { + info = names[i].Split(','); + currentVersion = new Version(info[1].Substring(info[1].LastIndexOf('=') + 1)); + if (currentVersion.CompareTo(bestVersion) > 0) { + bestVersion = currentVersion; + best = names[i]; + } + } + return new GacAssemblyName(best); + } + } + + public class GacAssemblyName : IEquatable + { + readonly string fullName; + readonly string[] info; + + public GacAssemblyName(string fullName) + { + if (fullName == null) + throw new ArgumentNullException("fullName"); + this.fullName = fullName; + info = fullName.Split(','); + } + + public string Name { + get { + return info[0]; + } + } + + public string Version { + get { + return (info.Length > 1) ? info[1].Substring(info[1].LastIndexOf('=') + 1) : null; + } + } + + public string PublicKey { + get { + return (info.Length > 3) ? info[3].Substring(info[3].LastIndexOf('=') + 1) : null; + } + } + + public string FullName { + get { return fullName; } + } + + + + public override string ToString() + { + return fullName; + } + + public bool Equals(GacAssemblyName other) + { + if (other == null) + return false; + else + return fullName == other.fullName; + } + + public override bool Equals(object obj) + { + return Equals(obj as GacAssemblyName); + } + + public override int GetHashCode() + { + return fullName.GetHashCode(); + } + } + +} + diff --git a/VisualPascalABCNETLinux/Projects/NewFileForm.Designer.cs b/VisualPascalABCNETLinux/Projects/NewFileForm.Designer.cs new file mode 100644 index 000000000..3c161796e --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NewFileForm.Designer.cs @@ -0,0 +1,147 @@ + +namespace VisualPascalABC +{ + partial class NewFileForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("PRJ_UNIT", 0); + System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("PRJ_FORM", 1); + System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("PRJ_NAMESPACE", 0); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewFileForm)); + this.lvTemplates = new System.Windows.Forms.ListView(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.tbFileName = new System.Windows.Forms.TextBox(); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lvTemplates + // + this.lvTemplates.HideSelection = false; + this.lvTemplates.HoverSelection = true; + listViewItem1.Tag = "0"; + listViewItem2.Tag = "1"; + listViewItem3.Tag = "2"; + this.lvTemplates.Items.AddRange(new System.Windows.Forms.ListViewItem[] { + listViewItem1, + listViewItem2, + listViewItem3}); + this.lvTemplates.LargeImageList = this.imageList1; + this.lvTemplates.Location = new System.Drawing.Point(1, 30); + this.lvTemplates.Name = "lvTemplates"; + this.lvTemplates.Size = new System.Drawing.Size(372, 196); + this.lvTemplates.TabIndex = 0; + this.lvTemplates.UseCompatibleStateImageBehavior = false; + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + this.imageList1.Images.SetKeyName(0, "Icons.32x32.Unit.png"); + this.imageList1.Images.SetKeyName(1, "Icons.32x32.Form.png"); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(1, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 23); + this.label1.TabIndex = 1; + this.label1.Text = "PRJ_TEMPLATES"; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(1, 241); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(100, 23); + this.label2.TabIndex = 2; + this.label2.Text = "PRJ_FILE_NAME"; + // + // tbFileName + // + this.tbFileName.Location = new System.Drawing.Point(86, 241); + this.tbFileName.Name = "tbFileName"; + this.tbFileName.Size = new System.Drawing.Size(287, 20); + this.tbFileName.TabIndex = 3; + // + // btnAdd + // + this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnAdd.Location = new System.Drawing.Point(183, 280); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.Size = new System.Drawing.Size(95, 23); + this.btnAdd.TabIndex = 4; + this.btnAdd.Text = "RF_OK"; + this.btnAdd.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(292, 280); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(81, 23); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // NewFileForm + // + this.AcceptButton = this.btnAdd; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(385, 315); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnAdd); + this.Controls.Add(this.tbFileName); + this.Controls.Add(this.lvTemplates); + this.Controls.Add(this.label1); + this.Controls.Add(this.label2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NewFileForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PRJ_NEW_FILE"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NewFileFormFormClosing); + this.ResumeLayout(false); + this.PerformLayout(); + + } + private System.Windows.Forms.ListView lvTemplates; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.TextBox tbFileName; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + } +} diff --git a/VisualPascalABCNETLinux/Projects/NewFileForm.cs b/VisualPascalABCNETLinux/Projects/NewFileForm.cs new file mode 100644 index 000000000..54238c5ca --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NewFileForm.cs @@ -0,0 +1,129 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Drawing; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public enum FileType { Unit, Namespace, Form} + + /// + /// Description of NewFileForm. + /// + public partial class NewFileForm : Form + { + public NewFileForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + foreach (ListViewItem li in lvTemplates.Items) + { + if ((string)li.Tag == "0" || (string)li.Tag == "2") + source_items.Add(li); + else + forms_items.Add(li); + } + } + + private List source_items = new List(); + private List forms_items = new List(); + + public string FileName + { + get + { + return tbFileName.Text; + } + set + { + tbFileName.Text = value; + } + } + + void NewFileFormFormClosing(object sender, FormClosingEventArgs e) + { + if (this.DialogResult == DialogResult.Cancel) + return; + try + { + if (lvTemplates.SelectedItems.Count == 0) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("FILE_TEMPLATE_NOT_SELECTED"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (string.IsNullOrEmpty(tbFileName.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("FILE_NAME_EMPTY"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (File.Exists(Path.Combine(ProjectFactory.Instance.ProjectDirectory,tbFileName.Text))) + { + e.Cancel = true; + MessageBox.Show(string.Format(Form1StringResources.Get("FILE_ALREADY_EXISTS{0}"), tbFileName.Text), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + FileInfo fi = new FileInfo(tbFileName.Text); + } + catch(PathTooLongException ex) + { + e.Cancel = true; + MessageBox.Show(string.Format(Form1StringResources.Get("TOO_LONG_FILE_NAME{0}"), tbFileName.Text), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + catch(ArgumentException ex) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("ERROR_IN_PATH"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + catch(Exception ex) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("ERROR_IN_FILE_CREATION"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + public void SetUnitFilter() + { + lvTemplates.Items.Clear(); + foreach (ListViewItem li in source_items) + lvTemplates.Items.Add(li); + lvTemplates.Items[0].Selected = true; + } + + public void SetWinFormsFilter() + { + lvTemplates.Items.Clear(); + foreach (ListViewItem li in forms_items) + lvTemplates.Items.Add(li); + lvTemplates.Items[0].Selected = true; + } + + public FileType GetFileFilter() + { + if ((string)lvTemplates.SelectedItems[0].Tag == "0") + return FileType.Unit; + else if ((string)lvTemplates.SelectedItems[0].Tag == "2") + return FileType.Namespace; + return FileType.Form; + } + + public Button CancelButtonCommon + { + get + { + return btnCancel; + } + } + } +} diff --git a/VisualPascalABCNETLinux/Projects/NewFileForm.resx b/VisualPascalABCNETLinux/Projects/NewFileForm.resx new file mode 100644 index 000000000..280f50551 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NewFileForm.resx @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACm + DAAAAk1TRnQBSQFMAgEBAgEAARQBAAEUAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm +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 + CLQCzwG0Ac8OrQGGRgAB7wP/AbUBBAHxBP8BAgNPAZgB/wGRAbwB7wG1AWwB7wcAAdYBCQjcBNYF1Qi0 + AYZGAAHvEP8BkQHxAbwBbAHvCAAB1gEJCNwE1gXVCLQBhkYAAbUQ/wGRAfQBrgHvCQAG1ga0Ac8PrUYA + AbUJ/wX0AvMB7QGuAQdsAAHvA7UC7wO1B/cC7QEH6QABQgFNAT4HAAE+AwABKAMAAYADAAEgAwABAQEA + AQEGAAECFgAD/wEACP8IAAHwAgABHwT/CAAB8AIAAR8E/wgAAfACAAEfAcACAAEDCAAB8AIAAR8BwAIA + AQMIAAHwAgABHwHAAgABAwgAAfACAAEfAcACAAEDCAAB8AIAAR8BwAIAAQMIAAHwAgABHwHAAgABAwgA + AfACAAEfAcACAAEDCAAB8AIAAR8BwAIAAQMIAAHwAgABHwHAAgABAwgAAfACAAEfAcACAAEDCAAB8AIA + AR8BwAIAAQMIAAHwAgABHwHAAgABAwgAAfACAAEfAcACAAEDCAAB8AIAAR8BwAIAAQMIAAHwAgABHwHA + AgABAwgAAfACAAEfAcACAAEDCAAB8AIAAR8BwAIAAQMIAAHwAgABHwHAAgABAwgAAfACAAEfAcACAAED + CAAB8AIAAR8BwAIAAQMIAAHwAgABHwHAAgABAwgAAfACAAEfAcACAAEDCAAB8AIAAR8BwAIAAQMIAAHw + AgABHwHAAgABAwgAAfACAAE/AcACAAEDCAAB8AIAAX8BwAIAAQMIAAHwAgAF/wgAAfABAAEBBf8IAAj/ + CAAL + + + + 67 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Projects/NewProject.Designer.cs b/VisualPascalABCNETLinux/Projects/NewProject.Designer.cs new file mode 100644 index 000000000..ac79f11ff --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NewProject.Designer.cs @@ -0,0 +1,185 @@ + +namespace VisualPascalABC +{ + partial class NewProjectForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("PRJ_WINFORMS_APP", 1); + System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("PRJ_CONSOLE_APP", 2); + System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("PRJ_CLASS_LIBRARY", 3); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewProjectForm)); + this.lvTemplates = new System.Windows.Forms.ListView(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.label1 = new System.Windows.Forms.Label(); + this.tbProjectName = new System.Windows.Forms.TextBox(); + this.tbProjectDir = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnProjectDirSelect = new System.Windows.Forms.Button(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.SuspendLayout(); + // + // lvTemplates + // + this.lvTemplates.HideSelection = false; + listViewItem1.StateImageIndex = 0; + this.lvTemplates.Items.AddRange(new System.Windows.Forms.ListViewItem[] { + listViewItem1, + listViewItem2, + listViewItem3}); + this.lvTemplates.LargeImageList = this.imageList1; + this.lvTemplates.Location = new System.Drawing.Point(1, 39); + this.lvTemplates.MultiSelect = false; + this.lvTemplates.Name = "lvTemplates"; + this.lvTemplates.Size = new System.Drawing.Size(425, 222); + this.lvTemplates.TabIndex = 0; + this.lvTemplates.UseCompatibleStateImageBehavior = false; + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + this.imageList1.Images.SetKeyName(0, "pas.ico"); + this.imageList1.Images.SetKeyName(1, "Icons.32x32.PABCProject.WinForms.png"); + this.imageList1.Images.SetKeyName(2, "Icons.32x32.PABCProject.ConsoleSimple.png"); + this.imageList1.Images.SetKeyName(3, "Icons.32x32.PABCProject.Library.png"); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(1, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(137, 23); + this.label1.TabIndex = 2; + this.label1.Text = "PRJ_PROJECT_TYPES"; + // + // tbProjectName + // + this.tbProjectName.Location = new System.Drawing.Point(114, 288); + this.tbProjectName.Name = "tbProjectName"; + this.tbProjectName.Size = new System.Drawing.Size(312, 20); + this.tbProjectName.TabIndex = 1; + this.tbProjectName.TextChanged += new System.EventHandler(this.TbProjectNameTextChanged); + // + // tbProjectDir + // + this.tbProjectDir.Location = new System.Drawing.Point(114, 314); + this.tbProjectDir.Name = "tbProjectDir"; + this.tbProjectDir.Size = new System.Drawing.Size(280, 20); + this.tbProjectDir.TabIndex = 2; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(12, 288); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(96, 23); + this.label2.TabIndex = 5; + this.label2.Text = "PRJ_PROJECT_NAME"; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(12, 314); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(96, 23); + this.label3.TabIndex = 6; + this.label3.Text = "PRJ_PROJECT_DIR"; + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(243, 346); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(82, 23); + this.btnOk.TabIndex = 7; + this.btnOk.Text = "RF_OK"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.BtnOkClick); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(346, 346); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(80, 23); + this.btnCancel.TabIndex = 8; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnProjectDirSelect + // + this.btnProjectDirSelect.Location = new System.Drawing.Point(402, 314); + this.btnProjectDirSelect.Name = "btnProjectDirSelect"; + this.btnProjectDirSelect.Size = new System.Drawing.Size(24, 20); + this.btnProjectDirSelect.TabIndex = 9; + this.btnProjectDirSelect.Text = "..."; + this.btnProjectDirSelect.UseVisualStyleBackColor = true; + this.btnProjectDirSelect.Click += new System.EventHandler(this.BtnProjectDirSelectClick); + // + // NewProjectForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(434, 381); + this.Controls.Add(this.btnProjectDirSelect); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.label3); + this.Controls.Add(this.tbProjectDir); + this.Controls.Add(this.tbProjectName); + this.Controls.Add(this.label1); + this.Controls.Add(this.lvTemplates); + this.Controls.Add(this.label2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NewProjectForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PRJ_NEW_PROJECT"; + this.Activated += new System.EventHandler(this.NewProjectFormActivated); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NewProjectFormFormClosing); + this.ResumeLayout(false); + this.PerformLayout(); + } + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private System.Windows.Forms.Button btnProjectDirSelect; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox tbProjectDir; + private System.Windows.Forms.TextBox tbProjectName; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ListView lvTemplates; + } +} diff --git a/VisualPascalABCNETLinux/Projects/NewProject.cs b/VisualPascalABCNETLinux/Projects/NewProject.cs new file mode 100644 index 000000000..73745fed2 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NewProject.cs @@ -0,0 +1,167 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Drawing; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + /// + /// Description of NewProject. + /// + public partial class NewProjectForm : Form + { + public NewProjectForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + // + // TODO: Add constructor code after the InitializeComponent() call. + // + tbProjectName.Text = InstNewProjectName(); + if (!string.IsNullOrEmpty(tbProjectName.Text)) + tbProjectDir.Text = currentDirectory+ Path.DirectorySeparatorChar+tbProjectName.Text; + this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer; + } + + private string currentDirectory = Constants.DefaultWorkingDirectory; + + public string ProjectName + { + get + { + return tbProjectName.Text; + } + } + + public PascalABCCompiler.ProjectType ProjectType + { + get + { + if (this.lvTemplates.SelectedIndices.Count == 0) + return PascalABCCompiler.ProjectType.WindowsApp; + switch (this.lvTemplates.SelectedIndices[0]) + { + case 0 : return PascalABCCompiler.ProjectType.WindowsApp; + case 1 : return PascalABCCompiler.ProjectType.ConsoleApp; + case 2 : return PascalABCCompiler.ProjectType.Library; + } + return PascalABCCompiler.ProjectType.WindowsApp; + } + } + + public string ProjectFileName + { + get + { + return System.IO.Path.Combine(tbProjectDir.Text,ProjectName+".pabcproj"); + } + } + + private string InstNewProjectName() + { + string[] dirs = Directory.GetDirectories(currentDirectory,"Project?*"); + List lst = new List(); + for (int i=0; i 0) + return "Project"+(lst[lst.Count-1]+1).ToString(); + else + return "Project1"; + } + + void TbProjectNameTextChanged(object sender, EventArgs e) + { + tbProjectDir.Text = currentDirectory+Path.DirectorySeparatorChar+tbProjectName.Text; + } + + void NewProjectFormActivated(object sender, EventArgs e) + { + //this.lvTemplates.Select(); + + } + + void BtnOkClick(object sender, EventArgs e) + { + // TODO: Implement BtnOkClick + } + + void NewProjectFormFormClosing(object sender, FormClosingEventArgs e) + { + if (this.DialogResult == DialogResult.Cancel) + return; + try + { + if (this.lvTemplates.SelectedItems.Count == 0) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("PROJECT_TEMPLATE_NOT_SELECTED"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (string.IsNullOrEmpty(tbProjectDir.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("PROJECT_DIRECTORY_EMPTY"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (string.IsNullOrEmpty(tbProjectName.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("PROJECT_NAME_EMPTY"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (Directory.Exists(tbProjectDir.Text)) + { + e.Cancel = true; + MessageBox.Show(string.Format(Form1StringResources.Get("DIRECTORY_ALREADY_EXISTS{0}"), tbProjectDir.Text), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + FileInfo fi = new FileInfo(Path.Combine(tbProjectDir.Text,tbProjectName.Text)); + } + catch(PathTooLongException ex) + { + e.Cancel = true; + MessageBox.Show(string.Format(Form1StringResources.Get("TOO_LONG_FILE_NAME{0}"), Path.Combine(tbProjectDir.Text,tbProjectName.Text)), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + catch(ArgumentException ex) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("ERROR_IN_PATH"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + catch(Exception ex) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("ERROR_IN_PROJECT_CREATION"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + void BtnProjectDirSelectClick(object sender, EventArgs e) + { + if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) + { + tbProjectDir.Text = folderBrowserDialog1.SelectedPath; + currentDirectory = folderBrowserDialog1.SelectedPath; + if (!string.IsNullOrEmpty(tbProjectName.Text)) + tbProjectDir.Text += Path.DirectorySeparatorChar+tbProjectName.Text; + } + } + } +} diff --git a/VisualPascalABCNETLinux/Projects/NewProject.resx b/VisualPascalABCNETLinux/Projects/NewProject.resx new file mode 100644 index 000000000..db9afb7b6 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NewProject.resx @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWws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AX8B/wF/Af8BfwH/AX8B/wF/Af8BfwH/AX8B/wF/Af8BfwH/AX8BEAFAwAABEAFAARABQAEQAUABEAFA + ARABQAEQAUABEAFAARABQAEQAUABEAFAARABQAEQAUABEAFAARABQAEQAUABEAFAARABQAEQAUABEAFA + ARABQAEQAUABEAFAARABQAEQAUABEAFAARABQAEQAUABEAFAARABQAEQAUABEAFAARABQMAAAUIBTQE+ + BwABPgMAASgDAAGAAwABQAMAAQEBAAEBBgABBBYAA///AP8ABwAM/wQADP8EAAz/BAAM/wQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAABwAIAAQMBwAIAAQMBwAIAAQMEAAHAAgABAwHAAgABAwHAAgABAwQAAcACAAED + AcACAAEDAcACAAEDBAAM/wQADP8EAAz/Cw== + + + + 123, 17 + + + 45 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Projects/NuGetTasks.cs b/VisualPascalABCNETLinux/Projects/NuGetTasks.cs new file mode 100644 index 000000000..8f8b67c14 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/NuGetTasks.cs @@ -0,0 +1,86 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace VisualPascalABC +{ + delegate void NugetPackageInstallHandler(bool result, string[] dlls, string[] xmls); + delegate void NugetPackageOutputHandler(string output); + + class NuGetTasks + { + public static void InstallPackage(string packageId, string workingDir, NugetPackageInstallHandler finishAction, NugetPackageOutputHandler outputAction) + { + string dir = Path.Combine(workingDir, "nuget"); + dir = Path.Combine(dir, packageId); + Directory.CreateDirectory(dir); + Process nugetProcess = new Process(); + nugetProcess.StartInfo.FileName = Path.Combine(PascalABCCompiler.Tools.GetExecutablePath(), "nuget.exe"); + nugetProcess.StartInfo.UseShellExecute = false; + nugetProcess.StartInfo.Arguments = "install "+packageId+ " -NonInteractive"; + nugetProcess.StartInfo.CreateNoWindow = true; + nugetProcess.StartInfo.RedirectStandardOutput = true; + nugetProcess.StartInfo.RedirectStandardError = true; + nugetProcess.StartInfo.WorkingDirectory = dir; + nugetProcess.EnableRaisingEvents = true; + nugetProcess.StartInfo.StandardOutputEncoding = System.Text.Encoding.UTF8; + nugetProcess.Exited += new EventHandler(delegate (object o, EventArgs a) { + string[] dlls; + string[] xmls; + bool result = getPackage(dir, out dlls, out xmls); + finishAction(result, dlls, xmls); + }); + nugetProcess.Start(); + nugetProcess.WaitForExit(); + } + + static bool getPackage(string workingDir, out string[] dlls, out string[] xmls) + { + dlls = null; + xmls = null; + List dllList = new List(); + List xmlList = new List(); + bool result = false; + foreach (string dir in Directory.EnumerateDirectories(workingDir)) + { + string libDir = Path.Combine(dir, "lib"); + if (Directory.Exists(libDir)) + { + string dotnetDir = Path.Combine(libDir, "net40"); + if (!Directory.Exists(dotnetDir)) + dotnetDir = Path.Combine(libDir, "net45"); + if (!Directory.Exists(dotnetDir)) + dotnetDir = Path.Combine(libDir, "net46"); + if (!Directory.Exists(dotnetDir)) + dotnetDir = Path.Combine(libDir, "net"); + if (!Directory.Exists(dotnetDir)) + dotnetDir = libDir; + if (Directory.Exists(dotnetDir)) + { + string[] dllFiles = Directory.GetFiles(dotnetDir, "*.dll"); + if (dllFiles.Length > 0) + { + dllList.AddRange(dllFiles); + dlls = dllFiles; + string[] xmlFiles = Directory.GetFiles(dotnetDir, "*.xml"); + if (xmlFiles.Length > 0) + xmlList.AddRange(xmlFiles); + result = true; + } + } + } + } + dlls = dllList.ToArray(); + xmls = xmlList.ToArray(); + return result; + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Projects/ProjectExplorer.Designer.cs b/VisualPascalABCNETLinux/Projects/ProjectExplorer.Designer.cs new file mode 100644 index 000000000..bb8774124 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectExplorer.Designer.cs @@ -0,0 +1,311 @@ + +namespace VisualPascalABC +{ + partial class ProjectExplorerForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectExplorerForm)); + this.tvProjectExplorer = new System.Windows.Forms.TreeView(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.AddReferenceMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.pRJADDREFERENCEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SouceFileMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.pRJOPENToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJVIEWCODEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJEXCLUDEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJRENAMEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ProjectMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.pRJBUILDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJBUILDALLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJRUNToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.pRJToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJNEWFILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJEXISTFILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJFORMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pRJToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.pRJPROPERTIESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ReferenceMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.pRJREMOVEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.imageList2 = new System.Windows.Forms.ImageList(this.components); + this.AddReferenceMenuStrip.SuspendLayout(); + this.SouceFileMenuStrip.SuspendLayout(); + this.ProjectMenuStrip.SuspendLayout(); + this.ReferenceMenuStrip.SuspendLayout(); + this.SuspendLayout(); + // + // tvProjectExplorer + // + this.tvProjectExplorer.Dock = System.Windows.Forms.DockStyle.Fill; + this.tvProjectExplorer.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tvProjectExplorer.ImageIndex = 0; + this.tvProjectExplorer.ImageList = this.imageList1; + this.tvProjectExplorer.Location = new System.Drawing.Point(0, 0); + this.tvProjectExplorer.Name = "tvProjectExplorer"; + this.tvProjectExplorer.SelectedImageIndex = 0; + this.tvProjectExplorer.Size = new System.Drawing.Size(209, 332); + this.tvProjectExplorer.StateImageList = this.imageList1; + this.tvProjectExplorer.TabIndex = 0; + this.tvProjectExplorer.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.TvProjectExplorerBeforeSelect); + this.tvProjectExplorer.DoubleClick += new System.EventHandler(this.TvProjectExplorerDoubleClick); + this.tvProjectExplorer.MouseClick += new System.Windows.Forms.MouseEventHandler(this.TvProjectExplorerMouseClick); + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + this.imageList1.Images.SetKeyName(0, "ProjectBrowser.ReferenceFolder.Closed.png"); + this.imageList1.Images.SetKeyName(1, "ProjectBrowser.ReferenceFolder.Open.png"); + this.imageList1.Images.SetKeyName(2, "Icons.16x16.Project.png"); + this.imageList1.Images.SetKeyName(3, "Icons.16x16.Reference.png"); + this.imageList1.Images.SetKeyName(4, "pabcfile.png"); + this.imageList1.Images.SetKeyName(5, "Icons.16x16.Form.png"); + // + // AddReferenceMenuStrip + // + this.AddReferenceMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.pRJADDREFERENCEToolStripMenuItem}); + this.AddReferenceMenuStrip.Name = "AddReferenceMenuStrip"; + this.AddReferenceMenuStrip.Size = new System.Drawing.Size(188, 26); + // + // pRJADDREFERENCEToolStripMenuItem + // + this.pRJADDREFERENCEToolStripMenuItem.Name = "pRJADDREFERENCEToolStripMenuItem"; + this.pRJADDREFERENCEToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.pRJADDREFERENCEToolStripMenuItem.Text = "PRJ_ADD_REFERENCE"; + this.pRJADDREFERENCEToolStripMenuItem.Click += new System.EventHandler(this.PRJADDREFERENCEToolStripMenuItemClick); + // + // SouceFileMenuStrip + // + this.SouceFileMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.pRJOPENToolStripMenuItem, + this.pRJToolStripMenuItem, + this.pRJVIEWCODEToolStripMenuItem, + this.pRJEXCLUDEToolStripMenuItem, + this.pRJRENAMEToolStripMenuItem}); + this.SouceFileMenuStrip.Name = "SouceFileMenuStrip"; + this.SouceFileMenuStrip.Size = new System.Drawing.Size(171, 114); + // + // pRJOPENToolStripMenuItem + // + this.pRJOPENToolStripMenuItem.Name = "pRJOPENToolStripMenuItem"; + this.pRJOPENToolStripMenuItem.Size = new System.Drawing.Size(170, 22); + this.pRJOPENToolStripMenuItem.Text = "PRJ_OPEN_FILE"; + this.pRJOPENToolStripMenuItem.Click += new System.EventHandler(this.pRJOPENToolStripMenuItem_Click); + // + // pRJToolStripMenuItem + // + this.pRJToolStripMenuItem.Name = "pRJToolStripMenuItem"; + this.pRJToolStripMenuItem.Size = new System.Drawing.Size(170, 22); + this.pRJToolStripMenuItem.Text = "PRJ_SHOW_FORM"; + this.pRJToolStripMenuItem.Visible = false; + this.pRJToolStripMenuItem.Click += new System.EventHandler(this.pRJToolStripMenuItem_Click); + // + // pRJVIEWCODEToolStripMenuItem + // + this.pRJVIEWCODEToolStripMenuItem.Name = "pRJVIEWCODEToolStripMenuItem"; + this.pRJVIEWCODEToolStripMenuItem.Size = new System.Drawing.Size(170, 22); + this.pRJVIEWCODEToolStripMenuItem.Text = "PRJ_VIEW_CODE"; + this.pRJVIEWCODEToolStripMenuItem.Click += new System.EventHandler(this.pRJVIEWCODEToolStripMenuItem_Click); + // + // pRJEXCLUDEToolStripMenuItem + // + this.pRJEXCLUDEToolStripMenuItem.Name = "pRJEXCLUDEToolStripMenuItem"; + this.pRJEXCLUDEToolStripMenuItem.Size = new System.Drawing.Size(170, 22); + this.pRJEXCLUDEToolStripMenuItem.Text = "PRJ_EXCLUDE"; + this.pRJEXCLUDEToolStripMenuItem.Click += new System.EventHandler(this.pRJEXCLUDEToolStripMenuItem_Click); + // + // pRJRENAMEToolStripMenuItem + // + this.pRJRENAMEToolStripMenuItem.Name = "pRJRENAMEToolStripMenuItem"; + this.pRJRENAMEToolStripMenuItem.Size = new System.Drawing.Size(170, 22); + this.pRJRENAMEToolStripMenuItem.Text = "PRJ_RENAME"; + this.pRJRENAMEToolStripMenuItem.Click += new System.EventHandler(this.pRJRENAMEToolStripMenuItem_Click); + // + // ProjectMenuStrip + // + this.ProjectMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.pRJBUILDToolStripMenuItem, + this.pRJBUILDALLToolStripMenuItem, + this.pRJRUNToolStripMenuItem, + this.toolStripMenuItem1, + this.pRJToolStripMenuItem1, + this.pRJToolStripMenuItem2, + this.toolStripMenuItem2, + this.pRJPROPERTIESToolStripMenuItem}); + this.ProjectMenuStrip.Name = "ProjectMenuStrip"; + this.ProjectMenuStrip.Size = new System.Drawing.Size(188, 148); + // + // pRJBUILDToolStripMenuItem + // + this.pRJBUILDToolStripMenuItem.Name = "pRJBUILDToolStripMenuItem"; + this.pRJBUILDToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.pRJBUILDToolStripMenuItem.Text = "PRJ_BUILD"; + this.pRJBUILDToolStripMenuItem.Click += new System.EventHandler(this.pRJBUILDToolStripMenuItem_Click); + // + // pRJBUILDALLToolStripMenuItem + // + this.pRJBUILDALLToolStripMenuItem.Name = "pRJBUILDALLToolStripMenuItem"; + this.pRJBUILDALLToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.pRJBUILDALLToolStripMenuItem.Text = "PRJ_BUILD_ALL"; + this.pRJBUILDALLToolStripMenuItem.Click += new System.EventHandler(this.pRJBUILDALLToolStripMenuItem_Click); + // + // pRJRUNToolStripMenuItem + // + this.pRJRUNToolStripMenuItem.Name = "pRJRUNToolStripMenuItem"; + this.pRJRUNToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.pRJRUNToolStripMenuItem.Text = "PRJ_RUN"; + this.pRJRUNToolStripMenuItem.Click += new System.EventHandler(this.pRJRUNToolStripMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(184, 6); + // + // pRJToolStripMenuItem1 + // + this.pRJToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.pRJNEWFILEToolStripMenuItem, + this.pRJEXISTFILEToolStripMenuItem, + this.pRJFORMToolStripMenuItem}); + this.pRJToolStripMenuItem1.Name = "pRJToolStripMenuItem1"; + this.pRJToolStripMenuItem1.Size = new System.Drawing.Size(187, 22); + this.pRJToolStripMenuItem1.Text = "PRJ_ADD"; + // + // pRJNEWFILEToolStripMenuItem + // + this.pRJNEWFILEToolStripMenuItem.Name = "pRJNEWFILEToolStripMenuItem"; + this.pRJNEWFILEToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pRJNEWFILEToolStripMenuItem.Text = "PRJ_NEW_FILE"; + this.pRJNEWFILEToolStripMenuItem.Click += new System.EventHandler(this.pRJNEWFILEToolStripMenuItem_Click); + // + // pRJEXISTFILEToolStripMenuItem + // + this.pRJEXISTFILEToolStripMenuItem.Name = "pRJEXISTFILEToolStripMenuItem"; + this.pRJEXISTFILEToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pRJEXISTFILEToolStripMenuItem.Text = "PRJ_EXIST_FILE"; + this.pRJEXISTFILEToolStripMenuItem.Click += new System.EventHandler(this.pRJEXISTFILEToolStripMenuItem_Click); + // + // pRJFORMToolStripMenuItem + // + this.pRJFORMToolStripMenuItem.Name = "pRJFORMToolStripMenuItem"; + this.pRJFORMToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pRJFORMToolStripMenuItem.Text = "PRJ_FORM"; + this.pRJFORMToolStripMenuItem.Click += new System.EventHandler(this.pRJFORMToolStripMenuItem_Click); + // + // pRJToolStripMenuItem2 + // + this.pRJToolStripMenuItem2.Name = "pRJToolStripMenuItem2"; + this.pRJToolStripMenuItem2.Size = new System.Drawing.Size(187, 22); + this.pRJToolStripMenuItem2.Text = "PRJ_ADD_REFERENCE"; + this.pRJToolStripMenuItem2.Click += new System.EventHandler(this.pRJToolStripMenuItem2_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(184, 6); + // + // pRJPROPERTIESToolStripMenuItem + // + this.pRJPROPERTIESToolStripMenuItem.Name = "pRJPROPERTIESToolStripMenuItem"; + this.pRJPROPERTIESToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.pRJPROPERTIESToolStripMenuItem.Text = "PRJ_PROPERTIES"; + this.pRJPROPERTIESToolStripMenuItem.Click += new System.EventHandler(this.pRJPROPERTIESToolStripMenuItem_Click); + // + // ReferenceMenuStrip + // + this.ReferenceMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.pRJREMOVEToolStripMenuItem}); + this.ReferenceMenuStrip.Name = "ReferenceMenuStrip"; + this.ReferenceMenuStrip.Size = new System.Drawing.Size(144, 26); + // + // pRJREMOVEToolStripMenuItem + // + this.pRJREMOVEToolStripMenuItem.Name = "pRJREMOVEToolStripMenuItem"; + this.pRJREMOVEToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.pRJREMOVEToolStripMenuItem.Text = "PRJ_REMOVE"; + this.pRJREMOVEToolStripMenuItem.Click += new System.EventHandler(this.pRJREMOVEToolStripMenuItem_Click); + // + // imageList2 + // + this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream"))); + this.imageList2.TransparentColor = System.Drawing.Color.Transparent; + this.imageList2.Images.SetKeyName(0, "ProjectBrowser.ReferenceFolder.Closed.png"); + this.imageList2.Images.SetKeyName(1, "ProjectBrowser.ReferenceFolder.Open.png"); + this.imageList2.Images.SetKeyName(2, "Icons.16x16.Project.png"); + this.imageList2.Images.SetKeyName(3, "Icons.16x16.Reference.png"); + this.imageList2.Images.SetKeyName(4, "pabcfile.png"); + this.imageList2.Images.SetKeyName(5, "Icons.16x16.Form.png"); + // + // ProjectExplorerForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(209, 332); + this.Controls.Add(this.tvProjectExplorer); + this.Name = "ProjectExplorerForm"; + this.TabText = "PRJ_PROJECT_EXPLORER"; + this.Text = "PRJ_PROJECT_EXPLORER"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProjectExplorerForm_FormClosing); + this.AddReferenceMenuStrip.ResumeLayout(false); + this.SouceFileMenuStrip.ResumeLayout(false); + this.ProjectMenuStrip.ResumeLayout(false); + this.ReferenceMenuStrip.ResumeLayout(false); + this.ResumeLayout(false); + + } + private System.Windows.Forms.ToolStripMenuItem pRJADDREFERENCEToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip AddReferenceMenuStrip; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.TreeView tvProjectExplorer; + private System.Windows.Forms.ContextMenuStrip SouceFileMenuStrip; + private System.Windows.Forms.ToolStripMenuItem pRJOPENToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJVIEWCODEToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJEXCLUDEToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJRENAMEToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip ProjectMenuStrip; + private System.Windows.Forms.ToolStripMenuItem pRJBUILDToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJBUILDALLToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJRUNToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem pRJToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem pRJNEWFILEToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJEXISTFILEToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJFORMToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pRJToolStripMenuItem2; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem pRJPROPERTIESToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip ReferenceMenuStrip; + private System.Windows.Forms.ToolStripMenuItem pRJREMOVEToolStripMenuItem; + private System.Windows.Forms.ImageList imageList2; + } +} diff --git a/VisualPascalABCNETLinux/Projects/ProjectExplorer.cs b/VisualPascalABCNETLinux/Projects/ProjectExplorer.cs new file mode 100644 index 000000000..110c5f091 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectExplorer.cs @@ -0,0 +1,431 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Drawing; +using System.Windows.Forms; +using Microsoft.Build.BuildEngine; + +namespace VisualPascalABC +{ + /// + /// Description of ProjectExplorer. + /// + public partial class ProjectExplorerForm : WeifenLuo.WinFormsUI.Docking.DockContent + { + public ProjectExplorerForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + var sc = ScreenScale.Calc(); + if (sc >= 1.99) + this.tvProjectExplorer.ImageList = this.imageList2; + + this.tvProjectExplorer.LabelEdit = true; + this.tvProjectExplorer.BeforeLabelEdit += tvProjectExplorer_BeforeLabelEdit; + this.Icon = new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("VisualPascalABC.Resources.PadIcons.ProjectBrowser.ico")); + pRJBUILDToolStripMenuItem.Image = VisualPABCSingleton.MainForm.BuildImage; + pRJBUILDALLToolStripMenuItem.Image = VisualPABCSingleton.MainForm.RebuildImage; + pRJRUNToolStripMenuItem.Image = VisualPABCSingleton.MainForm.RunImage; + pRJNEWFILEToolStripMenuItem.Image = VisualPABCSingleton.MainForm.NewFileImage; + pRJOPENToolStripMenuItem.Image = VisualPABCSingleton.MainForm.OpenFileImage; + pRJFORMToolStripMenuItem.Image = VisualPABCSingleton.MainForm.NewFormImage; + Form1StringResources.SetTextForAllControls(this.AddReferenceMenuStrip); + Form1StringResources.SetTextForAllControls(this.ProjectMenuStrip); + Form1StringResources.SetTextForAllControls(this.ReferenceMenuStrip); + Form1StringResources.SetTextForAllControls(this.SouceFileMenuStrip); + this.tvProjectExplorer.AfterLabelEdit += new NodeLabelEditEventHandler(LabelEditFinished); + } + + private void tvProjectExplorer_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e) + { + if (!source_item_nodes.Contains(e.Node)) + e.CancelEdit = true; + } + + public void Clear() + { + if (!this.tvProjectExplorer.IsDisposed) + this.tvProjectExplorer.Nodes.Clear(); + reference_nodes.Clear(); + reference_item_nodes.Clear(); + project_item_nodes.Clear(); + source_item_nodes.Clear(); + } + + class NodeInfo + { + public bool IsForm; + + public NodeInfo() + { + + } + } + + private Hashtable items = new Hashtable(); + private TreeNode ReferencesNode = null; + private TreeNode ProjectNode = null; + private List reference_nodes = new List(); + private List reference_item_nodes = new List(); + private List project_item_nodes = new List(); + private List source_item_nodes = new List(); + private const int ProjectImageIndex = 2; + private const int ClosedReferencesImageIndex = 0; + private const int OpenReferencesImageIndex = 1; + private const int ReferenceImageIndex = 3; + private const int SourceFileImageIndex = 4; + private const int FormImageIndex = 5; + + public void LoadProject(string projectName, PascalABCCompiler.IProjectInfo project) + { + TreeNode proj_tn = this.tvProjectExplorer.Nodes.Add(Form1StringResources.Get("MR_PROJECT")+" "+projectName); + ProjectNode = proj_tn; + project_item_nodes.Add(proj_tn); + proj_tn.ImageIndex = ProjectImageIndex; + proj_tn.SelectedImageIndex = ProjectImageIndex; + TreeNode ref_tn = proj_tn.Nodes.Add(Form1StringResources.Get("PRJ_PROJECT_REFERENCES")); + ReferencesNode = ref_tn; + reference_nodes.Add(ref_tn); + ref_tn.ImageIndex = ClosedReferencesImageIndex; + foreach (PascalABCCompiler.IFileInfo fi in project.SourceFiles) + { + TreeNode tn = proj_tn.Nodes.Add(fi.Name); + tn.ImageIndex = SourceFileImageIndex; + tn.SelectedImageIndex = SourceFileImageIndex; + items[tn] = fi; + if (VisualPABCSingleton.MainForm.IsForm(fi.Path)) + { + tn.ImageIndex = FormImageIndex; + tn.SelectedImageIndex = FormImageIndex; + NodeInfo ni = new NodeInfo(); + ni.IsForm = true; + tn.Tag = ni; + } + source_item_nodes.Add(tn); + } + foreach (PascalABCCompiler.IReferenceInfo ri in project.References) + { + TreeNode tn = ref_tn.Nodes.Add(ri.AssemblyName); + tn.ImageIndex = ReferenceImageIndex; + tn.SelectedImageIndex = ReferenceImageIndex; + items[tn] = ri; + reference_item_nodes.Add(tn); + } + proj_tn.Expand(); + } + + public void AddSourceFile(PascalABCCompiler.IFileInfo fi, bool is_form) + { + TreeNode tn = ProjectNode.Nodes.Add(fi.Name); + tn.ImageIndex = SourceFileImageIndex; + tn.SelectedImageIndex = SourceFileImageIndex; + items[tn] = fi; + source_item_nodes.Add(tn); + if (VisualPABCSingleton.MainForm.IsForm(fi.Path) || is_form) + { + tn.ImageIndex = FormImageIndex; + tn.SelectedImageIndex = FormImageIndex; + NodeInfo ni = new NodeInfo(); + ni.IsForm = true; + tn.Tag = ni; + } + ProjectFactory.Instance.SaveProject(); + } + + void TvProjectExplorerBeforeSelect(object sender, TreeViewCancelEventArgs e) + { + e.Cancel = false; + } + + void TvProjectExplorerMouseClick(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + TreeNode tn = this.tvProjectExplorer.GetNodeAt(e.Location); + if (tn != null) + { + if (source_item_nodes.Contains(tn)) + { + this.tvProjectExplorer.ContextMenuStrip = this.SouceFileMenuStrip; + if (tn.Tag != null && (tn.Tag as NodeInfo).IsForm) + this.pRJToolStripMenuItem.Visible = true; + else + this.pRJToolStripMenuItem.Visible = false; + } + else if (project_item_nodes.Contains(tn)) + { + this.tvProjectExplorer.ContextMenuStrip = this.ProjectMenuStrip; + } + else if (reference_item_nodes.Contains(tn)) + { + this.tvProjectExplorer.ContextMenuStrip = this.ReferenceMenuStrip; + } + else if (reference_nodes.Contains(tn)) + { + this.tvProjectExplorer.ContextMenuStrip = this.AddReferenceMenuStrip; + } + else + this.tvProjectExplorer.ContextMenuStrip = null; + } + else + { + this.tvProjectExplorer.ContextMenuStrip = null; + } + this.tvProjectExplorer.SelectedNode = tn; + } + } + + private void OpenFile() + { + object o = items[this.tvProjectExplorer.SelectedNode]; + if (o != null) + { + if (o is PascalABCCompiler.IFileInfo) + { + PascalABCCompiler.IFileInfo fi = o as PascalABCCompiler.IFileInfo; + WorkbenchServiceFactory.FileService.OpenFile(fi.Path,null); + } + } + } + + private void ViewCode() + { + object o = items[this.tvProjectExplorer.SelectedNode]; + if (o != null) + { + if (o is PascalABCCompiler.IFileInfo) + { + PascalABCCompiler.IFileInfo fi = o as PascalABCCompiler.IFileInfo; + WorkbenchServiceFactory.FileService.OpenFile(fi.Path, null); + if (VisualPABCSingleton.MainForm.CurrentCodeFileDocument.DesignerAndCodeTabs != null) + { + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.TextPage; + } + } + } + } + + private void ShowForm() + { + object o = items[this.tvProjectExplorer.SelectedNode]; + if (o != null) + { + if (o is PascalABCCompiler.IFileInfo) + { + PascalABCCompiler.IFileInfo fi = o as PascalABCCompiler.IFileInfo; + WorkbenchServiceFactory.FileService.OpenFile(fi.Path, null); + if (VisualPABCSingleton.MainForm.CurrentCodeFileDocument.DesignerAndCodeTabs != null) + { + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.DesignerPage; + } + } + } + } + + void TvProjectExplorerDoubleClick(object sender, EventArgs e) + { + OpenFile(); + } + + public void AddReferenceNode(PascalABCCompiler.IReferenceInfo ri) + { + TreeNode tn = ReferencesNode.Nodes.Add(ri.AssemblyName); + tn.ImageIndex = ReferenceImageIndex; + tn.SelectedImageIndex = ReferenceImageIndex; + reference_item_nodes.Add(tn); + items[tn] = ri; + ProjectFactory.Instance.SaveProject(); + } + + void PRJADDREFERENCEToolStripMenuItemClick(object sender, EventArgs e) + { + ProjectTask.AddReferencesToProject(this); + } + + //build project + private void pRJBUILDToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.BuildService.StartCompile(false); + } + + //build all + private void pRJBUILDALLToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.BuildService.StartCompile(true); + } + + //run project + private void pRJRUNToolStripMenuItem_Click(object sender, EventArgs e) + { + WorkbenchServiceFactory.RunService.Run(true); + } + + //new file + private void pRJNEWFILEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.NewFile(this); + } + + //existing file + private void pRJEXISTFILEToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.AddFile(this); + } + + //new form + private void pRJFORMToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.NewForm(this, true);//roman// + } + + //add reference + private void pRJToolStripMenuItem2_Click(object sender, EventArgs e) + { + ProjectTask.AddReferencesToProject(this); + } + + //svojstva proekta + private void pRJPROPERTIESToolStripMenuItem_Click(object sender, EventArgs e) + { + ProjectTask.ProjectProperties(); + } + + //udalenie reference + private void pRJREMOVEToolStripMenuItem_Click(object sender, EventArgs e) + { + object o = items[this.tvProjectExplorer.SelectedNode]; + if (o != null) + { + if (o is PascalABCCompiler.IReferenceInfo) + { + ProjectTask.RemoveReference(o as PascalABCCompiler.IReferenceInfo); + this.tvProjectExplorer.Nodes.Remove(this.tvProjectExplorer.SelectedNode); + ProjectFactory.Instance.SaveProject(); + } + } + } + + //open file + private void pRJOPENToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenFile(); + } + + //show form + private void pRJToolStripMenuItem_Click(object sender, EventArgs e) + { + ShowForm(); + } + + //view code + private void pRJVIEWCODEToolStripMenuItem_Click(object sender, EventArgs e) + { + ViewCode(); + } + + //exclude from project + private void pRJEXCLUDEToolStripMenuItem_Click(object sender, EventArgs e) + { + object o = items[this.tvProjectExplorer.SelectedNode]; + if (o != null) + { + if (o is PascalABCCompiler.IFileInfo) + { + PascalABCCompiler.IFileInfo fi = o as PascalABCCompiler.IFileInfo; + if (ProjectFactory.Instance.CurrentProject.MainFile != fi.Path) + { + ProjectTask.ExcludeFile(fi); + this.tvProjectExplorer.Nodes.Remove(this.tvProjectExplorer.SelectedNode); + ProjectFactory.Instance.SaveProject(); + } + else + MessageBox.Show(Form1StringResources.Get("CANNOT_EXCLUDE_MAIN_FILE"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + //rename file + private void pRJRENAMEToolStripMenuItem_Click(object sender, EventArgs e) + { + object o = items[this.tvProjectExplorer.SelectedNode]; + if (o != null) + { + if (o is PascalABCCompiler.IFileInfo) + { + this.tvProjectExplorer.LabelEdit = true; + this.tvProjectExplorer.SelectedNode.BeginEdit(); + } + } + } + + private void LabelEditFinished(object sender, NodeLabelEditEventArgs e) + { + this.tvProjectExplorer.LabelEdit = false; + PascalABCCompiler.IFileInfo fi = items[e.Node] as PascalABCCompiler.IFileInfo; + if (e.Label == null) + return; + if (!PascalABCCompiler.Tools.CheckFileNameValid(e.Label)) + { + e.CancelEdit = true; + MessageBox.Show(Form1StringResources.Get("INVALID_SOURCE_FILE_NAME"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (string.Compare(Path.GetExtension(e.Label), ".pas", true) != 0) + { + e.CancelEdit = true; + MessageBox.Show(Form1StringResources.Get("INVALID_SOURCE_FILE_EXTENSION"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (File.Exists(Path.Combine(Path.GetDirectoryName(fi.Name),e.Label))) + { + e.CancelEdit = true; + MessageBox.Show(string.Format(Form1StringResources.Get("FILE_ALREADY_EXISTS{0}"), e.Label), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + string oldFileName = fi.Path; + ProjectFactory.Instance.RenameFile(fi, e.Label); + if (oldFileName == ProjectFactory.Instance.CurrentProject.MainFile) + { + ProjectFactory.Instance.CurrentProject.MainFile = System.IO.Path.Combine(ProjectFactory.Instance.CurrentProject.ProjectDirectory,e.Label); + } + WorkbenchServiceFactory.FileService.RenameFile(oldFileName, fi.Path); + CodeCompletionActionsManager.RenameUnit(fi.Path, Path.GetFileNameWithoutExtension(e.Label)); + string oldFileNameWithoutExt = Path.Combine(Path.GetDirectoryName(oldFileName),Path.GetFileNameWithoutExtension(oldFileName)); + string newFilePath = Path.Combine(Path.GetDirectoryName(oldFileName), e.Label); + if (File.Exists(oldFileNameWithoutExt+".fmabc")) + { + string fmabcFullName = Path.Combine(Path.GetDirectoryName(oldFileName), oldFileNameWithoutExt + ".fmabc"); + File.Copy(fmabcFullName, Path.Combine(Path.GetDirectoryName(oldFileName), Path.GetFileNameWithoutExtension(e.Label) + ".fmabc"), true); + File.Delete(fmabcFullName); + } + ProjectFactory.Instance.SaveProject(); + WorkbenchServiceFactory.FileService.SaveAll(false); + WorkbenchServiceFactory.FileService.CloseFile(newFilePath); + WorkbenchServiceFactory.FileService.OpenFile(newFilePath, Path.GetFileName(newFilePath)); + //WorkbenchServiceFactory.DesignerService.SetActiveDesignerDirty(); + //WorkbenchServiceFactory.DesignerService.GenerateAllDesignersCode(); + /*if (File.Exists(oldFileNameWithoutExt + ".resources")) + { + string fmabcFullName = Path.Combine(Path.GetDirectoryName(oldFileName), oldFileNameWithoutExt + ".fmabc"); + File.Copy(fmabcFullName, Path.Combine(Path.GetDirectoryName(e.Label), Path.GetFileNameWithoutExtension(e.Label) + ".fmabc"), true); + File.Delete(fmabcFullName); + }*/ + } + + private void ProjectExplorerForm_FormClosing(object sender, FormClosingEventArgs e) + { + if (e.CloseReason == CloseReason.UserClosing) + { + e.Cancel = true; + this.Hide(); + } + } + } +} diff --git a/VisualPascalABCNETLinux/Projects/ProjectExplorer.resx b/VisualPascalABCNETLinux/Projects/ProjectExplorer.resx new file mode 100644 index 000000000..b6023c43d --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectExplorer.resx @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA8 + DQAAAk1TRnQBSQFMAgEBBgEAASQBAAEkAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAA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T8C/wEAAQEBAAEHAgAC/wEAAQEBAAEHAgAC/wEAAQEBAAEDAgAB/AEBAQABAQEAAQMCAAH4AgABAQEA + AQECAAEYAgABAQEAAQEFAAEBBAABGAIAAQEEAAH4AgABAQEAAQcCAAH4AgABAQEAAQcBgAEAAfwBAQEA + Af8BAAH/AYABAAL/AQEB/wEBAf8BgAEABv8BwAEACv8L + + + + 123, 17 + + + 294, 17 + + + 443, 17 + + + 579, 17 + + + 741, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABE + HAAAAk1TRnQBSQFMAgEBBgEAAQgBAAEIAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABgAMAAUADAAEBAQABCAYAASAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm + AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM + AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA + ATMBAAGZAQABMwEAAc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BgAsAAeACAAEP + AYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEPAYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEP + AYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEPAYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEP + AYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEPAYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEP + AYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAEPAYALAAHgAgABDwGACwAB4AIAAQ8BgAsAAeACAAE/ + AYALAAHgAgABPwGACwAB4AIABf8IAAj/AYABAAEPDf8BgAEAAQ8N/wGAAQABDw3/AYABAAEPBf8DAAED + AwABPwQABP8DAAEDAwABPwQABP8DAAEDAwABPwQABP8DAAEDAwABPwQABP8DAAEDAwABDwQAAf8B4AEA + AQMDAAEDAwABDwQAAf8B4AEAAQMDAAEDAwABDwQAAf8BgAUAAQMDAAEPBAAB/wGABQABAwMAAQMEAAED + AYAFAAEDAwABAwQAAQMBgAUAAQMDAAEDCwABAwMAAQMLAAEDDwABAwgAAQMBgAUAAQMIAAEDAYAFAAED + CAAB/wGABQABAwgAAf8BgAUAAQMDAAE/BAAB/wGABQABAwMAAT8EAAH/AYAFAAEDAwABPwGAAwAB/wHg + AQABAwMAAQMDAAE/AYADAAH/AeABAAEDAgAC/wIAAv8BgAMABP8CAAL/AgAC/wGAAwAE/wEAAQMC/wEA + AQMC/wGAAwAE/wEAAQMC/wEAAQMC/wGAAwAM/wHgAwAM/wHgAwAU/ws= + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Projects/ProjectHelper.cs b/VisualPascalABCNETLinux/Projects/ProjectHelper.cs new file mode 100644 index 000000000..6791cd618 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectHelper.cs @@ -0,0 +1,256 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using System.IO; +using System.Text; + +namespace VisualPascalABC +{ + + public class ProjectFactory + { + private PascalABCCompiler.ProjectInfo currentProject; + private int uid=1; + + static ProjectFactory() + { + + } + + public PascalABCCompiler.IProjectInfo CurrentProject + { + get + { + return currentProject; + } + } + + private static ProjectFactory instance; + public static ProjectFactory Instance + { + get + { + if (instance == null) + { + instance = new ProjectFactory(); + } + return instance; + } + } + + public string ProjectDirectory + { + get + { + return Path.GetDirectoryName(currentProject.Path); + } + } + + public PascalABCCompiler.IProjectInfo CreateProject(string projectName, string projectFileName, PascalABCCompiler.ProjectType projectType) + { + currentProject = new PascalABCCompiler.ProjectInfo(); + currentProject.name = projectName; + currentProject.path = projectFileName; + string dir = Path.GetDirectoryName(projectFileName); + if (!Directory.Exists(dir)) + { + Directory.CreateDirectory(dir); + } + currentProject.include_debug_info = true; + + currentProject.project_type = projectType; + currentProject.source_files.Add(new PascalABCCompiler.SourceCodeFileInfo(projectName + ".pas", Path.Combine(dir, projectName + ".pas"))); + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System", "System.dll")); + if (projectType == PascalABCCompiler.ProjectType.WindowsApp) + { + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Windows.Forms", "System.Windows.Forms.dll")); + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Drawing", "System.Drawing.dll")); + //roman// + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Core", "System.Core.dll")); + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Data", "System.Data.dll")); + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Data.DataSetExtensions", "System.Data.DataSetExtensions.dll")); + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Xml", "System.Xml.dll")); + currentProject.references.Add(new PascalABCCompiler.ReferenceInfo("System.Xml.Linq", "System.Xml.Linq.dll")); + //roman// + } + currentProject.main_file = Path.Combine(dir, projectName + ".pas"); + currentProject.generate_xml_doc = false; + currentProject.delete_exe = true; + currentProject.delete_pdb = true; + currentProject.major_version = 0; + currentProject.minor_version = 0; + currentProject.build_version = 0; + currentProject.revision_version = 0; + currentProject.output_directory = dir; + StreamWriter sw = File.CreateText(Path.Combine(dir, projectName + ".pas")); + currentProject.output_file_name = projectName + ".exe"; + if (projectType == PascalABCCompiler.ProjectType.ConsoleApp) + { + //sw.WriteLine("program "+projectName+";"); + //sw.WriteLine(); + //sw.WriteLine("uses System;"); + //sw.WriteLine(); + sw.WriteLine("begin"); + sw.WriteLine(); + sw.Write("end."); + } + else if (projectType == PascalABCCompiler.ProjectType.Library) + { + sw.WriteLine("library " + projectName + ";"); + sw.WriteLine(); + //sw.WriteLine("uses System;"); + //sw.WriteLine(); + sw.Write("end."); + currentProject.output_file_name = projectName + ".dll"; + } + sw.Close(); + currentProject.Save(); + //VisualPABCSingleton.MainForm.OpenFile(Path.Combine(dir,projectName+".pas")); + return currentProject; + } + + public PascalABCCompiler.IProjectInfo OpenProject(string projectFileName) + { + PascalABCCompiler.ProjectInfo _currentProject = new PascalABCCompiler.ProjectInfo(); + _currentProject.Load(projectFileName); + currentProject = _currentProject; + return currentProject; + } + + public bool ProjectLoaded + { + get + { + return currentProject != null; + } + } + + private bool dirty = false; + public bool Dirty + { + get + { + return dirty; + } + set + { + dirty = value; + if (value == true) + { + VisualPABCSingleton.MainForm.SaveAllButtonsEnabled = true; + WorkbenchServiceFactory.CodeCompletionParserController.SetAllInProjectChanged(); + } + else + { + VisualPABCSingleton.MainForm.SaveAllButtonsEnabled = VisualPABCSingleton.MainForm.AllSaved(); + } + } + } + + public PascalABCCompiler.IFileInfo AddSourceFile(string fileName) + { + PascalABCCompiler.SourceCodeFileInfo fi = new PascalABCCompiler.SourceCodeFileInfo(fileName, Path.Combine(Path.GetDirectoryName(currentProject.Path), fileName)); + currentProject.source_files.Add(fi); + Dirty = true; + return fi; + } + + public void AddNamespaceFileReference(string fileName) + { + var text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(currentProject.main_file, PascalABCCompiler.SourceFileOperation.GetText) as string; + text = "{$includenamespace " + Path.GetFileName(fileName) + "}"+Environment.NewLine + text; + var doc = WorkbenchServiceFactory.DocumentService.GetDocument(currentProject.main_file); + if (doc != null) + { + doc.TextEditor.Text = text; + } + else + { + File.WriteAllText(currentProject.main_file, text); + } + } + + public bool hasNamespaceFileReference(string fileName) + { + var text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(currentProject.main_file, PascalABCCompiler.SourceFileOperation.GetText) as string; + return text.IndexOf("{$includenamespace " + Path.GetFileName(fileName) + "}") != -1; + } + + public void RemoveNamespaceFileReference(string fileName) + { + var text = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler.SourceFilesProvider(currentProject.main_file, PascalABCCompiler.SourceFileOperation.GetText) as string; + text = text.Replace("{$includenamespace " + Path.GetFileName(fileName) + "}" + Environment.NewLine, ""); + var doc = WorkbenchServiceFactory.DocumentService.GetDocument(currentProject.main_file); + if (doc != null) + { + doc.TextEditor.Text = text; + } + else + { + File.WriteAllText(currentProject.main_file, text); + } + } + + public PascalABCCompiler.IReferenceInfo AddReference(string s) + { + PascalABCCompiler.ReferenceInfo ri = new PascalABCCompiler.ReferenceInfo(s, s + ".dll"); + currentProject.references.Add(ri); + Dirty = true; + return ri; + } + + public void RemoveReference(PascalABCCompiler.IReferenceInfo ri) + { + currentProject.RemoveReference(ri); + Dirty = true; + } + + public void ExcludeFile(PascalABCCompiler.IFileInfo fi) + { + currentProject.ExcludeFile(fi); + Dirty = true; + } + + public void RenameFile(PascalABCCompiler.IFileInfo fi, string new_name) + { + bool hasNsReference = hasNamespaceFileReference(fi.Name); + if (hasNsReference) + RemoveNamespaceFileReference(fi.Name); + fi.Name = new_name; + Dirty = true; + if (hasNsReference) + AddNamespaceFileReference(fi.Name); + } + + public string GetUnitFileName() + { + return "Unit"+uid++ + ".pas"; + } + + public string GetFullUnitFileName() + { + return Path.Combine(Path.GetDirectoryName(currentProject.path), GetUnitFileName()); + } + + public void SaveProject() + { + if (currentProject != null) + { + currentProject.Save(); + Dirty = false; + } + } + + public void CloseProject() + { + currentProject = null; + uid = 1; + Dirty = false; + GC.Collect(); + } + } +} diff --git a/VisualPascalABCNETLinux/Projects/ProjectInfo.cs b/VisualPascalABCNETLinux/Projects/ProjectInfo.cs new file mode 100644 index 000000000..30e94dfc6 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectInfo.cs @@ -0,0 +1,19 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace VisualPascalABC +{ + public enum AssemblyType + { + GAC, + COM, + File, + Project + } +} + diff --git a/VisualPascalABCNETLinux/Projects/ProjectProperties.Designer.cs b/VisualPascalABCNETLinux/Projects/ProjectProperties.Designer.cs new file mode 100644 index 000000000..e4b586e59 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectProperties.Designer.cs @@ -0,0 +1,478 @@ + +namespace VisualPascalABC +{ + partial class ProjectProperties + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.cbDebugRelease = new System.Windows.Forms.ComboBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.cbDeletePdb = new System.Windows.Forms.CheckBox(); + this.cbDeleteExe = new System.Windows.Forms.CheckBox(); + this.tbOutputDirectory = new System.Windows.Forms.TextBox(); + this.btSelectOutpotDirectory = new System.Windows.Forms.Button(); + this.tbRunArguments = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.tbAppIcon = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.pbAppIcon = new System.Windows.Forms.PictureBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tbCopyright = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.tbTradeMark = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.tbCompany = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.tbProduct = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.tbRevision = new System.Windows.Forms.TextBox(); + this.tbBuild = new System.Windows.Forms.TextBox(); + this.tbMinor = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.tbMajor = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.cbGenerateXmlDoc = new System.Windows.Forms.CheckBox(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbAppIcon)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(163, 282); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(78, 25); + this.btnOk.TabIndex = 0; + this.btnOk.Text = "RF_OK"; + this.btnOk.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(250, 282); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 25); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(126, 13); + this.label1.TabIndex = 2; + this.label1.Text = "PRJ_DEBUG_RELEASE"; + // + // cbDebugRelease + // + this.cbDebugRelease.FormattingEnabled = true; + this.cbDebugRelease.Items.AddRange(new object[] { + "Debug", + "Release"}); + this.cbDebugRelease.Location = new System.Drawing.Point(6, 25); + this.cbDebugRelease.Name = "cbDebugRelease"; + this.cbDebugRelease.Size = new System.Drawing.Size(134, 21); + this.cbDebugRelease.TabIndex = 3; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.cbDeletePdb); + this.groupBox2.Controls.Add(this.cbDeleteExe); + this.groupBox2.Location = new System.Drawing.Point(6, 52); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(290, 66); + this.groupBox2.TabIndex = 25; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "PRJ_ENVIRONMENT_RUNMODE"; + // + // cbDeletePdb + // + this.cbDeletePdb.AutoSize = true; + this.cbDeletePdb.Location = new System.Drawing.Point(6, 42); + this.cbDeletePdb.Name = "cbDeletePdb"; + this.cbDeletePdb.Size = new System.Drawing.Size(122, 17); + this.cbDeletePdb.TabIndex = 1; + this.cbDeletePdb.Text = "PRJ_DELETE_PDB"; + this.cbDeletePdb.UseVisualStyleBackColor = true; + // + // cbDeleteExe + // + this.cbDeleteExe.AutoSize = true; + this.cbDeleteExe.Location = new System.Drawing.Point(6, 19); + this.cbDeleteExe.Name = "cbDeleteExe"; + this.cbDeleteExe.Size = new System.Drawing.Size(121, 17); + this.cbDeleteExe.TabIndex = 0; + this.cbDeleteExe.Text = "PRJ_DELETE_EXE"; + this.cbDeleteExe.UseVisualStyleBackColor = true; + // + // tbOutputDirectory + // + this.tbOutputDirectory.BackColor = System.Drawing.Color.White; + this.tbOutputDirectory.Location = new System.Drawing.Point(6, 147); + this.tbOutputDirectory.Name = "tbOutputDirectory"; + this.tbOutputDirectory.Size = new System.Drawing.Size(207, 20); + this.tbOutputDirectory.TabIndex = 27; + this.tbOutputDirectory.Text = "bin\\"; + // + // btSelectOutpotDirectory + // + this.btSelectOutpotDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.btSelectOutpotDirectory.Location = new System.Drawing.Point(219, 146); + this.btSelectOutpotDirectory.Name = "btSelectOutpotDirectory"; + this.btSelectOutpotDirectory.Size = new System.Drawing.Size(77, 21); + this.btSelectOutpotDirectory.TabIndex = 28; + this.btSelectOutpotDirectory.Text = "PRJ_BROWSE"; + this.btSelectOutpotDirectory.UseVisualStyleBackColor = true; + this.btSelectOutpotDirectory.Click += new System.EventHandler(this.btSelectOutpotDirectory_Click); + // + // tbRunArguments + // + this.tbRunArguments.Location = new System.Drawing.Point(6, 196); + this.tbRunArguments.Name = "tbRunArguments"; + this.tbRunArguments.Size = new System.Drawing.Size(236, 20); + this.tbRunArguments.TabIndex = 29; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 180); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(155, 13); + this.label2.TabIndex = 30; + this.label2.Text = "PRJ_COMMAND_LINE_ARGS"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 229); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(86, 13); + this.label3.TabIndex = 31; + this.label3.Text = "PRJ_APP_ICON"; + this.label3.Visible = false; + // + // tbAppIcon + // + this.tbAppIcon.Location = new System.Drawing.Point(6, 245); + this.tbAppIcon.Name = "tbAppIcon"; + this.tbAppIcon.Size = new System.Drawing.Size(236, 20); + this.tbAppIcon.TabIndex = 32; + this.tbAppIcon.Visible = false; + // + // button1 + // + this.button1.BackColor = System.Drawing.SystemColors.Control; + this.button1.Location = new System.Drawing.Point(253, 245); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(27, 19); + this.button1.TabIndex = 33; + this.button1.Text = "..."; + this.button1.UseVisualStyleBackColor = false; + this.button1.Visible = false; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // pbAppIcon + // + this.pbAppIcon.Location = new System.Drawing.Point(293, 238); + this.pbAppIcon.Name = "pbAppIcon"; + this.pbAppIcon.Size = new System.Drawing.Size(32, 32); + this.pbAppIcon.TabIndex = 34; + this.pbAppIcon.TabStop = false; + this.pbAppIcon.Visible = false; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.tbCopyright); + this.groupBox1.Controls.Add(this.label12); + this.groupBox1.Controls.Add(this.tbTradeMark); + this.groupBox1.Controls.Add(this.label11); + this.groupBox1.Controls.Add(this.tbCompany); + this.groupBox1.Controls.Add(this.label10); + this.groupBox1.Controls.Add(this.tbProduct); + this.groupBox1.Controls.Add(this.label9); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.tbRevision); + this.groupBox1.Controls.Add(this.tbBuild); + this.groupBox1.Controls.Add(this.tbMinor); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.tbMajor); + this.groupBox1.Location = new System.Drawing.Point(6, 294); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(518, 0); + this.groupBox1.TabIndex = 35; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "PRJ_APP_INFO"; + this.groupBox1.Visible = false; + // + // tbCopyright + // + this.tbCopyright.Location = new System.Drawing.Point(345, 108); + this.tbCopyright.Name = "tbCopyright"; + this.tbCopyright.Size = new System.Drawing.Size(142, 20); + this.tbCopyright.TabIndex = 15; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(342, 93); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(96, 13); + this.label12.TabIndex = 14; + this.label12.Text = "PRJ_COPYRIGHT"; + // + // tbTradeMark + // + this.tbTradeMark.Location = new System.Drawing.Point(181, 108); + this.tbTradeMark.Name = "tbTradeMark"; + this.tbTradeMark.Size = new System.Drawing.Size(152, 20); + this.tbTradeMark.TabIndex = 13; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(178, 93); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(101, 13); + this.label11.TabIndex = 12; + this.label11.Text = "PRJ_TRADEMARK"; + // + // tbCompany + // + this.tbCompany.Location = new System.Drawing.Point(6, 108); + this.tbCompany.Name = "tbCompany"; + this.tbCompany.Size = new System.Drawing.Size(162, 20); + this.tbCompany.TabIndex = 11; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(4, 92); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(86, 13); + this.label10.TabIndex = 10; + this.label10.Text = "PRJ_COMPANY"; + // + // tbProduct + // + this.tbProduct.Location = new System.Drawing.Point(6, 32); + this.tbProduct.Name = "tbProduct"; + this.tbProduct.Size = new System.Drawing.Size(229, 20); + this.tbProduct.TabIndex = 9; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(4, 16); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(86, 13); + this.label9.TabIndex = 8; + this.label9.Text = "PRJ_PRODUCT"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(388, 54); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(112, 13); + this.label7.TabIndex = 7; + this.label7.Text = "PRJ_VER_REVISION"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(260, 54); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(93, 13); + this.label6.TabIndex = 6; + this.label6.Text = "PRJ_VER_BUILD"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(131, 54); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(97, 13); + this.label5.TabIndex = 5; + this.label5.Text = "PRJ_VER_MINOR"; + // + // tbRevision + // + this.tbRevision.Location = new System.Drawing.Point(389, 70); + this.tbRevision.Name = "tbRevision"; + this.tbRevision.Size = new System.Drawing.Size(122, 20); + this.tbRevision.TabIndex = 4; + this.tbRevision.Text = "0"; + this.tbRevision.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // tbBuild + // + this.tbBuild.Location = new System.Drawing.Point(261, 70); + this.tbBuild.Name = "tbBuild"; + this.tbBuild.Size = new System.Drawing.Size(122, 20); + this.tbBuild.TabIndex = 3; + this.tbBuild.Text = "0"; + this.tbBuild.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // tbMinor + // + this.tbMinor.Location = new System.Drawing.Point(133, 70); + this.tbMinor.Name = "tbMinor"; + this.tbMinor.Size = new System.Drawing.Size(122, 20); + this.tbMinor.TabIndex = 2; + this.tbMinor.Text = "0"; + this.tbMinor.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(5, 54); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(98, 13); + this.label4.TabIndex = 1; + this.label4.Text = "PRJ_VER_MAJOR"; + // + // tbMajor + // + this.tbMajor.Location = new System.Drawing.Point(5, 70); + this.tbMajor.Name = "tbMajor"; + this.tbMajor.Size = new System.Drawing.Size(122, 20); + this.tbMajor.TabIndex = 0; + this.tbMajor.Text = "0"; + this.tbMajor.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(3, 131); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(103, 13); + this.label8.TabIndex = 36; + this.label8.Text = "PRJ_OUTPUT_DIR"; + // + // cbGenerateXmlDoc + // + this.cbGenerateXmlDoc.AutoSize = true; + this.cbGenerateXmlDoc.Location = new System.Drawing.Point(6, 229); + this.cbGenerateXmlDoc.Name = "cbGenerateXmlDoc"; + this.cbGenerateXmlDoc.Size = new System.Drawing.Size(168, 17); + this.cbGenerateXmlDoc.TabIndex = 37; + this.cbGenerateXmlDoc.Text = "PRJ_GENERATE_XML_DOC"; + this.cbGenerateXmlDoc.UseVisualStyleBackColor = true; + // + // ProjectProperties + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(333, 324); + this.Controls.Add(this.cbGenerateXmlDoc); + this.Controls.Add(this.label8); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.pbAppIcon); + this.Controls.Add(this.button1); + this.Controls.Add(this.tbAppIcon); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.tbRunArguments); + this.Controls.Add(this.btSelectOutpotDirectory); + this.Controls.Add(this.tbOutputDirectory); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.cbDebugRelease); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ProjectProperties"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PRJ_PROJECT_PROPERTIES"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProjectProperties_FormClosing); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbAppIcon)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cbDebugRelease; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox cbDeletePdb; + private System.Windows.Forms.CheckBox cbDeleteExe; + private System.Windows.Forms.TextBox tbOutputDirectory; + private System.Windows.Forms.Button btSelectOutpotDirectory; + private System.Windows.Forms.TextBox tbRunArguments; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox tbAppIcon; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.PictureBox pbAppIcon; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox tbMajor; + private System.Windows.Forms.TextBox tbRevision; + private System.Windows.Forms.TextBox tbBuild; + private System.Windows.Forms.TextBox tbMinor; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.CheckBox cbGenerateXmlDoc; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox tbProduct; + private System.Windows.Forms.TextBox tbCompany; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox tbTradeMark; + private System.Windows.Forms.TextBox tbCopyright; + //private System.Windows.Forms.TextBox tbTitle; + //private System.Windows.Forms.TextBox tbDescription; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + } +} diff --git a/VisualPascalABCNETLinux/Projects/ProjectProperties.cs b/VisualPascalABCNETLinux/Projects/ProjectProperties.cs new file mode 100644 index 000000000..c1dc5cddc --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectProperties.cs @@ -0,0 +1,239 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Drawing; +using System.Windows.Forms; +using System.IO; + +namespace VisualPascalABC +{ + /// + /// Description of ProjectProperties. + /// + public partial class ProjectProperties : Form + { + public ProjectProperties() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + openFileDialog1.Filter = VECStringResources.Get("DIALOGS_FILTER_ICO_FILES")+"|*.ico"; + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + + private PascalABCCompiler.IProjectInfo proj; + + public void LoadOptions(PascalABCCompiler.IProjectInfo prj) + { + proj = prj; + this.cbDeleteExe.Checked = prj.DeleteEXE; + this.cbDeletePdb.Checked = prj.DeletePDB; + if (prj.IncludeDebugInfo) + this.cbDebugRelease.SelectedIndex = 0; + else + this.cbDebugRelease.SelectedIndex = 1; + this.tbOutputDirectory.Text = prj.OutputDirectory; + this.tbRunArguments.Text = prj.CommandLineArguments; + if (!string.IsNullOrEmpty(prj.AppIcon)) + { + this.tbAppIcon.Text = prepare_icon_name(prj.AppIcon); + } + this.tbMajor.Text = Convert.ToString(prj.MajorVersion); + this.tbMinor.Text = Convert.ToString(prj.MinorVersion); + this.tbBuild.Text = Convert.ToString(prj.BuildVersion); + this.tbRevision.Text = Convert.ToString(prj.RevisionVersion); + this.cbGenerateXmlDoc.Checked = prj.GenerateXMLDoc; + this.tbProduct.Text = prj.Product; + this.tbCompany.Text = prj.Company; + this.tbTradeMark.Text = prj.Trademark; + this.tbCopyright.Text = prj.Copyright; + //if (prj.Title != null) { this.tbTitle.Text = prj.Description; } else { this.tbTitle.Text = ""; }; + //if (prj.Description != null) { this.tbDescription.Text = prj.Description; } else { this.tbDescription.Text = ""; }; + } + + public void SetOptions(PascalABCCompiler.IProjectInfo prj) + { + prj.DeleteEXE = this.cbDeleteExe.Checked; + prj.DeletePDB = this.cbDeletePdb.Checked; + prj.IncludeDebugInfo = this.cbDebugRelease.SelectedIndex == 0; + prj.OutputDirectory = this.tbOutputDirectory.Text; + prj.CommandLineArguments = this.tbRunArguments.Text; + if (!string.IsNullOrEmpty(this.tbAppIcon.Text)) + { + /*if (File.Exists(this.tbAppIcon.Text)) + prj.AppIcon = this.tbAppIcon.Text; + else*/ + prj.AppIcon = Path.Combine(prj.ProjectDirectory, this.tbAppIcon.Text); + } + else + prj.AppIcon = null; + prj.MajorVersion = Convert.ToInt32(this.tbMajor.Text); + prj.MinorVersion = Convert.ToInt32(this.tbMinor.Text); + prj.BuildVersion = Convert.ToInt32(this.tbBuild.Text); + prj.RevisionVersion = Convert.ToInt32(this.tbRevision.Text); + prj.GenerateXMLDoc = this.cbGenerateXmlDoc.Checked; + prj.Product = this.tbProduct.Text; + prj.Company = this.tbCompany.Text; + prj.Trademark = this.tbTradeMark.Text; + prj.Copyright = this.tbCopyright.Text; + //prj.Title = this.tbTitle.Text; + //prj.Description = this.tbDescription.Text; + } + + private void ProjectProperties_FormClosing(object sender, FormClosingEventArgs e) + { + if (this.DialogResult == DialogResult.Cancel) + return; + if (string.IsNullOrEmpty(this.tbMajor.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("MAJOR_VERSION_MUST_BE_SET"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + int ver = Convert.ToInt32(this.tbMajor.Text); + if (ver < 0) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("MAJOR_VERSION_LESS_ZERO"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + catch + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("MAJOR_VERSION_MUST_BE_INT"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (string.IsNullOrEmpty(this.tbMinor.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("MINOR_VERSION_MUST_BE_SET"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + int ver = Convert.ToInt32(this.tbMajor.Text); + if (ver < 0) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("MINOR_VERSION_LESS_ZERO"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + catch + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("MINOR_VERSION_MUST_BE_INT"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (string.IsNullOrEmpty(this.tbBuild.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("BUILD_VERSION_MUST_BE_SET"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + int ver = Convert.ToInt32(this.tbBuild.Text); + if (ver < 0) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("BUILD_VERSION_LESS_ZERO"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + catch + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("BUILD_VERSION_MUST_BE_INT"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (string.IsNullOrEmpty(this.tbRevision.Text)) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("REVISION_VERSION_MUST_BE_SET"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + int ver = Convert.ToInt32(this.tbRevision.Text); + if (ver < 0) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("REVISION_VERSION_LESS_ZERO"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + catch + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("REVISION_VERSION_MUST_BE_INT"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (!string.IsNullOrEmpty(tbAppIcon.Text)) + if (!File.Exists(tbAppIcon.Text) && !File.Exists(Path.Combine(proj.ProjectDirectory, tbAppIcon.Text))) + { + e.Cancel = true; + MessageBox.Show(Form1StringResources.Get("ICON_FILE_NOT_FOUND"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + private Image ReadIconImage(string fileName) + { + FileStream fs = new FileStream(fileName, FileMode.Open); + Image tmp = Image.FromStream(fs); + fs.Flush(); + fs.Close(); + Bitmap bmp = new Bitmap(tmp); + tmp.Dispose(); + return bmp; + } + + private string prepare_icon_name(string fileName) + { + try + { + pbAppIcon.Image = ReadIconImage(fileName); + } + catch + { + } + return PascalABCCompiler.Tools.RelativePathTo(ProjectFactory.Instance.CurrentProject.ProjectDirectory, fileName); + } + + private void button1_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + try + { + if (Path.GetDirectoryName(openFileDialog1.FileName) != ProjectFactory.Instance.CurrentProject.ProjectDirectory) + File.Copy(openFileDialog1.FileName, Path.Combine(ProjectFactory.Instance.CurrentProject.ProjectDirectory,Path.GetFileName(openFileDialog1.FileName)),true); + pbAppIcon.Image = ReadIconImage(openFileDialog1.FileName); + } + catch + { + } + this.tbAppIcon.Text = Path.GetFileName(openFileDialog1.FileName);//PascalABCCompiler.Tools.RelativePathTo(ProjectFactory.Instance.CurrentProject.ProjectDirectory, openFileDialog1.FileName); + } + } + + private void btSelectOutpotDirectory_Click(object sender, EventArgs e) + { + if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) + { + tbOutputDirectory.Text = folderBrowserDialog1.SelectedPath; + } + } + } +} diff --git a/VisualPascalABCNETLinux/Projects/ProjectProperties.resx b/VisualPascalABCNETLinux/Projects/ProjectProperties.resx new file mode 100644 index 000000000..09e7ebf34 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectProperties.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 147, 17 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Projects/ProjectTasks.cs b/VisualPascalABCNETLinux/Projects/ProjectTasks.cs new file mode 100644 index 000000000..457ea157a --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ProjectTasks.cs @@ -0,0 +1,224 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Runtime.InteropServices; +//using ICSharpCode.FormsDesigner; +using PascalABCCompiler; + +namespace VisualPascalABC +{ + public class ProjectTask + { + public static void AddReferencesToProject(ProjectExplorerForm ProjectExplorerWindow) + { + ReferenceForm.Instance.Clear(); + ReferenceForm.Instance.LoadAssemblies(); + if (ReferenceForm.Instance.ShowDialog() == DialogResult.OK) + { + if (ReferenceForm.Instance.AssemblyType == AssemblyType.GAC) + { + string[] assemblies = ReferenceForm.Instance.GetSelectedGACAssemblies(); + foreach (string s in assemblies) + { + PascalABCCompiler.IReferenceInfo ri = ProjectFactory.Instance.AddReference(s); + ProjectExplorerWindow.AddReferenceNode(ri); + try + { + //ToolboxProvider.AddComponentsFromAssembly(PascalABCCompiler.NetHelper.NetHelper.LoadAssembly(Compiler.get_assembly_path(ri.FullAssemblyName, false))); + } + catch + { + + } + + } + } + else if (ReferenceForm.Instance.AssemblyType == AssemblyType.COM) + { + string[] assemblies = ReferenceForm.Instance.GetSelectedCOMObjects(); + foreach (string s in assemblies) + { + PascalABCCompiler.IReferenceInfo ri = ProjectFactory.Instance.AddReference(s); + ProjectExplorerWindow.AddReferenceNode(ri); + } + } + else + { + string[] assemblies = ReferenceForm.Instance.GetSelectedFileAssemblies(); + List assm_lst = new List(); + foreach (string dll in assemblies) + { + if (string.Compare(dll, Path.Combine(ProjectFactory.Instance.ProjectDirectory, Path.GetFileName(dll)), true) != 0) + File.Copy(dll, Path.Combine(ProjectFactory.Instance.ProjectDirectory, Path.GetFileName(dll)), true); + string xml = Path.ChangeExtension(dll, ".xml"); + if (File.Exists(xml)) + { + if (string.Compare(xml, Path.Combine(ProjectFactory.Instance.ProjectDirectory, Path.GetFileName(xml)), true) != 0) + File.Copy(xml, Path.Combine(ProjectFactory.Instance.ProjectDirectory, Path.GetFileName(xml)), true); + } + //assm_lst.Add(Path.GetFileNameWithoutExtension(s)); + //ProjectExplorerWindow.AddReferenceNode(Path.GetFileNameWithoutExtension(s)); + try + { + PascalABCCompiler.NetHelper.NetHelper.LoadAssembly(dll); + } + catch + { + continue; + } + + PascalABCCompiler.IReferenceInfo ri = ProjectFactory.Instance.AddReference(Path.GetFileNameWithoutExtension(dll)); + ProjectExplorerWindow.AddReferenceNode(ri); + try + { + //ToolboxProvider.AddComponentsFromAssembly(PascalABCCompiler.NetHelper.NetHelper.LoadAssembly(Compiler.get_assembly_path(Path.Combine(ProjectFactory.Instance.ProjectDirectory, ri.FullAssemblyName), false))); + } + catch + { + + } + } + //ProjectFactory.Instance.AddReferences(assm_lst.ToArray()); + } + } + } + + public static void NewFile(ProjectExplorerForm ProjectExplorerWindow) + { + NewFileForm frm = new NewFileForm(); + Form1StringResources.SetTextForAllControls(frm); + frm.FileName = ProjectFactory.Instance.GetUnitFileName(); + frm.SetUnitFilter(); + if (frm.ShowDialog() == DialogResult.OK) + { + PascalABCCompiler.IFileInfo fi = ProjectFactory.Instance.AddSourceFile(frm.FileName); + ProjectExplorerWindow.AddSourceFile(fi,false); + string full_file_name = Path.Combine(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path),frm.FileName); + StreamWriter sw = File.CreateText(full_file_name); + if (frm.GetFileFilter() == FileType.Unit) + { + sw.WriteLine("unit " + Path.GetFileNameWithoutExtension(frm.FileName) + ";"); + sw.WriteLine(); + sw.WriteLine("interface"); + sw.WriteLine(); + sw.WriteLine("implementation"); + sw.WriteLine(); + sw.Write("end."); + } + else + { + sw.WriteLine("namespace "+ProjectFactory.Instance.CurrentProject.Name+";"); + sw.WriteLine(); + sw.Write("end."); + ProjectFactory.Instance.AddNamespaceFileReference(full_file_name); + } + + sw.Close(); + WorkbenchServiceFactory.FileService.OpenFile(full_file_name, null); + } + } + + public static void NewForm(ProjectExplorerForm ProjectExplorerWindow, bool prompt) //roman// + { + NewFileForm frm = new NewFileForm(); + frm.SetWinFormsFilter(); + Form1StringResources.SetTextForAllControls(frm); + frm.FileName = ProjectFactory.Instance.GetUnitFileName(); + if (prompt && frm.ShowDialog() != DialogResult.OK) //roman// + return; + PascalABCCompiler.IFileInfo fi = ProjectFactory.Instance.AddSourceFile(frm.FileName); + string full_file_name = Path.Combine(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), frm.FileName); + StreamWriter sw = File.CreateText(full_file_name); + sw.Close(); + + WorkbenchServiceFactory.FileService.OpenFile(full_file_name, null); + VisualPABCSingleton.MainForm.CurrentCodeFileDocument.AddDesigner(null); + ProjectExplorerWindow.AddSourceFile(fi, true); + VisualPABCSingleton.MainForm.SaveFileAs(VisualPABCSingleton.MainForm.CurrentCodeFileDocument, full_file_name); + } + + public static void ProjectProperties() + { + ProjectProperties pf = new ProjectProperties(); + Form1StringResources.SetTextForAllControls(pf); + pf.LoadOptions(ProjectFactory.Instance.CurrentProject); + //pf.SetProperties(); + if (pf.ShowDialog() == DialogResult.OK) + { + pf.SetOptions(ProjectFactory.Instance.CurrentProject); + ProjectFactory.Instance.Dirty = true; + } + } + + public static void AddFile(ProjectExplorerForm ProjectExplorerWindow, string file_name) + { + PascalABCCompiler.IFileInfo fi = ProjectFactory.Instance.AddSourceFile(file_name); + ProjectExplorerWindow.AddSourceFile(fi,false); + } + + private static OpenFileDialog open_dlg = null; + + private static void openFileDialog_FileOk(object sender, System.ComponentModel.CancelEventArgs e) + { + foreach (string FileName in open_dlg.FileNames) + { + if (Path.GetDirectoryName(FileName) != ProjectFactory.Instance.CurrentProject.ProjectDirectory) + { + File.Copy(FileName, Path.Combine(ProjectFactory.Instance.CurrentProject.ProjectDirectory, Path.GetFileName(FileName)), true); + AddFile(VisualPABCSingleton.MainForm.ProjectExplorerWindow, Path.GetFileName(FileName)); + } + else + AddFile(VisualPABCSingleton.MainForm.ProjectExplorerWindow, Path.GetFileName(FileName)); + } + } + + public static void AddFile(ProjectExplorerForm ProjectExplorerWindow) + { + if (open_dlg == null) + { + open_dlg = new OpenFileDialog(); + open_dlg.Multiselect = true; + open_dlg.FileOk += new System.ComponentModel.CancelEventHandler(openFileDialog_FileOk); + } + open_dlg.FileName = ""; + open_dlg.InitialDirectory = ProjectFactory.Instance.ProjectDirectory; + open_dlg.Filter = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.GetFilterForDialogs(); + open_dlg.ShowDialog(); + } + + public static void RemoveReference(PascalABCCompiler.IReferenceInfo ri) + { + ProjectFactory.Instance.RemoveReference(ri); + //ToolboxProvider.RemoveComponentsFromAssembly(GetReflectionAssembly(ri)); + } + + private static System.Reflection.Assembly GetReflectionAssembly(IReferenceInfo ri) + { + var path = Compiler.get_assembly_path(Path.Combine(ProjectFactory.Instance.ProjectDirectory, ri.FullAssemblyName), false); + if (path == null) + path = Compiler.get_assembly_path(ri.FullAssemblyName, false); + if (path != null) + return PascalABCCompiler.NetHelper.NetHelper.LoadAssembly(path); + return null; + } + + public static void ExcludeFile(PascalABCCompiler.IFileInfo fi) + { + ProjectFactory.Instance.ExcludeFile(fi); + ProjectFactory.Instance.RemoveNamespaceFileReference(fi.Path); + } + + private static TypeLibConverter type_conv = new TypeLibConverter(); + + public static string GenerateStubForCOM(string com_obj) + { + return TypeLibrary.GetManagedWrapperForCOM(com_obj); + } + } +} + diff --git a/VisualPascalABCNETLinux/Projects/ReferenceForm.Designer.cs b/VisualPascalABCNETLinux/Projects/ReferenceForm.Designer.cs new file mode 100644 index 000000000..29a8fc2e1 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ReferenceForm.Designer.cs @@ -0,0 +1,260 @@ + +namespace VisualPascalABC +{ + partial class ReferenceForm + { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tpGAC = new System.Windows.Forms.TabPage(); + this.lvGac = new System.Windows.Forms.ListView(); + this.chComponentName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.chVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tpAssemblies = new System.Windows.Forms.TabPage(); + this.button1 = new System.Windows.Forms.Button(); + this.tpNuGet = new System.Windows.Forms.TabPage(); + this.label2 = new System.Windows.Forms.Label(); + this.tbLog = new System.Windows.Forms.TextBox(); + this.btnSearchPackages = new System.Windows.Forms.Button(); + this.btnInstallPackage = new System.Windows.Forms.Button(); + this.tbPackageName = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.tabControl1.SuspendLayout(); + this.tpGAC.SuspendLayout(); + this.tpAssemblies.SuspendLayout(); + this.tpNuGet.SuspendLayout(); + this.SuspendLayout(); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tpGAC); + this.tabControl1.Controls.Add(this.tpAssemblies); + this.tabControl1.Controls.Add(this.tpNuGet); + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(448, 258); + this.tabControl1.TabIndex = 0; + // + // tpGAC + // + this.tpGAC.Controls.Add(this.lvGac); + this.tpGAC.Location = new System.Drawing.Point(4, 22); + this.tpGAC.Name = "tpGAC"; + this.tpGAC.Padding = new System.Windows.Forms.Padding(3); + this.tpGAC.Size = new System.Drawing.Size(440, 232); + this.tpGAC.TabIndex = 0; + this.tpGAC.Text = "PRJ_GAC"; + this.tpGAC.UseVisualStyleBackColor = true; + // + // lvGac + // + this.lvGac.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chComponentName, + this.chVersion}); + this.lvGac.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvGac.FullRowSelect = true; + this.lvGac.Location = new System.Drawing.Point(3, 3); + this.lvGac.Name = "lvGac"; + this.lvGac.Size = new System.Drawing.Size(434, 226); + this.lvGac.TabIndex = 0; + this.lvGac.UseCompatibleStateImageBehavior = false; + this.lvGac.View = System.Windows.Forms.View.Details; + // + // chComponentName + // + this.chComponentName.Text = "PRJ_COMPONENT_NAME"; + this.chComponentName.Width = 314; + // + // chVersion + // + this.chVersion.Text = "PRJ_VERSION"; + this.chVersion.Width = 103; + // + // tpAssemblies + // + this.tpAssemblies.Controls.Add(this.button1); + this.tpAssemblies.Location = new System.Drawing.Point(4, 22); + this.tpAssemblies.Name = "tpAssemblies"; + this.tpAssemblies.Padding = new System.Windows.Forms.Padding(3); + this.tpAssemblies.Size = new System.Drawing.Size(440, 232); + this.tpAssemblies.TabIndex = 1; + this.tpAssemblies.Text = "PRJ_ASSEMBLIES"; + this.tpAssemblies.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(19, 20); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(93, 23); + this.button1.TabIndex = 1; + this.button1.Text = "PRJ_SEARCH"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.Button1Click); + // + // tpNuGet + // + this.tpNuGet.Controls.Add(this.label2); + this.tpNuGet.Controls.Add(this.tbLog); + this.tpNuGet.Controls.Add(this.btnSearchPackages); + this.tpNuGet.Controls.Add(this.btnInstallPackage); + this.tpNuGet.Controls.Add(this.tbPackageName); + this.tpNuGet.Controls.Add(this.label1); + this.tpNuGet.Location = new System.Drawing.Point(4, 22); + this.tpNuGet.Name = "tpNuGet"; + this.tpNuGet.Size = new System.Drawing.Size(440, 232); + this.tpNuGet.TabIndex = 2; + this.tpNuGet.Text = "PRJ_NUGET"; + this.tpNuGet.UseVisualStyleBackColor = true; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 110); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(73, 13); + this.label2.TabIndex = 5; + this.label2.Text = "NUGET_LOG"; + this.label2.Visible = false; + // + // tbLog + // + this.tbLog.Location = new System.Drawing.Point(17, 126); + this.tbLog.Multiline = true; + this.tbLog.Name = "tbLog"; + this.tbLog.Size = new System.Drawing.Size(407, 82); + this.tbLog.TabIndex = 4; + this.tbLog.Visible = false; + // + // btnSearchPackages + // + this.btnSearchPackages.Location = new System.Drawing.Point(273, 34); + this.btnSearchPackages.Name = "btnSearchPackages"; + this.btnSearchPackages.Size = new System.Drawing.Size(29, 20); + this.btnSearchPackages.TabIndex = 3; + this.btnSearchPackages.Text = "..."; + this.btnSearchPackages.UseVisualStyleBackColor = true; + this.btnSearchPackages.Click += new System.EventHandler(this.btnSearchPackages_Click); + // + // btnInstallPackage + // + this.btnInstallPackage.Location = new System.Drawing.Point(17, 69); + this.btnInstallPackage.Name = "btnInstallPackage"; + this.btnInstallPackage.Size = new System.Drawing.Size(118, 22); + this.btnInstallPackage.TabIndex = 2; + this.btnInstallPackage.Text = "NUGET_INSTALL"; + this.btnInstallPackage.UseVisualStyleBackColor = true; + this.btnInstallPackage.Click += new System.EventHandler(this.btnInstallPackage_Click); + // + // tbPackageName + // + this.tbPackageName.Location = new System.Drawing.Point(19, 34); + this.tbPackageName.Name = "tbPackageName"; + this.tbPackageName.Size = new System.Drawing.Size(249, 20); + this.tbPackageName.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(101, 13); + this.label1.TabIndex = 0; + this.label1.Text = "NUGET_PACKAGE"; + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(277, 264); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(79, 23); + this.btnOk.TabIndex = 1; + this.btnOk.Text = "RF_OK"; + this.btnOk.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(373, 264); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // openFileDialog1 + // + this.openFileDialog1.Multiselect = true; + this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.OpenFileDialog1FileOk); + // + // ReferenceForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(453, 292); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.tabControl1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ReferenceForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PRJ_REFERENCES"; + this.tabControl1.ResumeLayout(false); + this.tpGAC.ResumeLayout(false); + this.tpAssemblies.ResumeLayout(false); + this.tpNuGet.ResumeLayout(false); + this.tpNuGet.PerformLayout(); + this.ResumeLayout(false); + + } + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button btnOk; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.ColumnHeader chVersion; + private System.Windows.Forms.ColumnHeader chComponentName; + private System.Windows.Forms.ListView lvGac; + private System.Windows.Forms.TabPage tpAssemblies; + private System.Windows.Forms.TabPage tpGAC; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tpNuGet; + private System.Windows.Forms.TextBox tbPackageName; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnInstallPackage; + private System.Windows.Forms.Button btnSearchPackages; + private System.Windows.Forms.TextBox tbLog; + private System.Windows.Forms.Label label2; + } +} diff --git a/VisualPascalABCNETLinux/Projects/ReferenceForm.cs b/VisualPascalABCNETLinux/Projects/ReferenceForm.cs new file mode 100644 index 000000000..7e51d999b --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ReferenceForm.cs @@ -0,0 +1,195 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace VisualPascalABC +{ + /// + /// Description of ReferenceForm. + /// + public partial class ReferenceForm : Form + { + public ReferenceForm() + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + // + // TODO: Add constructor code after the InitializeComponent() call. + // + } + + private static ReferenceForm instance; + + public static ReferenceForm Instance + { + get + { + if (instance == null) + { + instance = new ReferenceForm(); + Form1StringResources.SetTextForAllControls(instance); + } + return instance; + } + } + + private List assembly_files = new List(); + public bool fromFile = false; + private AssemblyType assemblyType = AssemblyType.GAC; + + public AssemblyType AssemblyType + { + get + { + if (assemblyType == AssemblyType.File) + return assemblyType; + if (lvGac.SelectedItems.Count > 0) + return AssemblyType.GAC; + //if (lvCom.SelectedItems.Count > 0) + // return AssemblyType.COM; + return AssemblyType.GAC; + } + } + + public void LoadAssemblies() + { + lvGac.Items.AddRange(GetCacheContent().ToArray()); + } + + public void Clear() + { + assembly_files.Clear(); + assemblyType = AssemblyType.GAC; + lvGac.Items.Clear(); + tbLog.Text = ""; + //lvCom.Items.Clear(); + } + + public string[] GetSelectedGACAssemblies() + { + List lst = new List(); + for (int i=0; i lst = new List(); + /*for (int i=0; i GetCacheContent() + { + List itemList = new List(); + foreach (GacInterop.AssemblyListEntry asm in GacInterop.GetAssemblyList()) { + ListViewItem item = new ListViewItem(new string[] {asm.Name, asm.Version}); + item.Tag = asm.FullName; + itemList.Add(item); + } + return itemList; + } + + void Button1Click(object sender, EventArgs e) + { + openFileDialog1.InitialDirectory = ProjectFactory.Instance.ProjectDirectory; + openFileDialog1.Filter = VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.GetAssemblyFilterForDialogs(); + openFileDialog1.ShowDialog(); + } + + void OpenFileDialog1FileOk(object sender, System.ComponentModel.CancelEventArgs e) + { + foreach (string s in openFileDialog1.FileNames) + { + assembly_files.Add(s); + } + assemblyType = AssemblyType.File; + DialogResult = DialogResult.OK; + Close(); + } + + private bool com_page_populated = false; + + void LvComVisibleChanged(object sender, EventArgs e) + { + /*if (com_page_populated == false && lvCom.Visible) { + com_page_populated = true; + PopulateListView(); + }*/ + } + + void PopulateListView() + { + IEnumerable types = TypeLibrary.Libraries; + List sort_types = new List(); + sort_types.AddRange(types); + sort_types.Sort(TypeLibrary.Comparer); + foreach (TypeLibrary typeLib in sort_types) { + ListViewItem newItem = new ListViewItem(new string[] { typeLib.Description, typeLib.Path }); + newItem.Tag = typeLib; + //lvCom.Items.Add(newItem); + } + } + + private void nugetInstalled(bool result, string[] dlls, string[] xmls) + { + assemblyType = AssemblyType.File; + if (result) + { + foreach (string dll in dlls) + assembly_files.Add(dll); + this.DialogResult = DialogResult.OK; + } + else + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void nugetOutput(string output) + { + tbLog.Text += output; + } + + private void btnInstallPackage_Click(object sender, EventArgs e) + { + NuGetTasks.InstallPackage(tbPackageName.Text, + ProjectFactory.Instance.CurrentProject.ProjectDirectory, + new NugetPackageInstallHandler(nugetInstalled), + new NugetPackageOutputHandler(nugetOutput)); + + } + + private void btnSearchPackages_Click(object sender, EventArgs e) + { + System.Diagnostics.Process.Start("https://www.nuget.org/packages"); + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + + } + } +} diff --git a/VisualPascalABCNETLinux/Projects/ReferenceForm.resx b/VisualPascalABCNETLinux/Projects/ReferenceForm.resx new file mode 100644 index 000000000..9bad2f599 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/ReferenceForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Projects/TypeLibrary.cs b/VisualPascalABCNETLinux/Projects/TypeLibrary.cs new file mode 100644 index 000000000..4f0ec8bf7 --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/TypeLibrary.cs @@ -0,0 +1,318 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.CodeDom; +using System.CodeDom.Compiler; +using System.Collections; +using System.Collections.Generic; +using Microsoft.Win32; +using System.IO; +using System.Diagnostics; +using System.Reflection; +using System.Reflection.Emit; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Windows.Forms.Design; + +namespace VisualPascalABC +{ + public class TypeLibraryComparer : IComparer + { + public int Compare(TypeLibrary x, TypeLibrary y) + { + return string.Compare(x.Name, y.Name, true); + } + + } + + public class ConversionEventHandler : ITypeLibImporterNotifySink + { + public void ReportEvent( ImporterEventKind eventKind, int eventCode, string eventMsg ) + { + // handle warning event here... + } + + public Assembly ResolveRef( object typeLib ) + { + // resolve reference here and return a correct assembly... + + //This is where im not sure how to do it + + return null; + } + } + + + public class TypeLibrary + { + string name; + string description; + string path; + string guid; + string version; + string lcid; + bool isolated = false; + + public string Guid { + get { + return guid; + } + } + + public bool Isolated { + get { + return isolated; + } + } + + public string Lcid { + get { + return lcid; + } + } + + public string Name { + get { + if (name == null) { + name = GetTypeLibName(); + } + return name; + } + } + + public string Description { + get { + return description; + } + } + + public string Path { + get { + return path; + } + } + + public string Version { + get { + return version; + } + } + + public int VersionMajor { + get { + if (version == null) { + return -1; + } + string[] ver = version.Split('.'); + + return ver.Length == 0 ? -1 : GetVersion(ver[0]); + } + } + + public int VersionMinor { + get { + if (version == null) { + return -1; + } + string[] ver = version.Split('.'); + + return ver.Length < 2 ? -1 : GetVersion(ver[1]); + } + } + + public string WrapperTool { + get { + // TODO: which wrapper tool ? + return "tlbimp"; + } + } + + private static TypeLibraryComparer comparer = new TypeLibraryComparer(); + public static TypeLibraryComparer Comparer + { + get + { + return comparer; + } + } + + public static IEnumerable Libraries { + get { + RegistryKey typeLibsKey = Registry.ClassesRoot.OpenSubKey("TypeLib"); + foreach (string typeLibKeyName in typeLibsKey.GetSubKeyNames()) { + RegistryKey typeLibKey = null; + try { + typeLibKey = typeLibsKey.OpenSubKey(typeLibKeyName); + } catch (System.Security.SecurityException) { + // ignore type libraries that cannot be read from the registry + } + if (typeLibKey == null) { + continue; + } + TypeLibrary lib = Create(typeLibKey); + if (lib != null && lib.Description != null && lib.Path != null && lib.Description.Length > 0 && lib.Path.Length > 0) { + yield return lib; + } + } + } + } + + static TypeLibrary Create(RegistryKey typeLibKey) + { + string[] versions = typeLibKey.GetSubKeyNames(); + if (versions.Length > 0) { + TypeLibrary lib = new TypeLibrary(); + + // Use the last version + lib.version = versions[versions.Length - 1]; + + RegistryKey versionKey = typeLibKey.OpenSubKey(lib.version); + lib.description = (string)versionKey.GetValue(null); + lib.path = GetTypeLibPath(versionKey, ref lib.lcid); + lib.guid = System.IO.Path.GetFileName(typeLibKey.Name); + + return lib; + } + return null; + } + + static string GetTypeLibPath(RegistryKey versionKey, ref string lcid) + { + // Get the default value of the (typically) 0\win32 subkey: + string[] subkeys = versionKey.GetSubKeyNames(); + + if (subkeys == null || subkeys.Length == 0) { + return null; + } + for (int i = 0; i < subkeys.Length; i++) { + int result; + if (Int32.TryParse(subkeys[i], out result)) { + lcid = subkeys[i]; + RegistryKey NullKey = versionKey.OpenSubKey(subkeys[i]); + string[] subsubkeys = NullKey.GetSubKeyNames(); + RegistryKey win32Key = NullKey.OpenSubKey("win32"); + + return win32Key == null || win32Key.GetValue(null) == null ? null : GetTypeLibPath(win32Key.GetValue(null).ToString()); + } + } + return null; + } + + static int GetVersion(string s) + { + int version; + if (Int32.TryParse(s, out version)) { + return version; + } + return -1; + } + + string GetTypeLibName() + { + string name = null; + + int typeLibLcid; + if (guid != null && lcid != null && Int32.TryParse(lcid, out typeLibLcid)) { + Guid typeLibGuid = new Guid(this.guid); + name = GetTypeLibNameFromGuid(ref typeLibGuid, (short)VersionMajor, (short)VersionMinor, typeLibLcid); + } + + if (name == null) { + name = GetTypeLibNameFromFile(path); + } + + if (name != null) { + return name; + } + return description; + } + + /// + /// Removes the trailing part of the type library filename if it + /// starts with a number. + /// + static string GetTypeLibPath(string fileName) + { + if (fileName != null) { + int index = fileName.LastIndexOf('\\'); + if (index > 0 && index + 1 < fileName.Length) { + if (Char.IsDigit(fileName[index + 1])) { + return fileName.Substring(0, index); + } + } + } + return fileName; + } + + private static TypeLibConverter converter = new TypeLibConverter(); + public static string GetManagedWrapperForCOM(string fileName) + { + ITypeLib typeLib; + if (LoadTypeLibEx(fileName, RegKind.None, out typeLib) != 0) { + return null; + } + if (typeLib == null) + return null; + string fname = null; + try + { + ConversionEventHandler eventHandler = new ConversionEventHandler(); + AssemblyBuilder asm = converter.ConvertTypeLibToAssembly( typeLib, System.IO.Path.Combine(ProjectFactory.Instance.ProjectDirectory,System.IO.Path.GetFileNameWithoutExtension(fileName)+".dll"), 0, eventHandler, null, null, null, null ); + asm.Save(System.IO.Path.GetFileNameWithoutExtension(fileName)+".dll"); + fname = System.IO.Path.GetFileNameWithoutExtension(fileName); + } + finally + { + Marshal.ReleaseComObject(typeLib); + } + return fname; + } + + static string GetTypeLibNameFromFile(string fileName) + { + if (fileName != null && fileName.Length > 0 && File.Exists(fileName)) { + ITypeLib typeLib; + if (LoadTypeLibEx(fileName, RegKind.None, out typeLib) == 0) { + try { + return Marshal.GetTypeLibName(typeLib); + } finally { + Marshal.ReleaseComObject(typeLib); + } + } + } + return null; + } + + static string GetTypeLibNameFromGuid(ref Guid guid, short versionMajor, short versionMinor, int lcid) + { + ITypeLib typeLib; + if (LoadRegTypeLib(ref guid, versionMajor, versionMinor, lcid, out typeLib) == 0) { + try { + return Marshal.GetTypeLibName(typeLib); + } finally { + Marshal.ReleaseComObject(typeLib); + } + } + return null; + } + + enum RegKind { + Default, + Register, + None + } + + [DllImport("oleaut32.dll")] + static extern int LoadTypeLibEx([MarshalAs(UnmanagedType.BStr)] string szFile, + RegKind regkind, + out ITypeLib pptlib); + + [DllImport("oleaut32.dll")] + static extern int LoadRegTypeLib( + ref Guid rguid, + short wVerMajor, + short wVerMinor, + int lcid, + out ITypeLib pptlib); + } +} diff --git a/VisualPascalABCNETLinux/Projects/UserOptionsManager.cs b/VisualPascalABCNETLinux/Projects/UserOptionsManager.cs new file mode 100644 index 000000000..f57fc76af --- /dev/null +++ b/VisualPascalABCNETLinux/Projects/UserOptionsManager.cs @@ -0,0 +1,128 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.IO; +using System.Drawing; +using System.Xml; +using System.Xml.Serialization; +using System.Runtime.Serialization; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + [Serializable] + public class OpenedFileInfo + { + public string FileName; + public bool InProject; + public int CaretLine; + public int CaretColumn; + } + + [Serializable] + public class WatchExprInfo + { + public string Expression; + + public WatchExprInfo(string expression) + { + Expression = expression; + } + } + + [Serializable] + public class UserBreakpointInfo + { + public string FileName; + public int Line; + public bool IsConditional; + public int Kind; + public string Expression; + } + + [Serializable] + public class UserProjectSettings + { + public string CurrentDocument; + public bool CurrentDocumentIsInProject; + public OpenedFileInfo[] OpenDocuments; + public WatchExprInfo[] WatchExprs; + public UserBreakpointInfo[] Breakpoints; + } + + public class ProjectUserOptionsManager + { + private static string opt_ext = ".opt"; + + public static UserProjectSettings MakeOptions() + { + UserProjectSettings options = new UserProjectSettings(); + List openedDocuments = new List(); + List openedProjectDocuments = new List(); + foreach (CodeFileDocumentControl cfdc in VisualPABCSingleton.MainForm.OpenDocuments.Values) + { + OpenedFileInfo fi = new OpenedFileInfo(); + if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(cfdc.FileName)) + { + fi.FileName = PascalABCCompiler.Tools.RelativePathTo(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path),cfdc.FileName); + fi.InProject = true; + } + else + { + fi.FileName = cfdc.FileName; + } + openedDocuments.Add(fi); + fi.CaretLine = cfdc.TextEditor.CaretLine; + fi.CaretColumn = cfdc.TextEditor.CaretColumn; + } + if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName)) + { + options.CurrentDocument = PascalABCCompiler.Tools.RelativePathTo(Path.GetDirectoryName(ProjectFactory.Instance.CurrentProject.Path), VisualPABCSingleton.MainForm.CurrentCodeFileDocument.FileName); + options.CurrentDocumentIsInProject = true; + } + else + options.CurrentDocument = WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName; + options.OpenDocuments = openedDocuments.ToArray(); + string[] exprs = VisualPABCSingleton.MainForm.DebugWatchListWindow.GetExpressions(); + List watches = new List(); + foreach (string s in exprs) + { + watches.Add(new WatchExprInfo(s)); + } + options.WatchExprs = watches.ToArray(); + return options; + } + + public static void SaveOptions(string ProjectPath) + { + try + { + UserProjectSettings setts = MakeOptions(); + string file_name = Path.ChangeExtension(ProjectPath,opt_ext); + System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); + bf.Serialize(new FileStream(file_name, FileMode.Create),setts); + } + catch (Exception e) + { + + } + } + + public static UserProjectSettings LoadOptions(string ProjectPath) + { + UserProjectSettings setts = null; + try + { + string file_name = Path.ChangeExtension(ProjectPath,opt_ext); + System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); + return bf.Deserialize(new FileStream(file_name, FileMode.Open)) as UserProjectSettings; + } + catch (Exception) + { + + } + return setts; + } + } +} diff --git a/VisualPascalABCNETLinux/Properties/Resources.Designer.cs b/VisualPascalABCNETLinux/Properties/Resources.Designer.cs new file mode 100644 index 000000000..d35cee1ee --- /dev/null +++ b/VisualPascalABCNETLinux/Properties/Resources.Designer.cs @@ -0,0 +1,473 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace VisualPascalABC.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VisualPascalABC.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ABCHealth { + get { + object obj = ResourceManager.GetObject("ABCHealth", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignObjectsBottomHS { + get { + object obj = ResourceManager.GetObject("AlignObjectsBottomHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignObjectsCenteredHorizontalHS { + get { + object obj = ResourceManager.GetObject("AlignObjectsCenteredHorizontalHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignObjectsCenteredVerticalHS { + get { + object obj = ResourceManager.GetObject("AlignObjectsCenteredVerticalHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignObjectsLeftHS { + get { + object obj = ResourceManager.GetObject("AlignObjectsLeftHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignObjectsRightHS { + get { + object obj = ResourceManager.GetObject("AlignObjectsRightHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignObjectsTopHS { + get { + object obj = ResourceManager.GetObject("AlignObjectsTopHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AlignToGridHS { + get { + object obj = ResourceManager.GetObject("AlignToGridHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AutoInsertCode { + get { + object obj = ResourceManager.GetObject("AutoInsertCode", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap BringToFrontHS { + get { + object obj = ResourceManager.GetObject("BringToFrontHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap BringToFrontHS1 { + get { + object obj = ResourceManager.GetObject("BringToFrontHS1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap browserNavigBack_Image { + get { + object obj = ResourceManager.GetObject("browserNavigBack.Image", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap copy { + get { + object obj = ResourceManager.GetObject("copy", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap cut { + get { + object obj = ResourceManager.GetObject("cut", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Delete { + get { + object obj = ResourceManager.GetObject("Delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Delete3 { + get { + object obj = ResourceManager.GetObject("Delete3", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap format { + get { + object obj = ResourceManager.GetObject("format", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Intellisense { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Intellisense", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Options { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Options", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_CompilerConsole { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Window_CompilerConsole", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_DebugVariablesList { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Window_DebugVariablesList", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_DebugWatches { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Window_DebugWatches", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_ErrorList { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Window_ErrorList", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_FindSymbolResult { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Window_FindSymbolResult", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_Immediate { + get { + object obj = ResourceManager.GetObject("Icons.16x16.Window.Immediate", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Icons_16x16_Window_Output { + get { + object obj = ResourceManager.GetObject("Icons_16x16_Window_Output", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap new_file { + get { + object obj = ResourceManager.GetObject("new_file", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap new_file1 { + get { + object obj = ResourceManager.GetObject("new_file1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap new_file11 { + get { + object obj = ResourceManager.GetObject("new_file11", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap open { + get { + object obj = ResourceManager.GetObject("open", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap paste { + get { + object obj = ResourceManager.GetObject("paste", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Pointer { + get { + object obj = ResourceManager.GetObject("Pointer", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap print { + get { + object obj = ResourceManager.GetObject("print", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap PrintHS { + get { + object obj = ResourceManager.GetObject("PrintHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap redo { + get { + object obj = ResourceManager.GetObject("redo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap save { + get { + object obj = ResourceManager.GetObject("save", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap save_all { + get { + object obj = ResourceManager.GetObject("save_all", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SendToBackHS { + get { + object obj = ResourceManager.GetObject("SendToBackHS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap start { + get { + object obj = ResourceManager.GetObject("start", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap stop { + get { + object obj = ResourceManager.GetObject("stop", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap undo { + get { + object obj = ResourceManager.GetObject("undo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/VisualPascalABCNETLinux/Properties/Resources.resx b/VisualPascalABCNETLinux/Properties/Resources.resx new file mode 100644 index 000000000..9075be6fc --- /dev/null +++ b/VisualPascalABCNETLinux/Properties/Resources.resx @@ -0,0 +1,535 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\PrintHS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAno2AY0k1Y0k1 + Y0k1Y0k1Y0k1Y0k1Y0k1Y0k1Y0k1AACAAACAAACAAACAAACAAACAm4p9/Pr42cCu1byrz7emyLGgwaub + u6aWt6KTY0k1AACAAACAAACAAACAAACAAACAm4p9/v7++/j39vHt8ejh697W5dXJ4c2+vKWWY0k1AACA + AACAAACAAACAAACAAACAno2A/////v39+vf19e/q8Obf693T5dTHwaqbY0k1AACAAACAAACAAACAAACA + AACAopGE/////////f37+fXz9O3o7+Tc6dvQyLGhY0k1AACAAACAAACAAACAAACAAACAp5WI//////// + /////Pv6+fTx8+zm7ePaz7emY0k1AACAAACAAACAAACAAACAAACAq5qM/////////////////Pr49/Pv + 8urk1byrY0k1AACAAACAAACAAACAAACAAACAsJ6Q//////////////////7++/n39vHt2cCuY0k1AACA + AACAAACAeMnjiNnviub6Ob7lmdjfkeH2gdDp/////////v79xK2dw6ucZEo2AACAAACAAACAouX1MLff + fen9Xcbmk/D/L7bfoOj5////////qZiKZEo2ZEo2ZEo2AACAAACAAACAmev6k/H/v/j/r+j0x/v/k/H/ + n/D/////////rpyO1MW6ZEo2z8W+AACAAACAAACAIqvZU7/hr+j08P/9tOv2U7/hNrvl////////sqCS + ZEo20Ma/AACAAACAAACAAACAmev6lvP/x/v/reXzw/v/lvP/i9fitqSWtqSWtaOV0cfAAACAAACAAACA + AACAAACAoOT0MbjgjPH/WMLjkPH/Lrbfk9zvAACAAACAAACAAACAAACAAACAAACAAACAAACAbcXhiNnv + mOr6Jq7bj+j5lN3vh8viAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA6Mi66Ma1AACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA4Y1s741Z4svCAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACA0X5Z8IhQ3buqAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACA3r2p8IhQx39fAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA8JBg4HhA0cG4 + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA5si38IhQsFgwAACAAACAAACA0HBAwGhA + sGAwoFgwkFAwkEggAACAAACAAACAAACA7r2i74ZZmltHAACAAACAAACAAACA8LiQ8Jhw8IBQ4HAwkFAw + AACAAACAAACAAACA77mb4H5KpXBSAACAAACAAACA1sW7qXhp8KBw8JBg8IBQoFgwAACAAACAAACAAACA + 77mb4H5Kmls5AACAAACAzauXpGA6oFAw7ZNi8KBw8JhwsGAwAACAAACAAACAAACA78Wp8IhQoFgwtn5U + vYFes2c6sGAw8JBg7aFw5Mm47MWswGhAAACAAACAAACAAACA78W377uk4H5Ks2g7sGhAwndJ75Vo76R3 + 5M7AAACAAACA0HBAAACAAACAAACAAACAAACA78Kz776p7rCN7q+N7q+M76SG5svAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACA7NPK7cqy7r2p6NLHAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACsElEQVQ4T52T2UtUYRjG/S+6CCIqKLK0 + hQIzsqysbIMkUUbDJRW3yIm0NLPSjBSli1wy1BbKUohyyiWZybLAC8uSdhfcHfccneXM9us7x8ZJuuuD + h3PgO8/vfd4HjgegKL96jL+V+3CMrLujpN7Wk3RzhKjCYUKuDXHk8iABGYPsSB3AR90/b3YB7r2BymYn + ZVoHxY12brywkf/USk6NRGaVhbR7JlLKjSTcMhJTNMvGmPeLAS7lPBglvXKUUyXzk4NzhwjMHGDnn6ku + eUe1ugFVdW3isfg4hex2J5LVidHsYGbOxuSMDf2UlYExiS0Hot2A+7Wtsoej2WP4Z+iVCZsTfyLZHHiG + v2Z1sIZJg41RYR4U5rrXnxYDKp60KADXcTjAanNilhwYjHamZPO0laFxiT695V9A2WOdYjyUNcDu1C58 + UnoxWxx4nWxXEoxP2xiemDd3DZn/BRQ/eEl3dzeHj4XQ2KTFZLEzZ7IzLfYe/2VjZMLKs/q3bNvhz49+ + EzWNHxcDLmQXEhkZSVBSBSGqCKWDX7N2vGLaWSsS9Iu9k9SZrFzjxddeE/eft7sBHR0dinn7rn3MGEzM + iehy4xNy45OSaNxCz4iZnLxSVqz2oqPH6AZotVrF7OMXQPGtchF9vrRJg1UpTW68V2+mc9DMtz6TSLCB + D51zbkBKihq1+gxBoVGkpp0n+fRZNPU63rZ9p7TyEXHxyYSERXM8LFYkDBQAb6qaOt2A2Lh4DAYDrz47 + KaidZdmq9Wza4ktUbALBoSeQJImmL3YuVY+zZOlyce+pGF3yKCgooLkT7ryDIvEvHDh4lD0B+0k7l44q + PILmn1Am7i7WwroNW5FXdhUvy6OlpYWG2gYRNRFfv71cunJ14QONRkPe9TxUKhUlJaXodDrkwl33shZe + /k94/Aa8APszT/SghwAAAABJRU5ErkJggg== + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACA35x2sGBAsGAwoFAwoEggkEAQkDgQgDAAgDAAAACAAACAAACAAACAAACA + AACAAACA4Jhw8MCg0KCA0JBwwIBgsGhQoGBAoFgwgDAAAACAAACAAACAAACAAACAAACAAACA4Jhw/8iw + 8LiQ8KCA4Jhw4Ihg0HhQsGhAgDAQAACAAACAAACAAACAAACAAACAAACA8KCA/9DA/8Cg8LCQ8KCA4JBw + 4IhgsGhQkDgQAACAAACAAACAAACAAACAAACAAACA8KCA/9jQ/8iw8Lig8KiQ8KCA4JhwwHhQkEAQAACA + AACAAACAAACAAACAAACAAACA8KiA/+DQ/9DA/8Cg8LCQ8KiA8KCA0JBwoEggAACAAACAAACAAACAAACA + AACAAACA8LCA/+jg/9jQ/8iw/8Cw8Lig8LCQ4KCAoFAgAACAAACAAACAAACAAACAAACAAACA/7CQ/+DQ + /+DQ/9jA/9DA/8iw/8iw8LigsFgwAACAAACAAACAAACAAACAAACAAACA/7CQ/7CQ8LCA8KiA8KCA8KCA + 4Jhw4Jhw4Jx3AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + ..\Resources\AlignObjectsBottomHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\AlignObjectsCenteredVerticalHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\AlignObjectsLeftHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACNklEQVQ4T42Q30tTYRzGz59QUH+DF5EV + 4oU3EQVBXtidRFEX1rqoKDNYoEiUohdmVDjFxCRHHXIRtWohUtPC6YW29KJW03DbOft19kPntrPz8+m8 + 7+bsbAa+8JyX9z3v8/k+3y8DgOmbiONf9byI486zGKwjUVwbiKDlQRhnenk03eVwsoPDUWsIDW1Bwwqm + DBj/AoxN63jyScPgpIqHHxT0vZHR7ZDQyRZwezyPm6M5XBnOwWLbxBHLohmwpe7nMbSPxXB9qFi5uYdH + Y2cIx0pVt3SoZX4bwLoWyMG0dEOqqkOSdeREDRtZBckNBdGUjFBcQv2pi+RZEWB3UhpOd8VxvCNKK9Rd + /Q1J0XDg/Axqmt8hmVEQM8ycYXbNLJkBT19/JYfy0jRAVnSIkoZMTkWKmNMyeEFCIFqoBjg+FhM0GQlO + tEdoArGgofaSlyYQ0grCiaJ5hRerAS73Is6N+KAbjStG36RyNq8ibfQtrCuIJGSkPjdgNSziVzAPx+R3 + M4CY59YkHL7ghM0p0ATrmypqLV60PlpGYGIfJO4lph/vx4+1POzvvduAxt4Far7BBsDUDSNrRCcTT5CJ + J43YJTNJMHhrL5b/5MyA+svustkfzNChca08HRqZ+NLoHmC2hpo9cx5882fNAPopmX0rAWqW3BLdp+ZX + 4XJ7qNn+6i3YKT9VFaB/iIW1awDWezbcP9gPwZagkNmzHvrwfyoDKkUgP9t8FFb5r1I7XhLtxky04+Xu + BeYvawEODflOrRsAAAAASUVORK5CYII= + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAwNDJAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAEGAQwtHLAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAEGggAGAQxdPNAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAIHAgIHAwAGAQx9XPAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAIHgw + MIBAIHAwAGAQyNfQAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAMIAwUKBgMIBAIHAwAGAQ + y9jSAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAQIBAYLBwUKBgMIBAIHAwEGggy9jSAACAAACA + AACAAACAAACAAACAAACAAACAAACAQIhQcMBwcMBwUKBgMHhAx97MAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAUJBQcMBwoNiwMHhAyN/MAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAUJhg + oNiwMHhAyeDNAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAYJhgMHhAyuDOAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAYJhgy+HPAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAzOLPAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAno2AY0k1Y0k1 + Y0k1Y0k1Y0k1Y0k1Y0k1Y0k1Y0k1AACAAACAAACAAACAAACAAACAm4p9/Pr42cCu1byrz7emyLGgwaub + u6aWt6KTY0k1AACAAACAAACAAACAAACAAACAm4p9/v7++/j39vHt8ejh697W5dXJ4c2+vKWWY0k1AACA + AACAAACAAACAAACAAACAno2A/////v39+vf19e/q8Obf693T5dTHwaqbY0k1AACAAACAAACAAACAAACA + AACAopGE/////////f37+fXz9O3o7+Tc6dvQyLGhY0k1AACAAACAAACAAACAAACAAACAp5WI//////// + /////Pv6+fTx8+zm7ePaz7emY0k1AACAAACAAACAAACAAACAAACAq5qM/////////////////Pr49/Pv + 8urk1byrY0k1AACAAACAAACAAACAAACAAACAsJ6Q//////////////////7++/n39vHt2cCuY0k1AACA + AACAAACAeMnjiNnviub6Ob7lmdjfkeH2gdDp/////////v79xK2dw6ucZEo2AACAAACAAACAouX1MLff + fen9Xcbmk/D/L7bfoOj5////////qZiKZEo2ZEo2ZEo2AACAAACAAACAmev6k/H/v/j/r+j0x/v/k/H/ + n/D/////////rpyO1MW6ZEo2z8W+AACAAACAAACAIqvZU7/hr+j08P/9tOv2U7/hNrvl////////sqCS + ZEo20Ma/AACAAACAAACAAACAmev6lvP/x/v/reXzw/v/lvP/i9fitqSWtqSWtaOV0cfAAACAAACAAACA + AACAAACAoOT0MbjgjPH/WMLjkPH/Lrbfk9zvAACAAACAAACAAACAAACAAACAAACAAACAAACAbcXhiNnv + mOr6Jq7bj+j5lN3vh8viAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACA5sW0162S2tnYAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA4MrB8IhQ + 0HhQzbWqAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA4tvW2bin8IhQ0H5YAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAxX5e8IhQ1bShAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAybuy4HhA8JBgAACAAACAAACAAACAAACA4HhA0HBAwGhAsGAw + sFgwkFAwAACAAACA19HNwGhA8IhQ2r6uAACAAACAAACAAACA4IBQ4HAw8IBQ8Jhw4JBg59XPAACAAACA + AACAwGhA34VY6LidAACAAACAAACAAACA4JBg8IBQ8JBg8KBwqnlp1sW7AACAAACAAACAwGhA335J6bSX + AACAAACAAACAAACA4Jhw8Jhw8KBw75VosGBAsGBAy6uXAACA19XRo2A6335J6bSXAACAAACAAACAAACA + 8KiA7siu68i18LCQ4JBgwHBAwGhAu4BctX1ToGBA8IhQ7MOnAACAAACAAACAAACA8KiQ6uXfAACA68Wx + 8LCQ75Vo0HBAsGhAsmc6335J7rqj7MO1AACAAACAAACAAACAAACAAACAAACAAACA7b2l8LCQ7raa7a+M + 7a+M7byo7sGy2tjZAACAAACAAACAAACAAACAAACAAACAAACAAACA6NXI7L2l7b2o68iw5s3G29raAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAwHBAsFgwsFgwoFAg + oFAgkEggkEggkEAggEAgAACAAACAAACAAACAAACAAACAAACAwHhQ//jw0LCg0LCg0LCgwLCgwKigwKiQ + kEAgAACAAACAAACAAACAAACAAACAAACA0Ihg////4JBg0IBQ0IBQ0IBQ0IBQwKigkEggAACAsKCQYEgw + YEgwYEgwYEgwYEgw0JBw//////////Dw8ODQ8NDA8MCwwLCgkEggAACAsKCQ//Dw8ODQ4NjQ4NDA4MjA + 4KCA////8KiA4Jhw4JBg0IBQ0IBQ0LCgoEggAACAsKCQ//jw4LCA4KBw4KBw0Jhw4KiQ//////////// + //jw8Ojg8NDA0LCgoFAgAACAwKiQ//////jw8PDw8Ojg8ODQ4Lig/////7CQ/7CQ8NjQ4JBgsFgwsFgw + oFAgAACAwKig/////8ig8LiQ4LCA4KBw8MCg////////////////8Jhw8MiwsFgwyrqyAACAwLCg//// + //////j///Dw8Ojg8Miw////////////////8KiAwGgw0b6zAACAAACA0Liw/////9jA/9Cw8ODQsKCQ + 8Miw8MCw8MCw8Lig8LCQ8LCQ2srAAACAAACAAACA0MCw////////////////wKiQ0MjAkHBgyMjFAACA + AACAAACAAACAAACAAACAAACA4MCw////////////////wLCgoIBgy8nGAACAAACAAACAAACAAACAAACA + AACAAACA4MCw4MCw0MCw0MCw0Liw0LCg087NAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + ..\Resources\browserNavigBack.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\format2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsQAAALEAGtI711AAAA6ElE + QVQ4T82RrQ7CMBSF6/YMoPcAPAHhxyB5hEnkJLISWYmsnJycnERWIiuRVYQEcbi37SCQtZnkJJ/Ylvud + 3k78T1TjwEhGW9RnQllUzMliLw1WR6I2WBwM4tgnPKx7vFEd0YKEQK0dCR2qSFKQPIGccALdGUzKA1js + qhFBGwS6abNYSyuMC2jxXKjZEWlBEwS1lEmcA8w1IVBR8Btu9dAwlWcEmv6ZEJ6x3Qd6kxMURWBoHZpv + AWOB/pITlCXcbD7azLCgzQme6y3uy42/ad6V4SN7aJCHswL+MJU49h166y8xPk6IEC/jMt5BpHjAnQAA + AABJRU5ErkJggg== + + + + ..\Resources\SendToBackHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\format.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\BringToFrontHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\PrintHS.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\BringToFrontHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABGklEQVQ4T2P4//8/RRir4Lt9lv9BGF0c + G8YQAGn89rT//5d7tf9PzBAHCqHKo2MUDrLmT2dDwBjdkLtXvv+/lHr5/8OzN8HieDW/Xsf7f1qxIFgh + CN+78g2s+dfaX2D6wZnr5Gn+NeP3/9sFd/736PZCJEF4R5/U//d7dVE0L1y4EIzXz1v//0bOTQzNcBcg + G4JuM8gAEH39wpf/m2w2wzVjhAEMI2sGYZgBIHz+5Gew5pz8CXAxuEJcGNkAEN629+3/6Nk34GJwCVwY + Fg4gPHXBKrDmmWf//3cuPgmUJsIAGD5z7Q5cc82Wl2A2g/FM7IrR8bnrd7FqBslh1YANg1xgmrwVRTMI + YyjEh89cuYWiGYRRFJCO/zMAAPvG+J4+mDFyAAAAAElFTkSuQmCC + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA07qsmmlGZ0I7 + uKGXAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA1I1tsGBAkFAwYU04AACAzraoZ0I6 + Z0Irs6CUAACAAACAAACAAACAAACAAACAAACA4IBQ4tTO0bWqgFAwAACAxoxssGBAYEAwOisrAACAAACA + AACAAACAAACAAACAAACA4IhQ5dbO29DKkFAw3t7e0HhQ3M/Ju6WbcEAwAACAAACAAACAAACAAACAAACA + AACA4qaA4IhQsGhAkFAwqn9p0HhQ3dbTzLSmkFAwAACAAACAAACAAACAAACAAACAAACA6tnT75Vo4IZZ + pGBJmmJGwXZJ0HhQwGhAuZeGAACAAACAAACAAACAAACAAACAAACAAACA6NfR7KaL4IBQ1pp/0HhQ0H5Y + 1J+H0rqvAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAhXdocGBQgGhQu7KtAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACA09LUkIBwgHBgcGBQfHhzAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAy7y3oJiQsKumkIBwZ1hYAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAwrOz + oJCQ2dvc0MjAcGBQw8fJAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAsJiQw7qxAACA7+fggHBg + w8fJAACAAACAAACAAACAAACAAACAAACAAACAAACA3NzaoJiQ29vbAACA8O/swLCwubeyAACAAACAAACA + AACAAACAAACAAACAAACAAACA0MnKtq+pAACAAACAAACA3+Dgp6OeAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA0klEQVQ4T6WRqxLCMBBF+0n9BCSST6hE + ViIjkZHIyMrIykpkJDISGYm73O1rmJKkhe7Mmcmks+fupgWAXUQvf2E+6CZAUILxqG9Ee1TC1eOkHA4X + UjuUZ8eWiMB0mNEtsaAQqE2gMKAaSQqSE6gNE5i2v1yvF1AeKzktBHYQmMZm8Z4rxAVcPFdMDiQtaAZB + rVSSEAD3SAj0KFiWpPawmeEZgeE/Y8X2/qRzK4K+ptQp+TngPNDdd0wgApsTTK8syK6CjNzDRmnOCuTD + Vr4E/4HiDU9GETteJZO8AAAAAElFTkSuQmCC + + + + ..\Resources\Pointer.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAzklEQVQ4T6WSIRLCMBREeySOgERyBI7Q + IyCRkchKZGTll8hIZCQyEvf5G5pMkyYphc68GabNvt0O7Zj5L4o3txB/DKPhiA5Qyi1lIcgv9yrgmI11 + vD+ecKQuqIXtUwQPCHocmwlkcrg0GR/Qs9dRMlkN5AV0t7w75AsmwaIVSLNvn9BlAcVAa8FZaXm+Iohk + zZgPVgWtBf3lmwWV5vYCaQhhtCGorp93BmgGBoKxJpBQqxlhY1m+1oYAHwnJKfzXmJogQYSrAtzcQiL4 + De7e5oAugatAC10AAAAASUVORK5CYII= + + + + ..\Resources\AlignToGridHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADDDgAAww4AAAAAAAAAAAAA/wD//wD/ + /wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/ + /wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/oaCfVlZVkZGRtra2/wD//wD//wD//wD/ + /wD//wD/vLy8uLi4/wD//wD//wD/u7u7Z2ZmFxMSTUtKpaSkvr6+/wD//wD//wD//wD/vb29cnBwmpqa + vr6+/wD//wD//wD/kJCPIBgWKyYlcG9uuLi4/wD//wD//wD/vr6+qqqpODc3qqqqvr6+/wD//wD//wD/ + u7u7XlpZKSQhQDw7qKen/wD//wD/urq6trW1TUtJZGJgvr6+/wD//wD//wD//wD//wD/srGxQ0E+JSEe + U1BQtLS0uLi4uLi4ZGJgOTY2r66u/wD//wD//wD//wD//wD//wD//wD/r66uQ0E/LSgnW1pZnZ2cUE1M + MzEwgoGA/wD//wD//wD//wD//wD//wD//wD//wD//wD/rq6uRkJBMS4tNDAvODU0QkA//wD//wD//wD/ + /wD//wD//wD//wD//wD//wD//wD//wD/nJubNzIxPTo5REFAtbS0/wD//wD//wD//wD//wD//wD//wD/ + /wD//wD/v7+/q6urWVdWOzc2Ojc2Ojs5W1lWurq6/wD//wD//wD//wD//wD//wD//wD/vb29iYiIREJB + Qj4+dXV0qKendXJyPDw9b21rt7e2/wD//wD//wD//wD/s7OzpKSkZ2VkPzw6QD8+bnBxuru7/wD/u7u7 + cXFwQ0E/dXR0ubm4/wD//wD/vr6+kI+PZmNjPTk3RUFAh4aGvr6+/wD//wD//wD/u7u7n56dTU1OcnFx + /wD//wD/vr6+jo2NREFBR0dGmpqavr6+/wD//wD//wD//wD//wD/vb29sbGxi4uL/wD//wD/wMDAqamp + aGlnoaGgv7+//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/ + + + + ..\Resources\AlignObjectsCenteredHorizontalHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAC10lEQVQ4T3VRWU8TURglPhg1xn9gfOAN + H9QXH7RRI24JosEiwgtRiSgFXIIIISyCsghWiCIGCohEsKAVAlWoEqCUFAIlWAsUBqVQoItsBUrX6Rzv + zCQWg37JNzf3zDnnnu/eAABbetagQ1/bU7RJsyF9dR+UfpjAW3lscx+LaQZf1BTkPXrIlTooGtNgszbA + bn0D42gJ0hNCUdOkQrWsG5L3XdAOqYlsk0G7eoIF/lS7LB+Dg3WorH2Nif4s5CQJQfsAl4eBw0njZkoR + S/MbyFXjLMDV16ZizFISrJmrYKVyYegXQV4dhZKCZNiJeEhvhbiigaX6DVqUYyzAVVN9HiTFIkjECSjJ + iUNR5g2U5idB9q4Cy2s01Np5FEs+sFS/QXOXjgX+Kh+J7Pb44HD5sLpBY2nVC8uyB50DRjx+/pal+A1k + Hd9YgC8GZF6GE284fbDZaSwQsXnRjRmrC597p3AtqZBl+g0aFUMsAIaIvTQDp9vHzbuyTmNxgsKv6kJQ + z9IxnPcAPTkpKI+LwQ9tPyvhDaSfBrjI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DA0Ghg//////////jw8PDw8Ojg8NjQ4NDA4MjAoDgQwGBg + kEhQAACAAACA4Jig/8DA0HBw//////////////jw8PDw8Ojg8NjQ4NDAoEAg0GhgoFBQAACAAACA8KCg + /8DA4Hhw//////////////////jw8PDw8Ojg8NjQsEgw0HBwoFBQAACAAACA8Kig/8DA4ICA//////// + //////////////jw8PDw8OjgsFAw4HiAoFBQAACAAACA8LCw/8DA8IiQ//////////////////////// + //jw8PDwwFBAYDAwsFhQAACAAACA8LCw/8DA/5CQ//////////////////////////////jwwFhQsFhg + sFhgAACAAACA8Liw8Liw8LCw8LCw8Kiw8KCg4Jig4JCQ4JCQ4IiQ4ICA0HiA0Hhw0HBwAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABXklEQVQ4T6WSPU/DMBCG8xMYGfkJHhkz + dsxP8MiYkTEjoweQ+BostQNjgAooisALVVhQhBBCqEMWPkaPbIffS53EEJAQlR7X996957uqERH9i0ER + mLIiYxz4dsyKuZO/17UXpXMCPgbF9S3pI0PVU83Nckc/D4Igv6hI7YZNFotnbmw/LFlrSecmyPPLPkAy + zXQbe9C0frdU1zVPg6l8jhvA6Ekz1SbBvLzjqarKrVE2q2Sqe5QPvJpsZCRTNhNWgQ4mh2M2w5RtaUo9 + y0nblzzLCbiJ1ZpqmZCME0i9Gqe7leSmCs0ePwmvJWJcg3xxdcNm3IMEeJmMyUjJK+HT/8GGCILXvW2q + RjHl6zFlq4ISmTr59ybt5W2/M6sVQffHZ06mKE6aJkoPN2nMBzuB+eHk3MldkRhJxIOT8GGEIL0mGvPp + zElhEfhpEj5gBI/TyyD5FUyC/0JfCwr+DkWfcYfy5YVMq4EAAAAASUVORK5CYII= + + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + gGhQIDBAIDBAIDBAIDBAIDBAIDBAIDBAIDBAIDBAztPZYICQUGBwQFBgMEBQIDBAkHBg8ODQsKCQsKCQ + sKCQsKCQsKCQsKCQsKCQIDBAcICQILjwAJDQAJDQAJDQAJDQkHhg8Ojg8NjQ4NDA4MjA0MCw0Liw0Liw + sKCQIDBAcIiQcMjwELjwELDwAKjgAJjQoIBw8PDwwLCgwLCgwKigsKCQ0MCwsKCQsKCQIDBAgIiQcNDw + MMDwELjwAKjwAKDgoIiA//j/8PDw8Ojg8NjQ4NDAcFhQYFBAUEhAQEBAgJCggNjwQMjwMMDwELjwAKDg + sJCA////wLCgwLCgwKig8ODQgGBQ0MjAYFBAAACAgJigkODwYNjwUMjwMMDwELDwsJiQ//////////j/ + 8PDw8OjggGhQgGBQAACAAACAgJigoOjwgODwcNjwUNDwELDwsKCQsJiQsJCAoIiAoIBwkHhgkHBgAACA + AACAAACAkKCgsPD/oOj/kODwcNDwEKDQEKDQEKDQEJjQAJDQAJDQAJDQMDhAAACAAACAAACAkKCwsPD/ + oPD/YICQYHCAUHCAUGhwUGhwUGBwQFhwIHCQAJDQQEhgAACAAACAAACAkKiwsPD/sPD/YIiQkMjQkOjw + gNjgYMjgUJiwQFhgIICgAJDQUFhwAACAAACAAACAkKiwsPDwsPD/oPDwcJigoPDwa3+GgMjQUHCAMGCA + YMDwILjwUGBwAACAAACAAACAxNDVkKiwkKiwkKiwYJCgoOjwoOjwkNjgQGhwcIiQgIiQcIiQvsjMAACA + AACAAACAAACAAACAAACAAACA5+rsgLDAgLDAgKCwxczRAACAAACAAACAAACAAACAAACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + ..\Resources\AlignObjectsTopHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAzbCvsl9nsFhgsFhQoFBQ + kEhQkEhAgEBAcDhAcDhAAACAAACAAACAAACAAACAAACAwGhw0IiAwGBQUEhAgICA4NjQsLiwUEBAoEhA + gEBAAACAAACAAACAAACAAACAAACAwHBw4JCQ0IiAYFBAcGBgsLCg0NDAYFhQoEhAgEBAcDhAcDhAAACA + AACAAACAAACAwHiA4Jig4JCQYFBAYFBAYFBAYFBAYFBAsFBQkEBAoEhAgEBAAACAAACAAACAAACA0ICA + 8KCg4Jig4JCQ0IiA0HiAwHBwwGhgsGBQkEhQoEhAgEBAcDhAcDhAAACAAACA0IiQ8Kiw0Hhw0GBgwFhQ + sFBAsEAgsEgwwGhgkEhQsFhQkEBAoEhAgEBAAACAAACA0JCQ8LCw4HBw//////jw8Ojg4NjQsFBAwHBw + oFBQsGBQkEhQoEhAgEBAAACAAACA4Jig/7jA8IiA//////////jw8OjgwFhQoGBgoFBQwGhgkEhQsFBQ + kEhAAACAAACA4KCg/8DA/5CQ//////////////jw0GBggEBAsFhQwHBwoFBQsGBQkEhQAACAAACA4Kig + 4KCg4Jig0JCQ0IiQ0ICAwHiAwHBwwHBwsGBgsGBgoFBQwGhgoFBQAACAAACAAACAAACA4KCg/8DA/5CQ + //////////////jw4KCgoHBwoFBQwHBwoFBQAACAAACAAACAAACA4Kig4KCg4Jig0JCQ0IiQ0ICAwHiA + wHhwwHBwsGBgsHhwsFhQAACAAACAAACAAACAAACAAACA4KCg/8DA/5CQ//////////////jw0IiAoHhw + sFhQAACAAACAAACAAACAAACAAACA4Kig4KCg4Jig0JCQ0IiQ0ICAwHiAwHBwwGhwsGBgAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + ..\Resources\AlignObjectsRightHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\format1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAcIiQYICQYHiAUHCAUGBwQFhg + QEhQMDhAIDAwICAwEBggEBAQEBAgAACAAACAAACAcIiQkKCwcLDQAJDQAJDQAJDQAJDAEIjAEICwEICw + IHigIHCQIEhgnqeoAACAAACAgIiQgMDQkKiwgOD/YND/UMj/UMj/QMDwMLDwMKjwIKDgEJDQIGiAWWFn + AACAAACAgJCggNDwkKiwkMDQcNj/YND/YND/UMj/UMD/QLjwMLDwMKjwEIjQIEhgw8rNAACAgJCggNjw + gMjgkKiwgOD/cND/YNj/YND/YND/UMj/QMDwQLjwMLDwIGiAaouaAACAgJigkODwkOD/kKiwkLjAcNj/ + YNj/YNj/YNj/YND/UND/UMj/QLjwMKDgSWd3xczRgJigkODwoOj/gMjgkKiwgOD/gOD/gOD/gOD/gOD/ + gOD/gOD/cNj/cNj/UKjQh5KdkKCgoOjwoOj/oOj/kLDAkLDAkKiwkKiwgKCwgKCwgJiggJiggJCggJCg + gIiQcIiQkKCwoOjwoPD/oOj/oOj/gNj/YNj/YNj/YNj/YNj/YNj/YNj/cIiQAACAAACAAACAkKCwoPDw + sPDwoPD/oOj/oOj/cNj/kKCggJiggJiggJCggJCQcIiQAACAAACAAACAkKiwoNDgsPDwsPDwoPD/oOj/ + kKCws8nOAACAAACAAACAAACAAACAkGhQkGhQkGhQzdbakKiwkKiwkKiwkKiwkKiwtsXKAACAAACAAACA + AACAAACAAACA0sfGkGhQkGhQAACAAACAAACAAACAAACAAACAAACAAACAAACAkHhgyLqzAACAAACAoJCA + 0s3HkHhgAACAAACAAACAAACAAACAAACAAACAAACAAACA2NjToJCAoIiAsJiAxb63AACAAACAAACAAACA + AACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACAAACA + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 + JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB+0lEQVQ4T31RTUsbURSdH1AKrgruiwuF + CuJCmkCgKzeBpAsxhQp1IaZuRBpdtMX0B3QlYgjYRRelC4tNZuLH+FGUggVb6sKorbX1a+KMUWvVGpOY + 03fvMGNsnx043HfPO+e8+94oAP6LzyvfRZHvEaSkg4Wv67gXX8anpW+ilWukJGHhi22OfQTudH3AfHpV + 0P/qLjVPXljojlvoiGVc82PV5LVSF8PtngxqHpqobpkWcknAo7iJtn65ubbTQFW7ybh5d0jIJQGvUvMo + lUrY3MuhvlVzzdQTf1Y4x4+dE9Q3tgq5JOBlYk4U+yMTmdfMHI5Oizg4KsA8yGNmRr06YPDNrCj2Vzwv + Yc06xQmZjwuwfuZhbqexP9WApvvNJLkcEOmOIBgM0gac9e9cEYfHRWQP89g1bDM2+jA3cAObSymS2gHJ + xLBrEld11/rEJPZ/FZDNpLE3fovNZ4udbsj6ogZFSybYoGkaPF6viFS4Uu/z+fB6SEVydhX6u0mMPq8E + 3ldxCE0z2HNdjB6JwO/384lkpDCuZTw9GoHuTiYKiT64Zk9AQsMwWOj12BNQLefpmg6MlXH0d1VcvAEJ + dV1HIBCARxizVoZrOe+YHWwtj7kcB4TDYT7pWbSXA6K9TznA4R2xDPz7QqGQOCmIkZTKAZr6lt/C4f82 + XQDKH/Sd31Epdaa+AAAAAElFTkSuQmCC + + + + ..\Resources\Delete3.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\new_file1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Properties/Settings.Designer.cs b/VisualPascalABCNETLinux/Properties/Settings.Designer.cs new file mode 100644 index 000000000..4537e4b3a --- /dev/null +++ b/VisualPascalABCNETLinux/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.1 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace VisualPascalABC.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/VisualPascalABCNETLinux/Properties/Settings.settings b/VisualPascalABCNETLinux/Properties/Settings.settings new file mode 100644 index 000000000..39645652a --- /dev/null +++ b/VisualPascalABCNETLinux/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/VisualPascalABCNETLinux/ReplaceConfirmDialog.Designer.cs b/VisualPascalABCNETLinux/ReplaceConfirmDialog.Designer.cs new file mode 100644 index 000000000..9584580df --- /dev/null +++ b/VisualPascalABCNETLinux/ReplaceConfirmDialog.Designer.cs @@ -0,0 +1,122 @@ +namespace VisualPascalABC +{ + partial class ReplaceConfirmDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lMessage = new System.Windows.Forms.Label(); + this.btYes = new System.Windows.Forms.Button(); + this.btNo = new System.Windows.Forms.Button(); + this.btAll = new System.Windows.Forms.Button(); + this.btCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lMessage + // + this.lMessage.AccessibleRole = System.Windows.Forms.AccessibleRole.None; + this.lMessage.AutoSize = true; + this.lMessage.Location = new System.Drawing.Point(13, 9); + this.lMessage.Name = "lMessage"; + this.lMessage.Size = new System.Drawing.Size(35, 13); + this.lMessage.TabIndex = 0; + this.lMessage.Text = "TEXT"; + // + // btYes + // + this.btYes.Location = new System.Drawing.Point(16, 43); + this.btYes.Name = "btYes"; + this.btYes.Size = new System.Drawing.Size(75, 23); + this.btYes.TabIndex = 1; + this.btYes.Text = "!YES"; + this.btYes.UseVisualStyleBackColor = true; + this.btYes.Click += new System.EventHandler(this.btYes_Click); + // + // btNo + // + this.btNo.Location = new System.Drawing.Point(97, 43); + this.btNo.Name = "btNo"; + this.btNo.Size = new System.Drawing.Size(75, 23); + this.btNo.TabIndex = 2; + this.btNo.Text = "!NO"; + this.btNo.UseVisualStyleBackColor = true; + this.btNo.Click += new System.EventHandler(this.btNo_Click); + // + // btAll + // + this.btAll.Location = new System.Drawing.Point(259, 43); + this.btAll.Name = "btAll"; + this.btAll.Size = new System.Drawing.Size(75, 23); + this.btAll.TabIndex = 3; + this.btAll.Text = "!ALL"; + this.btAll.UseVisualStyleBackColor = true; + this.btAll.Click += new System.EventHandler(this.btAll_Click); + // + // btCancel + // + this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btCancel.Location = new System.Drawing.Point(178, 43); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(75, 23); + this.btCancel.TabIndex = 4; + this.btCancel.Text = "!CANCEL"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // + // ReplaceConfirmDialog + // + this.AcceptButton = this.btYes; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btCancel; + this.ClientSize = new System.Drawing.Size(346, 78); + this.Controls.Add(this.btCancel); + this.Controls.Add(this.btAll); + this.Controls.Add(this.btNo); + this.Controls.Add(this.btYes); + this.Controls.Add(this.lMessage); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ReplaceConfirmDialog"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "!CONFIRM"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btYes; + private System.Windows.Forms.Button btNo; + private System.Windows.Forms.Button btAll; + private System.Windows.Forms.Button btCancel; + public System.Windows.Forms.Label lMessage; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ReplaceConfirmDialog.cs b/VisualPascalABCNETLinux/ReplaceConfirmDialog.cs new file mode 100644 index 000000000..01549b9aa --- /dev/null +++ b/VisualPascalABCNETLinux/ReplaceConfirmDialog.cs @@ -0,0 +1,46 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class ReplaceConfirmDialog : Form + { + public enum ModalResult {Yes,No,All,Cancel} + public ModalResult Result; + public ReplaceConfirmDialog() + { + InitializeComponent(); + } + + private void btYes_Click(object sender, EventArgs e) + { + Result = ModalResult.Yes; + Close(); + } + + private void btNo_Click(object sender, EventArgs e) + { + Result = ModalResult.No; + Close(); + } + + private void btCancel_Click(object sender, EventArgs e) + { + Result = ModalResult.Cancel; + Close(); + } + + private void btAll_Click(object sender, EventArgs e) + { + Result = ModalResult.All; + Close(); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ReplaceConfirmDialog.resx b/VisualPascalABCNETLinux/ReplaceConfirmDialog.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/VisualPascalABCNETLinux/ReplaceConfirmDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ReplaceForm.Designer.cs b/VisualPascalABCNETLinux/ReplaceForm.Designer.cs new file mode 100644 index 000000000..22fd5e2ed --- /dev/null +++ b/VisualPascalABCNETLinux/ReplaceForm.Designer.cs @@ -0,0 +1,241 @@ +namespace VisualPascalABC +{ + partial class FindReplaceForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.lReplaceTo = new System.Windows.Forms.Label(); + this.btFindNext = new System.Windows.Forms.Button(); + this.btCancel = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.cbUseRegex = new System.Windows.Forms.CheckBox(); + this.cbSearchUp = new System.Windows.Forms.CheckBox(); + this.cbMathWord = new System.Windows.Forms.CheckBox(); + this.cbMathCase = new System.Windows.Forms.CheckBox(); + this.btReplace = new System.Windows.Forms.Button(); + this.btReplaceAll = new System.Windows.Forms.Button(); + this.tbTextToFind = new System.Windows.Forms.ComboBox(); + this.tbTextToReplace = new System.Windows.Forms.ComboBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 10); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(55, 17); + this.label1.TabIndex = 2; + this.label1.Text = "L_FIND"; + // + // lReplaceTo + // + this.lReplaceTo.AutoSize = true; + this.lReplaceTo.Location = new System.Drawing.Point(27, 38); + this.lReplaceTo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lReplaceTo.Name = "lReplaceTo"; + this.lReplaceTo.Size = new System.Drawing.Size(107, 17); + this.lReplaceTo.TabIndex = 3; + this.lReplaceTo.Text = "L_REPLACETO"; + // + // btFindNext + // + this.btFindNext.Location = new System.Drawing.Point(313, 155); + this.btFindNext.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btFindNext.Name = "btFindNext"; + this.btFindNext.Size = new System.Drawing.Size(135, 33); + this.btFindNext.TabIndex = 4; + this.btFindNext.Text = "FINDNEXT"; + this.btFindNext.UseVisualStyleBackColor = true; + this.btFindNext.Click += new System.EventHandler(this.btFindNext_Click); + // + // btCancel + // + this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btCancel.Location = new System.Drawing.Point(456, 155); + this.btCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(100, 33); + this.btCancel.TabIndex = 5; + this.btCancel.Text = "!CANCEL"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.button2_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.cbUseRegex); + this.groupBox1.Controls.Add(this.cbSearchUp); + this.groupBox1.Controls.Add(this.cbMathWord); + this.groupBox1.Controls.Add(this.cbMathCase); + this.groupBox1.Location = new System.Drawing.Point(16, 64); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox1.Size = new System.Drawing.Size(540, 84); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "G_OPTIONS"; + // + // cbUseRegex + // + this.cbUseRegex.AutoSize = true; + this.cbUseRegex.Location = new System.Drawing.Point(248, 52); + this.cbUseRegex.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbUseRegex.Name = "cbUseRegex"; + this.cbUseRegex.Size = new System.Drawing.Size(111, 21); + this.cbUseRegex.TabIndex = 3; + this.cbUseRegex.Text = "USE_REGEX"; + this.cbUseRegex.UseVisualStyleBackColor = true; + // + // cbSearchUp + // + this.cbSearchUp.AutoSize = true; + this.cbSearchUp.Location = new System.Drawing.Point(248, 23); + this.cbSearchUp.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbSearchUp.Name = "cbSearchUp"; + this.cbSearchUp.Size = new System.Drawing.Size(110, 21); + this.cbSearchUp.TabIndex = 2; + this.cbSearchUp.Text = "SEARCH_UP"; + this.cbSearchUp.UseVisualStyleBackColor = true; + // + // cbMathWord + // + this.cbMathWord.AutoSize = true; + this.cbMathWord.Location = new System.Drawing.Point(8, 52); + this.cbMathWord.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbMathWord.Name = "cbMathWord"; + this.cbMathWord.Size = new System.Drawing.Size(177, 21); + this.cbMathWord.TabIndex = 1; + this.cbMathWord.Text = "MATH_WHOLE_WORD"; + this.cbMathWord.UseVisualStyleBackColor = true; + // + // cbMathCase + // + this.cbMathCase.AutoSize = true; + this.cbMathCase.Location = new System.Drawing.Point(8, 23); + this.cbMathCase.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cbMathCase.Name = "cbMathCase"; + this.cbMathCase.Size = new System.Drawing.Size(110, 21); + this.cbMathCase.TabIndex = 0; + this.cbMathCase.Text = "MATH_CASE"; + this.cbMathCase.UseVisualStyleBackColor = true; + // + // btReplace + // + this.btReplace.Location = new System.Drawing.Point(159, 155); + this.btReplace.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btReplace.Name = "btReplace"; + this.btReplace.Size = new System.Drawing.Size(135, 33); + this.btReplace.TabIndex = 7; + this.btReplace.Text = "REPLACE"; + this.btReplace.UseVisualStyleBackColor = true; + this.btReplace.Click += new System.EventHandler(this.btReplace_Click); + // + // btReplaceAll + // + this.btReplaceAll.Location = new System.Drawing.Point(16, 155); + this.btReplaceAll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.btReplaceAll.Name = "btReplaceAll"; + this.btReplaceAll.Size = new System.Drawing.Size(135, 33); + this.btReplaceAll.TabIndex = 8; + this.btReplaceAll.Text = "REPLACEALL"; + this.btReplaceAll.UseVisualStyleBackColor = true; + this.btReplaceAll.Click += new System.EventHandler(this.btReplaceAll_Click); + // + // tbTextToFind + // + this.tbTextToFind.FormattingEnabled = true; + this.tbTextToFind.Location = new System.Drawing.Point(144, 10); + this.tbTextToFind.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tbTextToFind.Name = "tbTextToFind"; + this.tbTextToFind.Size = new System.Drawing.Size(411, 24); + this.tbTextToFind.TabIndex = 9; + // + // tbTextToReplace + // + this.tbTextToReplace.FormattingEnabled = true; + this.tbTextToReplace.Location = new System.Drawing.Point(144, 38); + this.tbTextToReplace.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tbTextToReplace.Name = "tbTextToReplace"; + this.tbTextToReplace.Size = new System.Drawing.Size(411, 24); + this.tbTextToReplace.TabIndex = 10; + // + // FindReplaceForm + // + this.AcceptButton = this.btFindNext; + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btCancel; + this.ClientSize = new System.Drawing.Size(572, 203); + this.Controls.Add(this.tbTextToReplace); + this.Controls.Add(this.tbTextToFind); + this.Controls.Add(this.btReplaceAll); + this.Controls.Add(this.btReplace); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.btCancel); + this.Controls.Add(this.btFindNext); + this.Controls.Add(this.lReplaceTo); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FindReplaceForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "FORMTEXT"; + this.TopMost = true; + this.Shown += new System.EventHandler(this.FindReplaceForm_Shown); + this.Activated += new System.EventHandler(this.FindReplaceForm_Activated); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FindReplaceForm_FormClosing); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lReplaceTo; + private System.Windows.Forms.Button btFindNext; + private System.Windows.Forms.Button btCancel; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox cbMathWord; + private System.Windows.Forms.CheckBox cbMathCase; + private System.Windows.Forms.CheckBox cbSearchUp; + private System.Windows.Forms.CheckBox cbUseRegex; + private System.Windows.Forms.Button btReplace; + private System.Windows.Forms.Button btReplaceAll; + public System.Windows.Forms.ComboBox tbTextToFind; + public System.Windows.Forms.ComboBox tbTextToReplace; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ReplaceForm.cs b/VisualPascalABCNETLinux/ReplaceForm.cs new file mode 100644 index 000000000..2925658c2 --- /dev/null +++ b/VisualPascalABCNETLinux/ReplaceForm.cs @@ -0,0 +1,272 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class FindReplaceForm : Form + { + private Form1 Form1; + public enum FormType { Find, Replace }; + public int resOffset=-1; + public int resLength=-1; + public bool findSuccess=false; + FormType formType; + public ReplaceConfirmDialog ReplaceConfirmDlg; + public bool ReplaceAllExec = false; + public System.Text.RegularExpressions.Match Match; + public System.Text.RegularExpressions.MatchCollection Matches; + private string lastSearched; + + public FindReplaceForm(FormType formType) + { + InitializeComponent(); + this.formType = formType; + this.ActiveControl = this.tbTextToFind; + if (formType == FormType.Find) + { + this.AcceptButton = this.btFindNext; + this.tbTextToReplace.Visible = false; + this.lReplaceTo.Visible = false; + this.btReplace.Visible = false; + this.btReplaceAll.Visible = false; + } + else + { + this.AcceptButton = this.btReplace; + AddOwnedForm(ReplaceConfirmDlg = new ReplaceConfirmDialog()); + PascalABCCompiler.StringResources.SetTextForAllObjects(ReplaceConfirmDlg, "VP_REPLACECONFIRMDLGFORM_"); + } + } + + private void button2_Click(object sender, EventArgs e) + { + resOffset = -1; + resLength = -1; + ReplaceAllExec = false; + Close(); + } + + private void UpdateLastWordsList(System.Windows.Forms.ComboBox cb) + { + if (cb.Items.Count > 0) + { + if ((string)cb.Items[0] != cb.Text) + cb.Items.Insert(0, cb.Text); + } + else + cb.Items.Add(cb.Text); + } + + int startOffset; + + public bool FindNext(bool exec_goto_action=true) + { + Form1 = (Form1)this.Owner; + UpdateLastWordsList(this.tbTextToFind); + if (exec_goto_action) + startOffset = Form1.CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Caret.Offset; + if (cbSearchUp.Checked && resLength >= 0) + startOffset -= resLength; + resOffset = -1; + //resLength = -1; + System.Text.RegularExpressions.RegexOptions options = System.Text.RegularExpressions.RegexOptions.None; + if (!cbMathCase.Checked) + options = options | System.Text.RegularExpressions.RegexOptions.IgnoreCase; + if (cbSearchUp.Checked) + options = options | System.Text.RegularExpressions.RegexOptions.RightToLeft; + string pattern = this.tbTextToFind.Text; + if (pattern == "") + { + findSuccess = false; + return findSuccess; + } + if (!cbUseRegex.Checked) + pattern = System.Text.RegularExpressions.Regex.Escape(pattern); + if (cbMathWord.Checked) + pattern = @"\b" + pattern + @"\b"; + System.Text.RegularExpressions.Regex Regex; + try + { + Regex = new System.Text.RegularExpressions.Regex(pattern, options); + } + catch (Exception e) + { + MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("VP_REPLACEFORM_REGEXPERR{0}"),e.Message), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + findSuccess = false; + return findSuccess; + } + if (cbSearchUp.Checked) + Match = Regex.Match(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent, 0, startOffset); + else + Match = Regex.Match(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent, startOffset); + + if (findSuccess = Match.Success) + { + resOffset = Match.Index; + resLength = Match.Length; + //Point p = Form1.CurrentSyntaxEditor.TextEditor.Document.OffsetToPosition(resOffset); + if (exec_goto_action) + { + ICSharpCode.TextEditor.TextLocation p = Form1.CurrentSyntaxEditor.TextEditor.Document.OffsetToPosition(resOffset); + Form1.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(null, p.Y + 1, p.X + 1, p.Y + 1, p.X + resLength), VisualPascalABCPlugins.SourceLocationAction.FindSelection); + } + else + startOffset = resOffset + resLength; + } + return findSuccess; + } + + public bool Replace(bool exec_goto_action=true) + { + UpdateLastWordsList(this.tbTextToReplace); + if (!findSuccess) + FindNext(exec_goto_action); + if (findSuccess) + { + /*Form1.CurrentSyntaxEditor.TextEditor.Document.Remove(resOffset, resLength); + Form1.CurrentSyntaxEditor.TextEditor.Document.Insert(resOffset, tbTextToReplace.Text);*/ + Form1.CurrentSyntaxEditor.TextEditor.Document.Replace(resOffset, resLength, tbTextToReplace.Text); + resLength = tbTextToReplace.Text.Length; + //Point p = Form1.CurrentSyntaxEditor.TextEditor.Document.OffsetToPosition(resOffset); + if (exec_goto_action) + { + ICSharpCode.TextEditor.TextLocation p = Form1.CurrentSyntaxEditor.TextEditor.Document.OffsetToPosition(resOffset); + Form1.ExecuteSourceLocationAction(new PascalABCCompiler.SourceLocation(null, p.Y + 1, p.X + 1, p.Y + 1, p.X + resLength), VisualPascalABCPlugins.SourceLocationAction.SelectAndGotoEnd); + } + else + startOffset = resOffset + resLength; + resOffset = -1; + findSuccess = false; + return true; + } + else + return false; + } + + private void button1_Click(object sender, EventArgs e) + { + + } + + private void groupBox2_Enter(object sender, EventArgs e) + { + + } + + private void btReplace_Click(object sender, EventArgs e) + { + lastSearched = this.tbTextToFind.Text; + Replace(); + } + + private void btFindNext_Click(object sender, EventArgs e) + { + FindNext(); + } + + private void btReplaceAll_Click(object sender, EventArgs e) + { + startOffset = 0; + if (FindNext(false)) + { + Close(); + ReplaceAll(); + /*while (findSuccess) + { + ReplaceConfirmDlg.lMessage.Text = String.Format(PascalABCCompiler.StringResources.Get("VP_REPLACECONFIRMDLGFORM_REPLACE{0}TO{1}"), Match.Value, tbTextToReplace.Text); + ReplaceConfirmDlg.ShowDialog(); + if (ReplaceConfirmDlg.Result == ReplaceConfirmDialog.ModalResult.Yes) + Replace(); + else + if (ReplaceConfirmDlg.Result == ReplaceConfirmDialog.ModalResult.Cancel) + return; + else + if (ReplaceConfirmDlg.Result == ReplaceConfirmDialog.ModalResult.All) + { + + ReplaceAll(); + return; + } + FindNext(); + }*/ + } + } + + internal void ReplaceAll() + { + UpdateLastWordsList(this.tbTextToReplace); + if (findSuccess) + { + System.Text.RegularExpressions.RegexOptions options = System.Text.RegularExpressions.RegexOptions.None; + if (!cbMathCase.Checked) + options = options | System.Text.RegularExpressions.RegexOptions.IgnoreCase; + if (cbSearchUp.Checked) + options = options | System.Text.RegularExpressions.RegexOptions.RightToLeft; + string pattern = this.tbTextToFind.Text; + if (pattern == "") + { + findSuccess = false; + return; + } + if (!cbUseRegex.Checked) + pattern = System.Text.RegularExpressions.Regex.Escape(pattern); + if (cbMathWord.Checked) + pattern = @"\b" + pattern + @"\b"; + + try + { + if (lastSearched == this.tbTextToFind.Text) + { + int offset = Form1.CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret.Offset; + Form1.CurrentSyntaxEditor.TextEditor.Document.Replace(offset, + Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent.Length - offset, + System.Text.RegularExpressions.Regex.Replace(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent.Substring(offset), pattern, tbTextToReplace.Text)); + } + else + Form1.CurrentSyntaxEditor.TextEditor.Document.Replace(0, Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent.Length, System.Text.RegularExpressions.Regex.Replace(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent, pattern, tbTextToReplace.Text)); + //Form1.CurrentSyntaxEditor.TextEditor.Document.CommitUpdate(); + } + catch (Exception e) + { + MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("VP_REPLACEFORM_REGEXPERR{0}"), e.Message), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + findSuccess = false; + lastSearched = null; + return; + } + lastSearched = null; + findSuccess = false; + + } + + } + + private void FindReplaceForm_Shown(object sender, EventArgs e) + { + Form1 = (Form1)this.Owner; + this.ActiveControl = tbTextToFind; + startOffset = Form1.CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Caret.Offset; + + /*string selt = Form1.CurrentSyntaxEditor.SelectedText; + if (selt != string.Empty) + tbTextToFind.Text = selt;*/ + } + + private void FindReplaceForm_FormClosing(object sender, FormClosingEventArgs e) + { + e.Cancel = true; + this.Visible = false; + } + + private void FindReplaceForm_Activated(object sender, EventArgs e) + { + FindReplaceForm_Shown(sender, e); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/ReplaceForm.resx b/VisualPascalABCNETLinux/ReplaceForm.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/VisualPascalABCNETLinux/ReplaceForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Resources/AlignObjectsBottomHS.png b/VisualPascalABCNETLinux/Resources/AlignObjectsBottomHS.png new file mode 100644 index 0000000000000000000000000000000000000000..60003933304ce6d2e9abfa703163e2bc12cb05e2 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?a(lWshE&`-GTGMaNPtM|{^vevhBuquB}j1#UfRWUTE|Ixd*XW`9ThXPWJM0< zrlc>Lc5(Oo^X9qEaXhHVr)l$a?}x&3e*-mDk7cw^oRya~Cq8D`6rtGZ6*cQD?QVrf zTM7vBJ>M;J=KGFa`)=Af<+SP@JbYPO|5tA8d9}!2rcR-uC#%mF?OdY4C7P_lRb#?8 zG4Dp>_jxwwBXz_WT5bqMeenCoW^hbFDPwK5!wcCPVU0nD8J^4dUJkhaRb1hLHOJZ{ zv)O#iYqm-xZ@Bi&LB7JgPl4&-7|gvy$cwG44$rjF6*2UngCKJoE`uG literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/AlignObjectsCenteredHorizontalHS.png b/VisualPascalABCNETLinux/Resources/AlignObjectsCenteredHorizontalHS.png new file mode 100644 index 0000000000000000000000000000000000000000..c9622baf52fe3a62462f530e93e81d7e8fd13d15 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx&hT*_jGX#skpUg@E`D*3LN3}<~jD{+Tpp?{KiRXIg16Ov(`3t%;>n`CwxMn`EvJ6T~oouLZKh+ zJ`{u(R2xsddb3&a`meKvrDZKzM^bhq^!RrjWNBtQpL+D+lV9&e>zr5&jBlPu*lOMI zy>VN&itmvxj=|@ub*e;H{hIsd&yU^K4cu;*n_ee;jF=dIu0DOkj(Vjf>s8mCUQy$A vLD23+Rfqoiug5<8<9(E;SGfNE4@-uhQB6xqbP0l+XkKiO`OW literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/AlignObjectsCenteredVerticalHS.png b/VisualPascalABCNETLinux/Resources/AlignObjectsCenteredVerticalHS.png new file mode 100644 index 0000000000000000000000000000000000000000..7910fae89e60d7102f83b3a37a4969aae6cc5994 GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx&hTb_H=O!skn7z^2RKtKmphD8UN0!&Cn|4lCF2;xDlz<_`v?gl8xIulQlJ)SQc@J z?Vhw|_jz;u$*(x0bFSn(Eio?MS-!(qIn8ZuMu2ga@SQnKCBKEeFXb~_yFKOQ4rOsc z854u5J;(~D=I!po%K26vnXlJTki9D{GRu89%}i<>^r+-?|j+M3mVrj zEbsmN?!nimJD*JBx7V=~Dq8;Eddc0ia~THf-<BboFyt I=akR{0C!%GW&i*H literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/AlignObjectsLeftHS.png b/VisualPascalABCNETLinux/Resources/AlignObjectsLeftHS.png new file mode 100644 index 0000000000000000000000000000000000000000..6d1af563475d6769cb3b44d771084edbc03af621 GIT binary patch literal 425 zcmV;a0apHrP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-A4x<(RCwCNlfg;@F%(5_+D!k-Pq1qj;s+F5_yvM% z-S`{sh3<>1u8Rvn7!Z^hCyGN%UgqVxkb$CYDXrjzkOxT)_uV9hB=*q&d&>4jF)RoG zNt2n+=ZrC;ZCiv8;Jt@)4wK2m{34J9N!Wp<9axgYY&K)lG_0zMWm$5uSa3WZv){Ws z>?&JjSzz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-JV``BRCwB?Q^86DF%+C^cfpGv;I&ZbPxuM;>^JmR ztRS8g#2=^!PletW52ao_6c2*1;6YlGifha!n~Vo(k#@J(`XGdt%o~QuM3BUPD%$aG zS#j0jcsyoN6v*=&#u#X=p_D?m+Z9P8Apkh<1OR~K+Dg-uQc6yzQ)XGl$z;M#r$ds6 zqnL3NbAhc?kYyQ$!y%MXn9XL;TBFvhDg`7VrHp>}Cl~#LjSBjMJ9_WoN)P88tSe!y zgS8f>u<$;hcX_j4Ya&S;9~~kPa2~Mb&t3%JJvZo`o}=Ar?$r{6K$HP^d6oG1GAN9P zE(L5UV74%P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-6G=otRCwC7ld(zzK@>&LlaPc4l_pjz!pDj1a@>s|E%x=iYapq?8ykI}Dsr{}7R_ zP*O_rCj>GygQbPCEK>-9`Fu{E=W>2=nNmu0UE=Y%;`nG^daFJDiiHpYS(Y)I%>YnU z4kx=DO!m0CzFEoXYhFtMYb~mZF$RF9Rk{QZPp`a~x0T?2B=Fu-*ELmDEd-i|M&YCO zsCJus;GDx+i*pWu*tEnJg4f>(7-N`Dr}SHiaY5i(0g=sHD2hUgqF8>!7zrK3Rv3>* z+gI6#$h-AK6@rgz4O}DmKB^rjr)S*W-4kQ;e@z^G3!ei3u}r2x&R+*300000NkvXX Hu0mjfNvofZ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/AlignToGridHS.png b/VisualPascalABCNETLinux/Resources/AlignToGridHS.png new file mode 100644 index 0000000000000000000000000000000000000000..abddef8df3c126c98fa1650c7aa78193b11f462e GIT binary patch literal 530 zcmV+t0`2{YP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-h)G02RCwB?ld)@5K@i4&??{>d!O9dus;F2cor0th zB8r7rTBWlPg4l>+uudSARR~%s7Ge=mY&4<>5wrTB3nTBc#kC#vlgZr;TG{Wu2&5=_F5}gU$4p;Z#Vim)7yv!FGn)E>shIx{CpT)6dSl!KEOS5+H`l)zh}@`=g?+If$%>>jRQ%^XafTULK; z3khcl=OfO9^O2(H0N|Sd>TJgd&Jx}d&V(JtYQHyjf{8lY`wq4~ejzU%-V$aaM(7s# zSQRGf$-CFj`0#dz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;CrLy>RCwB?l1)ohK>&uIbFb1Sg#JTPn}Q6pps+-6 zQ~r(?fe^GVFoJ3kL2W97+Eh?cm{t^;v~STSNG;UjqSt%RJ?G4sGc#vCTAaW{`+#1U z<@?O@4ikkC_@8tEyqTE`T9@R7M&t#lC`dAiEEHGHk41k4XkBvTP#?L>X?GIhb_Zh& zw;#S_cJ6)GiNRy`cYr8_z@w*AVc_6Cnyr}SPqP4c@A1y#oX1*+vliJnG;F@WlB&fPQ_fhx3yxA1C>P&DxQcbr&Z z@$)@Q??vr6s7eDyxK2cCboP>Kv;JTCJGF2ljBZe=mzmOO?T|v85&0jIS$g zoXjvvVx__q25U5}wk4MZA`_IQ+Xmnq7bjLxI*{jeGEpZT*mt`7_ zRS040gzb_`#l(Xtq&8$(fz~D6-F2dR4MGV2be_MM-tla5s@6L&8if#;oPHIB5cn|w Xb4a$e-)-?q00000NkvXXu0mjfWJ@d= literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Delete.bmp b/VisualPascalABCNETLinux/Resources/Delete.bmp new file mode 100644 index 0000000000000000000000000000000000000000..c097bc4206bad78f5bfda01acddb624370aca8fe GIT binary patch literal 824 zcmZ?rwP0od12Z700mK4O%*Y@C7H0y=ALfH#umF(w&+wlPXyJnSVPT;YCr;e9Z5yU_ zd-m+vv112ZeE06%>1k==!a}~@UQ3rO*|%>WTnfn8yLWFi=H{zbtwL50v?4AlQd33I!Nz*U^5qcockSA>ZR=KFZ_kvZ1Z2e! z*-aZaIy>5_D#`^11Z>%|1!xNp099I=nXO;94%vlpHc;Hz(Oy?WJvu6K?%X*6zCOl= z22G6(a0Qr*b?er-IXN2Y>6#emTbPCluC<=Y;0`vbF;T^ zM~TGEn>R06vLrn<#oors!QL*fpm5jj-9U4Ifm~Qv01ScBl9HV}q45h0*a`jpY01g9 zmgcUG4()Ai$UzO%GJoD&UthnX!a|5kfU0E8 X4y;_cG9xp6;lc$#|3U=ukPHj}m@C3o literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Delete3.bmp b/VisualPascalABCNETLinux/Resources/Delete3.bmp new file mode 100644 index 0000000000000000000000000000000000000000..40908d6edca42aea21eaa89c2a35b9b385b33561 GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpTufKV87W1@ptgLMKj~xNX}uObhqy*|THE z4!HR4-MiD%(!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z;1l8sRKQ?7(=>UjbMeXihUw9>Z`5pg*_gyLuY#{fw|A4x=1ZxUZ{*y(U2x~b4DpAn zMBZ+ddAn8i-8Px``}E%*F!=yNrXNrHe>@%V`C87GYuPi;{{J=O_pi0TzCLLE^04jE zz3<=N-FW=&$KN-9L3WLT(GVC+A&~Mip9Pqw7)pZtg8z?fz!3bMT@@HNoCO|{#S9GG zf*{OTpAtV2C@4|l8c`CQpH@-L15RjOeSEA?V8lq5UtY>gmKimzd*yr^8ap{W|-v9sdE&u-CAOBKtLt2Sl+}XL(b$|AM`*FYi?1iZbXJ6FpnI(N~ z-~amGFZciFs^dN|>*CKJruy~&|Nq%r|NrTo=Z+?eKYq-PW4KcD_kKNNJEy?ejGCrd z{ILvK+gvi-o;|)AWA*yvf8FH`vwEWrnl1kPF-vbo;s5`e4&VQ`S=yw*6f82U@_&8F z<;MR!0bmQ4ui5|kzGC6C`f3F>O_%5Vlh%Cr|G%EC$dF;rrxzVP96ud^-eT}{^>bP0 Hl+XkKPc)v6 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.Continue.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.Continue.png new file mode 100644 index 0000000000000000000000000000000000000000..f0739de381e954e0984136a5fffa65395e67e022 GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP(r-K zHKHUqKdq!Zu_%=xATcwqM9 z|M-Fj|LbQcroVe!##zQ}rNGuuaEPhH``n$wc|a91QVp}r9ZZ>Tva$aEubuMee?8|5 z-7hl^WHm4b2;WFsk=DqHF?hQAxvX? literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepInto.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepInto.png new file mode 100644 index 0000000000000000000000000000000000000000..3d2dba5388749e2199695247c403068f30b21c7e GIT binary patch literal 327 zcmV-N0l5B&P)OTMg002ovPDHLkV1j{Hgb)A# literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepOut.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Debug.StepOut.png new file mode 100644 index 0000000000000000000000000000000000000000..9a9d6d401fb7fa3ecf975d96cf47e76677c15b71 GIT binary patch literal 317 zcmV-D0mA-?P)p)J#jVZAm?0r%U!0HlMAd+GbvRb?@0L2c9Vr*f7rT`;G3Aqg2 z1{4G4ufO}>A>+XRtoD;YbHM2ZGd6G~q@MW~|CdcXi;~K)g%{Q^09lpYc^bE^s4hXc zI;-R4f3Nb3U|S>W4}lFJgu%M&CLR7CQhwyWL&XKSlglO&X@G%8!+(Q-3I81u7W@w= zIPgER?&AM|iUa?%oA(j#0=MX%|1g7)qk)j~F(M$YZ07%j;K%JR0yCf;IENG`dCi5bpw52qzS;{U290lb}YJ ZdH@NnjQ7Kzd!+yX002ovPDHLkV1hvyhd%%S literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Delegate.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Delegate.png new file mode 100644 index 0000000000000000000000000000000000000000..a1dcc15cb927de3aac5dc549d20519c9533cdbe0 GIT binary patch literal 1469 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRAAwoZsC_ezDS?m#A>J?Y+9bf66Tpf~DADZ3}k=-1X z+Ztckkx=rM!Te8x1)uq(S zm(#CY%e{0X_vWp<+qVnu^v>Bfy=U{ZN!upO+c0VV&gqNS&Rn`~*0Oa|7H*!pcByVlNGabWJsLkrd(Ubyzi z;`PUtZ8*Mc)A8k-PpsN{WaXBVtGAtAyZy}C9cR|>JiBSZ={>71ZrFWx(W`rpT|2q#+R-hyF7A2ss{8fp32%PQ`2B0y?_X;S5H^JdbZ}!iHiqLTt9H)#_@A^PMp7U^8DSi zmv5cB^6>8Amlv-+x^&~wwL8yl-g|cI-t*fJUfh5D>gn}&FK&K#@c8wkr*9rVfBWS5 z>nG3OJ$v!~`Kz}tUVVJ|=Hu(PpI*QF{Px}F51+n%{PgY1*B{@$|NQ>r*Uw+SfBpLN z_wPR-`2YVuFuq0s6+__KYtE{55LLY}HH`i85{A2&NTrKkTwbjRtA6wzJqtN&d z|BLr;v$A!-}DKY#AS{k6*%Z(X*=BhWR}&+k}U z@5BAY=}|>ZOUrgNZJM)X38(hq`u1!( xEvtv;|K}q|U0PaMepKwRxDheKM{%Dk6NCQDYH^uWPdyz|bz!zqe_-vsw(1gpnFl}RqYkRC1T zx08N12bDlwE764VHApsCq$r6DDZDSFLSU*VP0Sl4nF5l_N~~I{!AM>tE`T3#AQlr! z1?pvF(l9=+8$?vv>j-L2R*Ti(d54ai44kPUAV`H#QF2 z(FU@;L$IAkf!TQ@0@f0GhSF+9*Qf`@?jAVv?5uVRI++sFfE}(-0OH&Nu8b8_L%2zy z-#Lhv{Rm#0TX4%+k+yY!&%NVx`w+I^L9lLwh6vC?yr4F>5;N=Lv4rvCqL{19LO>QT&*l(e(^00000NkvXXu0mjf5pL9> literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Enum.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Enum.png new file mode 100644 index 0000000000000000000000000000000000000000..bfed35598d881f0e394a97f092517b84a7b9d199 GIT binary patch literal 1352 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sR8SseSrKDZ6=zeIWM7-)kX|)4uW@#M1fO5qD;h;iZ)pH#Rul+u?b0f98YjE|2#3J=*L4cwfNN!;w!9M?F0n^ZZ20%Twtu zPiMY5pa1G&(d&!FuP>Fpxl;M|TFtu~^`{SPet*09{q5HGcUnK*>wI)^<;MqopC0yq zdOY#Vvl(BW&HVOy{@2$FzQ0}e{q1?6BS*n#2+$$~#HUQT1I$wlB|(0{|3@}p2>#Bl z3Jhb;0*}aI1_o|H5N51TiJu4*lqhkHC<)F_D=AMbN@WO0%*-p%^K%VRC^ObGHgITh z2NhGLo-U3d8o|jw`q?Bp#0(}+nj|7BD0ZnebE1){q0xoF@Q1D364Hf58#J{G4zu!n z-FkJ(lhjDbe}_xD3pZ{)>0xO6r~P%qK)$f7neiHVHS>`Vhpl<)2{88iMs$w9iFa!F6*2UngC>@$QS?s literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Error.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Error.png new file mode 100644 index 0000000000000000000000000000000000000000..f770410a8d2920afdab5e7025ceff265d5b873f4 GIT binary patch literal 851 zcmV-Z1FZasP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;$w@>(RCwB?lTT<|RTRd5=iN7XlQyJ$2y7h{}yV&(7f-w!KF4=1)`?eqm|3sr}G?29zeOU3nm|x%~dY=knu+ zi$zj6fT?&l4+;AcEB7hYWuH748eK z;0Fnz2s?(90>)fmH22IfraTXgJJ^Lb_R1yXcevKgLko0)~qz4>;kqr}X--2!j zjSwP)y_n2;KW+RdA{GaS|CR$RHdgB-agRV7LbsoRch2(2i8Hjnze02VGCN*; zmHbB+akD$I+5iv*24K+z%9R#JGZ`TWHK{^@?8#}`H?DGP<_)55mjk_sJ;zVdTDVU2 z(ifz%9)8;bl+|&-?{VUZ-OA}Xg5S7@f9DVWy6`dGRudzz{^PfVcPli%`x+aEh$GZ) zCt4@Gx0S@RPwrLI`C)}08@fS)_7vi7SY(aHbQ7Gki|SL{uWIV6$tM%m&TJ*I^mk3~ z(J(%gb1@l(Y-3Cug_}`W;C?lszN+Vd(nDeD^JMDLA*C{dg4e&{dDt}sZA+`6b@VWp d{twRo4gjAhSlU-V!BhYM002ovPDHLkV1iolftmmS literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.ErrorInWatch.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.ErrorInWatch.png new file mode 100644 index 0000000000000000000000000000000000000000..37100c0a0c0f77d49aff479020fb616d4757dba7 GIT binary patch literal 805 zcmV+=1KRwFP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7<5HgbW?9;ba!ELWdKlNX>N2bPDNB8b~7$BH8Ae8p8x;?e@R3^ zR5(wqlU+ztVHn2`N|s?4>mo+LxR}rq=*%jKg%66fZO7On-S^ z%?b!SbIE+?`Bodyqfj7^<82^E3V(VuCQ_r(o+@Qropgo(Av4pnO{9qL z%oo#@;D+7{0PaH%kR6L9Z4`V*!qKaWMsu#(DFArG_?ZK;8;pR1+}}M90(zUko!bRA zEfNc=jTlr!z#@<776824ykV%$1Mceqiw@|l3y$D4z<)Ld>`4(85<~DkArv?EMST1D%A8O!IL^8&zMpaiQCWAW%_{8dnxl!f4WocOZ<7_Ka2yw_5e-M*?KXCjcF zK-A=etH=q=&YswU1to=_2^3!M4?~$$98@sXXr)I<&b(24T*!_CSCuO$U=129CWXQ) zr!XU*ui1_z(-{HayP1jKMEcAD3NQ9-K$&E#yT8_a zc*QP^H&mMYvJ{vkIrC91s>0waK8}Ay$KW|gVVZRAA;skqk-N)q*}UpDx@;zMn_3#k zdGJsK+{Ep1V%RG(vt6e)ErPVx8?qo{#Mtv=cjT|#dw~f`N j$ew(1SWd0?N2bPDNB8 zb~7$BF*k#Eh5!HpYDq*vR5(w4lU+!YVHC%oshgYlLCLl*3K3~zF{p@KA5tr^*+g+I zHft6V-Xtt&Nl7f+o7gC7^TP7Zi#duu2wF*!(8RpS7GYmR7b~Hwpb3_>koV;pr;40TJdf7F2w9MTOMHkoX7lopBd=t0whU@{{X8d zU^ap`G$5hdh{uvQngvN%n}Mb#tT>&3$&@8dgSa0?BNp{~#A<3VBzaE=Nc^bN_tRhy z!gs~R{{`^)f>w+78V!ccdmsQG9Cj?!)?%fuP5=r)MD-^MFrwS{ismjEhX|~QI)S$ zb?%Fmlwg)}CgpNOXm_=@f=y~Qcvf19S7dV(c$un{z75~Gc!pb15uVcdKJ8(G9d2m` zo7lb$<8+uNdoGi$zD6b>{rrR=5y}aXT_cFY-VQcywM1_b^au%Ck`QnI#HtEjrGHEyf0000NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sR1oKGknOJ-5$v6n4oHed+; z&aMg!W6lDP$YKTtZb1-ctWSxb2o#hkag8Vm&QB{TPb^Ah2uRG#E79|F4N)jF)-yJ6 zXmJM>Q*E9ujv*Ss$v^tpBsxS5LIVOPiHijM`7gi9H6+$4(xdGrk6MC8mWrOv;Updt zfkjRsu`w=f!bjRUBs!!zPkzX1dU}9qk&sYU(I%swUj~eIa$$Lel4`j-y8i!HJ(_A^ zA`tb@yYuvhmkxJ$%$)s0+hVz2v2SSDA~Rj@jK6?rjaq?y(ho5P-kx2XKeIN8f|84; LtDnm{r-UW|q$|-o literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.ExtensionMethod.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.ExtensionMethod.png new file mode 100644 index 0000000000000000000000000000000000000000..07d8e724ce9cc134db5a3c7882f5bb135f6267f2 GIT binary patch literal 647 zcmV;20(kw2P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FWS01FWTe`H^g00007bV*G`2iyS? z5;YjWr|qr)00IX|L_t(I%cYXdOO$aC$3OGvqSfLad|6kMO-Yj_0+H<2i}eS%6%<5v z2+~VX(0ViqlDr39yIAH+C{gEzBQ&&-+$H&KA*QZdY!(u53DSlyK7=H7a zncs}4DuKnDwfh{XH=b8M-L20#ZnsYk5hEAh(uR{^lV!94RF3Y8t;!2YzX2v zN;!U{f>>9K)Q>Dgc7CGk^yy?$7*7~XCLwY!EYZ%W7M?1kbRz&(_MPq8%(+Rbo2z#N z_R^bhw-yJBsc)#qoAJUXAYiIV&&M8ew=1u%fw>}>HY_=UX$vj4!Xhe^Y?UzbZ6pi% z3=3O-~VZmzr^wrpfW-k?YCh{nMcA1X*L2KD*jMr27$p`hWn)*uNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRKQ?7Q_gRtM)-Qos12scTcc)OkDh%aX7-JW^^Yqz0MV1`O;2k#J+0aNyk^VG zrtPn~_P$%Q_g?pbFMWqTPdxl_!jW%tPkx$t_W#`T|K?x#x9GyZ_1FGvJ@Rnh>8JZ| zyx(-=_o15~j^6%w_VLe4&wgBb_Ve=dUsqrJzW4Um^N+tlwvU3*5E!@+Q2Dea6PTwM zN`m}?|Br0I5d5886&Mqo1s;*b3=G_YAk0{w5k_!qmd7oY8Fir3gYtVDPSyPWX)tvb5mg~tCI`^Qha4)3eyAm*168(RZ-|p tS*s*Hg};1;&|-lj!aM#leO77XVvq{lyUan}>nSMZc)I$ztaD0e0su-wuqFTi literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Form.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Form.png new file mode 100644 index 0000000000000000000000000000000000000000..5db6f871d5986fb5838442e43817cb6c1a06311f GIT binary patch literal 642 zcmV-|0)737P)Px#32;bRa{vGi!vFvd!vV){sAK>D00(qQO+^RU1O^NR97$qNH2?qt6iGxuR5;6} zlD%$KR}e}=7?WXX45JuEahMI+S-cvmW!agK#Kr+ATSe!=*s!&_gD0YK)4(;r_uO+^AdZz@4)IKU`5gR^^Z6Fx4+M@ zTykgY3TDRLTN}6xtPswF?LVms(hSr5EayM@l+Jp-xwej*fSSLiiig{O5wjd_MIp?K zibT?hf@CaAN1IrH1>ar2h#{0`pqro^Ghr-ft3)uReJFVc!m&h4+(aY2~_b<{(WtTIUFBcRc| zc)#~AiX<~>6t!whN+N=6MYV}gkyFwtPu3_~@b!&H^T8RI98(})fbuwn%L$uU(2*EA cKGRdw2VNCj;8@GbnE(I)07*qoM6N<$f`Y*iCjbBd literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.GenerateMethod.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.GenerateMethod.png new file mode 100644 index 0000000000000000000000000000000000000000..c35cdef3c358b91bfa1c103610cd594f6d925062 GIT binary patch literal 655 zcmV;A0&x9_P)N2bPDNB8 zb~7$8%`aC*0006GNklF6@C!e_8 zNQ|98F+GTNP?VIXEEk6lZxsGMEb$V9Xp*+EXBp(nxK=ngixPin(3j;iHhA`4R3ia_S^!vXcT?XX93cSaBR+rZ(hfIot zAnaqb)D782E~g zqj%8L&+RDDUm~ThR4uI1U(_kAUTyppEHd3xjD?8pNG4)9l?emJcl~q+TUhx zU_#QdG{Vk)OrMUjTkjt6u6(4e0RC3HC4>J0_z8?h@8Nw%8wUUY002ovPDHLkV1jGtCN2N~ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.GotoDefinition.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.GotoDefinition.png new file mode 100644 index 0000000000000000000000000000000000000000..b8e2eeb084bae74387ae8f48bf4e7dbf925a4e58 GIT binary patch literal 574 zcmV-E0>S->P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0004*NklX$4h(Q^Z%p zoA(`dsiTEN?I2Iq>Jbqgk0CRkWkrHDlmiub!{PVHBAV6bE4$ zvBEIC&J;?Q1(?_xV2Rv~<1i7IC2+5KpmyCK^X?L@f&zT7qA^hvEw@FdM{LUV>#crb`q7dVPsc<$aNAFL6{~8 zVZ-8Y87VE;Gl9~@j_^+cbL<;ru7pd_`d%?(dxBy+-_?hn3EI8*0X^Zh90jMDDF6Tf M07*qoM6N<$f|{b`V*mgE literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.GotoRealization.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.GotoRealization.png new file mode 100644 index 0000000000000000000000000000000000000000..27cfe623e3304e1cfa08f45c0d9d78c537ed2675 GIT binary patch literal 507 zcmVL@#zn{^HZ|B^bhll@TQLNtDjYV0|@+w}N-i2OJ7# zS0zkjG>Y_GrU405Q1X}IRvp49F;c*!lReR6JZK;3s|UkwtPHGn zwUaF&Vc`@`USH$m0@?kEP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0004jNkluF6zaSE7=^{diT13z)moD2xP@qH*Ey5^@&_K+x$jl%O z$|MC1v&gF8b^F%x+f#(8ug(=yNmWAGyI_kEUsFh zooVCZ;kj0hq`-}fjM-dTvw4w9%Xm+f@cL22Vyb7=pP!XzR zGVdY!l;aNS0qxa{*Y1D}f_E9XePJj-tFJ>qMFRn(#2xeujIrtgrG2IKUsDhtg#xsC zqy&@p-KmACErO7STZLxc~qF07*qoM6N<$f?nU_h5!Hn literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Intellisense.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Intellisense.ico new file mode 100644 index 0000000000000000000000000000000000000000..bb56beae5ea0519498b4e9c27e0c09caec5ed3bb GIT binary patch literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x#lH~{4a65P6S=KoA%hX3Ta;m)-) z|Fv87GUKi3$gh zUgYq4yLTJd3}i86wqWrz6!pmZKc77RzgM^C|AhP;6g4pYQhhuA^R9dSAK46;{x27< z|KDu0>HnRA+h8+po_&a721u{&-uM4Q&VGWM0rU6zdF%h*%(?OZ*V@H{<%5 z2VgTS_r3ey|Mc7c+IwHX`jO3mx$WDPd;c$|UcxW~CQqsvAhTfh<1<5i#t9UEe!p@T z><)DQV>1I?FH8*~8srxcCZvuU^8bOh{C^I_hk>{ehz|fUBM=ueFnmvDV0i4vzyK6t XXaEui5*QdB6f!V;0P6V((g(xPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0003bNkli5^YW_9j z_y5}kcmDV2_96msN1xRH_j`50&W72%aN)xLAiRFw`u{g_Zh~z_)(m$6EM!53pgS96 z07(A&g)jd%*=&Z}j1dMfLy-Lp5`!54VxK?x8SLzw{0Z=I!H7omct$n=B)4tv+yBwC zZ;)mHEG(ujSOwNR^X&is&c!EDqmfXmJ9F(0TyxEqmtZ!7@l4EQjLo2P*Y9H0jFOOu zae-;_R=CYD^#lVE+2Au*Zh@VREJl(6*jxz!&|J&R%Mb^A00000NkvXXu0mjfA|t}I literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Interface.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Interface.png new file mode 100644 index 0000000000000000000000000000000000000000..5526c34dcc983be61932139707c47760d47d1fb0 GIT binary patch literal 1345 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRNxd|;2K#Ro!1tf+mTSzl~~-DT+(0OF|WF7Np0`)+P)=q{YzV?tn8V+sekUK z{&}0HEZi}3`R>^(_Rm=fL?e>!!cAnU@=iIjar?>CFwBz9A z-AAtOKYDo&kUW0n!0{`GPTf3n`OcZkcQ0Olbm_*!D>on9xcltk(>L!we*X03JJ2zs zU^E2i83La+ed!10DTb0Dzu^BP8!!ZaXIBM=J!gSOWHAE+w;%{J)~Ccz1PV%&xJHx& z=ckpFCl;kL1SDqWmFW4ohA5O7>lqt3w77$csXR{?#}JL+Kf{`{gw!OixkGuK%T>HzfaQuk`xBRk+!R zvx_NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRG_IOW2PfvWgzWpDeLd3y;h_}krCv-q)NFa# zn8Y)$g0DHpup!U3N4IyA&E`v~mv7|Uyj^f-&GgJob27IsDBQlNc<0j6oy$x1tgP6( zs^Y{9@dIlqt3w77$csV$x^jv*Ssrv1-_nhXS5lGi&1zOhYWmS&W0 z+w(tq?rej5^UrMGeRFnlirddq`y{4)uKpa}v*3@vP^9Z^mOmD|-t6xB65!k*@4kKR z)9V4oKRip${=HuOM)Bc2{o{JiYf>U+^L>Ay^=Juu!tSs}#R=c`rJc6q3G2RD!u0%g zihz^i<&Z9^z-KnMBo`})26082-YJ~bbM2*P$6B4@(;hmX^<7UzC6t`0{_D0kNNWM} eocQ1J27ej2!wT6uAA4tk5|O8?pUXO@geCz0gz<6! literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalConstant.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalConstant.png new file mode 100644 index 0000000000000000000000000000000000000000..5468f6c1b0f102b165d9e7ce282dfb57e4383e88 GIT binary patch literal 682 zcmV;b0#*HqP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-@JU2LR5(wiknKxTVHn2i-zf2eeUN>TvJaN|k|<*#OwuHZ zL_u0x)KI51lT=91N>)&;u%)u4ZEI^bJ@~fiY+Do#iA^E3v~cEvY=Tp?30Kea*c#|r z3wGe<9L_nv-*w&3K>!C5x~L$L*$038{0)YI_t2VMc&Z=AL+vP38V+}!SkdyxjHdf~ z)Zf*Cv%e#`r2XD>BY`8=uka2+8(a7hT*vatPkj0k!1U}AJibLpZm9SLI*Xg}VFGV# zZWA~JKY{1Jeur->UNwPm;V96jym&J?D}y#(%h z>BLE~G%9deoA9RZ796Gq*bGVx_tb&wu7*`3gXyshqDytiKVQvKPZeE7M&T7ae>D;n zI4P`2MR2|bSZilPpXs{`XO6HRV-5S@FgGwLB8kBCem4I<1a_m63A|hZlhB#6WU&^) z%;fkDhF{diT;W98q4%1c4!(Zdj=B>hwH8*F{iMe&Q& Qxc~qF07*qoM6N<$f}pD-KmY&$ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalDelegate.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalDelegate.png new file mode 100644 index 0000000000000000000000000000000000000000..7acff0b1d96ec9939ee7326873ee9c8076647863 GIT binary patch literal 882 zcmV-&1C9KNP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;xJg7oR5(wKlj}=UaTv$vzYqjM^&(#sLP7OHv`jPM$3!&`1Sr?UjLZEZGhX?B+TcFu21 z@DlXEm*4pvp6}=PJiqgt5CE)$!sYQ|#InGms6VuPtk|d%tkA=ULiXh{fW30Me?X!# zp+T(08-WT>U+|Dq!hvCMf==C?zt7AhboX0P@m3D|oRb(9onF)kdyty@{Qm$Sdd+yv z@4&|9){dcy--VQn(t`nuP7m~hHfT+gQ0vWT*NsEgIRdeA2txS)crqj1jsbPeA5ksP zq4J#uKU^-b;q&^M2t8(Z*r*WsF8A!bTOk##~h4~@}+cI_D0cZ&i5re`J`^DP(~m!hLf zhB{Fz9IoYnxt#(f@`0-Hk$s zGdvYb#2l13K?0Ft0ExE>0)RHnDBKPyY*SJg`=yYnWT+LkV*0BC=6e=$s{5sf00c2j zM0}YE@hN#=nH0q^$e%$kErL#52#v4+Dqb!W+;m7e>9C}I#!R-IK!RpoG#}jedc-9^ z1k1>nxhJt~&jVJup2s(1onG}abPsz``BhE9V8a_uM- zykXQv)PYmhK~HHHUNxu@c{L3zP4lCFwh(bD6v=5N(e*gdg07*qo IM6N<$g14f2?*IS* literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalEnum.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalEnum.png new file mode 100644 index 0000000000000000000000000000000000000000..2067c6baf0858ab1c7eb6449b29a09cdade87439 GIT binary patch literal 626 zcmV-&0*(ENP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-xJg7oR5(wilHDtVQ5?tT-#{+rLT-esS%l^#r43gmFC|$| zY4WmcV{8o(kqfb`NUM@K6jj%2t$sD`FK?-Rh4^>UYjdUzgk-4tu7GQP*aF0%FPfXm5t^uz?m! zNkebe3(!%O6$Nl*9aB|csHGIWR3WF%?yvM<&!T~Ku@hTnB{t_2Set3Vijl(N1V!wVCNdK>Jx~jSwh}+H z+8D7hg@(5RFT8tXY>jiRcURC1&<=Q4E0X1tkGE*9r)Psng|b;-W~H z#O+|y)Xo|~kQUDkSf6c!z9|D*c@E@tnWzz`LXyviFg*dO{KRj-2d`AQ^-2dikN^Mx M07*qoM6N<$f=4<3XaE2J literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalEvent.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalEvent.png new file mode 100644 index 0000000000000000000000000000000000000000..09ad83661352556fe5022593a11f2fb166f82f0f GIT binary patch literal 621 zcmV-z0+RiSP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-vq?ljR5(wilG`i8VHn5xFBHOVv~qz9MO+Xg$}ZecPPwwt z>RX*tWOjbWR)Fgc&*YwuJ0mGIkzx1Qd&w?3ce`@Fq@ z00RECn1HWdA1+`qcfq-(hGSC=%Zd_fMma{cQfw~t^TSN+T+749r2)89;AT;ctHCDN z+Lg%7$-?vV6Tjf)-U=r8ygS0%b{$+JEd)zTGT^YEd;Q+=`QrP!Gx*w|Ah@F;lY@B$ zPwri=`=d!lu)b4-ljA*jJRa)KD`4H(+^p`*J#f!;!=-N{QDJ&CT=rA`5yrK}(5iA! zUoL`1nNM%P;4-lg_Ok>330S=Mw->BVcXP0&Q~>MY1_%3n#PxX{2lrNl!EQVL29sdf zsKBD38K%)j%nr*jGgymBeI<;267Oe`P;8w%6z7)xA211)7~B^L_em9StD$0Nc9)wW zz?d=|&I{|WFbPa!jRg55KA7#|lnA&Swm)GK%#FxNurrxT5>^`%iIgHOK9mbTEX15Wj*i@}S6=dl!B000000NkvXX Hu0mjf_)!Ib literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalField.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalField.png new file mode 100644 index 0000000000000000000000000000000000000000..a72816be51f43bbd7df7b3b485c5f1e7d8252b75 GIT binary patch literal 581 zcmV-L0=oT)P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-i%CR5R5(wil1ocMK^TVZZ&bLjMY)MC1R=GEB4}f@imYhS zN(iAF7%D~WDxy|lDcy)L48;-=vP5kWVHcw^1R+eVpwx;;4d2epNnM1U0}Z^)FvIhF z-!M}IK=7|Y1bpL*d_rRhBbrDv2+Q$?y`dzOrVyqbFBmh25PVKi2`|BAG{r#onD=}@ z>jmaqZ&c!oB)QwadPqaXv_0c|r!dLdc?SC9SBPb1Zh?9?iUoH9`m+p$R~XphPeUj* zKv1jY7IZKBF=>0E(8dJ|S9F?Kn6H3H)O(LGU4Nmj-!AVCF2M=YD_2^q3EkYuT+foCJ`i6B@l~B{}g-!ARM_~ TY8h!s00000NkvXXu0mjfgzDa2 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalInterface.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalInterface.png new file mode 100644 index 0000000000000000000000000000000000000000..a52f664078ef134bf415f9d17d80737d10a8f142 GIT binary patch literal 604 zcmV-i0;BzjP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-qDe$SR5(wik>4vraTvzuzfica8?9X6LJ=1h<%&xrAyO@~}9=A|%Kl3~=}G zgtLo#Y=_Sgy}V=OujTR_GI2a{i{#52>&t5)=w|GxK@yWo=qLfsya{fB$FSavR@Eew zO?~hPQA~@@B&K=l0Wne65SIe@MQ0M*Huf-KaA4lP4c)929RpLSYf-~s@xtN?e@n0> z9HX^Yp8`;9awhRf?E2RVw5xGNfSr#(h{Uk&J3yy;R-C=b{DcJ2PFc}4$T4RUXMBbK zE+q@|qX@0*5O8YYcWB_V4Z*$G58l)b=Un%%b$-HRyCgOhA$c_bJWsQtH~nj_mrDZz zE-e$KA!#x7MrENiU}sgs08w`>gHWBWRk0Lx6$R1&pMCJp70Qcqr2(ELHO6~NF{Y}9 qs=W+t4GJ{Y$Wd962ZcOe67UHnSj%cOa6w=I0000Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;07*naR5(wSlHW^{Q5eVHL4QR>7Z!*_V+Dc8x`;yPMwfS8 zM3-SdW?BPja}&CWDAS8{(qs|Y-1csUG(wzVQPFIz$0rnI5r9AWZ=TVZ%PI^W2U*e>k6p)SN#vY_5 zKv`6TDEl^x8Z3|=$cTOZTNzRX*i!t&<1+H=AP0I66kqE%j7DOZ0tyW=1f!1*F5EP7hUh~A7< zAnpR$ksO0%$Uhb?D_%==0)rV2X3RAN2mL+o#;W@-rD}B0}ZkoUBzqi@#$(r zRDIGo$lc>sl(>R4JK^B{s~%=#D`9UplcN?w&pMfKwIdI;@4?qUuL~y*Lob$k3+ZUO z{EQzov8$fkQWq!>MQCg7?9zp!Rqise44uciNJUbWk2Djo3ehfPSFFt!&s78d^yQ^# zU$+3nLgxiUi@9;5aM9d!q~`rdlb$<&ZJ|+rur}b$^V{6Jagtv18O&Esak-^|*0Xgq g84l41lMF0Q* literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalProperty.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalProperty.png new file mode 100644 index 0000000000000000000000000000000000000000..390beea1a1246a7e1d28115a745ce02ae80dd71f GIT binary patch literal 830 zcmV-E1Ht@>P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;gh@m}R5(wClU+!YQ5eThmvz;R6s1IVAp?n8SY!^evM)so zZ;Ub<88k7?ud<10seL&Z%}mk-YA$om9P_J1ADb1pNs1rrVy=d=&4$LbtkE|6w{u=L znl5_b&w0*)-|ua>Q=${8!kM(p9uo6%Wwj7Z}-93 z&qI~s3QBdEAmxv(2t@hP9PE5qn9Sg!Qwgkd0JdpjV0sdXy!ve9_NH@!whw^TU=M+3 zK8leqOkr?AW)iF#K87Aeq36yfTuR@9jOsLGt5P_@fN_z*_K91do$t!p{p)dj)(e@0 zj=U=-0`aly5y#tr+c&P^V6gzg_GFOz&Assb_QC0#L3PPl*lkv}A2ALxiK$~dj>K() z_RSzNL>2z~=I*Ui{|qTN6G3X5x*4D!p2C>f&ecW>i>gbF!ZV4O|L%d_FbToQoS=Y8 zmfTAqHT6mct&H2_#ljCSoQocO`tl2%FN}y!y%-{3-%y2A!C*;~8Z{4;prEX!FSx%h zZNu2K8?Bn5@B;C@=8*1G;PQ8NxIB2TslcGR96D7QUUig0t0+NVa{)AR5mXH#HVrAR zk%vq`VOdK*B#mmkqp&;%uBk#`LBc|7dX{lCniJ$#HZXzBF$>GgEG8`u44drGkJ_N? zDq~PU5`gKNc3>+f$SJD>|L{4)9Xr1&ua%`tFy42FNoYp86WA0Hq)$07*qo IM6N<$g6mmqfdBvi literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalStruct.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.InternalStruct.png new file mode 100644 index 0000000000000000000000000000000000000000..ee40f180cf05e1189527c091d70a0e1bc50697da GIT binary patch literal 693 zcmV;m0!safP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-`$Fjs`LPGK7lMv-rZ6m7Br6>Q2U4MVq1Ng`wzVmn7#rJhTOP-D@oVq9 z&T(_vE?&O#ox}6IzxVKc0)WUbIktnng>uk(`rBFiv*GYGzD{07EZ`_9Q3Yz}$TW_E zWBB9Mv!qlK7N~I8!f?_vjO6!wh_7o4B70cV-?H$U7Sc)$q8}>ow1hW{(25Kyqa}=fTvOV5*co z#WE!ck6+3?uX`1plL5 zhG`7(#r_zd7DupZGh*ef0ZywPORooEpX!Beq8Ee9aaBT)U*}h0N-sVWJar9{cL+E% zanUoqyW6Hg*PGvHp9wa=5ttz$ic^6AK=ZDW7p`oUNWB>0~3dfudPy23QwEs5xAKb+Kj%sw?(V+4A6;x{~ bOWwx6jvoJO=uD#M00000NkvXXu0mjf#g`&* literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Keyword.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Keyword.png new file mode 100644 index 0000000000000000000000000000000000000000..68b7eca4f0d985e100c98fed8ecb2f7a2ecb85eb GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP(r-K zHKHUqKdq!Zu_%=xATcwqM9w6&@l|2u6{1-oD!MPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-b4f%&R5(wqlHDtVQ2@sIn_Nf=rLns;1a`X5P_F6W3-m@OgC9w4F&ZPaX>u4I zQky1I*uHxLWo;Kviw1)mKlY$NcB!-Jx#HojnZasv?xlg;eHyrJ*f zG}+=1u&{QBywWDVpkHrI)eg|x{@F}nn!HHhx#a`oC^dWm{lD~vD;s-ReY#aq-HyVF vR+gGu(unNh2F$N+@dfF;%Kv@J=`{ENGVN2bPDNB8 zb~7$8%`aC*00037Nkl|L!vf#rd6hp8Y zup(S6SUjW0ETHHANhXlCx<0c$4O0FWWN7pnhfJbV71ZL$DdGf@VJ0X2gR z0AZM|FuLx3HeoL`Jf9BK?1*7N!L3;0qp|hHT(BW9o3UvIX9Il6xbx*AumQ=}La?Sn lf(8(iM+oKxLWWRm000z*rpR|tW3&JO002ovPDHLkV1g>`qZa@G literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Method.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Method.png new file mode 100644 index 0000000000000000000000000000000000000000..8df072934258a22e75a79a55ca7ed223be5a1abb GIT binary patch literal 542 zcmV+(0^$9MP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-WJyFpR5(wy($7o6U>pYU`d@+$k$4F@c3=84KpN0L;DtSgoHGykybJa83khkEm^b(r z0|uZcH|s|F&F!#3HVx*?Xb@Y9gInWANK}Iy=_2Sjf!pGyH%K^=;8u7DP67Fi0-l){ z_!f>3wngBvct(KUqFzm*_`o8YOCuaJ8r1G;h}#q3SIa1`SKzUF5w%5eIOl_Vc9-5j zM;crM340Rv%SDoUJRijN%nlSmF$d^K=dnYYc&&SIO}o(IT7Q2dZKd0M8=F&GkcyJ| gMWUh9P5gJ@6N)q1l)72^B>(^b07*qoM6N<$f|>2p?f?J) literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.NameSpace.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.NameSpace.png new file mode 100644 index 0000000000000000000000000000000000000000..1a4533424114655081f51de2b8383d9246255654 GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=d3- zBeIx*fm;xS8S7KxCjteW8}lm8|k~ zaSXBW-#Xcl@2~=o>+Pwp3;6O5CRzw{n$Pi^8>A&A;1(7eD^~i{-+jIiDwZteN25P@MN_9V^3!|LhrS=iW{3aTb5u z(dR!e>o8A`;iJ9rV%dy#mEH^~XQo^dYU=y{l_fwj=>9@^iC_NCcbE$J8KwlaomX%> tzW-0}ZS#-s;&OB^?L1j-UH5E1gVK(b%Wq$wZwYiYgQu&X%Q~loCIC_Pf7t*4 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.NewProjectIcon.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.NewProjectIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..4cb1e0fb5b90480cd10ccf656f864af227dff8cc GIT binary patch literal 740 zcmVPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGmaR2}kaRKw(dX4}90!>LoK~y+Tg_28X6Hyq2Z#JS- z_pV*5h@cBMA}$0Gq#MD7t4dsm2xd_i3JOXW+L97QQn6wMTddJq(^##w)u4^q#L|SM z$uw%-X&&Y=nRnuG?hScWs}~M)xt#O;XYP!F4_dKldlxYnHWSG=LALDdCLkKovMTA? zamqmcx76}ugq+<_`ALW&6O=+9mY(l}T$;g^2W#lPo5s0YDV*#};P}-zj$Df4U~dcu zOi?DHR_stKFQCdXDCIfG#c9YtExHC_p3-n*LdCUl1s6v|T(~FTtW|*VHjlkVHxuE% z7{LY3=;2u?nxF$5aJvp;b$A=j-$|ioAjx#7Z7Q9-r^m%aRNe-qcptLBv9K(JAm`1H zvez;Begzw?SVqDAqo+ZX;xOFfyIAe==VOp^{YXFB4KX*y40I)B`43JcnX3az{y}}R zT@T(w(7F{u`Z6j>6Y}p)um%mSC-{GebpSPpO08M9Rs)pkFLuTYRTRn^GjcJh$;cE` zd~k4_D~~cy%HL&?e!8jFqTv{9ZRY=9d}3HpgLfrlpPs)Ib5W$&e!p%M*GB zJ`Cu0@a&bF0X7oRzYP-w&?fV)0A4$Nu+J{x>GUGT?4KGxRMXqY&}RqWUz6HH?fc&f Wvk1aWHKZ5-0000J%=P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0004+Nklv~Kd7hyhs4tq1&Kux!!<+FVvaa%q7_O{_bEOxY23|Evt#E&P_N~b~ z91Q57Bd86t0pc`B11w4TxB6nhDc+!#DHT}FUbLif>K1hq z-=-hhL|o5R${SP@I!rr3MGbxujmG2IL5Aaly_Nx)Fl>fo;19J%uyk)TV3NTNQ&c*^ zZf64zcOx>OI*w*uNVm0t2T2T?)Wfb!AiDxb`#XM_!N7*<*3{`O5GJHD=mrUFKSsVT zFq>Wn173zTt=a3uCbb4DEnrpb(>vQ+AFncRk{_ilX)!8lWa!>dS}B8cPe2vIrw>j~ z77dilA$z1ELy>35H&bNmDblqBNg|L40kIk*j$;T?`_=x_$MoCR`UZwPyEDh!r5^wQ N002ovPDHLkV1iw7<#qr7 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Options.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Options.ico new file mode 100644 index 0000000000000000000000000000000000000000..75f8d082642008214ae2b0ec4137fdd5f6606b9f GIT binary patch literal 1150 zcmcIiJx>Bb5FMfkrBudFO3N$hypr;M!gW$!sg;*dNXHeJ_*HBIh2{AX6+?6_L~P8) z7-I~@HHzhy6ei=$;wt0-weT*(+nasw&AVFwGIZy1K)-n?%>v8=z!DX;s59sjfJ=M- zaXGmNxz3LtahkthbWl{n6vuHSI(cC{nnw?*efA7I7x|JRO6_m%_RuXVbPKWZI6WNo z;JHS-FH%~Yx3)9tadL2PxYOoZt;O2*>vxWY5Ch-)ajw-`tT$fJ_a%mRzST0`b=nwjMaCoPNK{f9FUw)QU9*SvwLM1GbKWGOdQvDS z{0}%cbBDFh-7fMB-PfqKHaUm)?V35mS-5|D*)p?uCg)Z%9`Ux?ai~7u)gZ0gt>&+_ ypFH2`K2k=fj)_wrK0Yg*( literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Options.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Options.png new file mode 100644 index 0000000000000000000000000000000000000000..20943464e2f1abadc1f06577f9f820c0a8199871 GIT binary patch literal 516 zcmV+f0{i`mP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0004BNkl69q;-Mf3w*#OY_*CK&7n6ZU11?X8|n2(BM&9fC*=?sMWq5Rq2;lB_Iof=awJ;yhONB^wE1;>0Nag_ z?LC zy)D4x!LZS^bxv4-h=jMRyH;{(mz>aDs5i6qPi*VNS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRN&|x;h$9PpIpOWJkvCJYiLGecve$vetTR&XL4z8N*NIKrI%00t)J#xd@{db zdTHyNs;-66vv1UFdD)o6Gp~ZLN4IyA&E`v~mv7|Uyj^hT#0>F=t3=*zm3g~W_WeHn z_XkWqfRO3O)BYb%2YkMk^W|Fhgn3(LEZ?(W^`X_hJ!1oh7I#oFb;{Gl zF+?NSwEuP4K?jjme-YQ{WsibFr*GkP6=(_*N;G=>SN`P<iloIWzYLeC%doq?|;@^f1kAY^V{Cr zP95ckXZ@JfcKX4grmxZxvYBFM7OSzmes^=vC-Y><4sDkCu}7!m*H3!#(y~3^-L8ci zCk>XbP~+KtM=96nc%fgSE63@sCY`cJ6`{v^g=S>VlUrP{RbxSLW8kl-`jvKePo7;* b*vEMGXWHg1TALhzzGCon^>bP0l+XkK8$}%M literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateConstant.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateConstant.png new file mode 100644 index 0000000000000000000000000000000000000000..986091109d1afa68c058d411b8f3e3104cf1df7e GIT binary patch literal 701 zcmV;u0z&Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;14%?dR5(wilI=@VVHn2iZ|Z|YP)ZPj;6M!{GNRQK!Iy|7 zSvU*D6kI|w1+^FFYjcUR(eO;m+?j*7u^U)(qX#4&1LY!rDJd zxzzsO^w$Lcy>|EZp=|A7b!`*#i$C#wW(i(@2(l*#O_4sfz}W2+{2swu+rJ1_5GHtP zb{QUj7_vJ6r~D0Bg->D&nmPvstZZ|#f;3GDE@b56OtPAi18@**cYem@oYL3=gV8SF zA5=TMv_`c#IRqEg=46Jg0~1KSQG8gizMk!#)(0)t$WopdSqyHNWP}U z#mqY*^_(gf2`SlVdD9maFu?T>4!^>{h!1LQwRrHj5eL$cSHMXrS0cj#UT9W9MSKA- zjs>IRej(sHPp>pi-}_N~0dJkZ0{{SbWiza9Jr0D$3D!#d#C00000NkvXXu0mjf4R$MM literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateDelegate.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateDelegate.png new file mode 100644 index 0000000000000000000000000000000000000000..b651e629aad2ff0c46eeab862b5220a56ca5656b GIT binary patch literal 876 zcmV-y1C#uTP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;vPnciR5(wKll@CmQ5eUs|3VP-7xY`dhL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Rms~fUfu9`0|@}xsG(K~)J=Kl ztII)0RTdUB{nS9lzbSUt4a09cisfAiK(bBLt=gzL?P*?I1V9Qcl(h&0NL~Wi*mh6= z`4dg+w(LKr|=C$F$(-lt=0msx7o@L+M#J7EARO0FD0W#cDEYkMJi(}vvg_YfD? b-zxD6D|FdG?k!`G00000NkvXXu0mjf%cLB+ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateEvent.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateEvent.png new file mode 100644 index 0000000000000000000000000000000000000000..99a291547abebcd15f4903d710e3ba7473aad0f3 GIT binary patch literal 669 zcmV;O0%HA%P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-<4Ht8R5(wilglq-VHk&J{*Z}@-R%4eHbz)E$Hzi{3#KDXfA$>iIaz7>@cRh)!YA)9wV@Mpyb`1kA&J0N)17iLgDG>@63EmSx6 z;qu}fOQKeSTZ`i1-nK|Ek3iKI%no!9OiKqOQhn9IDE3Nlmnsf^kMjY{0$(5u!=eq^ z-U%$PyEvc9+hS>lUF_hte^kDM*R}ZwW&r`z{{2|(Ud;a5LVj5rMuhhW`rJ>#EHM1E zF`Ss1DTM^I&>U4GLIKaSFbim25|}Iw7SNwEZm=M|s9qLk0d1XbVZrR=w#7Ls!$UE# zBCqCU0WGoYTMtUq-%(hhMQ*7E8A<_){94f2ORx0?CK=tilpy6P00000NkvXXu0mjf D>`@fd literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateField.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateField.png new file mode 100644 index 0000000000000000000000000000000000000000..2fbc6abec69fc75c1e82f1493715cfffedeb04ba GIT binary patch literal 630 zcmV-+0*U>JP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-yh%hsR5(wilie#raTv$vA92mK`~j{NS0Zm0rbvk!?~|93 z5X}wdT`r`lF*KQpnRoMYFdLaTY^=zT*zk3pXEsAQ%BgRs&N-jY@A*B???eDl{OcmY zUn01kP^rIw+v}G;|789ITg7LT>O?e}ZcsKV!g=irNn{1PZl465Lv4A4#tO8U?^z}s%VE@vO3aRX-xd(ZrUxHSR|1f)_noZw&WIu-@)RWWq2MF&cS6 zT9+NQ1`k7nI{`QPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+0rE*iK~y+Tosv&T6j2<<-?Epe zWDlJ>m}OKtLS=srL1J_P~6YpBu0WLRy=In`Gsk%;?P$E+zTNLw)r=;&1jd)LFp0Ho=*Se2$j;xa8E9 z1tIM=vw8sE`2*&rSKUS8y^BV7Ilp2GMVlNH7dTKhJ7~Gp%CSQ}E~_uB2_E|^EE|oo zjd<@KcI4+R?c444Cz*Ntuy6T%tmg)U;U>b*ycWsTs@;~g0cXDZ(sQgQz+&n(>9~jV zn1>GkR#qO&_OFQ8D+wpVrXX13V6y)ReB91+Dai_EUVa&P$d9k>vU)9_-&Qjotsxav zOhL{mM*Av3-)6RuiWIM|g-nvszA7_C$MwS8E3fR)NRf_TAQ>r=k}bLQZxyI~A3j0Q jz5f3a7_y*i-Kyc=NrWX5Eig-Y00000NkvXXu0mjf4R0Y# literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateInterface.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateInterface.png new file mode 100644 index 0000000000000000000000000000000000000000..26083dde87017502835125ab45c3ef985e37a823 GIT binary patch literal 643 zcmV-}0(||6P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-$w@>(R5(wilItr&aTv$>(|k<~0bDBAWWm$gk=}dQJ^&vWh`gnap&b z&Rv#B*C0dy4py1Wv#a~)8J@?uRYIF_21T`cWaQOh*kXreN%@mtLq0)%Wq$-fv8ghd zJ-*wx7O2;WIT=>b4cYC(%H|=8>x}GfFami0{KoP59qhX*R<};EXgdMDi=6{OTJ$r} z)eF2bnWI}E^L_Y*8>bdr*xtWHv)&SyB+X!hA z-T(*CNfIS5vdg=)0W@{mg5tU1vF%Qkn->^3tE5F6K!a-NF`=?!1Z7P_D6APkPDMAe dbgfAZ@fR6`;^QXbp_u>x002ovPDHLkV1n5F5yJog literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateMethod.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateMethod.png new file mode 100644 index 0000000000000000000000000000000000000000..ecedb939270b854cba74bfba3ef9f6ceabc6a21b GIT binary patch literal 721 zcmV;?0xtcDP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;7fD1xR5(wSlHW^HVI0QK9}{#Di8nzP-gMJV(1s9oQx_Q+ zhRuQ%=-MoZO4yng%_C_msOH>S5JtkLWJy1CXy=_<7waTsZA?f zT|6AlIq&m%pZEE`0s!G(lwZhW_U0^fRj(|sdH&0+hE;}as2f#CU4Wj{*_0d4!H5)* z>CN(c{;LVu0oc?-P?RvjBN6oUM^G-8d2#A#3Pz|1Lo~JOP4oAHR)A0{m3Exz_dXt5 z1BlvU$URzzarY;rzX(nI4)4)k2!>&Rc3%Bv?mjVDN$~s$#D@_E2P{L7+T|L=Uqo(j z9lqv1I2s%#V7Dm*n};E_$xv(xVjW{x6qn#Rd>aEzgK#!DA#81KLC+U3B`sm}rHp6M z8H8UIc|iZR_mh>gxUlCUw76EgNMxY++eN_fw{vK*yLT;^ z6GUGp*?j28iK+-dg`TwCs1Kmx2=H#^69ec;qG=pEd$m4*TBj*Y#y@lH(Ft>up$gb? zx~o2bin3oHK)cI_*2`X;>bQmDZP#FFar{x@-!9w_XwMU^B|{l}00000NkvXXu0mjf D+9)v< literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateProperty.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.PrivateProperty.png new file mode 100644 index 0000000000000000000000000000000000000000..7d430c9c501f4a3f42d879ed0bd7cc7ddab84dde GIT binary patch literal 855 zcmV-d1E~CoP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;ok>JNR5(wClU+ztVI0QaF6*ir38Ltt3lX9VLxM`k!lD!w zNMwZC(kLX;%4yBQ{K|BxP18_Il+@*1Wy`NwwoOdk)QOucoFA*XP5f$8R>C%WI_EuX zG!q&;ocA2~{r=DSAGQqu+3L5lJP(zkg=}nW5U<{XxkN3qZu zg1n{-+*QSaJa}n_FVY^9e{vc>io$m;9;1_euvH!mW6MFD4%-h= zsTe1C3CzB^y|t=eBRV$%L{$5Z0_x!@jGJuSSvyT5d(#GSz5v?sS#+!Pc;7P$S=TU} zYc48st-C-9Dy0UTMhJ@={7p!9Srdhy)V87EnG`Ho z-q1ns`!o~iADM)RIsb61V&5P)Px#1ZP1_K>z@;j|==^1poj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rTn-yyL@1aT`L(eFRuYP$rI&Spru+A!8Fz}fCE zkoI&SrEd)5eQg*J^`KWQ!GKhZ?;m?0lF1+)9D;mU3i+rE^3Ow<_&Q89f(iLJCVx!M z^n9~?Hi7?2fc;l#&r|(X^A#f`;1RGABEZL`66#y&2_qkn;82wm8~rf#UuR6l+-+<*#Woch?d& z+j%M7hp}I4ji#%HBj%{+(v0YC9t@_|K8-+iJM&d)%h%HB^qmAS7Y2H}*l*UeRNQfx z!Cb@)Ccx2Ri^3}alK@+NCwHYMVAJ|_hWdNAJ5BrFeQJutr}Yo1{~7NHvEPUkKT>h_ EC#=vFSpWb4 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Property.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Property.png new file mode 100644 index 0000000000000000000000000000000000000000..8dfc458c4435f56893ea1dee8a4a86e1bcfe8e67 GIT binary patch literal 1433 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRA8(wYN{!2r6XYEmSF0cY~`0>8<^#8s_a~1n;R@&9BC7gSzi?GP!!`>80(s! z=u?pBRgmbNRXy3K$uXkEKW}PE;&ShlH9k38f-4Th<~K|)X`NHmwVNTwAGkf0NOZP3kYVX};cXeSTB?y@QGGPX;_X zTlMKu>X+N)ty5ODPF>wOX?geT^*ysT%-Jz>;({%c7H*xiaNB}u%}eKWtX$Z$W=a2= zwHs!vIzDIJiA9@Etln{I)vjAR_Z^ybdGfM@>sB9JvF6aDB}e~nJoH+pIqN6hlF}lZlWMh@DSGXT=pd;Qpw$nSL$x-ouqQ?oJ zfOv=Yi8DQC2G2RDrR`~`sO=Ik`S9H5|LgSy**>q?@M6t}0{4Ae0?H<^@~A~BOqe-Q z>isD;u?gol8Jyg*&0u18aU;ixrYDz!A3a_)N0G_MLG-1W*s@Q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;s7XXYR5(wKlkZDYQ5eUs|3VP-F6c$?D(FQl5-~`KqNGSL zqZUMIm}Z7Z^}<02VOpl?%pbKiUCo+p{#edUojTjrro&yG^H(FaZEm`jHnF?dw|mZI zhUtqgJY4SO`Fx)9ob#L{0L)HLAQXm!U0^uwHy<%3_2_y`-dV}Rbn{% zs!^|OgD>!1fVCVrWei+hjD8PyPUD@ZoQ#iWZjtx%^4P~haUS}J;3qiQ^ zTnJSzQ#cW-v{oqFEjW3p2n>N&7FCEx-=jQtFXoI{fb%dEl7pD~;)CltOREMShp0f2 z(o93HHseHQp&;;0JfoEfOd@PLL3j#7xL=doE#?$Pj)vF5abmC!foO=xh!e sl%0QX*81uag(D&Fwt3&_#wPy#0Xh5W4~leNkN^Mx07*qoM6N<$f=F(9j{pDw literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedEnum.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedEnum.png new file mode 100644 index 0000000000000000000000000000000000000000..4afa9803dd74d788b959734e5f0c346589de4c76 GIT binary patch literal 693 zcmV;m0!safP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-`$i^yUI%cNh7)>^ZWjn#BB_v`FO&Yf+p=+n+S)-vYI z1JBKQ-{s;VIvhRs7EAhwVJx7ErrbfaOC9|jy zwC!Ma>Ix~JX+hU~+#$>n-wl2#59v9&imx^;xYlyFv%UhDEG{kOyFmPN2QinPu>DYR zQG3b8>;e#Un#5$)tSULyun-V*4>54L1*vln=8oNTAK%VJ-Ddi`^mv_5MQ?Sg3MrfA zfU}Zdv4>Rt|IPPSOjZGE^kmHc$6WIz{tYez{*AvZK*WB4-nP|zmnWB>Ae)X>HUD>l bT6_8pDUsPx#1ZP1_K>z@;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b5klwBsdumUwdie zPJL-6(3$<;wou-KknfBolYo->MD>F|t-HKPlAyAFJ^#ozLCijY<T3W1 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedInterface.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedInterface.png new file mode 100644 index 0000000000000000000000000000000000000000..b8d32488b41443e140267407492ba5d68cd9632e GIT binary patch literal 597 zcmV-b0;>IqP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ-n@L1LR5(wil1obhQ5c5nmjwNQf>y1AenV75MVla!$fQMd z*%Tt_Y$S*-AYDwd+X!hWjEb6R7jh~Uvof-qWp=Sz^)}xTA<@N110QE|p67i(&Qt=Z z_}51QIrH}M1>SK8n@hy3NkAliD`8T&Tv*sW!3ehm?FZH5zoZ$I70MRyz;D!o*Q#+F4YDvkEW)WQj z97`scy+R(&KJoaDbhB9=ug6{3QY0z$VilB}O|9c6YsO?x72=K-;HVA@V>R*x>DUxY zCYUDetd%dw+@G<%DU~F7IF&e%*MRoAiTPME38;Gd@j@0{@GIv9<T>7@6p|3y#YbL00000NkvXXu0mjfA^7sa literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedMethod.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedMethod.png new file mode 100644 index 0000000000000000000000000000000000000000..1432c69e1fbc75fda4837b7efe30b2f6776370a7 GIT binary patch literal 678 zcmV;X0$KfuP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ->`6pHR5(wSlgmpRQ544KKM_ReqL@lSaN)YkHn=PlmldV4 z6|%80aU)3a6^b#^N)~OS(Kv!yC^S9_5`quXBu=UXqb6xylZ=-^`&1^7fqU2u5+>K}RZU&uuszHm*>JW3xf4M42@^@{5@fyr(U@ZA z%!vZ20bGy;2!b8at8Us zU&wR;QF9CvPmSP;#UiM4;*F~5=^DN@*vpINPd8-gh0n*GFOdV6usdV6E zS+2R&e_zDbF%M6-7ecQ9$Llp5nS&U6GLDb!GtjH_3LqWYhVPpJJ4;%)Y@Kj#yvI-f zAp=LYBbZa$;O+6jr`d1n``<2m4dj8B8An$gk+X_my$G6?MhEkuu~ zJR=220TXkkVp`JXqyGT3Ips~^O;aDDyV2?*k+`4DON7SmLJ08x$&4FV#H-T(jq M07*qoM6N<$f@)P53;+NC literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedProperty.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.ProtectedProperty.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8e6b73cff2fd18d5090571ddbc12b131944c4a GIT binary patch literal 805 zcmV+=1KRwFP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+02g#cSaefwW^{L9a%BKeVQFr3 zE>1;MAa*k@FwHMlMgRZ;Ye_^wR5(wKlWRy*VE~4|e%7!4NDzfkKST(F#V9Hv35!xF z@Q+=VjSRYKnRYQkOV>?dG+mMwC|-9lubD>FCP;I`Mj0mCa=81Nx+POo#S`{3?NMp^Ss z+*S!d?!7W268SqrwE3DagTXgW>}Smp*w&qdvBoXPljh<|Zx$zL8UhA}?J=-rq!{_a zOa@;Uq{H0JgXYCn^gP~-t67Q2E?y z7fZtLn|p5xbsI7tq=8h_bud7!GvbTE&RuIwEXwvy6r4_j)%Xdc{Uy+K6hR})2`^PJ zk$=GtB9h7(v^oocAbfK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(JBVqE|L4V}|pttvYy00000NkvXXu0mjf DBj>c$ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.RuntimeError.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.RuntimeError.png new file mode 100644 index 0000000000000000000000000000000000000000..315ff97cef7ca21d63e26b0b3f4600a2ea29e231 GIT binary patch literal 654 zcmV;90&)F`P)N2bPDNB8 zb~7$8%`aC*0006FNklCcsa&EiNEN_AI6IF5 zSToBJOfgv{*=4j#F4)t8{K2H>rPC#F>vVcDlRCdA)4OGTEUaSDJnQMNB zsMoVHHpWAvkqg>G1bmPG{cxi9XPIkn$1B7SL}9aH?ld(aiAFrvuhrK0w-@+k(T`hP o)ABu2=ePp}`B>(^b07*qoM6N<$f>VnjlmGw# literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Save.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Save.png new file mode 100644 index 0000000000000000000000000000000000000000..8262de3ae8ebd479949957dcb6c377ebeeb9bba0 GIT binary patch literal 535 zcmV+y0_gpTP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0004UNkl_f>5N!XTpTH-aL`EVbk&(zqWF#^Y8HtQUMj}sEMpj1FZD;m?3s*4hzBljQ zyJTi}X7es0Z~rO^k#w!k0LIC!oc*2jMqPYrySc>2>|GlpEEn>Gt z+%_wI3mn=@Hp#6uF}BDsI0$tD2_tg?j`*x@2g~Zo<0k|* zS^Yl>AS@M_g1Og{T*fLZlf>;70!*3$Jh;^}a=BFbSVO=Su^UZ%+Cs#N%2}{Vh&ZV8 z0@BvN;F)8y^PSAIUV!0cgi0i26JwKrjZAy5YRzLh?F_Po=%WB0Mn27CyY;x(!FkvV z9T@^9%og~v`pzWddCOpoF!`}Iar=O->`Zc62w=o?#5=f-O#zbqK1v0d`}ZN@ABk!D zuKNk#PkqDlih&IVffhw6qm&ERW|gSGCd}H;7PtwwV?bFS$Q?+UVJYC5T_<3|r2s|# Zf*-~>!i>FQ^x6Ob002ovPDHLkV1m|L*`ELa literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Struct.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Struct.png new file mode 100644 index 0000000000000000000000000000000000000000..58259927caabc0aa6303c6b8ce1c36286dcabbb5 GIT binary patch literal 1405 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fHRz`)E9 z;1l8sRKQ?7)4BL$^z0j+^B+g9coDhsW#P7ujY&N7D)^Sx3iRmq&NH2VDfRO0)I0Zz z@7*hZ@TB1BgX)JTW{BTiF8Xkl$lJ{lZ?{Oi-=p(>ukOcV&L5Ate7X?x`Bus2Tcuxa zm3+BX+Ijfr%(MTWv^;s*@%+_-W;8{gmGdHn9jujju(ZXN}rAwZ1~ zC{TYk7nr9QN`m}?|Br0I5d5886&R+R1s;*b3=G_YAk0{w57OAvJx5e+Q7pY3{q z>;M1QuV%)2l`rQ^p6z$Y#EW-IJ2 z{2Oxafb;X0oXHWvY9Ehm&_8lh+wf7)zjxiIUvBv9wJiRfMad?wdv@=(zm_{LcZya2 z?VhcXrItcb=?`2FpQ~(t%-?aSU~QIYf^x^}gj+pAW?$=%AFP=vbRwev{MP&x=0(3` S%rW8}ll}zz; zaSXBWPoA^)(}8+64G+%E=`9;OmpQUEG^|WF>PTXEIPK)?f7ie0{f@t6^}oLCuFnn& zAGw)n44Ey7Ib0l_jk!x$7H6GF}Hgjo>{rnWqr3>^BZlPN2bZe?^J zG%hhNHDpIvQUCw}Q%OWYR5(wil3z>0U=+sR>wO(RK%ZbYeS$6w3cTs2KQ}>L#3FAB z!h}Xfgi#{QA}OO4In!b^Nn9jh8vR*R5E0nbljoJ0Tay;P@MF(8&p8ildl`V9@NE7E z&t@l*Bq0z8G-azMO+CAI47+hJ+jNFF3^$@Eb`2npw8L=IbAZ>fjqR~??iyOL&N(Pl zu%6PmAqWD3!64UOkVi8tYt))`>)cy!kRl0;Of6E$L+I&+?XhG1h6F!%kFOY=Sw>%f z2$Nx%zo%CS_1fPcn!H3PV!^C8pf$tJOEoOTGZ-EZ`wNI|7a{Mx8y-cv#l`ID5pP(8a*xc2j zs1?MLKLLNiPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf4FCWO4FT;3z$^d&0&z)1K~y+Tl~P+slVKSC{+;LM zg;GjEpcD~81xcll^ovW8dB68#Y@KB>z2bw*hlGItFuz{ThWx_( zb|Dg0ArMfYs_MS*Um`BsS>Eer0J0Gct6?zYqPeLNtU z;MtVG+{{IO-p0Y>N=D^X5&HVlfRGgRx;*Ibv|jnAhQ*F*EreM)Iot}zfD(m8cM~qAKD6=fw{nEc^l40FcbpPU4EJtGp_1){=D=~l zPF##1Be>};sMQK>F&;g9$+Nk^Je}hW!}nnke!S=62#s(U?UA7%`v{C(mk^@D)w_>k z1mB6!-=2Yz(iVZ)2hZ`7J;@mFvYhz#zuJz@P!dKp~(AL>x#lH~{4aBM6F){jXtaNiv4{rKV@X z|4qkEf$@JL0mwdD=?9t%G8>F>Ifs_^!|YtMX3c+e43ndW{r^=M{=+fQVwhV%ZlI<8 uu&{^GAp2l;gJ=+-rTt(F2oUJ@gVHc57+F8ipJapoz*Gvt4UD8?kUjvtyibt; literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CodePage.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CodePage.png new file mode 100644 index 0000000000000000000000000000000000000000..2b7a903e172520c97d341ce603b4c73b878228ec GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP(r-K zHKHUqKdq!Zu_%=xATcwqM9T7EvnU5>j<;F5_v$KgNXgC^f z(th!rDW(4K4TI|!&3G;(GeqB7u$H^SvsXi}qnD3KohQi9M!!MgNzx|MLpm%BSFeA( U@pyW`VxaX5p00i_>zopr04Hf#761SM literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CompilerConsole.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CompilerConsole.ico new file mode 100644 index 0000000000000000000000000000000000000000..8a606552a07c731dea3e340379693918a79e4c53 GIT binary patch literal 1150 zcmc(dAritc5Ji_64uC=MNyQ$gB72uTC3hwYfmn z6b9#`rNGWBg!#)T585$FO1z(mnJ9wR!fXxpeRU;t^yh zKl{nqc(0$sTx2WFAK&Q%JZEgbDYE(L@C+8YbVm%28QS*nj1d%j#=fP(jC0PT()sz< MyP^tq^1aAW4}&>7zyJUM literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CompilerConsole.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.CompilerConsole.png new file mode 100644 index 0000000000000000000000000000000000000000..70e123f7828fd3ebb123a87471a87451405fe11d GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijSl0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP(r-K zHKHUqKdq!Zu_%=xATcwqM9n@ zTBtOD^>}ugceGB@1b8?aeHE9T#2Ll4$gCrE9a0W9iQ} zg~>5$7c|{Vbe|ou)F~F-kluB2N;3D^J3JX1CY(unzEC>a;K8Jhdylq1+u(M|Ni3ar jhs^$rEvNqfo0z{_jB&k|&%_R(Zy7vY{an^LB{Ts5g29sr literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugVariablesList.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugVariablesList.ico new file mode 100644 index 0000000000000000000000000000000000000000..6d85e7fb6eab6f5a9426820ba499310dee4137c9 GIT binary patch literal 1150 zcmcgs-%C?b9KS+;z=GF4O`@m=YY`P?1`8DF$3!2@sBnsjNsb!1 zh+4G}scGTdgSPacR#S1?-S4^S+^_rd(>Z7D)~q0U=v+SM-21(Jew_2=UXH6Emrlo# zc{_Jz6US}iIBo|4DUnLCP8P0?y!&6HXV*>qs~6>ZT0Y}%H7xx-=rtN(x?y0PgeeZe zA;5Wb3MUWM{1K&m1JxYTelL6r9t4|t#-;0`YaC989h)!r;rSCYyyF%I_e(R=q%R=lT0JKG+)N289al>n1=1d9>i@X_*-frudl+bufqJDW=&)3-3jEDKmEd= zC3~bAP*te11VzY0&e0qxNUL#(i7@lehZd3Zf5FEwtG0jY?|N+o9Wi4A!mS6Gzf#D< zeX0tR$9FyKH7g zjTsLk(zc)Ze?3vt!?8!#{jNPJH|G1%NAwv}fDEaL7o=}Yl>1&`Y ze{8fHB}5-~AUfQNaQ_8_ZZ#p;*@!@UJpzV0mW%d=!qv1}`#vZa??#|b3`2Qy5As+a zq*u2gKI?{H?LfiOj@-xPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0006$Nkl?=4R%3&U;R#0f02%k|EVx zRFfn^At@@P5@A(yFRPMNX78v5$!j~*AaOzeL<-}dfw36_BOi4PPHA}fo}&M?iar-X zkF$*1<0af2E#m5M5f=Lvj$4)(%KGjIxP({V^CY^*lDIw;N5_L0+V4ft))U4FYZ$Fv zp-LU?Sf~n|?nQnuT?RX8ngOC3C@MNO3ly16ibPgLI7QHM`chTkm=rdg?M>n2orLJp zeC-zq)p7X3EE?P2B9o^`GC0Cu_w2G+@a)wWQ+HhlRBAvWI`TygSq|q^L}h|tqP$z+ z`mmkg3`=mTJ1!C^WgShIeIkLJqll%q;nk?JTj2IA;rvrS3^q7rbMwxHl7<|cTi&3E zr&VM>wPG!%;Af}=*VH%j2ppbYCpdO-681@1B-q%}&}8wU^U(@|69+&dFEI1?Ail4c z;CSb&3fk^33iyUI2&s7(1s0ueJk2+rVX^3Gz(g;cq(uplov~jbVkL} z_{Nt<_W^T_0`|^(@ikB|3&h{VI&;{+8Wb?`5OJSgScBW+6|m#w8#t!}qD&)jfo;eM zYwr_S@7ghN#0J@(7LvJhUNP%lRr!_qLv3-%k1oHE)xWDho4|U>zu-L+{13SE%^$Vh V0*<=N^Bn*H002ovPDHLkV1g#;JY@g? literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugWatches.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugWatches.ico new file mode 100644 index 0000000000000000000000000000000000000000..768c78306d31e6bafa1c45f9efe3713c5662c2b2 GIT binary patch literal 1150 zcmb`FTWm~G6o!vPc=g1CL<9+Osar^jxT`yfMpGF?OY2smBU(x+im0^lKwE^mgt{a` z2W>SoN=f=qO5@sF+D@y}X{$Qz%=FBena|#*It(u!tdq6(&R*yL*T2@c?Im;zLiCDW^&?K3Vk_DCKG9=(=Zqe zWM^ezu~?|6s0hU6f9dJzP*n`CuELA+tX{s9C1DFm+Mmd#4F;%`v5Sy*nCX+oV>X+E z@Y}b>;&3?dzkfzoUOE#-4P)lCDeQ=iX5+dDR8__Mp@`PIDGVPvgmEIidFix(8{^~I zYcvwQE}R323GCam3roI<&t)&Uos-QjQP<}6k;JZF%d&a1m^fx6RYkd!Kf0lFNIg+e zQH0G2OZ`r>&Wn`45>tdj_tC zFT5?hr`IoYOS9Y&GZJP!vV!V_1=PidiaOksZ;|=Op>?#Pwtc0?R*$=>ns?8i1mR2W zU(xY_#plDXdGM)jy`P%nTW>#Gn{-AUeoQh9V_57xY(P(le z-+E{AC%)`SZXorqgCD=wi{GQ-b31>|L~__fKdnLf?RU@6=Pfr=X~{{VIcqmxGoooa z8G$u<8P7~&V18-Skd2t z^TH0g&d2aNW^xd|FTcLuI!Vj5BiJq_(0negSI4PH8jr4`@nD$HGF#VxU>Gn^3{d)S LmLkr@|KL9WQwW8K literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugWatches.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.DebugWatches.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8563f1cc8dedcfc90b2b0914dae334b9ba0fea GIT binary patch literal 861 zcmV-j1ETziP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0008GNklNuo?cXDU8LTcl-Kk`|;*dgCLgp@^jr zwUrOamNo-lSk~y#si^Z|I_JZ6yLb0t`*!YKI*0E%@Z+Atx!=$E{=S^E4FDyLryX|R z)|WU`4oQ zYNJ9_gML6;=Mdop4lh}Xq8A+Rg^TrI)hWQSD!{hH!@9sBEGFF#XwePI>bTMcMBTN? zryR*00VjA6oYIe=1U($IfO#UGCgRTiZ-IcuSEhjDJsyA;ykI#GXqSj3NxaNs#?E2V z=H3dZe`%Bf7av%0x?mLH>ItxJ4;0siWe4_U0kexf@#qY@6;R#!9%Ex;xO6!YJ-r4n zZV^sK#4_pIz9L|5k;j{^0USFKg+EgaI(ohaws5bs5@~5^h|g<8qB2#^U}a5&B4Zf) ziGwN9cb=vgd-f^tbAmz3+hISzY&Of{t${{!6Y)tZ z6cpY;{*7DEcNsA-^c%HJFOZd;kHqA3TuII(4r2)*1Z}+*KOi$J8#GPh!*?&Vx;5dD@H9dID@D5RFxufO~dO(qk%b=|~jE+Qh&qU7PDjUV)SJ<6YyL#b4v nrluA~qY+Zz0f5bm|C#><1hDQyKmrpd00000NkvXXu0mjfCBbms literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.ErrorList.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.ErrorList.ico new file mode 100644 index 0000000000000000000000000000000000000000..48645201674c32ef6b893a60bcacb0bc5459136f GIT binary patch literal 1150 zcmb7?Sxi({7{{-*X1>z(`a%wcIK(KMc$?|f(b{d51{ zIf}AKd~tD#=$9$GURIPh6h(PkgjfH|90|&ORVc)jZ986qC zrhW&BUzM<2*GaTxlmvKdyGC;El$^h^;yUSuTFKk~EGIPXVYtJNtF@kfyOn$Om)N+| z!3TPkwBoR2($37tyzQ75W#u%>*PA5YP;-Is)HtCh9)e>-1V;Mt4?5YJ(#=QvRX)## z)8>$5vq}TJ`DuukR%tAKuX2G`ebcB@Uc%l{LXU?DxF51;&?@;` zf0-Z>K?{e71bwK!N$KZ-bByCZ4M~mU{2&Q?!o2%Mkoe7a`FK}54Xr(rZ?jfOO*9Qn z4GRrFsz2)I3C`Xz3d;T={RbyU^4d9?bCcxVB{X;3mu&P6+`ev}<)gi@szp@cCphOv z)MR2*)OCb_XMn!OzbQ!la)FKVj=GwE`T3FXBQ*lT&&*s+#@)DX-Qd?BPsH$DwoCIA zc^9kE7aB=17}=du#Mj49k$Unp=YBJzPL4Aq-pC)u!Wh1%!Lq;?R$s&Dd_?KUB)Lux z`sRKT%PbtuFOoI!bhlA?&Je@*+OI6|(ZNac6)IX<`1!(lGMjtRrRIqHQPIR5t9~D+ zj(!uv4-C6;+ON`m(}Kfh;aHWGN{^RcJku0)y4aMGPD6D$_2x3_em7!o>xki_HT-XL o^grVJ+9tA1wH!KYqP^Ss-196_6ivWc&kM1iwfNZ)SfwaW0f=jsNdN!< literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.ErrorList.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.ErrorList.png new file mode 100644 index 0000000000000000000000000000000000000000..b4bb57bb4acaaee184591e05be58f91e6cc3773d GIT binary patch literal 890 zcmV-=1BLvFP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0008jNklr0bS9LHxbq9Xbaq8Ac`y~ujeiy9@_4a~x3rUX(+mQ%YRrihoayre9pOwg&B zq)lrny2_QPb23FIw&rz~mo<0E+ve`uvwb@|17$@WIM3l6p3moef9Dqjfc59l%#T4c zC1x2-R+eea%sLcyg|&BIXwY9j`VM>oy>5<;YHn zM189ib;4fo-}XQ;A|n_mOFx~mY2U%d=oA)Vc(@TY4KFc0n1}o{4j2#MaCu>~Gq{;i z8YmD+r#9d(t!4PB;$vM`3xlcvbAw!n>f%sdoDK_tMlEsgYZo?R@WKG6pJY1zY7$!^(X^M@NGOKveV^(&EbK`%3#IhhJMwB z?jbcEKYJZ05O#gt6nH`E^-|bs_rPdjutZ?pvJ(pi2R`=C;#yisprA!OLIqv|yBRO+ zP7kej&CFnVT7_SAB~U%h#%SSv^yO!uDk%Zq6@yelyCC>5L?gT0LY$B0;_3Bn!&gfr(7yiK%bIBOr!)mEGc z=Hzy?aSm?^e31=nE-aGAn$tO;(%3PX5(S3biiels5>`;yK_sq=yWu^)123p(Xw-1RORxV%g}gEX3GAk1q)8Hyn5f;j%?N QTmS$707*qoM6N<$f}Wd&^8f$< literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.FindSymbolResult.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.FindSymbolResult.ico new file mode 100644 index 0000000000000000000000000000000000000000..80aee0093c1f4afca5d3f0f4c1989e9c571e5a0b GIT binary patch literal 1150 zcmb7@&ubG=5XWE9qe#6dc+rbgP*9K_#4H9pc?l#vh!GU*L5*HQaa-_L;ve8iiXqS* zJcx&iCc9A^tEEM#P(=?-Tdmqy-F0KyTHD&RN%M8)EgK#&D!wo~v)|0;JMTSMA)4sd z+$`w1Q=Hu>#8x51ZVHk}adk?xe`m z2!%q3#ji{LYAg;_SNrR0?#pJg2-1Ab=aW2VRj+3rPke@_ai3*ba=zx%SSKG%@}BPX za_*nBu%)9LneiFv!F(VPaCwd9(tT*06}|mvD>#myJci9(J!p9jY&so>IhIE%?cSAX znv#?AiRX8}-w&hjE~bXl7#PfA`;AAEjgGD2;L|zj#e2G+O3S%?hp1L-^}v%X%0K3i zvy0f*KZ~260A@LFyEP)`GtZ0nEqS2ES4uxoSz5r_LJ>LZo1E#f-uYeHeGcF2A=+Kl z^$J!BA5d9YMtNx-Yu^jVeQ~4*--F6|^+@Wrhodw*gTw)WlEWU0C@+%7yaQusNZzH# zsChJVhmK#Btl8d*iR1~_gS=Q@FRx+~OaCwUQe_Zi9IWde?Ix#nR-_rp2YBBQTu zSHt}mdat06?1Y`T(9px~It1tZUOYRsry;MNCI9wK&ErMK5lrPq|H-I4*ZFs@$NTYD p|IK<{A17b`oxMh#9G57f9wkJK%E2ZfrZ@Z^l^sG<57UQ6+%ILP*+>8Y literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.FindSymbolResult.png b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.FindSymbolResult.png new file mode 100644 index 0000000000000000000000000000000000000000..553a7abc4ea5ace0a687745bf7eb930047e555f4 GIT binary patch literal 659 zcmV;E0&M+>P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0005*NklHhEjlafr z?wY*fm91UW`quGl?N3ffPQc1$O6>g!RJQ%Va%ej%v5(h-~j@QC!|8aC#Ysb{fO{yp$U-Ft%U<68A~$=(o5g@l_o9 zSq$1i2q)jlQB(Kfr30};gwyF{Kze=?P2l`0fyj9bM`}up|Gil1e}lcXAVau`0spuu zGOlXQm6=(bT*MIxhj2Vy%Hq4#Rui(jDnpP1eiq2G42#ujAO()Jw%KeL8I=%N*oHDU zi>aPMV6liH(e$kGJ&BAw3%cmVXB-%$?tbb$Z>002ovPDHLkV1m#x9((`* literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.Immediate.ico b/VisualPascalABCNETLinux/Resources/Icons.16x16.Window.Immediate.ico new file mode 100644 index 0000000000000000000000000000000000000000..1d8597cc22b79d36006e6c33a7b27d454a435973 GIT binary patch literal 1406 zcmeH{J5$0y6on5U2H#N;4fr6CKm?NE7dSo|OMe0-WlGDGmMJMyrc6nh(sE17bXsoZ zIAgKi-Nm6|Mte@?+dJo;o0;Sm3zXB-^2{_gfxtt!8#W!v`E#o6(ZX=<QL70(Y)*K0-AbW|YuPggaR(3%di+bl8p!tlPo-U3d7N?I+ zUg&qkLB!Qx*y(9llGKC~Qj<=3#T0r>IPsMGR2`#-%4@N3nfVv}BRXr86*hA|QCxPo z>_rK)#JpKE&se{|XRZ6ET(z!nyAZ1YgLVh&n)}T>=XFZHyE1JsUy{mhY{ZauFm+?w znKVAOlDofFt23PF?$j0#*p_~=s^Z-j_tent%igluFHW95zI^V&&{WYk>|%2ccYn6J zx0CVm?H=YT*6ZCzpM05J`M9WqvF6ZrU*Q;o*>4#-9oV^8guX}Wguh+VwfON#o(7Xr z%Q;tPG@9y1zgfq_@JZ(LFSpyr;umSWp4iLqVV?Y^{|iG>MSZ?{UAw=mpFutIomlwi j{eL65RxQ~7@+ZsuO*1kCUmx8D3?~LpS3j3^P6`%!i)kp~fZBHZFm-RC4*p8eGbevjdK^J8xFFg?x+&AIZP zphk+76X#PXm`_s=AWXgsGUGAEoSq?=hoKea{E;g~A7}M*{&r^dwEW}5`di~`9?IUZ zCvCkiYUf7u0Bh;$L)EuZD0`Ql*!OAqr;C2E{+|B0;D1ewd9?hM{i`@+PYxsU-WZVG zfaG3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)yS)F=Jzm*=G5;$TLsbc)1RppV z9dkaJaGsqbMSvt}lcpWIy*{FOV9|V?s-kugM=kdSt!tq6CH(UKx0S_)O1{ucQMDYz vN&s8<^ReZ7Tly^bVHaaF!!WMx+N$;sbqKE0x{sLo00000NkvXXu0mjfKn}kX literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.ConsoleSimple.png b/VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.ConsoleSimple.png new file mode 100644 index 0000000000000000000000000000000000000000..a92da82145e2fea8ab53c34f9e1d512039f14678 GIT binary patch literal 712 zcmV;(0yq7MP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1O^TV7w-ZfQ2+n}T1iAfR9M69 zmOpM&K@i4&`}{YK=>k$N;0i>^S;84oQBqUUA#Om!5h!T6KokiiAW@_QT8Qm9j^ECF z6#E?8iJxiSBSOkZD~)D%XTF`8{dVDA?pVTHdGY2zbNwn8lNpSs&iGP{r(%5ROs?Q6 zs*=Db@1F&L=Cbke(GQRo z-Aacbgqx=n2v9)9I!T1<1SUHOX(_E~=SIoaT2%m9E>hq|u)?`kLxo$#-3(!+1cwKQ z|EvdY$=i1yw7a{j#rdlpgTX+1dwcqJcB$w4ue3G;!{Lxtt3{sYl^v|zZqw;*v9t4# z?d?9Nrze>C`X1FwE*U^hbFYkfLWKu7Hg1$?8AkSm%0L(XJ;P1>` z0RXe|9;ovcWLbthFJ8(GL{ygy1_PA;#@%q;!7Uh#Mnn^~=^C0@Z2-3WeHs~rP6IVvkbx6`57Y*pS1yHlZ+NH8cr-#1(t2*_bi26Corw@a`hdETH5yp)u7nVn&8BoZTWQ`Ll>zvA z{FB2kM~SV9`x=X;F(nF3OqS-{g%>F`PmULJj%(q^m2A;hdte2?{>#@(o9E8c2KOR} u7QyHCq$|~SZkuOM3tbYbnQiao|C2wQhZIi%0=l>W0000Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1O^Ta5`3Hu6#xJP^GQTOR9M69 zmR*QdRTRg6C&n7a0y8t}Au~&JP?QnMz=C>7dWv2{CMf7dd{F2if+&dmD8x__vLXO0|P9;vhU1{ zpiW?F2g9sDYx?J$;UJWIitD#1gbIac?*MTUgTHW@}_K)bBje%J+VU~da!!UxnxQslwnbiU2 zfU-5sd?*YI^dX|Nr(pWdMU)^2&bL?ZP9SPC$({O%ST_2KZN3;BErU9>tY9kF~Rjj3DKKCzf zp}F}g0Bbia&(?*()8BCccx25A0Mvxv|LUNB5?tbP9cb;;1gL7720*+{(ZCb{YEZ3u z&Yt^?uo5#kIE;vL;^!`+N<>tNm>8L0(TmEt6KAMK5pfi8znc;>ndLf|=ve6;J=`$T%@rE6o_M=I!hE0 zC2^hC&k)QBx7$2ld6 zyGh&-kF|#QYM2J_3;1?OXnELS-qXyTwAez9e>uvwtw-_}oavxm4Jj~S*0>OvL2vIB zN~IA72fOfIING_8v9W;u{!w}_U*v^19^__cGdIRUh6hIIyVS)epP$M^HZ}LP3TXAa zfuPzb1sLysu&PivHfF6f-A#V6C>9o`l;8XgP`J!wCqvaxQLGUFRXBg)a$2pj^XfCv zh@~Yotz_w1&0%_jP95iKidybREwzbSV-0M6YiHr-n)6gNs#y@rgV*foJZ-(yY*|aj j@_Bl-Gj5ODqd5KniSr%YNDTN000000NkvXXu0mjfONNLZ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.WinForms.png b/VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.WinForms.png new file mode 100644 index 0000000000000000000000000000000000000000..be900a4dd90ea97d621bc2c05f6dcc4d39b6a37d GIT binary patch literal 987 zcmV<110?*3P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ% z2sk2LUe%cZ00Ub|L_t(o!|j&8i(N$=#XmP#7_rbo+%BY7?94w9#K0o9iUCQTG!_;j zm{R;vh+rewC|Fq7Y^ANGg(0FKBv}cFvRmo%?Y?*Cdyd7-y)*mXyU(lyMaaPNX218| z`JOrFe7`gBVEo6U8z!%PaKpoV(VO`aX2)W7WM;=^b|mHtSR~(<#QUFL=l~vSgHJv4 zG&V$lY(k(gVF)?@g-HQ2q!6L}OaV#dyD(CI$Ih{KeErQ2;eLeG2Lh`QxR&lF+0CHaidB=F)}7 zPF+ryUi}#Rqv`_vrzXh!qAnaTtYN=MmE$5YrM|+dVg_{|KOEpfsr{<{Q|^C*>3aW|ZJG9!P!5 zKv!uWdO-mq87Yt_0hp8$0H5yN;g5UtKwrMe$yGaHW6E5fxfe`Jpi1ZEQ+Qwi?bdMa z>epXsdPY(cY{Ehk^uAaix+w6g^MQ^8Fo`I7Hwl` z61Inrn#)Y749O^jrvOOs{g1bDw<`6TifO{Rh2~D?B2Qj0-=Oot^_h_CI&zNX18c$q zSKoN2`FL17n?@>0T$2y+JkJ*ohM02<*Ll9$-QPRqgYo|#e*ukzN4v%^xnBSP002ov JPDHLkV1lTm&Jh3r literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.png b/VisualPascalABCNETLinux/Resources/Icons.32x32.PABCProject.png new file mode 100644 index 0000000000000000000000000000000000000000..436325f49673a367587a290de4603bfc11c78212 GIT binary patch literal 1389 zcmV-z1(N!SP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU1O^E^8GZ(0EC2um|4BqaR9M69 zmRpEdRTRd5M`p@#yoIHX`Y?>6gCt_5BGCm3)4>awrX__!XhB0oSyT_1P-KRAK`9Fz zFBF7WBAKO@H!9Ma(GtXPv>Yvvbg&ZjfA(6dhrQ3Onenk++;BMi>~qdqYk%uo-`a3( z{LdpwCWj{-F#s_|O>p9HCWyww>WDSQX-r9CVkr?zOiBH`Br&m;C`pM}V`7QZyHkhL z7#D1c32MrQKh{M6W%+0ZkE_8{5mm$~DuOtFxnv$YTxsb^%ysvgk0(EedX< zC}-HxWJW*~Sz!Z46e2SJZEh4&(6aNyf5L$d1K2mCm4-(rw9kftnfVPUXn0n_Tn#l) z1vSf_&B7Xpf~uu!3l=Sbl^r0^J{`e%npeY!LJC=BQYt{&6&K%C}-6uKG(v~BkCstBWtD9F)y{ad}-s{KSQ#+Yn z_XrZWqiR0rz!9g4cA5h7A2+UTrlO*ZF=GZX?!H<8);2a35U`L2fT=@gvUU1?Hr>CA zc_W`;+4ryWb?cr0zu$S90;ipGK+WfT>(*mjy5tyKvy}P?8v)q3;SjNtj0<5`0DUW~ zxTW71#tgWFXGgsXz_(}iA}IoaGio@|0td?e-J3rA;73X&VcGI}YKQc}%=mKGNtP}B zhV9#arhZag$f;*F!0EqQ*>`FePL(~Ub^uV@dsqSbgbSiY1PTF|8jb6ksjlwL+-$0+m3GrpnG`_9v(KA@zvAPK*cQMj!1z6g#Z-z z?%)%tnk6dOt7lh!JNqJPP_|_=-4?w@+3{oOjeTjGvyclFS(NpLToV&fRID=uGBL80I8nNjr0_MZ>nJm>6y}zq zrzjB?_~1k_>y!hQ<QIb3L%&-G0QxZ$Oz>ALeX`ae0Fisl1I_g(=dEA)K{HWKiBrAXRCI_L$K z=6;tv`ZCr;(;%0?>o@22Xp8FW2#kl$Z36C6Y z@oE+7)dkXsc?p%8n~~)kQPtF-HZ>vY4f|5_Ojpb7sQEQfD{!C?K*P(6b3X^;=1HS! v-icZ2JXz0oJd(B0*syG#=*zWnZRE#4QPfH_#%1xQ00000NkvXXu0mjfC#QuH literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Icons.32x32.Unit.png b/VisualPascalABCNETLinux/Resources/Icons.32x32.Unit.png new file mode 100644 index 0000000000000000000000000000000000000000..3104c300d72d4f6ecc29034ab4825cf2610ae387 GIT binary patch literal 1345 zcmV-H1-|-;P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ% z2^j|L08X3$00hBFL_t(o!{wG;Y!y`y$A5d-E0d+i@dmI1whl|D>rofV+1-oe<29o=fsKrF+Wdf zn?l`=I%;>+GUu~7?CRYW1#!NAh;x4ov2@9k08I;*z0@&54vcmnm+NKu^83i;dTDK4 zGCDOu3CCVJ20-6HACK&Ol+`tB5LLFcZ7V*y3CND?K$u9u@bFcR9zDb1!)vLp?-=7i z;WA+G${>{$m8b@^z17U#c{ThwILy%SB?bnE_`a)af>j_A-S6A?EA{oWsji+*Rn=6w zyU#Lz{>+#!Ce-ez<7#-7zKg$c;Q8-RGtA(brxqXvX2y}9&Ro}lu_R2SAeZZ*v9Sh# z#>N_Qxt>JWMkdJcI-JUF52W1zx6I8Yb?5Dyq=c)f^edT%_yQKkSL>o-e#T;*EH? z4MJ5+K+FZ=(6Tfs2vIW+uVEVasDM3tD0yfBWee&ke_$?UueKn0*MuDO9(Hr9h!KW{ zD(O-nJ}Qey2EqRQlx+Q&%bf?%$|_8R(l2)+*YaptnMVOnLQg&)y;$lL7>Z#EW*}xv z+P0M|?c34HD*rx1e(lT7usF1w@cNZ7bac%3pdM1xT*)@T$js__I$ z$@gY)S*GpAn2)}|fwTySXw<`#Q5BOc78%e&gCcM#h-92d zmechDGruO`Efydmk>r_5V1rWk`quIx!<>x1Bv>`PxhUQ z8{+I`^c$*0u00000NkvXXu0mjf D#U*n# literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/PadIcons.ProjectBrowser.ico b/VisualPascalABCNETLinux/Resources/PadIcons.ProjectBrowser.ico new file mode 100644 index 0000000000000000000000000000000000000000..e357073b5f837becd028d53b3d513d46087808c0 GIT binary patch literal 1406 zcmeIwc~I147{Kwbl|?sQc3DbhSz6ekU0URkl5u3AhL{Sdh+se&!B?(qxIhUJdS&qG6x0in$YR3Qiv-dZj_j#Y^{muO5`OO34#A9uZ z*sbsy4-CpC}r89s4{m_AdkT{vyk$`yO@|+Nqp83+T;iVQ0QkotQLT7&YCD z3|+_A*Mn)4R?V=s7gN6mi@sjmwPDh!7#`3tJlH2_8PNAItQ+9yu!TIc1+zhiaby6q z$%w_$hsA6VM#R~4vvK{u{vZDVY3zDvY$8eHZ10k!g*QHU%gpuDkruA`eAUVokG=lf z-4A;{|AENUlH$L9*=N(b#rI6`wio&SZxi3$kP_+V@#bdV53#;;{B5_sn3|m#yK$-i z=8t&PZNXcw&JUF5>Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGmaR2}kaRKw(dX4}90+vZcK~y+Tt&`hJ(_tKk{S*2F zx{Iy~?53^?q=J(0KwyO#m0FP*sAyKEX?P$tG|;px4>&dRP?|?vnq?jl%`}~dId#)H zb#8OI{eGK!`njcHH&OJ3&*k%c-uM0Ty1D(2NqeIssYFX$p@zG8vxH}>2+5oxIBk+k zDGJUdjN~=p#ZuD{}up4K8sw7C1Ef8Cv;m(UW!khx7QxK4>;C#aO zU4o-O1@7B|N?8W7mnpo;ibu3Lum}#!7CWYOJBBqID@GeSy^V!s0kuwKcF{`Rr*RH@ z2H{p-l+J3?zMbTx-)B2pu-;^2$zWqqFQQozm|GN3X|2?>D_nwnsTD`fPAuwlOnu%c zO7}bAWrOI1=a)sPU0_CnmGf5KwT-z1&!k4|6>MmqV^+qoHgpB!7Y~{X{i&+|NacqC z9?R+pOU{>If$0S+lNt-vt)nhMMq&hxi^KDAYPO9bl6L3zDF7X_K_NK_=!b zC}u2Fv<$lh_d){*5Ax&YMK6N=PI1}iILSHXXe>6QWnkVEQ5mhY&sfR*JdZ+ZA60Ge zx_QVY*qY+nZj92(R!w$kWg-P-a@wZ#Oj}{ZAkaH+;{Dh<56k+T@Q8Aq(#Eg51qQR- z`Rck=5$%ddOhG+zjeuP3pjIi6(W2yR=o22rT;2I literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/Pointer.bmp b/VisualPascalABCNETLinux/Resources/Pointer.bmp new file mode 100644 index 0000000000000000000000000000000000000000..90fc1831e4f8ff9f2cf4e6f7c854477bb214beb8 GIT binary patch literal 246 zcmYjKu@Qhk2*W#j9K$*6UB{Zy7>UXj13}M!LP)~>ALlJR7ib5z!6Iu1)}8ImsF0w< zjD(I6FmZPT*(I4Z0k~zA{+&>Yh+<7`melqYL;H*&LdpPUe{xEQUY}R6NBMn8`2Yl6 Be@g%W literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/PrintHS.bmp b/VisualPascalABCNETLinux/Resources/PrintHS.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3d2e23e6ed53d8c06de5416e67860749104ecf3a GIT binary patch literal 1078 zcmcJNTS${(9L868)m7JZ(^YiYO$O1K0#m1H1=GxIqL{12=5V#8Bb%0o)D9LoV||L` zl$oV6)=*=h*p?kUkdlzw@=(()-CUbHJiXuN_RT>-UG&29@_aA+p8xZ`yhpk5aU5pF zlYJM_*045lb`bafR+Cb4NRgk8>--d4JD-H&tOSU8$8hD$5eU)_pde)*@{;x<_r#uv zE=Jnik`(M$-zBJ@koa*ns2Kubo|>|~bje5k~S*WEB1o@1bsLT~c}v^P{hT_r<9 zsSwpge3TXPAm^WityNsKH3w6GS2m7ieK6pM-|K}+fBi!d5kwNTcD@zL38&8RAnMmi*rztn+EB*M3i63 zM31^2Dy0NhvlAJf?(nR(By&is!j!3xnH^a3k?Zs^bKQ&cSe%)Hp{)_J94=bx6d2S# zfjm5)=IKTF-E>AM7{KDZ6`#yTMkYfSMvXdH#!OHaW)Lpb`$AR2ypwe@x|@4injEuV z*#D75iJ5=5z}d#~4QCn6n!SaH~6It+EU!8&e6g)ob}@nmO|igkn+ x+s59xVoHR2IOi-F)^*T4-C<`ex&B4?xQ~X8qVfJt{7GYdTK4XLm+>!WzW{!eC*}YE literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/PrintHS.png b/VisualPascalABCNETLinux/Resources/PrintHS.png new file mode 100644 index 0000000000000000000000000000000000000000..7b9216e5ef0a2fff4c7e2ea7f4c9b3c689d5d4ce GIT binary patch literal 766 zcmVz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;bV)=(RCwB?l5c2DaTv!x=iGI##kM*?3?{Q7=>&+mD@N*IRx4~l*-baeF;sj9js5{aDt8z~G!Hm;nfj3&Rv z)jQq$Uc4MI!{6ZMWcWFyh1Zf#!nNBD1#7k*oE?VY_zpU{da8jljSba|XeNE{zW|Wd zO&mv3S2KgohmE|QgFPuZp^Ko3s;IPh{_x)(P5dwz` z9HlVC)*FwTfbQ)ZmXP|I=F{M}(br?KNmP`Vakk|mb~fuaFI^Oi#iH!qvPw|_j-0)+ z8R)K^SwTcqsH%vwxUrtbIW;U^&_M01>GbrzMc6h?^BZF2Q!DAZ_b9)G11B%7kC&F5 zibkWn`#4N$NJrCjG+jr}7-+gqCS%~{a>UC@DUX-Y*Y_IV_wxc(RaG~4Y+6pqBk^lez07*qoM6N<$f@%3?MF0Q* literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/ProjectBrowser.ReferenceFolder.Closed.png b/VisualPascalABCNETLinux/Resources/ProjectBrowser.ReferenceFolder.Closed.png new file mode 100644 index 0000000000000000000000000000000000000000..c6b7f414b1e5ab338659807ee00fc49dccb79ab3 GIT binary patch literal 655 zcmV;A0&x9_P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+0r*KoK~y+T&63S)8c`I*{a5lQ zxGA{mMzD01+J%d*r0v2*Q#S>zOca!gAfZ?zMUXgxA1SsPbz*eDf>bwJDMe{O4H~P4 z`ZZEbDg;h@-w;9q1viC0I561vB@zjyU@%Ax6bdr0R;wFYEEbR?38T>ngTVmZ zZWqmF6ZLu>)oK-`QVDLiTLw@U0$hzSo6RsDk8xP2;GOUZdvOuF`~j>xJc`94^7%YG z9?vy^;t`&#<+iPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vGf5dZ)S5dnW>Uy%R+0kBC#K~y+T%~DH?!EqGzReS?h zw)XZ`tb73M6hf4ZjTK9gXCjjKGkN6^5#?Ph2>A$S=H6+T|I93Grsh|t|Kr|!?z!i8 zMWX+3#HCUR-|;R?{E|2-T&-5P-|vju?S{+cf>AQp=u6bc~_2oUk}L+hw`53p6WTA<1^T-Oy^a@OV5=0t!$En&07YJYcumVYAs_u~=X>n_)B>VK5k= zR;z`3;Pd(5^?I4z>2$(mGC`-)L8H+?sZ>ItP(Uu1Lnf0!B9TBUl?n-7+V{UqdIPeV V;=fPyj=2B;002ovPDHLkV1nGM{9yn9 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/SendToBackHS.png b/VisualPascalABCNETLinux/Resources/SendToBackHS.png new file mode 100644 index 0000000000000000000000000000000000000000..464d712a75ae819c3265b91037077598ef3f5a66 GIT binary patch literal 586 zcmV-Q0=4~#P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-z)3_wRCwB?lRaw`Q51%s$xbXpTRVS)5H!R>Bq12V z(k9>^uu{}Q!A6M$!CD(p(0?IjlWY_e1#9sGAxqe($?VMioI7)8uEnwo>t;8C2Tu7u zoO7RZqYwiBQ!&8n^;U4ML|cc_7NL5rwB^yg>(QYA=St4b&Y+A&N`*BBr42XkKVhRa z6VIPN=O+TRb!1YqpCpt;fpZ1jGzFmZ?Oplu^IIzK@l{3TE3V#LiG~15Ta?y=uqz6L zlmJ}5coIrM$OTp2W%b3cp$Vn{gtAy;24UwMT5AA;?NI9-D%Ixum#+Zay>)teXab=u zX(q_B3~dZbDufh0fJ>=eMrHOXOiEoJ2O9Or3b$9E9{5P15Y#52)CoSfNToS?EFQRz z`gibZZGCEKaiMKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709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HuNfCBu#KHG`ZdEehneAwm>FkD@zXB@ ziackb$N^A8)T|3U5dkx@mp3HCo59;{1(6KN^0xqkrKoyud8xCr+V4?5 zJz_cw*ARaH-x~mgsNdvyc6W2V+&R}TOO=AJKL3=hDir;+;BglLS$6|e4!0PG>{S}y2j;IbaBB{la;_ETh@qo6eD1bjV*2>P- zW}n)@>nR+aK-DCibHvaRU4w6D1Ycu7Giy*YM1%r(_~ON@?_NG1eBE8%#OG_A)Zm=r zT_6TWXlvT0#=8nl0bfr@(P0)SfZhFrmv{czJNWtHXJ1^{*u1=u6+MD$am|$I8-lO! zt|It`;2ohonFG=sK&RXNBhTdZ@cI6)G1;a5`XxsH4w;OGh($DcQgmnvm@1|oi2*Fl z0a>0Oi^wC_RQHb$2e*A&U!P9L)b(sH7kPxnq{(5L5CkDnr~-QG!RbLd-SR>7?$zjU zu&vl93q|o)Ci$+ZAfi}0)zJ)0z~p_EPxBbKg=%HdUD4QL77;$~@&^DBIhHJY4D6vg kGflm@!ygC8S>O5100xU$ISV5x?EnA(07*qoM6N<$g3f$O5dZ)H literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/copy.bmp b/VisualPascalABCNETLinux/Resources/copy.bmp new file mode 100644 index 0000000000000000000000000000000000000000..8a12f3bc4a2e958beb9996c14bcbf0c220a04a7f GIT binary patch literal 822 zcmchTEldMJ5QUH62@+X}tg3EMH6)eDlgN|EmB^KqD=Q~pE(kIL$Wj6sf@x4Akt6Gl zx4ZN>2q+RZZzr3XZ|Cpmc(PmNGl4zC-T$~d)j{?rbF)`&@2Fh$zv5;}Cu1ngN06Uo zO-F7z`mqx}n|B)%3PntTmyq|r@N!;vU8lYlH}8cnD1`hJd_5ZvCB6Zlj+v>LurZ-Z z&lkV0MTIr82A9~S(?#=Hg+kcoN4H8&LjwtzrO(;3*_gd4N?;buj(#vm3c!zpkcze; zdB{VCqQ36emH8Zv!CGIc7-vuVla4JKi-a$$tBb_bHoD0JqC})Z7K=gnbo_jM2^f+# zN7vj5p&6_JJQkAF2185aUsqh<#PgSI7)K)erjGHpXNC{`#$ykzez?CIGQ&4`2vw3= NLPIZ4k3-;(?{{l5gO>mR literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/cut.bmp b/VisualPascalABCNETLinux/Resources/cut.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e77b66919dfa095dc25a47a490018ae5873a935a GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpU(9fq{V>ba~gBS($F>PS!gXPAA5ME4{fJ z5*#K37$o{y0M(z{wj$lhD&0wY^MWZ@wLfSGcy#65#jUFv0t|o(j`idKwI?_jSZQlx zSKkrv^xC=G7fu1KxOeZ~g^GYX=TGilI=jFDq#YAITGsHOBVa=Y$Vsc}GlA;wUb}o| z%Q7GrQ!!BF)y>QAr)E58i(Hc6IV;KSV3{XS%Yh7sozvT}ss{?bxPI}?vTmS9uFa|k zD!xz`ab?B28%ze=F&u$ vojbRHj=6pNHc literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/format.bmp b/VisualPascalABCNETLinux/Resources/format.bmp new file mode 100644 index 0000000000000000000000000000000000000000..64ef5df229bb4729345691b65c90a6d3bc6d7422 GIT binary patch literal 822 zcmbV}-%C?r7{?d=16_6>f!%l$4ZP?ggAB~liws2wa)SopZZ-%*FsUSPRQ6+;R+eiS zZsM=jVsp%#Bj;Gms10>f=JL$_bUWM5kN2GS^qg(N+ief$eGccG&-eL$&-*sED32;C zrG#Dw>sW0aQ5>(lSJb{&AF5qaNdIwJpWGeNcMod21~lz`s^5b|chQC>9EC2Ys7so{-n|(`^qpXMMIQb@LgLpMUuf6*8mu z^jtQJ1hU zNHEWWkqAbmf}`V<`HDP$Hx%qswUYeG^aRFu;hhm9gn6zaDG4Pok~d*55+2Z8Bl++1 zlM)ohk| Ay#N3J literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/format.png b/VisualPascalABCNETLinux/Resources/format.png new file mode 100644 index 0000000000000000000000000000000000000000..7e19f69dbfbd87d3fa0f752e2a3128d3374626f9 GIT binary patch literal 587 zcmV-R0<`^!P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RU3>*t3HVwu|{r~_0-AP12R5;76 zlf7%xVGzeZ5&r@gaq$o6;^-iX(4o>PxKuKzl`4&cif$QnQBgsVRPcp@N~^dS6eS>1 zr3$_*ot?7SL9A)ONR!|5+>68WOKMHBd2nzX-1k0r_dEr1TmJIZV^o4DB1+6%dajD9 zrJO3~rVkYWw)X^LRL1v>G0Myx9L%9|<3T^atrrAQ0A9ZS2*8utTLA7a)-iXg^UqO( z_n%e>Aq;kS@n*&UH8XQj^C;$7H1A~QKYsr5a;5461QHX$<7Z0=)e^4vVs+G<5QQwn ze&fv@Xc8zL9!DJ}E`F!o?$X_8@%i>1)WLFrzem`zM0e-jLYF?Y;%qv~4( zVjMxB1}93BsDrzsmWuYyyhAqDux^vuts>bl0Tsg>=H_dZr;C^sFmu$M4|fly*x=jh zDl(ivFmq;)7cnEpcFdgpPx#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA0n2FA?lor~h34(=SVWC}qfdo>86lnr!qF4$s1dY0wg~(2H zcXnpp*UhowJt@#qxE6*<8c*z zHO-?xeD^SVV{G(Su(k6k4J+g#NNs|YwU?swGOfIf=_jNR*Tt!V*kyA`fXpd=Z`4>^Srr_io_)W)NpSHQc#B;f9% zvK^>3@bSYMs2XY(H8wDjF$r|N0-Xxpfl{NW0-nD7lTN9`q(oKb*n7Pke@6~_inRrr z+XgJ%yMyiZ``njPaSbh+We+f|IU!?X$bp;30kd`AeB4#FRKa)PhN zM{$2gzGi4u-*~$vKL_6<%X(E+>&6=0o0sW0W%DXO?{3byG5-zV5@uVW=$@&aO#lD@ Z07*qoM6N<$g7g3Y002ovPDHLkV1g~K0f7Jj literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/format2.png b/VisualPascalABCNETLinux/Resources/format2.png new file mode 100644 index 0000000000000000000000000000000000000000..b7f203d590c3d1bb046527af56e8b64f2c57d8f5 GIT binary patch literal 587 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85p>QL70(Y)*K0-hCELf#}Etuxxu#jE{-C5^B>PoP_C*!_{-;t z7HjK-j0_biPWyyPtq`lufZW8@yoyCGix(nhE*H`+uPe(+|M{=2Jv z;U`)D&N{#D-Km`^-RswKcC5L$`qr*rx;+LD3J&eMmi>QnW8Bmtkq=@lK^%`Y_Unck zzsgTcD|EhgIosyVy$jE;x7Q@LbyoM46h7gZTl~bi=ZxByE7r?XKG+M?GF#L<4DNT` z4vHQIPgg&ebxsLQC%&q^y)V0KuGo6Le#K`qoWz#ae_~`ZeIE5yQQS{H_2HksJsIMG z=HgOK3RXT2qJin(A|_t@Wu@r0X+ev^&$q2UN{U>Il*o}uaBdz Vq3OTbe;My@T3^ii`ui7T8v!Am`APr) literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/new_file.bmp b/VisualPascalABCNETLinux/Resources/new_file.bmp new file mode 100644 index 0000000000000000000000000000000000000000..f205e193b7274d1938708a39a5b78f7d707af984 GIT binary patch literal 822 zcmbV~OD_Xa6vsz=0ZVHOvGQ1GVrxfYWn*K-*4{=!A|drw8q}le6(;HtT0vT`DiKlf ztk)RrG}Bfy9n;s$n7Iy9&4jUWbMDFi-upWz=iGbCt904e*U*74fSHq?Sy=AZK9)XL z7T>-Z!~SFAUCnhBrGMG)oF;wKyO8qkSg*G6GyCk(ig_0|ZOt0(76T;FyMtadd3>ZZ!+(YdsU*j|h5XRICcix1tL72( z&VTj}H>TzrkA3Z4MjsH$9MteF(MKj)JV7N;mZgKmv3-2Bz7l>w`b{lVyx2}O1*O`< zfFX*CY=oKS6@Gq552RulemE=`SmaEhB|7F75$K6%x-RQz_oZtS_%oLy!{_1NY9|SB z6iI901ZdqBr39>+`vLYGIx{c`$ZzBjWL~7WeG!4~xOuTn8^PA62G89)Y8bTHA1m2- r?qpHTp0Afhg*L+Q!2Dp;%LW$-_cIg{@~!thG(Ygjw4J=Dfgkz-Z!~SFAUCnhBrGMG)oF;wKyO8qkSg*G6GyCk(ig_0|ZOt0(76T;FyMtadd3>ZZ!+(YdsU*j|h5XRICcix1tL72( z&VTj}H>TzrkA3Z4MjsH$9MteF(MKj)JV7N;mZgKmv3-2Bz7l>w`b{lVyx2}O1*O`< zfFX*CY=oKS6@Gq552RulemE=`SmaEhB|7F75$K6%x-RQz_oZtS_%oLy!{_1NY9|SB z6iI901ZdqBr39>+`vLYGIx{c`$ZzBjWL~7WeG!4~xOuTn8^PA62G89)Y8bTHA1m2- r?qpHTp0Afhg*L+Q!2Dp;%LW$-_cIg{@~!thG(Ygjw4J=DfgkzS->P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0nj- z?KXX}*{<8yE!)T4=@K+(%fVkVnM^XzlmGn2B}XryCi*e*BWwf@)5zXL-MY>8%2iwk zNjdH3`|D$%4Ul?!#@Yu-PWPa0dJZNq3ZtNVp&3J0rmTHIoVPz;!~0-btl|5wn2UY* zyD%XgLXMoKoPCN(iE81cI4d)~?B1-!nMz%t7{IvD6w(idvQ6T!P~#&;464FeW+JUh2jU zs$L_V|A{oa-dWH;{K&!DF`7GQ_A91;U0ZW7Ty?w@O`2YX_ M07*qoM6N<$f(@Sq=Kufz literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/open.bmp b/VisualPascalABCNETLinux/Resources/open.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4f0c973acb39d731d971cc04e42ec79fed1d702b GIT binary patch literal 822 zcmb7=ze~eF6vrd}0~tHs=$NTE2B$g*8Ff3S7N=}>yv=~i!>I_$+st@S(BdEmQd^6a zvw{Stj2-Vki0^XoTG~a!H^=?>eBbxo9UQfHgZgXJxJQ53{5wIb-Vd5{xA+}J5d1@F z23!E|izF2ZPvc`Acams7W>Lgg6t-AsKjv!^4=7Wq1MpH|ra~b}tdA@O*5S8zxwD82 zgwl{pQC3`6$9nwx#-*xw)VRV-Q^fOZP8LCY zVZ^j_5h?L&E(&rkia5Kxw)_C0G*DJHVx(+@7qwS+Xf0SCcF)IeACAXmVwLOPuCk->zXl-j8P+FfA987sqcO`5ox<>EqBX5yWCX Zp&fs^Jt>M$!Y~tZAjVG*+rVFTegLFma`*rM literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/openclosed.png b/VisualPascalABCNETLinux/Resources/openclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..9572ae18e2ec7fbeab3aa9be09e5793f1d654cf4 GIT binary patch literal 3205 zcmV;040`j4P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#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{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z00057Nkld>X4at}r-XcDAz8^Tg{nhiIx-A3S{Y{!|B%gGK#D z*6z|rJLK^;D=RlSIIztZ&mUuIs2OgCnX|V3r1%T)?7aQh|A%{dniKBdzBHrwb?X%y zo6EBf+?+diuTc~bSt(qIoCr@ed+#8XL@LQrQr8zr>B1}^=Zv=d^sFIEMMw=&k)YJF6fQCmXQJ4JI;9M4_tZnJ>FaFH)RuF|$GX_C6L rO{A1at)QyY?3&H<>?r@&ZTvF;+;LN!A1J~l00000NkvXXu0mjf(_Z|D literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/pabcfile.png b/VisualPascalABCNETLinux/Resources/pabcfile.png new file mode 100644 index 0000000000000000000000000000000000000000..375afbdb9328abf644d9e0097fc162ec1a063c13 GIT binary patch literal 556 zcmV+{0@MA8P)Px#32;bRa{vGi!vFvd!vV){sAK>D00(qQO+^RU1O^KMI21y7WdHyHzDYzuR5;6> zk}+sgQ51&1JVPeCxmf5_Ds*+I@SK8+gsyQA9AY}yO^j^^gGi%`h=^!GX(?@&KyYa( z)j=Y5*3F`$-AZvX@80*`z4sl5*Sw?&q11o5Kb(8M^K3r*^ADH#esGwj%>YU{*4JTk6SVF@5=rnUe3B%g{_GV1^9zlvp6{Cd z&tn`Pr@q;QN+tD23r9@7p5o8q^Q>vB`GKJXpSCZty9;}Ju(HxiF#ckk*(N7 z-^ku=D8cf}ACyYh0J!=49bBv-0U#C;L4}5nGDE+VB`~(HSg%974JVU~O^9Mg7~9bR zYX<0ET5^dH8Alj9qSy@q^8E_~u-0lbS-OSqU#Ad9EH>VwwI+-r9^9*p1~`|}tK}k; zi?Hz)>k=Mo!(SB>sPr5O=xVLiMrn;wA%Ri^N~2YppnB)_*??-fNNmzH!O8TFGIUf- uN1L+&Z?-;i9-RWrl;$|Ea{XKNKl%qXNda5aULCgp0000&|>1?C3 zsHVxLPC`Ld+b9K%fCkCv1wMhFv}%jQG-@QvnufOllF213op;tPEEcg)ueLi#BuA!U z7^e483wf8i77}!lYT>NDS2s$c#+tz|>)?WpK{B=-eAy~x4UnW#MM<@0xF9jqg7VR^ zX+|s(b&%}<7Zfs+v`2mHSoNc1GJ+)*z7Cjz59EMVD8NLPVICNLwu_VZo5BbDnz>7i z-1_Xh?CNNjeog|uTZZHNg|9mc4X8!+_UAoy2}YGC-zugFuZjOFy>b&rcoef$fctD$ f0i!I_S@T2pIPp&}fB*fb*cM3q{rG$u`tto9IP+{e literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/redo.bmp b/VisualPascalABCNETLinux/Resources/redo.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9f7a6ca6d67090250f5ebecafafc3487d81b7b6c GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpU(9fq{Xp=*5X$FOF>`($a^$Iq!QTADuo# zjQWdpksmq&?(SYijN*HHR{|9uua752F;LBi2?-A>94;Q*L5%umC$<9(-wnUcY7DTZ;PB2?T#$?VaJ3IGYUR51Ux7JX+f5HzjOA3 zIHq$D5;TfPO($zy1C0B|s-_&amE);c%$j z^ZnF}_e;v3oI3zf2J}9%dLaA#q0R62t$eqk_uYCR>UqDU?b&IlVlniONJWRcAVbJc&GsJc*1%Mj|6uMj|7TmB>hB9DRITF8wgs zdB@Dbd&|CEK0bG^ti}%OJHAc-Uf5gRXZ^hWEURJcY4}OeD4p!EgS3MHj1XpDpbL1* z944KtjmFTh6@2T@1O)HH#Y3ps8(WQfdM2}JkZfBihOxI|Qu6%(Nw{-rj zvvart67U&gkfg7WVlcC!K>!Ygi96rq6Ez9=E0i>o@}ndvA-VHWMkXp)Zoy8RP0$+F zyy_CzZ}r53&1awC5l2cQp_hUrrvXm4Zog@gm2YiEHzt)^+){~agoPMn#ZyiaibH>w2o73Wk& tV}Mlo8Lt10TPhM;Gy;fJ1p#0kfDjEHwU8>o>v0ma6~& literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/save_all.bmp b/VisualPascalABCNETLinux/Resources/save_all.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4a4c02dd12a826bd2e6ec039bf33a00e0e45be0b GIT binary patch literal 822 zcmb7>Ax{J`5QUfU2arf45_Lf~s52y$>!{=8$d#2VE0H75F+rW|A0VkjRw65L%j>qA zENm}?rfss__xjD7K0NL&yLs%e-(p?WbOK+stthL)? zDytOT=efPjA1I908?7O;Hhu&-iB^hdS3^$}orA?_MaGD52;P8ohT;bsUlTJ zvR0s=U296oj!LGJPovFxjM)MZ8v}i%8CFbG(X0M~N*#wGk(92y)F zHWa|M0KJ1>i$h01!GQuG0%@smIDYR8e)9t+fYdLzu>q*~#C-yafkp+)NPs9l`GBY( jO_%|4#;FJA@H+!83sislAyFX@(Q@Vy35wyi;9&p&*oLj8 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/stop.bmp b/VisualPascalABCNETLinux/Resources/stop.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3ff8844f8371fd0c7406bc25ff3d0e73d0909912 GIT binary patch literal 822 zcmdr|p^ic^5G=VLcoK;`Sw)a9r!bdPA}f(7K(0hqA`mN|TzRq*S&5?(**_@L@(8A! zzFf1rNw>3|o%#Bnf2exqsGrDg%!!)Tz8c>jmuDrV{z+U%lJ!v@I@DQ*ZeD<8Aj<_-c7Hstv ze+iX>(=f95y@8N6exMw~i(()!LJPFF@k03)bEU{0Lds&1iA@`y#g+dN7hhP;^4LvQ YFtnk!;Gt9~)lEj1VAN^X#Q%ln9i(IOk^lez literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/Resources/undo.bmp b/VisualPascalABCNETLinux/Resources/undo.bmp new file mode 100644 index 0000000000000000000000000000000000000000..21a9ed16dc27262a7d3a9fab9deee13ac8f87f70 GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpU(9fq{Vv=-JUN*Vj(Eb@K+1rad@y@Iyzy zg^GZ)TUQaI<R*)r*T0tT5GoSkdtA#Jblfwtmk8T8N0onre{)P;PP3a)R-|brb=I~Zz^~mhEdzS*WyxTVG?fM=N+Oy)_!A-Yr i+(cG`#(r`2#GAcK-|k)U`oxB3XOG>!bqh@a?YICbzXyH* literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/RunArguments.Designer.cs b/VisualPascalABCNETLinux/RunArguments.Designer.cs new file mode 100644 index 000000000..64d96a4f3 --- /dev/null +++ b/VisualPascalABCNETLinux/RunArguments.Designer.cs @@ -0,0 +1,104 @@ +namespace VisualPascalABC +{ + partial class RunArguments + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.tbRunArguments = new System.Windows.Forms.TextBox(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(2, 33); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(91, 13); + this.label1.TabIndex = 0; + this.label1.Text = "M_ARGUMENTS"; + // + // tbRunArguments + // + this.tbRunArguments.Location = new System.Drawing.Point(82, 30); + this.tbRunArguments.Name = "tbRunArguments"; + this.tbRunArguments.Size = new System.Drawing.Size(236, 20); + this.tbRunArguments.TabIndex = 1; + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(152, 71); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 2; + this.btnOK.Text = "RF_OK"; + this.btnOK.UseVisualStyleBackColor = true; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(243, 71); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 3; + this.btnCancel.Text = "RF_CANCEL"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // RunArguments + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(330, 106); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.tbRunArguments); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "RunArguments"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "M_RUN_PARAMETERS"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tbRunArguments; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/RunArguments.cs b/VisualPascalABCNETLinux/RunArguments.cs new file mode 100644 index 000000000..db5750297 --- /dev/null +++ b/VisualPascalABCNETLinux/RunArguments.cs @@ -0,0 +1,32 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class RunArguments : Form + { + public RunArguments() + { + InitializeComponent(); + } + + public string CommandLineArguments + { + get + { + return this.tbRunArguments.Text; + } + set + { + this.tbRunArguments.Text = value; + } + } + } +} diff --git a/VisualPascalABCNETLinux/RunArguments.resx b/VisualPascalABCNETLinux/RunArguments.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/VisualPascalABCNETLinux/RunArguments.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/RunProcessOptions.cs b/VisualPascalABCNETLinux/RunProcessOptions.cs new file mode 100644 index 000000000..9365b25b6 --- /dev/null +++ b/VisualPascalABCNETLinux/RunProcessOptions.cs @@ -0,0 +1,14 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC +{ + public class RunProcessOptions + { + public System.Diagnostics.Process Process = null; + + } +} diff --git a/VisualPascalABCNETLinux/SSYY/App.ico b/VisualPascalABCNETLinux/SSYY/App.ico new file mode 100644 index 0000000000000000000000000000000000000000..3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6 GIT binary patch literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/SSYY/DefaultMenuCommands.cs b/VisualPascalABCNETLinux/SSYY/DefaultMenuCommands.cs new file mode 100644 index 000000000..be60fb530 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/DefaultMenuCommands.cs @@ -0,0 +1,289 @@ +// +// System.ComponentModel.Design.DefaultMenuCommands.cs +// +// Author: +// Ivan N. Zlatev +// +// (C) 2008 Ivan N. Zlatev +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.ComponentModel.Design.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Design; +using System.Collections; +using System.IO; + +using System.Windows.Forms.Design; + +namespace SampleDesignerHost +{ + internal sealed class DefaultMenuCommands + { + private IServiceProvider _serviceProvider; + private const string DT_DATA_FORMAT = "DT_DATA_FORMAT"; + + public DefaultMenuCommands (IServiceProvider serviceProvider) + { + if (serviceProvider == null) + throw new ArgumentNullException ("serviceProvider"); + _serviceProvider = serviceProvider; + } + + public void AddTo (IMenuCommandService commands) + { + commands.AddCommand (new MenuCommand (Copy, StandardCommands.Copy)); + commands.AddCommand (new MenuCommand (Cut, StandardCommands.Cut)); + commands.AddCommand (new MenuCommand (Paste, StandardCommands.Paste)); + commands.AddCommand (new MenuCommand (Delete, StandardCommands.Delete)); + commands.AddCommand (new MenuCommand (SelectAll, StandardCommands.SelectAll)); + } + + private object _clipboard = null; + + private void Copy (object sender, EventArgs args) + { + IDesignerSerializationService stateSerializer = GetService (typeof (IDesignerSerializationService)) as IDesignerSerializationService; + IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost; + ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService; + if (host == null || stateSerializer == null || selection == null) + return; + + // copy selected components and their associated components + ICollection selectedComponents = selection.GetSelectedComponents (); + ArrayList toCopy = new ArrayList (); + foreach (object component in selectedComponents) { + if (component == host.RootComponent) + continue; + toCopy.Add (component); + ComponentDesigner designer = host.GetDesigner ((IComponent)component) as ComponentDesigner; + if (designer != null && designer.AssociatedComponents != null) + toCopy.AddRange (designer.AssociatedComponents); + } + object stateData = stateSerializer.Serialize (toCopy); + _clipboard = stateData; + // Console.WriteLine ("Copied components: "); + // foreach (object c in toCopy) + // Console.WriteLine (((IComponent)c).Site.Name); + // + + // TODO: MWF X11 doesn't seem to support custom clipboard formats - bug #357642 + // + // MemoryStream stream = new MemoryStream (); + // new BinaryFormatter().Serialize (stream, stateData); + // stream.Seek (0, SeekOrigin.Begin); + // byte[] serializedData = stream.GetBuffer (); + // Clipboard.SetDataObject (new DataObject (DT_DATA_FORMAT, serializedData)); + } + + // Reminder: We set control.Parent so that it gets serialized for Undo/Redo + // + private void Paste (object sender, EventArgs args) + { + IDesignerSerializationService stateSerializer = GetService (typeof (IDesignerSerializationService)) as IDesignerSerializationService; + ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService; + IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost; + IComponentChangeService changeService = GetService (typeof (IComponentChangeService)) as IComponentChangeService; + if (host == null || stateSerializer == null) + return; + // + // TODO: MWF X11 doesn't seem to support custom clipboard formats - bug #357642 + // + // IDataObject dataObject = Clipboard.GetDataObject (); + // byte[] data = dataObject == null ? null : dataObject.GetData (DT_DATA_FORMAT) as byte[]; + // if (data != null) { + // MemoryStream stream = new MemoryStream (data); + // stateSerializer.Deserialize (new BinaryFormatter().Deserialize (stream)); + // ..... + // } + // + if (_clipboard == null) + return; + + DesignerTransaction transaction = host.CreateTransaction ("Paste"); + ICollection components = stateSerializer.Deserialize (_clipboard); + // Console.WriteLine ("Pasted components: "); + // foreach (object c in components) + // Console.WriteLine (((IComponent)c).Site.Name); + System.Collections.Generic.List sel = new System.Collections.Generic.List(components.Count); + foreach (object component in components) { + sel.Add(component); + Control control = component as Control; + if (control == null) + continue; // pure Components are added to the ComponentTray by the DocumentDesigner + + PropertyDescriptor parentProperty = TypeDescriptor.GetProperties (control)["Parent"]; + if (control.Parent != null) { + // Already parented during deserialization? + // In that case explicitly raise component changing/ed for the Parent property, + // so it get's cought by the UndoEngine + if (changeService != null) { + changeService.OnComponentChanging (control, parentProperty); + changeService.OnComponentChanged (control, parentProperty, null, control.Parent); + } + } else { + ParentControlDesigner parentDesigner = null; + if (selection != null && selection.PrimarySelection != null) + parentDesigner = host.GetDesigner ((IComponent)selection.PrimarySelection) as ParentControlDesigner; + if (parentDesigner == null) + parentDesigner = host.GetDesigner (host.RootComponent) as DocumentDesigner; + if (parentDesigner != null && parentDesigner.CanParent(control)) + { + parentProperty.SetValue(control, parentDesigner.Control); + control.Name = null; + (host as IContainer).Add(control); + (host as SampleDesignerHost).AddDesignedComponent(control); + //parentDesigner.Control.Controls.Add(control); + } + } + } + //_clipboard = null; + //(host as SampleDesignerHost).SetSelectedComponents(components.); + selection.SetSelectedComponents(sel.ToArray(), SelectionTypes.Primary); + transaction.Commit (); + ((IDisposable)transaction).Dispose (); + } + + private void Cut (object sender, EventArgs args) + { + IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost; + if (host == null) + return; + using (DesignerTransaction transaction = host.CreateTransaction ("Cut")) { + Copy (this, EventArgs.Empty); + Delete (this, EventArgs.Empty); + transaction.Commit (); + } + } + + private void Delete (object sender, EventArgs args) + { + IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost; + ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService; + if (host == null || selection == null) + return; + + ICollection selectedComponents = selection.GetSelectedComponents (); + string description = "Delete " + + (selectedComponents.Count > 1 ? (selectedComponents.Count.ToString () + " controls") : + ((IComponent)selection.PrimarySelection).Site.Name); + DesignerTransaction transaction = host.CreateTransaction (description); + + foreach (object component in selectedComponents) { + if (component != host.RootComponent) { + ComponentDesigner designer = host.GetDesigner ((IComponent)component) as ComponentDesigner; + if (designer != null && designer.AssociatedComponents != null) { + foreach (object associatedComponent in designer.AssociatedComponents) + host.DestroyComponent ((IComponent)associatedComponent); + } + host.DestroyComponent ((IComponent)component); + } + } +#if NET_2_0 + selection.SetSelectedComponents (selectedComponents, SelectionTypes.Remove); +#else + selection.SetSelectedComponents (selectedComponents); +#endif + transaction.Commit (); + } + + private void SelectAll (object sender, EventArgs args) + { + IDesignerHost host = GetService (typeof (IDesignerHost)) as IDesignerHost; + ISelectionService selection = GetService (typeof (ISelectionService)) as ISelectionService; + if (host != null && selection != null) + selection.SetSelectedComponents (host.Container.Components, SelectionTypes.Replace); + } + + // * StandardCommands + // o AlignBottom + // o AlignHorizontalCenters + // o AlignLeft + // o AlignRight + // o AlignToGrid + // o AlignTop + // o AlignVerticalCenters + // o BringToFront + // o CenterHorizontally + // o CenterVertically + // -o Copy + // -o Cut + // -o Delete + // o HorizSpaceConcatenate + // o HorizSpaceDecrease + // o HorizSpaceIncrease + // o HorizSpaceMakeEqual + // -o Paste + // -o SelectAll + // o SendToBack + // o SizeToControl + // o SizeToControlHeight + // o SizeToControlWidth + // o SizeToGrid + // o SnapToGrid + // o TabOrder + // o VertSpaceConcatenate + // o VertSpaceDecrease + // o VertSpaceIncrease + // o VertSpaceMakeEqual + // o ShowGrid + // o LockControls + // + // * MenuCommands + // o KeyDefaultAction + // o KeySelectNext + // o KeySelectPrevious + // o KeyMoveLeft + // o KeySizeWidthDecrease + // o KeyMoveRight + // o KeySizeWidthIncrease + // o KeyMoveUp + // o KeySizeHeightIncrease + // o KeyMoveDown + // o KeySizeHeightDecrease + // o KeyCancel + // o KeyNudgeLeft + // o KeyNudgeDown + // o KeyNudgeRight + // o KeyNudgeUp + // o KeyNudgeHeightIncrease + // o KeyNudgeHeightDecrease + // o KeyNudgeWidthDecrease + // o KeyNudgeWidthIncrease + // o DesignerProperties + // o KeyReverseCancel + + private object GetService (Type serviceType) + { + if (_serviceProvider != null) + return _serviceProvider.GetService (serviceType); + return null; + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/DesignerComponentCollection.cs b/VisualPascalABCNETLinux/SSYY/DesignerComponentCollection.cs new file mode 100644 index 000000000..37f1e9ea3 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/DesignerComponentCollection.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.ComponentModel.Design.Serialization; + using System.Diagnostics; + using System.Collections; + using System.Windows.Forms; + using System.Reflection; + using System.Text; + + /// This collection keeps a list of components parallel with the host's list of + /// sites for those components. + internal class DesignerComponentCollection : ComponentCollection + { + private SampleDesignerHost host; + + internal DesignerComponentCollection(SampleDesignerHost host) : base(new IComponent[0]) { + this.host = host; + + // Initially fill the list with site data. After the initial fill it is up to + // those who modify the Sites hash to update us. + // + if (host.Sites != null) { + foreach(ISite site in host.Sites.Values) { + InnerList.Add(site.Component); + } + } + } + + /// Access components from sites by name. + public override IComponent this[string name] { + get { + Debug.Assert(name != null, "name is null"); + if (name == null) { + return null; + } + + if (name.Length == 0) { + Debug.Assert(host.RootComponent != null, "base component is null"); + return host.RootComponent; + } + + ISite site = (ISite)host.Sites[name]; + return (site == null) ? null : site.Component; + } + } + + internal void Add(ISite site) { + InnerList.Add(site.Component); + } + + internal void Clear() { + InnerList.Clear(); + } + + internal void Remove(ISite site) { + InnerList.Remove(site.Component); + } + + } +} diff --git a/VisualPascalABCNETLinux/SSYY/DesignerHost.csproj b/VisualPascalABCNETLinux/SSYY/DesignerHost.csproj new file mode 100644 index 000000000..9e3f9ee83 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/DesignerHost.csproj @@ -0,0 +1,180 @@ + + + Local + 8.0.50727 + 2.0 + {D1B610E3-444E-4438-9CB3-A4EB05CB3954} + Debug + AnyCPU + App.ico + + + DesignerHost + + + JScript + Grid + IE50 + false + WinExe + DesignerHost + + + + + + + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + System.Design + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + + + + Code + + + Code + + + Code + + + Form + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Component + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Form + + + Code + + + UserControl + + + MainForm.cs + + + SampleDocumentWindow.cs + + + ServiceRequests.cs + + + + + + + + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/DesignerHost.sln b/VisualPascalABCNETLinux/SSYY/DesignerHost.sln new file mode 100644 index 000000000..1e81c856f --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/DesignerHost.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesignerHost", "DesignerHost.csproj", "{D1B610E3-444E-4438-9CB3-A4EB05CB3954}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1B610E3-444E-4438-9CB3-A4EB05CB3954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1B610E3-444E-4438-9CB3-A4EB05CB3954}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1B610E3-444E-4438-9CB3-A4EB05CB3954}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1B610E3-444E-4438-9CB3-A4EB05CB3954}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/VisualPascalABCNETLinux/SSYY/DesignerMain.cs b/VisualPascalABCNETLinux/SSYY/DesignerMain.cs new file mode 100644 index 000000000..6d028cbb2 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/DesignerMain.cs @@ -0,0 +1,181 @@ +using System; +using System.Drawing.Design; +using System.Drawing; +using System.Windows.Forms; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.ComponentModel.Design.Serialization; +using System.Windows.Forms.Design; +using System.Reflection; +using System.CodeDom; +using System.Collections; +using SampleDesignerHost; +using System.IO; +using VisualPascalABC; + +namespace SampleDesignerApplication +{ + public class CodeStrings + { + public string PascalABCCode; + public string XMLCode; + + public void Reset() + { + PascalABCCode = null; + XMLCode = null; + } + } + + public class DesignerMain : Component + { + public SampleDesignerHost.SampleDesignerHost host; + public SampleDesignerLoader loader; + private ServiceContainer hostingServiceContainer; + private ServiceRequests serviceRequests; + //private Form1 pabcform; + private PropertyGrid propertyGrid; + private ToolBoxPane toolbox; + private Panel panelMain; + private KeystrokeMessageFilter filter; + public CodeStrings generatedCode; + + public DesignerMain(PropertyGrid props, ToolBoxPane t, Panel p) + { + propertyGrid = props; + toolbox = t; + panelMain = p; + hostingServiceContainer = new ServiceContainer(); + generatedCode = new CodeStrings(); + hostingServiceContainer.AddService(typeof(CodeStrings), generatedCode); + hostingServiceContainer.AddService(typeof(PropertyGrid), propertyGrid); + hostingServiceContainer.AddService(typeof(ToolBoxPane), toolbox); + } + + /// This method is called whenever we create a new designer or + /// load one from existing XML. + private void CreateDesigner(SampleDesignerLoader loader) + { + // Our loader will handle loading the file (or creating a blank one). + host = new SampleDesignerHost.SampleDesignerHost(hostingServiceContainer); + + // The limited events tab functionality we have requires a special kind of + // property grid site. + // + propertyGrid.Site = new PropertyGridSite(host as IServiceProvider, this); + propertyGrid.PropertyTabs.AddTabType(typeof(EventsTab)); + + host.LoadDocument(loader); + this.loader = loader; + + // The toolbox needs access to the IToolboxService and the designers. + toolbox.Host = host; + + // Initialize our document window. + host.View.Dock = DockStyle.Fill; + host.View.Visible = true; + panelMain.Controls.Add(host.View); + + // These are normally unavailable if we've got no host created. + // Otherwise we gets lots of null reference exceptions. + // + //tabControl.Visible = true; + //menuItemSave.Enabled = true; + //menuItemSaveAs.Enabled = true; + //menuItemEdit.Enabled = true; + //menuItemView.Enabled = true; + //menuItemLayout.Enabled = true; + //menuItemDebug.Enabled = true; + + // This IMessageFilter is used to intercept and decipher keyboard presses + // that might be instructions for our designer. We have to do it this way + // since we can't have our designer raise KeyPress events. + // + filter = new KeystrokeMessageFilter(host); + Application.AddMessageFilter(filter); + } + + /// This is called to destroy our designer (when we load a new one for example). + /// It returns true if our environment has been cleared, false if not (if someone + /// cancels a dispose when prompted to save changes). + private bool DestroyDesigner() + { + if (loader != null) + { + if (loader.PromptDispose()) + { + // Again, bad things happen if there's no host loaded and + // certain buttons are pressed in our TabControl or MainMenu. + // + //tabControl.Visible = false; + //menuItemSave.Enabled = false; + //menuItemSaveAs.Enabled = false; + //menuItemEdit.Enabled = false; + //menuItemView.Enabled = false; + //menuItemLayout.Enabled = false; + //menuItemDebug.Enabled = false; + + // Get rid of our document window. + panelMain.Controls.Clear(); + + // No need to filter for designer-intended keyboard strokes now. + Application.RemoveMessageFilter(filter); + filter = null; + + // Get rid of that property grid site so it doesn't ask for + // any more services from our soon-to-be-disposed host. + // + propertyGrid.Site = null; + + host.Dispose(); + loader = null; + host = null; + return true; + } + return false; + } + return true; + } + + public void CreateNew() + { + if (DestroyDesigner()) // make sure we're clear for a new designer + { + // A loader created with no parameters creates a blank document. + SampleDesignerLoader designerLoader = new SampleDesignerLoader(); + CreateDesigner(designerLoader); + } + } + + public void CreateFromXML(string file_name) + { + if (DestroyDesigner()) // make sure we're clear for a new designer + { + SampleDesignerLoader designerLoader = new SampleDesignerLoader(file_name); + CreateDesigner(designerLoader); + designerLoader.dirty = false; + } + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (host != null) + { + host.Dispose(); + } + + } + base.Dispose(disposing); + } + + public void ExecuteCommand(CommandID id) + { + IServiceContainer sc = host as IServiceContainer; + IMenuCommandService mcs = sc.GetService(typeof(IMenuCommandService)) as IMenuCommandService; + mcs.GlobalInvoke(id); + } + + } +} diff --git a/VisualPascalABCNETLinux/SSYY/EULA.txt b/VisualPascalABCNETLinux/SSYY/EULA.txt new file mode 100644 index 000000000..c351b6f22 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/EULA.txt @@ -0,0 +1,3 @@ +The information provided in the Microsoft Knowledge Base is provided "as is" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no Event shall Microsoft corporation or its suppliers be liable for Any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply. + +Microsoft does not warrant that the functions for the licensed software or code contained in the Knowledge Base will meet your requirements, or that the operation of the licensed software or code will be uninterrupted or error-free, or that defects in the licensed software or code can be corrected. Furthermore, Microsoft does not warrant or make any representations regarding the use or the results of the use of the licensed software, code or related documentation in terms of their correctness, accuracy, reliability, or otherwise. No verbal or written information or advice given by Microsoft or its authorized representatives shall create a warranty or in any way increase the scope of this warranty. Should the licensed software or code prove defective after Microsoft has delivered the same, you, and you alone, shall assume the entire cost associated with all necessary servicing, repair or correction. \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/KeystrokeMessageFilter.cs b/VisualPascalABCNETLinux/SSYY/KeystrokeMessageFilter.cs new file mode 100644 index 000000000..23946a440 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/KeystrokeMessageFilter.cs @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerApplication +{ + using System; + using System.Windows.Forms; + using System.ComponentModel.Design; + using System.Windows.Forms.Design; + using SampleDesignerHost; + + /// This filter is used to catch keyboard input that is meant for the designer. + /// It does not prevent the message from continuing, but instead merely + /// deciphers the keystroke and performs the appropriate MenuCommand. + public class KeystrokeMessageFilter : System.Windows.Forms.IMessageFilter + { + private IDesignerHost host; + + public KeystrokeMessageFilter(IDesignerHost host) + { + this.host = host; + } + #region Implementation of IMessageFilter + + public bool PreFilterMessage(ref Message m) + { + // Catch WM_KEYCHAR if the designerView has focus + if ((m.Msg == 0x0100) && (((SampleDesignerHost)host).View.Focused)) + { + IMenuCommandService mcs = host.GetService(typeof(IMenuCommandService)) as IMenuCommandService; + + // WM_KEYCHAR only tells us the last key pressed. Thus we check + // Control for modifier keys (Control, Shift, etc.) + // + switch (((int)m.WParam) | ((int)Control.ModifierKeys)) + { + case (int)Keys.Up: mcs.GlobalInvoke(MenuCommands.KeyMoveUp); + break; + case (int)Keys.Down: mcs.GlobalInvoke(MenuCommands.KeyMoveDown); + break; + case (int)Keys.Right: mcs.GlobalInvoke(MenuCommands.KeyMoveRight); + break; + case (int)Keys.Left: mcs.GlobalInvoke(MenuCommands.KeyMoveLeft); + break; + case (int)(Keys.Control | Keys.Up): mcs.GlobalInvoke(MenuCommands.KeyNudgeUp); + break; + case (int)(Keys.Control | Keys.Down): mcs.GlobalInvoke(MenuCommands.KeyNudgeDown); + break; + case (int)(Keys.Control | Keys.Right): mcs.GlobalInvoke(MenuCommands.KeyNudgeRight); + break; + case (int)(Keys.Control | Keys.Left): mcs.GlobalInvoke(MenuCommands.KeyNudgeLeft); + break; + case (int)(Keys.Shift | Keys.Up): mcs.GlobalInvoke(MenuCommands.KeySizeHeightIncrease); + break; + case (int)(Keys.Shift | Keys.Down): mcs.GlobalInvoke(MenuCommands.KeySizeHeightDecrease); + break; + case (int)(Keys.Shift | Keys.Right): mcs.GlobalInvoke(MenuCommands.KeySizeWidthIncrease); + break; + case (int)(Keys.Shift | Keys.Left): mcs.GlobalInvoke(MenuCommands.KeySizeWidthDecrease); + break; + case (int)(Keys.Control | Keys.Shift | Keys.Up): mcs.GlobalInvoke(MenuCommands.KeyNudgeHeightIncrease); + break; + case (int)(Keys.Control | Keys.Shift | Keys.Down): mcs.GlobalInvoke(MenuCommands.KeyNudgeHeightDecrease); + break; + case (int)(Keys.Control | Keys.Shift | Keys.Right): mcs.GlobalInvoke(MenuCommands.KeyNudgeWidthIncrease); + break; + case (int)(Keys.ControlKey | Keys.Shift | Keys.Left): mcs.GlobalInvoke(MenuCommands.KeyNudgeWidthDecrease); + break; + case (int)(Keys.Escape): mcs.GlobalInvoke(MenuCommands.KeyCancel); + break; + case (int)(Keys.Shift | Keys.Escape): mcs.GlobalInvoke(MenuCommands.KeyReverseCancel); + break; + case (int)(Keys.Enter): mcs.GlobalInvoke(MenuCommands.KeyDefaultAction); + break; + } + } + // Never filter the message + return false; + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/SSYY/MainForm.cs b/VisualPascalABCNETLinux/SSYY/MainForm.cs new file mode 100644 index 000000000..848b73816 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/MainForm.cs @@ -0,0 +1,1069 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerApplication { + + using System; + using System.Drawing.Design; + using System.Drawing; + using System.Windows.Forms; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.ComponentModel.Design.Serialization; + using System.Windows.Forms.Design; + using System.Reflection; + using System.CodeDom; + using System.Collections; + using SampleDesignerHost; + using System.IO; + + /// The main UI for our design environment. + public class MainForm : System.Windows.Forms.Form { + private System.ComponentModel.IContainer components = null; + + private SampleDesignerHost host; + private SampleDesignerLoader loader; + private System.Windows.Forms.MainMenu mainMenu; + private System.Windows.Forms.MenuItem menuItemFile; + private System.Windows.Forms.MenuItem menuItemNew; + private System.Windows.Forms.MenuItem menuItemOpen; + private System.Windows.Forms.MenuItem menuItemSave; + private System.Windows.Forms.MenuItem menuItemExit; + private System.Windows.Forms.MenuItem menuItemView; + private System.Windows.Forms.MenuItem menuItemServiceRequests; + private ServiceContainer hostingServiceContainer; + private System.Windows.Forms.TabControl tabControl; + private System.Windows.Forms.TabPage tabDesign; + private System.Windows.Forms.TabPage tabXML; + private System.Windows.Forms.PropertyGrid propertyGrid; + private System.Windows.Forms.TextBox textXML; + private System.Windows.Forms.TextBox textCS; + private System.Windows.Forms.TextBox textVB; + private System.Windows.Forms.TabPage tabCS; + private System.Windows.Forms.TabPage tabVB; + private System.Windows.Forms.MenuItem menuItemEdit; + private System.Windows.Forms.MenuItem menuItemUndo; + private System.Windows.Forms.MenuItem menuItemRedo; + private System.Windows.Forms.MenuItem menuItemCut; + private System.Windows.Forms.MenuItem menuItemCopy; + private System.Windows.Forms.MenuItem menuItemPaste; + private System.Windows.Forms.MenuItem menuItemDelete; + private System.Windows.Forms.MenuItem menuItemSelectAll; + private System.Windows.Forms.MenuItem menuItemRule; + private System.Windows.Forms.MenuItem menuItemDesign; + private System.Windows.Forms.MenuItem menuItemCSource; + private System.Windows.Forms.MenuItem menuItemVBSource; + private System.Windows.Forms.MenuItem menuItemXML; + private System.Windows.Forms.MenuItem menuItemLayout; + private System.Windows.Forms.MenuItem menuItemShowGrid; + private System.Windows.Forms.MenuItem menuItemAlign; + private System.Windows.Forms.MenuItem menuItemCenter; + private System.Windows.Forms.MenuItem menuItemSizeTo; + private System.Windows.Forms.MenuItem menuItemSnapToGrid; + private System.Windows.Forms.MenuItem menuItemLefts; + private System.Windows.Forms.MenuItem menuItemToGrid; + private System.Windows.Forms.MenuItem menuItemRights; + private System.Windows.Forms.MenuItem menuItemTops; + private System.Windows.Forms.MenuItem menuItemBottoms; + private System.Windows.Forms.MenuItem menuItemMiddles; + private System.Windows.Forms.MenuItem menuItemCenters; + private System.Windows.Forms.MenuItem menuItemHoriz; + private System.Windows.Forms.MenuItem menuItemVert; + private System.Windows.Forms.MenuItem menuItemControl; + private System.Windows.Forms.MenuItem menuItemControlW; + private System.Windows.Forms.MenuItem menuItemControlH; + private System.Windows.Forms.MenuItem menuItemGrid; + private System.Windows.Forms.MenuItem menuItemZO; + private System.Windows.Forms.MenuItem menuItemBTF; + private System.Windows.Forms.MenuItem menuItemSTB; + private System.Windows.Forms.MenuItem menuItemTO; + private ServiceRequests serviceRequests; + private System.Windows.Forms.MenuItem menuItemDebug; + private System.Windows.Forms.MenuItem menuItemBuild; + private System.Windows.Forms.MenuItem menuItemRun; + private System.Windows.Forms.MenuItem menuItemStop; + private System.Windows.Forms.MenuItem menuItemProperties; + private SampleDesignerApplication.ToolBoxPane toolbox; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.Panel panelMain; + private System.Windows.Forms.MenuItem menuItemSaveAs; + private System.Windows.Forms.Splitter splitter2; + private System.Windows.Forms.OpenFileDialog openFileDialog; + private KeystrokeMessageFilter filter; + + public MainForm() { + + // Required for Windows Forms Designer support + this.InitializeComponent(); + hostingServiceContainer = new ServiceContainer(); + + // Our ISelectionService looks for this and informs the grid + // of selection changes. In an environment such as Visual Studio, this + // is all handled for you. + // + hostingServiceContainer.AddService(typeof(PropertyGrid), propertyGrid); + + // Our IToolboxService needs access to our toolbox. + hostingServiceContainer.AddService(typeof(ToolBoxPane), toolbox); + + // Our IDesignerLoader needs access to our main tab control in order + // to fill in the text in the source code windows. + // + hostingServiceContainer.AddService(typeof(TabControl), tabControl); + } + + /// This method is called whenever we create a new designer or + /// load one from existing XML. + private void CreateDesigner(SampleDesignerLoader loader) + { + // Our loader will handle loading the file (or creating a blank one). + host = new SampleDesignerHost(hostingServiceContainer); + + // The limited events tab functionality we have requires a special kind of + // property grid site. + // + propertyGrid.Site = new PropertyGridSite(host as IServiceProvider, this); + propertyGrid.PropertyTabs.AddTabType(typeof(EventsTab)); + + host.LoadDocument(loader); + this.loader = loader; + + // The toolbox needs access to the IToolboxService and the designers. + toolbox.Host = host; + + // Initialize our document window. + host.View.Dock = DockStyle.Fill; + host.View.Visible = true; + panelMain.Controls.Add(host.View); + + // These are normally unavailable if we've got no host created. + // Otherwise we gets lots of null reference exceptions. + // + tabControl.Visible = true; + menuItemSave.Enabled = true; + menuItemSaveAs.Enabled = true; + menuItemEdit.Enabled = true; + menuItemView.Enabled = true; + menuItemLayout.Enabled = true; + menuItemDebug.Enabled = true; + + // This IMessageFilter is used to intercept and decipher keyboard presses + // that might be instructions for our designer. We have to do it this way + // since we can't have our designer raise KeyPress events. + // + filter = new KeystrokeMessageFilter(host); + Application.AddMessageFilter(filter); + } + + /// This is called to destroy our designer (when we load a new one for example). + /// It returns true if our environment has been cleared, false if not (if someone + /// cancels a dispose when prompted to save changes). + private bool DestroyDesigner() + { + if (loader != null) + { + if (loader.PromptDispose()) + { + // Again, bad things happen if there's no host loaded and + // certain buttons are pressed in our TabControl or MainMenu. + // + tabControl.Visible = false; + menuItemSave.Enabled = false; + menuItemSaveAs.Enabled = false; + menuItemEdit.Enabled = false; + menuItemView.Enabled = false; + menuItemLayout.Enabled = false; + menuItemDebug.Enabled = false; + + // Get rid of our document window. + panelMain.Controls.Clear(); + + // No need to filter for designer-intended keyboard strokes now. + Application.RemoveMessageFilter(filter); + filter = null; + + // Get rid of that property grid site so it doesn't ask for + // any more services from our soon-to-be-disposed host. + // + propertyGrid.Site = null; + + host.Dispose(); + loader = null; + host = null; + return true; + } + return false; + } + return true; + } + + protected override void Dispose(bool disposing) { + if (disposing) { + if (host != null) { + host.Dispose(); + } + + } + base.Dispose(disposing); + } + + /// Check to make sure our stuff is saved before we close. + protected override void OnClosing(CancelEventArgs e) + { + if (DestroyDesigner()) + { + e.Cancel = false; + base.OnClosing (e); + } + else + { + e.Cancel = true; + base.OnClosing (e); + } + } + + private void InitializeComponent() + { + this.mainMenu = new System.Windows.Forms.MainMenu(); + this.menuItemFile = new System.Windows.Forms.MenuItem(); + this.menuItemNew = new System.Windows.Forms.MenuItem(); + this.menuItemOpen = new System.Windows.Forms.MenuItem(); + this.menuItemSave = new System.Windows.Forms.MenuItem(); + this.menuItemSaveAs = new System.Windows.Forms.MenuItem(); + this.menuItemExit = new System.Windows.Forms.MenuItem(); + this.menuItemEdit = new System.Windows.Forms.MenuItem(); + this.menuItemUndo = new System.Windows.Forms.MenuItem(); + this.menuItemRedo = new System.Windows.Forms.MenuItem(); + this.menuItemRule = new System.Windows.Forms.MenuItem(); + this.menuItemCut = new System.Windows.Forms.MenuItem(); + this.menuItemCopy = new System.Windows.Forms.MenuItem(); + this.menuItemPaste = new System.Windows.Forms.MenuItem(); + this.menuItemDelete = new System.Windows.Forms.MenuItem(); + this.menuItemSelectAll = new System.Windows.Forms.MenuItem(); + this.menuItemView = new System.Windows.Forms.MenuItem(); + this.menuItemServiceRequests = new System.Windows.Forms.MenuItem(); + this.menuItemDesign = new System.Windows.Forms.MenuItem(); + this.menuItemCSource = new System.Windows.Forms.MenuItem(); + this.menuItemVBSource = new System.Windows.Forms.MenuItem(); + this.menuItemXML = new System.Windows.Forms.MenuItem(); + this.menuItemProperties = new System.Windows.Forms.MenuItem(); + this.menuItemLayout = new System.Windows.Forms.MenuItem(); + this.menuItemShowGrid = new System.Windows.Forms.MenuItem(); + this.menuItemSnapToGrid = new System.Windows.Forms.MenuItem(); + this.menuItemAlign = new System.Windows.Forms.MenuItem(); + this.menuItemLefts = new System.Windows.Forms.MenuItem(); + this.menuItemRights = new System.Windows.Forms.MenuItem(); + this.menuItemTops = new System.Windows.Forms.MenuItem(); + this.menuItemBottoms = new System.Windows.Forms.MenuItem(); + this.menuItemMiddles = new System.Windows.Forms.MenuItem(); + this.menuItemCenters = new System.Windows.Forms.MenuItem(); + this.menuItemToGrid = new System.Windows.Forms.MenuItem(); + this.menuItemCenter = new System.Windows.Forms.MenuItem(); + this.menuItemHoriz = new System.Windows.Forms.MenuItem(); + this.menuItemVert = new System.Windows.Forms.MenuItem(); + this.menuItemSizeTo = new System.Windows.Forms.MenuItem(); + this.menuItemControl = new System.Windows.Forms.MenuItem(); + this.menuItemControlW = new System.Windows.Forms.MenuItem(); + this.menuItemControlH = new System.Windows.Forms.MenuItem(); + this.menuItemGrid = new System.Windows.Forms.MenuItem(); + this.menuItemZO = new System.Windows.Forms.MenuItem(); + this.menuItemBTF = new System.Windows.Forms.MenuItem(); + this.menuItemSTB = new System.Windows.Forms.MenuItem(); + this.menuItemTO = new System.Windows.Forms.MenuItem(); + this.menuItemDebug = new System.Windows.Forms.MenuItem(); + this.menuItemBuild = new System.Windows.Forms.MenuItem(); + this.menuItemRun = new System.Windows.Forms.MenuItem(); + this.menuItemStop = new System.Windows.Forms.MenuItem(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tabDesign = new System.Windows.Forms.TabPage(); + this.splitter2 = new System.Windows.Forms.Splitter(); + this.panelMain = new System.Windows.Forms.Panel(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.toolbox = new SampleDesignerApplication.ToolBoxPane(); + this.propertyGrid = new System.Windows.Forms.PropertyGrid(); + this.tabCS = new System.Windows.Forms.TabPage(); + this.textCS = new System.Windows.Forms.TextBox(); + this.tabVB = new System.Windows.Forms.TabPage(); + this.textVB = new System.Windows.Forms.TextBox(); + this.tabXML = new System.Windows.Forms.TabPage(); + this.textXML = new System.Windows.Forms.TextBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.tabControl.SuspendLayout(); + this.tabDesign.SuspendLayout(); + this.tabCS.SuspendLayout(); + this.tabVB.SuspendLayout(); + this.tabXML.SuspendLayout(); + this.SuspendLayout(); + // + // mainMenu + // + this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemFile, + this.menuItemEdit, + this.menuItemView, + this.menuItemLayout, + this.menuItemDebug}); + // + // menuItemFile + // + this.menuItemFile.Index = 0; + this.menuItemFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemNew, + this.menuItemOpen, + this.menuItemSave, + this.menuItemSaveAs, + this.menuItemExit}); + this.menuItemFile.Text = "&File"; + // + // menuItemNew + // + this.menuItemNew.Index = 0; + this.menuItemNew.Text = "&New"; + this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click); + // + // menuItemOpen + // + this.menuItemOpen.Index = 1; + this.menuItemOpen.Text = "&Open..."; + this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click); + // + // menuItemSave + // + this.menuItemSave.Enabled = false; + this.menuItemSave.Index = 2; + this.menuItemSave.Text = "&Save"; + this.menuItemSave.Click += new System.EventHandler(this.menuItemSave_Click); + // + // menuItemSaveAs + // + this.menuItemSaveAs.Enabled = false; + this.menuItemSaveAs.Index = 3; + this.menuItemSaveAs.Text = "Save &As..."; + this.menuItemSaveAs.Click += new System.EventHandler(this.menuItemSaveAs_Click); + // + // menuItemExit + // + this.menuItemExit.Index = 4; + this.menuItemExit.Text = "&Exit"; + this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click); + // + // menuItemEdit + // + this.menuItemEdit.Enabled = false; + this.menuItemEdit.Index = 1; + this.menuItemEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemUndo, + this.menuItemRedo, + this.menuItemRule, + this.menuItemCut, + this.menuItemCopy, + this.menuItemPaste, + this.menuItemDelete, + this.menuItemSelectAll}); + this.menuItemEdit.Text = "&Edit"; + // + // menuItemUndo + // + this.menuItemUndo.Enabled = false; + this.menuItemUndo.Index = 0; + this.menuItemUndo.Shortcut = System.Windows.Forms.Shortcut.CtrlZ; + this.menuItemUndo.Text = "Undo"; + // + // menuItemRedo + // + this.menuItemRedo.Enabled = false; + this.menuItemRedo.Index = 1; + this.menuItemRedo.Shortcut = System.Windows.Forms.Shortcut.CtrlY; + this.menuItemRedo.Text = "Redo"; + // + // menuItemRule + // + this.menuItemRule.Index = 2; + this.menuItemRule.Text = "-"; + // + // menuItemCut + // + this.menuItemCut.Enabled = false; + this.menuItemCut.Index = 3; + this.menuItemCut.Shortcut = System.Windows.Forms.Shortcut.CtrlX; + this.menuItemCut.Text = "Cu&t"; + this.menuItemCut.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemCopy + // + this.menuItemCopy.Enabled = false; + this.menuItemCopy.Index = 4; + this.menuItemCopy.Shortcut = System.Windows.Forms.Shortcut.CtrlC; + this.menuItemCopy.Text = "&Copy"; + this.menuItemCopy.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemPaste + // + this.menuItemPaste.Enabled = false; + this.menuItemPaste.Index = 5; + this.menuItemPaste.Shortcut = System.Windows.Forms.Shortcut.CtrlV; + this.menuItemPaste.Text = "&Paste"; + this.menuItemPaste.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemDelete + // + this.menuItemDelete.Index = 6; + this.menuItemDelete.Shortcut = System.Windows.Forms.Shortcut.Del; + this.menuItemDelete.Text = "&Delete"; + this.menuItemDelete.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemSelectAll + // + this.menuItemSelectAll.Index = 7; + this.menuItemSelectAll.Shortcut = System.Windows.Forms.Shortcut.CtrlA; + this.menuItemSelectAll.Text = "Select &All"; + this.menuItemSelectAll.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemView + // + this.menuItemView.Enabled = false; + this.menuItemView.Index = 2; + this.menuItemView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemServiceRequests, + this.menuItemDesign, + this.menuItemCSource, + this.menuItemVBSource, + this.menuItemXML, + this.menuItemProperties}); + this.menuItemView.Text = "&View"; + // + // menuItemServiceRequests + // + this.menuItemServiceRequests.Index = 0; + this.menuItemServiceRequests.Text = "&Service Requests"; + this.menuItemServiceRequests.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemDesign + // + this.menuItemDesign.Index = 1; + this.menuItemDesign.Text = "&Design"; + this.menuItemDesign.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemCSource + // + this.menuItemCSource.Index = 2; + this.menuItemCSource.Text = "&C# Source"; + this.menuItemCSource.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemVBSource + // + this.menuItemVBSource.Index = 3; + this.menuItemVBSource.Text = "&VB Source"; + this.menuItemVBSource.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemXML + // + this.menuItemXML.Index = 4; + this.menuItemXML.Text = "&XML"; + this.menuItemXML.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemProperties + // + this.menuItemProperties.Index = 5; + this.menuItemProperties.Text = "&Properties"; + this.menuItemProperties.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemLayout + // + this.menuItemLayout.Enabled = false; + this.menuItemLayout.Index = 3; + this.menuItemLayout.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemShowGrid, + this.menuItemSnapToGrid, + this.menuItemAlign, + this.menuItemCenter, + this.menuItemSizeTo, + this.menuItemZO, + this.menuItemTO}); + this.menuItemLayout.Text = "&Layout"; + // + // menuItemShowGrid + // + this.menuItemShowGrid.Checked = true; + this.menuItemShowGrid.Index = 0; + this.menuItemShowGrid.Text = "Show &Grid"; + this.menuItemShowGrid.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemSnapToGrid + // + this.menuItemSnapToGrid.Checked = true; + this.menuItemSnapToGrid.Index = 1; + this.menuItemSnapToGrid.Text = "S&nap to Grid"; + this.menuItemSnapToGrid.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemAlign + // + this.menuItemAlign.Index = 2; + this.menuItemAlign.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemLefts, + this.menuItemRights, + this.menuItemTops, + this.menuItemBottoms, + this.menuItemMiddles, + this.menuItemCenters, + this.menuItemToGrid}); + this.menuItemAlign.Text = "&Align..."; + // + // menuItemLefts + // + this.menuItemLefts.Index = 0; + this.menuItemLefts.Text = "&Lefts"; + this.menuItemLefts.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemRights + // + this.menuItemRights.Index = 1; + this.menuItemRights.Text = "&Rights"; + this.menuItemRights.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemTops + // + this.menuItemTops.Index = 2; + this.menuItemTops.Text = "&Tops"; + this.menuItemTops.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemBottoms + // + this.menuItemBottoms.Index = 3; + this.menuItemBottoms.Text = "&Bottoms"; + this.menuItemBottoms.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemMiddles + // + this.menuItemMiddles.Index = 4; + this.menuItemMiddles.Text = "&Middles"; + this.menuItemMiddles.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemCenters + // + this.menuItemCenters.Index = 5; + this.menuItemCenters.Text = "&Centers"; + this.menuItemCenters.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemToGrid + // + this.menuItemToGrid.Index = 6; + this.menuItemToGrid.Text = "to &Grid"; + this.menuItemToGrid.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemCenter + // + this.menuItemCenter.Index = 3; + this.menuItemCenter.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemHoriz, + this.menuItemVert}); + this.menuItemCenter.Text = "&Center..."; + // + // menuItemHoriz + // + this.menuItemHoriz.Index = 0; + this.menuItemHoriz.Text = "&Horizontally"; + this.menuItemHoriz.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemVert + // + this.menuItemVert.Index = 1; + this.menuItemVert.Text = "&Vertically"; + this.menuItemVert.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemSizeTo + // + this.menuItemSizeTo.Index = 4; + this.menuItemSizeTo.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemControl, + this.menuItemControlW, + this.menuItemControlH, + this.menuItemGrid}); + this.menuItemSizeTo.Text = "&Size to..."; + // + // menuItemControl + // + this.menuItemControl.Index = 0; + this.menuItemControl.Text = "&Control"; + this.menuItemControl.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemControlW + // + this.menuItemControlW.Index = 1; + this.menuItemControlW.Text = "Control &Width"; + this.menuItemControlW.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemControlH + // + this.menuItemControlH.Index = 2; + this.menuItemControlH.Text = "Control &Height"; + this.menuItemControlH.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemGrid + // + this.menuItemGrid.Index = 3; + this.menuItemGrid.Text = "&Grid"; + this.menuItemGrid.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemZO + // + this.menuItemZO.Index = 5; + this.menuItemZO.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemBTF, + this.menuItemSTB}); + this.menuItemZO.Text = "&Z Order"; + // + // menuItemBTF + // + this.menuItemBTF.Index = 0; + this.menuItemBTF.Text = "&Bring to Front"; + this.menuItemBTF.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemSTB + // + this.menuItemSTB.Index = 1; + this.menuItemSTB.Text = "&Send to Back"; + this.menuItemSTB.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemTO + // + this.menuItemTO.Index = 6; + this.menuItemTO.Text = "&Tab Order"; + this.menuItemTO.Click += new System.EventHandler(this.menuItem_Click); + // + // menuItemDebug + // + this.menuItemDebug.Enabled = false; + this.menuItemDebug.Index = 4; + this.menuItemDebug.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItemBuild, + this.menuItemRun, + this.menuItemStop}); + this.menuItemDebug.Text = "&Debug"; + // + // menuItemBuild + // + this.menuItemBuild.Index = 0; + this.menuItemBuild.Text = "&Build..."; + this.menuItemBuild.Click += new System.EventHandler(this.menuItemBuild_Click); + // + // menuItemRun + // + this.menuItemRun.Index = 1; + this.menuItemRun.Shortcut = System.Windows.Forms.Shortcut.F5; + this.menuItemRun.Text = "&Run"; + this.menuItemRun.Click += new System.EventHandler(this.menuItemRun_Click); + // + // menuItemStop + // + this.menuItemStop.Index = 2; + this.menuItemStop.Text = "&Stop"; + this.menuItemStop.Click += new System.EventHandler(this.menuItemStop_Click); + // + // tabControl + // + this.tabControl.Controls.AddRange(new System.Windows.Forms.Control[] { + this.tabDesign, + this.tabCS, + this.tabVB, + this.tabXML}); + this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; + this.tabControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.tabControl.ItemSize = new System.Drawing.Size(120, 25); + this.tabControl.Location = new System.Drawing.Point(0, 0); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(760, 537); + this.tabControl.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tabControl.TabIndex = 0; + this.tabControl.Visible = false; + this.tabControl.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl_DrawItem); + this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); + // + // tabDesign + // + this.tabDesign.Controls.AddRange(new System.Windows.Forms.Control[] { + this.splitter2, + this.panelMain, + this.splitter1, + this.toolbox, + this.propertyGrid}); + this.tabDesign.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.tabDesign.Location = new System.Drawing.Point(4, 29); + this.tabDesign.Name = "tabDesign"; + this.tabDesign.Size = new System.Drawing.Size(752, 504); + this.tabDesign.TabIndex = 0; + this.tabDesign.Text = "Design"; + // + // splitter2 + // + this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; + this.splitter2.Location = new System.Drawing.Point(520, 0); + this.splitter2.Name = "splitter2"; + this.splitter2.Size = new System.Drawing.Size(3, 504); + this.splitter2.TabIndex = 12; + this.splitter2.TabStop = false; + // + // panelMain + // + this.panelMain.BackColor = System.Drawing.SystemColors.Window; + this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelMain.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.panelMain.Location = new System.Drawing.Point(291, 0); + this.panelMain.Name = "panelMain"; + this.panelMain.Size = new System.Drawing.Size(232, 504); + this.panelMain.TabIndex = 11; + // + // splitter1 + // + this.splitter1.Location = new System.Drawing.Point(288, 0); + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(3, 504); + this.splitter1.TabIndex = 10; + this.splitter1.TabStop = false; + // + // toolbox + // + this.toolbox.BackColor = System.Drawing.Color.Black; + this.toolbox.Dock = System.Windows.Forms.DockStyle.Left; + this.toolbox.Host = null; + this.toolbox.Location = new System.Drawing.Point(0, 0); + this.toolbox.Name = "toolbox"; + this.toolbox.Size = new System.Drawing.Size(288, 504); + this.toolbox.TabIndex = 9; + // + // propertyGrid + // + this.propertyGrid.BackColor = System.Drawing.SystemColors.Control; + this.propertyGrid.CausesValidation = false; + this.propertyGrid.CommandsVisibleIfAvailable = true; + this.propertyGrid.Dock = System.Windows.Forms.DockStyle.Right; + this.propertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.propertyGrid.LargeButtons = false; + this.propertyGrid.LineColor = System.Drawing.Color.LightSlateGray; + this.propertyGrid.Location = new System.Drawing.Point(523, 0); + this.propertyGrid.Name = "propertyGrid"; + this.propertyGrid.Size = new System.Drawing.Size(229, 504); + this.propertyGrid.TabIndex = 7; + this.propertyGrid.Text = "propertyGrid"; + this.propertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; + this.propertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; + // + // tabCS + // + this.tabCS.Controls.AddRange(new System.Windows.Forms.Control[] { + this.textCS}); + this.tabCS.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.tabCS.Location = new System.Drawing.Point(4, 29); + this.tabCS.Name = "tabCS"; + this.tabCS.Size = new System.Drawing.Size(752, 504); + this.tabCS.TabIndex = 2; + this.tabCS.Text = "C# Source"; + // + // textCS + // + this.textCS.BackColor = System.Drawing.Color.DarkSlateGray; + this.textCS.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textCS.Dock = System.Windows.Forms.DockStyle.Fill; + this.textCS.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.textCS.ForeColor = System.Drawing.Color.Gold; + this.textCS.Location = new System.Drawing.Point(0, 0); + this.textCS.Multiline = true; + this.textCS.Name = "textCS"; + this.textCS.ReadOnly = true; + this.textCS.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textCS.Size = new System.Drawing.Size(752, 504); + this.textCS.TabIndex = 1; + this.textCS.Text = ""; + this.textCS.WordWrap = false; + // + // tabVB + // + this.tabVB.Controls.AddRange(new System.Windows.Forms.Control[] { + this.textVB}); + this.tabVB.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.tabVB.Location = new System.Drawing.Point(4, 29); + this.tabVB.Name = "tabVB"; + this.tabVB.Size = new System.Drawing.Size(752, 504); + this.tabVB.TabIndex = 1; + this.tabVB.Text = "PABC.NET"; + // + // textVB + // + this.textVB.BackColor = System.Drawing.Color.DarkSlateGray; + this.textVB.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textVB.Dock = System.Windows.Forms.DockStyle.Fill; + this.textVB.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.textVB.ForeColor = System.Drawing.Color.Tomato; + this.textVB.Location = new System.Drawing.Point(0, 0); + this.textVB.Multiline = true; + this.textVB.Name = "textVB"; + this.textVB.ReadOnly = true; + this.textVB.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textVB.Size = new System.Drawing.Size(752, 504); + this.textVB.TabIndex = 0; + this.textVB.Text = ""; + this.textVB.WordWrap = false; + // + // tabXML + // + this.tabXML.Controls.AddRange(new System.Windows.Forms.Control[] { + this.textXML}); + this.tabXML.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.tabXML.Location = new System.Drawing.Point(4, 29); + this.tabXML.Name = "tabXML"; + this.tabXML.Size = new System.Drawing.Size(752, 504); + this.tabXML.TabIndex = 3; + this.tabXML.Text = "XML"; + // + // textXML + // + this.textXML.BackColor = System.Drawing.Color.DarkSlateGray; + this.textXML.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textXML.Dock = System.Windows.Forms.DockStyle.Fill; + this.textXML.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.textXML.ForeColor = System.Drawing.Color.LimeGreen; + this.textXML.Location = new System.Drawing.Point(0, 0); + this.textXML.Multiline = true; + this.textXML.Name = "textXML"; + this.textXML.ReadOnly = true; + this.textXML.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textXML.Size = new System.Drawing.Size(752, 504); + this.textXML.TabIndex = 1; + this.textXML.Text = ""; + this.textXML.WordWrap = false; + // + // openFileDialog + // + this.openFileDialog.Filter = "XML Files|*.xml"; + // + // MainForm + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(760, 537); + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.tabControl}); + this.Menu = this.mainMenu; + this.Name = "MainForm"; + this.Text = "Simple Designer Host Sample"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.tabControl.ResumeLayout(false); + this.tabDesign.ResumeLayout(false); + this.tabCS.ResumeLayout(false); + this.tabVB.ResumeLayout(false); + this.tabXML.ResumeLayout(false); + this.ResumeLayout(false); + + } + + //[System.STAThreadAttribute()] + //public static void Main() + //{ + // System.Windows.Forms.Application.Run(new MainForm()); + //} + + private void menuItemNew_Click(object sender, System.EventArgs e) + { + if (DestroyDesigner()) // make sure we're clear for a new designer + { + // A loader created with no parameters creates a blank document. + SampleDesignerLoader designerLoader = new SampleDesignerLoader(); + CreateDesigner(designerLoader); + } + } + + private void menuItemOpen_Click(object sender, System.EventArgs e) + { + if (DestroyDesigner()) // make sure we're clear for a new designer + { + if (openFileDialog.ShowDialog(this) == DialogResult.OK) + { + // Load up this file (XML is all we support for now). + SampleDesignerLoader designerLoader = new SampleDesignerLoader(openFileDialog.FileName); + CreateDesigner(designerLoader); + } + } + } + + /// The user gets to choose between saving in XML, C#, or VB. + /// Just remember that you can only load XML. + private void menuItemSave_Click(object sender, System.EventArgs e) + { + loader.Save(false); // false == don't force file dialog if file already chosen + } + + /// The user gets to choose between saving in XML, C#, or VB. + /// Just remember that you can only load XML. + private void menuItemSaveAs_Click(object sender, System.EventArgs e) + { + loader.Save(true); // true == force file dialog even if file already chosen + } + + /// Try to close our form. Our OnClosing method will check to make sure our stuff + /// is saved before closing. + private void menuItemExit_Click(object sender, System.EventArgs e) + { + if (DestroyDesigner()) + { + this.Close(); + } + } + + /// The loader also handles building. It keeps a codeCompileUnit that represents + /// the state of the document at any time. The user will be prompted for an executable + /// filename the first time there's a build. + private void menuItemBuild_Click(object sender, System.EventArgs e) + { + loader.Build(); + } + + /// This builds to the executable the user has selected and then runs it. + private void menuItemRun_Click(object sender, System.EventArgs e) + { + loader.Run(); + } + + /// Another way to kill any running executable. + private void menuItemStop_Click(object sender, System.EventArgs e) + { + loader.Stop(); + } + + private void tabControl_SelectedIndexChanged(object sender, System.EventArgs e) + { + // If the tab is changing, that means we'd better let the loader know it needs + // to flush changes that have been made and update the code windows. + // + loader.Flush(); + } + + /// The rest of the MenuItem click events are handled here. Most of these MenuItems + /// require a loaded host to have any applicable use--thus they are disabled + /// if there isn't one. + private void menuItem_Click(object sender, System.EventArgs e) + { + // The IMenuCommandService makes doing common commands easy. + // It keeps track of what commands and verbs the designer supports + // and can invoke them given members of the MenuCommands enum (CommandID's). + IServiceContainer sc = host as IServiceContainer; + IMenuCommandService mcs = sc.GetService(typeof(IMenuCommandService)) as IMenuCommandService; + + switch ((sender as MenuItem).Text) + { + case "Cu&t": mcs.GlobalInvoke(StandardCommands.Cut); + break; + case "&Copy": mcs.GlobalInvoke(StandardCommands.Copy); + break; + case "&Paste": mcs.GlobalInvoke(StandardCommands.Paste); + break; + case "&Delete": mcs.GlobalInvoke(StandardCommands.Delete); + break; + case "Select &All": mcs.GlobalInvoke(StandardCommands.SelectAll); + break; + case "&Service Requests": + if (serviceRequests == null) + { + serviceRequests = new ServiceRequests(); + serviceRequests.Closed += new EventHandler(OnServiceRequestsClosed); + + // Our designer host looks for this service to announce the success / failure + // of service requests. + hostingServiceContainer.AddService(typeof(ServiceRequests), serviceRequests); + serviceRequests.Show(); + } + serviceRequests.Activate(); + break; + case "&Design": tabControl.SelectedTab = tabDesign; + break; + case "&C# Source": tabControl.SelectedTab = tabCS; + break; + case "&VB Source": tabControl.SelectedTab = tabVB; + break; + case "&XML": tabControl.SelectedTab = tabXML; + break; + case "&Properties": mcs.GlobalInvoke(MenuCommands.Properties); + break; + case "Show &Grid": + mcs.GlobalInvoke(StandardCommands.ShowGrid); + menuItemShowGrid.Checked = !menuItemShowGrid.Checked; + break; + case "S&nap to Grid": + mcs.GlobalInvoke(StandardCommands.SnapToGrid); + menuItemSnapToGrid.Checked = !menuItemSnapToGrid.Checked; + break; + case "&Lefts": mcs.GlobalInvoke(StandardCommands.AlignLeft); + break; + case "&Rights": mcs.GlobalInvoke(StandardCommands.AlignRight); + break; + case "&Tops": mcs.GlobalInvoke(StandardCommands.AlignTop); + break; + case "&Bottoms": mcs.GlobalInvoke(StandardCommands.AlignBottom); + break; + case "&Middles": mcs.GlobalInvoke(StandardCommands.AlignHorizontalCenters); + break; + case "&Centers": mcs.GlobalInvoke(StandardCommands.AlignVerticalCenters); + break; + case "to &Grid": mcs.GlobalInvoke(StandardCommands.AlignToGrid); + break; + case "&Horizontally": mcs.GlobalInvoke(StandardCommands.CenterHorizontally); + break; + case "&Vertically": mcs.GlobalInvoke(StandardCommands.CenterVertically); + break; + case "&Control": mcs.GlobalInvoke(StandardCommands.SizeToControl); + break; + case "Control &Width": mcs.GlobalInvoke(StandardCommands.SizeToControlWidth); + break; + case "Control &Height": mcs.GlobalInvoke(StandardCommands.SizeToControlHeight); + break; + case "&Grid": mcs.GlobalInvoke(StandardCommands.SizeToGrid); + break; + case "&Bring to Front": mcs.GlobalInvoke(StandardCommands.BringToFront); + break; + case "&Send to Back": mcs.GlobalInvoke(StandardCommands.SendToBack); + break; + case "&Tab Order": mcs.GlobalInvoke(StandardCommands.TabOrder); + break; + } + } + + /// Put away our serviceRequests service if no one's looking. + private void OnServiceRequestsClosed(object sender, EventArgs e) + { + serviceRequests = null; + hostingServiceContainer.RemoveService(typeof(ServiceRequests)); + } + + /// OwnerDraw for that rainbow look. + private void tabControl_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + TabControl tcSender = sender as TabControl; + string text = tcSender.TabPages[e.Index].Text; + Size textSize = e.Graphics.MeasureString(text, tcSender.Font).ToSize(); + + switch (e.Index) + { + case 0: e.Graphics.FillRectangle(Brushes.SteelBlue, e.Bounds); + break; + case 1: e.Graphics.FillRectangle(Brushes.Gold, e.Bounds); + break; + case 2: e.Graphics.FillRectangle(Brushes.Tomato, e.Bounds); + break; + case 3: e.Graphics.FillRectangle(Brushes.LimeGreen, e.Bounds); + break; + } + + Point textLocation = new Point( + e.Bounds.X + (e.Bounds.Width - textSize.Width) / 2, + e.Bounds.Y + (e.Bounds.Height - textSize.Height) / 2); + e.Graphics.DrawString(text, tcSender.Font, Brushes.White, textLocation); + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/MainForm.resx b/VisualPascalABCNETLinux/SSYY/MainForm.resx new file mode 100644 index 000000000..7e323966c --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/MainForm.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/VisualPascalABCNETLinux/SSYY/PABCCodeProvider.cs b/VisualPascalABCNETLinux/SSYY/PABCCodeProvider.cs new file mode 100644 index 000000000..158d05490 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/PABCCodeProvider.cs @@ -0,0 +1,575 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.CodeDom.Compiler; +using System.CodeDom; + +namespace SampleDesignerHost +{ + public static class string_consts + { + public static readonly string nr = "\r\n"; + public static readonly string tab = " "; + public static readonly string tab2 = tab + tab; + public static string event_handler_header_trim = tab2; + public static readonly string begin_designer_region = "{$region FormDesigner}"; + public static readonly string end_designer_region = "{$endregion FormDesigner}"; + public static readonly int min_spec_char = 0; + public static readonly int max_spec_char = 30; + + public static readonly string begin_unit = + "Unit {0};" + nr + + "{{$reference 'System.Windows.Forms.dll'}}" + nr + + "{{$reference 'System.Drawing.dll'}}" + nr + + nr + "interface" + nr + nr + + "uses System, System.Drawing, System.Windows.Forms;"+ + nr + nr + + "type" +nr + + tab + "{1} = class(System.Windows.Forms.Form)" + nr + + tab + '{' + begin_designer_region + '}' + nr + + tab + "private" + nr + tab2; + + public static readonly string end_unit = + tab + end_designer_region + nr + + tab + "public" + nr + + tab2 + "constructor;" + nr + + tab2 + "begin" + nr + + tab2 + tab + "InitializeComponent;" + nr + + tab2 + "end;" + nr + + tab + "end;" + nr + nr + + "implementation" + nr + nr + "end." + nr; + + public static readonly string void_type = "System.Void"; + + public static readonly string main_designer_program = + "uses {0};" + nr + nr + + "begin" + nr + + tab + "System.Windows.Forms.Application.Run(new {1})" + nr + + "end."; + + public static readonly string xml_form_extention = "fmabc"; + } + + class PABCCodeGenerator : CodeCompiler + { + protected override string CmdArgsFromParameters(CompilerParameters options) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override string CompilerName + { + get { throw new Exception("The method or operation is not implemented."); } + } + + protected override string FileExtension + { + get { throw new Exception("The method or operation is not implemented."); } + } + + protected override void ProcessCompilerOutputLine(CompilerResults results, string line) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override string CreateEscapedIdentifier(string value) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override string CreateValidIdentifier(string value) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateArgumentReferenceExpression(System.CodeDom.CodeArgumentReferenceExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateArrayCreateExpression(System.CodeDom.CodeArrayCreateExpression e) + { + //throw new Exception("The method or operation is not implemented."); + Output.Write("new "); + OutputType(e.CreateType); + Output.Write("["); + Output.Write(e.Initializers.Count); + Output.Write("]"); + if (e.Initializers.Count > 0) + { + Output.Write("("); + GenerateExpression(e.Initializers[0]); + for (int i = 1; i < e.Initializers.Count; i++) + { + Output.Write(", "); + GenerateExpression(e.Initializers[i]); + } + Output.Write(")"); + } + } + + protected override void GenerateArrayIndexerExpression(System.CodeDom.CodeArrayIndexerExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateAssignStatement(System.CodeDom.CodeAssignStatement e) + { + GenerateExpression(e.Left); + Output.Write(" := "); + GenerateExpression(e.Right); + Output.WriteLine(";"); + } + + protected override void GenerateAttachEventStatement(System.CodeDom.CodeAttachEventStatement e) + { + GenerateExpression(e.Event); + Output.Write(" += "); + GenerateExpression(e.Listener); + Output.WriteLine(";"); + } + + protected override void GenerateAttributeDeclarationsEnd(System.CodeDom.CodeAttributeDeclarationCollection attributes) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateAttributeDeclarationsStart(System.CodeDom.CodeAttributeDeclarationCollection attributes) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateBaseReferenceExpression(System.CodeDom.CodeBaseReferenceExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateCastExpression(System.CodeDom.CodeCastExpression e) + { + Output.Write("("); + OutputType(e.TargetType); + Output.Write("("); + GenerateExpression(e.Expression); + Output.Write("))"); + //throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateComment(System.CodeDom.CodeComment e) + { + Output.WriteLine("// " + e.Text); + } + + protected override void GenerateConditionStatement(System.CodeDom.CodeConditionStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateConstructor(System.CodeDom.CodeConstructor e, System.CodeDom.CodeTypeDeclaration c) + { + //Output.Write("constructor"); + //OutputMethodSignature(e.Attributes, e.ReturnType, "", e.Parameters, false, false); + //GenerateBlock(e.Statements); + //Output.WriteLine(";"); + } + + protected void GenerateBlock(CodeStatementCollection statements) + { + OutputStartingBrace(); + GenerateStatements(statements); + OutputEndingBrace(); + } + + void OutputMethodSignature(MemberAttributes attributes, CodeTypeReference returnType, string name, + CodeParameterDeclarationExpressionCollection parameters, bool isSpecialName, bool isDelegateMethod) + { + OutputIdentifier(name); + + // generate parameters + if (parameters != null) + OutputParametersDeclarations(parameters); + + // return type + //OutputType(returnType); + Output.WriteLine(";"); + } + + protected virtual void OutputStartingBrace() + { + Output.WriteLine("begin"); + Indent++; + } + + protected virtual void OutputEndingBrace() + { + Indent--; + Output.Write("end"); + } + + protected override void GenerateDelegateCreateExpression(System.CodeDom.CodeDelegateCreateExpression e) + { + Output.Write(e.MethodName); + } + + protected override void GenerateDelegateInvokeExpression(System.CodeDom.CodeDelegateInvokeExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateEntryPointMethod(System.CodeDom.CodeEntryPointMethod e, System.CodeDom.CodeTypeDeclaration c) + { + //ничего не делаем + } + + protected override void GenerateEvent(System.CodeDom.CodeMemberEvent e, System.CodeDom.CodeTypeDeclaration c) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateEventReferenceExpression(System.CodeDom.CodeEventReferenceExpression e) + { + GenerateExpression(e.TargetObject); + Output.Write("."); + Output.Write(e.EventName); + } + + protected override void GenerateExpressionStatement(System.CodeDom.CodeExpressionStatement e) + { + GenerateExpression(e.Expression); + Output.WriteLine(";"); + } + + protected override void GenerateField(System.CodeDom.CodeMemberField e) + { + Output.Write(e.Name); + Output.Write(": "); + OutputType(e.Type); + Output.WriteLine(";"); + } + + protected override void GenerateFieldReferenceExpression(System.CodeDom.CodeFieldReferenceExpression e) + { + GenerateExpression(e.TargetObject); + Output.Write("."); + Output.Write(e.FieldName); + } + + protected override void GenerateGotoStatement(System.CodeDom.CodeGotoStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateIndexerExpression(System.CodeDom.CodeIndexerExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateIterationStatement(System.CodeDom.CodeIterationStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateLabeledStatement(System.CodeDom.CodeLabeledStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateLinePragmaEnd(System.CodeDom.CodeLinePragma e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateLinePragmaStart(System.CodeDom.CodeLinePragma e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateMethod(System.CodeDom.CodeMemberMethod e, System.CodeDom.CodeTypeDeclaration c) + { + if (e.ReturnType.BaseType == string_consts.void_type) + { + Output.Write("procedure "); + } + else + { + Output.Write("function "); + } + OutputMethodSignature(e.Attributes, e.ReturnType, e.Name, e.Parameters, false, false); + GenerateBlock(e.Statements); + Output.WriteLine(";"); + } + + protected override void GenerateMethodInvokeExpression(System.CodeDom.CodeMethodInvokeExpression methodInvoke) + { + CodeMethodReferenceExpression methodRef = methodInvoke.Method; + if (methodRef.TargetObject != null) + { + GenerateExpression(methodRef.TargetObject); + Output.Write("."); + } + Output.Write(methodRef.MethodName); + OutputParameters(methodInvoke.Parameters); + //Output.Write(";"); + } + + protected override void GenerateMethodReferenceExpression(System.CodeDom.CodeMethodReferenceExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateMethodReturnStatement(System.CodeDom.CodeMethodReturnStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateNamespaceEnd(System.CodeDom.CodeNamespace e) + { + //throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateNamespaceImport(System.CodeDom.CodeNamespaceImport e) + { + Output.Write(e.Namespace); + } + + protected override void GenerateNamespace(CodeNamespace e) + { + GenerateNamespaceStart(e); + + //GenerateNamespaceImports(e); + + GenerateTypes(e); + GenerateNamespaceEnd(e); + } + + public void GenerateNamespaceImports(CodeNamespace e) + { + Indent++; + CodeNamespaceImportCollection imports = e.Imports; + int imports_count = imports.Count; + if (imports_count > 0) + { + //Output.Write(string_consts.tab); + Output.WriteLine(); + GenerateNamespaceImport(imports[0]); + for (int i = 1; i < imports_count; ++i) + { + Output.WriteLine(","); + //Output.Write(string_consts.tab); + GenerateNamespaceImport(imports[i]); + } + Output.WriteLine(";"); + } + Indent--; + } + + protected override void GenerateNamespaceStart(System.CodeDom.CodeNamespace e) + { + //if (e.Name != null && e.Name.Length > 0) + //{ + // Output.WriteLine("Unit " + e.Name + ";"); + //} + } + + protected override void GenerateObjectCreateExpression(System.CodeDom.CodeObjectCreateExpression e) + { + Output.Write("new "); + OutputType(e.CreateType); + OutputParameters(e.Parameters); + } + + protected override void GenerateProperty(System.CodeDom.CodeMemberProperty e, System.CodeDom.CodeTypeDeclaration c) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GeneratePropertyReferenceExpression(System.CodeDom.CodePropertyReferenceExpression e) + { + GenerateExpression(e.TargetObject); + Output.Write("."); + Output.Write(e.PropertyName); + } + + protected override void GeneratePropertySetValueReferenceExpression(System.CodeDom.CodePropertySetValueReferenceExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateRemoveEventStatement(System.CodeDom.CodeRemoveEventStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateSnippetExpression(System.CodeDom.CodeSnippetExpression e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateSnippetMember(System.CodeDom.CodeSnippetTypeMember e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateThisReferenceExpression(System.CodeDom.CodeThisReferenceExpression e) + { + Output.Write("self"); + } + + protected override void GenerateThrowExceptionStatement(System.CodeDom.CodeThrowExceptionStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateTryCatchFinallyStatement(System.CodeDom.CodeTryCatchFinallyStatement e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateTypeConstructor(System.CodeDom.CodeTypeConstructor e) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateTypeEnd(System.CodeDom.CodeTypeDeclaration e) + { + //Output.WriteLine("end;"); + Indent--; + } + + protected override void GenerateTypeStart(System.CodeDom.CodeTypeDeclaration e) + { + //Output.WriteLine("type " + e.Name + " = class" + "(" + e.BaseTypes[0].BaseType + ")"); + Indent++; + } + + protected override void GenerateVariableDeclarationStatement(System.CodeDom.CodeVariableDeclarationStatement e) + { + Output.Write("var " + e.Name + ": "); + OutputType(e.Type); + if (e.InitExpression != null) + { + Output.Write(" := "); + GenerateExpression(e.InitExpression); + } + Output.WriteLine(";"); + //throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateVariableReferenceExpression(System.CodeDom.CodeVariableReferenceExpression e) + { + Output.Write(e.VariableName); + } + + protected override string GetTypeOutput(System.CodeDom.CodeTypeReference value) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override bool IsValidIdentifier(string value) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override string NullToken + { + //get { throw new Exception("The method or operation is not implemented."); } + get { return "nil"; } + } + + protected override void OutputType(System.CodeDom.CodeTypeReference typeRef) + { + Output.Write(typeRef.BaseType); + } + + protected override string QuoteSnippetString(string value) + { + if (value.Length == 0) + { + return "''"; + } + StringBuilder b = new StringBuilder(value.Length + 5); + bool inside = false; + //b.Append('\''); + for (int i = 0; i < value.Length; ++i) + { + int code = (int)value[i]; + if (code >= string_consts.min_spec_char && code <= string_consts.max_spec_char) + { + if (inside) + { + b.Append('\''); + inside = false; + } + b.Append('#'); + b.Append(code); + } + else + { + if (!inside) + { + b.Append('\''); + inside = true; + } + if (value[i] == '\'') + { + b.Append("''"); + } + else + { + b.Append(value[i]); + } + } + } + if (inside) + { + b.Append('\''); + inside = false; + } + //b.Append('\''); + //Output.Write(value); + return b.ToString(); + } + + protected override bool Supports(GeneratorSupport support) + { + throw new Exception("The method or operation is not implemented."); + } + + protected override void GenerateParameterDeclarationExpression(CodeParameterDeclarationExpression e) + { + Output.Write(e.Name); + Output.Write(": "); + OutputType(e.Type); + } + + protected virtual void OutputParametersDeclarations(CodeParameterDeclarationExpressionCollection parameters) + { + int count = parameters.Count; + if (count == 0) return; + Output.Write("("); + GenerateParameterDeclarationExpression(parameters[0]); + for (int i = 1; i < count; ++i) + { + Output.Write("; "); + GenerateParameterDeclarationExpression(parameters[i]); + } + Output.Write(")"); + } + + protected virtual void OutputParameters(CodeExpressionCollection parameters) + { + int count = parameters.Count; + Output.Write("("); + if (count > 0) + { + GenerateExpression(parameters[0]); + for (int i = 1; i < count; ++i) + { + Output.Write(", "); + GenerateExpression(parameters[i]); + } + } + Output.Write(")"); + } + + } +} diff --git a/VisualPascalABCNETLinux/SSYY/PropertiesForm.Designer.cs b/VisualPascalABCNETLinux/SSYY/PropertiesForm.Designer.cs new file mode 100644 index 000000000..99b68680f --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/PropertiesForm.Designer.cs @@ -0,0 +1,108 @@ +namespace VisualPascalABC +{ + partial class PropertiesForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.componentsComboPanel = new System.Windows.Forms.Panel(); + this.componentsCombo = new NETXP.Controls.ComboBoxEx(); + this.panel2 = new System.Windows.Forms.Panel(); + this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); + this.componentsComboPanel.SuspendLayout(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // componentsComboPanel + // + this.componentsComboPanel.Controls.Add(this.componentsCombo); + this.componentsComboPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.componentsComboPanel.Location = new System.Drawing.Point(0, 0); + this.componentsComboPanel.Name = "componentsComboPanel"; + this.componentsComboPanel.Size = new System.Drawing.Size(292, 26); + this.componentsComboPanel.TabIndex = 1; + // + // componentsCombo + // + this.componentsCombo.Dock = System.Windows.Forms.DockStyle.Fill; + this.componentsCombo.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.componentsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.componentsCombo.EnableMRU = false; + this.componentsCombo.Flags = NETXP.Controls.AutoCompleteFlags.None; + this.componentsCombo.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.componentsCombo.ItemHeight = 20; + this.componentsCombo.Location = new System.Drawing.Point(0, 0); + this.componentsCombo.MRUHive = NETXP.Controls.MRUKeyHive.CurrentUser; + this.componentsCombo.MRUKey = "Software\\Microsoft\\Internet Explorer\\TypedURLs"; + this.componentsCombo.Name = "componentsCombo"; + this.componentsCombo.Size = new System.Drawing.Size(292, 26); + this.componentsCombo.TabIndex = 0; + this.componentsCombo.Visible = false; + this.componentsCombo.SelectedIndexChanged += new System.EventHandler(this.componentsCombo_SelectedIndexChanged); + // + // panel2 + // + this.panel2.Controls.Add(this.propertyGrid1); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 26); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(292, 236); + this.panel2.TabIndex = 2; + // + // propertyGrid1 + // + this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill; + this.propertyGrid1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.propertyGrid1.Location = new System.Drawing.Point(0, 0); + this.propertyGrid1.Name = "propertyGrid1"; + this.propertyGrid1.Size = new System.Drawing.Size(292, 236); + this.propertyGrid1.TabIndex = 0; + // + // PropertiesForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 262); + this.Controls.Add(this.panel2); + this.Controls.Add(this.componentsComboPanel); + this.HideOnClose = true; + this.Name = "PropertiesForm"; + this.TabText = "PropertiesForm"; + this.Text = "PropertiesForm"; + this.componentsComboPanel.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel componentsComboPanel; + private NETXP.Controls.ComboBoxEx componentsCombo; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.PropertyGrid propertyGrid1; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/PropertiesForm.cs b/VisualPascalABCNETLinux/SSYY/PropertiesForm.cs new file mode 100644 index 000000000..efeadb11d --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/PropertiesForm.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class PropertiesForm : DockContent + { + public PropertiesForm() + { + InitializeComponent(); + TabText = PascalABCCompiler.StringResources.Get("VP_MF_M_PROPERTIES"); + componentsCombo.ImageList = new ImageList(); + //componentsCombo. + } + + public PropertyGrid Properties + { + get + { + return propertyGrid1; + } + } + +// public Dictionary componentBitmaps = new Dictionary(); +// public Dictionary componentItems = new Dictionary(); +// public Dictionary itemsComponent = new Dictionary(); + +// public static string getComboText(IComponent comp) +// { +// if (comp.Site != null) +// { +// return comp.Site.Name + ": " + comp.GetType().FullName; +// } +// else +// { +// return comp.GetType().FullName; +// } +// } + +// public void AddDesignedComponent(IComponent comp) +// { +// int num = -1; +// Type type = comp.GetType(); +// if (!componentBitmaps.TryGetValue(type, out num)) +// { +// ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; +// if (tba == null) +// { +// num = -1; +// } +// else +// { +// num = componentsCombo.ImageList.Images.Count; +// componentsCombo.ImageList.Images.Add(tba.GetImage(type)); +// } +// componentBitmaps.Add(type, num); +// } +// NETXP.Controls.ComboBoxExItem it = new NETXP.Controls.ComboBoxExItem(num, getComboText(comp), 0); +// componentsCombo.Items.Add(it); +// componentItems.Add(comp, it); +// itemsComponent.Add(it, comp); +// } + +// public void DeleteDesignedComponent(IComponent comp) +// { +// NETXP.Controls.ComboBoxExItem it; +// bool exist = componentItems.TryGetValue(comp, out it); +// if (!exist) return; +// componentsCombo.Items.Remove(it); +// itemsComponent.Remove(componentItems[comp]); +// componentItems.Remove(comp); +// } + +// public void SetSelectedComponents(object[] selection) +// { +// switch (selection.Length) +// { +// case 0: +// componentsCombo.SelectedItem = null; +//// componentsCombo.SelectedText = Form1StringResources.Get("NOTHING_SELECTED"); +// break; +// case 1: +// componentsCombo.SelectedItem = componentItems[selection[0] as IComponent]; +// break; +// default: +//// string s = string.Format(Form1StringResources.Get("{0}_COMPONENTS5_SELECTED"), selection.Length); +// componentsCombo.SelectedItem = null; +// break; +// } +// } + + private void componentsCombo_SelectedIndexChanged(object sender, EventArgs e) + { +// if (componentsCombo.SelectedItem == null) return; +// IComponent comp = itemsComponent[componentsCombo.SelectedItem as NETXP.Controls.ComboBoxExItem]; +// Form1.Form1_object.CurrentCodeFileDocument.Designer.host.selectionService.SetSelectedComponents(new IComponent[]{comp}); +// //SampleDesignerHost.SampleSelectionService + } + +// public NETXP.Controls.ComboBoxExItemCollection GetItemsControls() +// { +// return componentsCombo.Items; +// } + + public Panel GetComponentsComboPanel() + { + return componentsComboPanel; + } + + public NETXP.Controls.ComboBoxEx GetComponentsCombo() + { + return componentsCombo; + } + + } + + public class MyGrid : DataGrid + { + public override ISite Site + { + get + { + return base.Site; + } + set + { + base.Site = value; + } + } + } + +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/PropertiesForm.resx b/VisualPascalABCNETLinux/SSYY/PropertiesForm.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/PropertiesForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/PropertyGridSite.cs b/VisualPascalABCNETLinux/SSYY/PropertyGridSite.cs new file mode 100644 index 000000000..60b54061f --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/PropertyGridSite.cs @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ + +using System; +using System.ComponentModel; + +namespace SampleDesignerApplication +{ + /// A nearly empty implementation of ISite, this class merely passes on + /// service requests to the host. It is required when we add the events + /// tab to our property grid. + public class PropertyGridSite : System.ComponentModel.ISite + { + private IServiceProvider sp; + private IComponent component; + + public PropertyGridSite(IServiceProvider sp, IComponent component) + { + this.sp = sp; + this.component = component; + } + #region Implementation of ISite + + public System.ComponentModel.IComponent Component + { + get + { + return component; + } + } + + public System.ComponentModel.IContainer Container + { + get + { + return null; + } + } + + public bool DesignMode + { + get + { + return false; + } + } + + public string Name + { + get + { + return null; + } + set {} + } + + #endregion + + #region Implementation of IServiceProvider + + public object GetService(Type serviceType) + { + if (sp != null) + { + return sp.GetService(serviceType); + } + return null; + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignSite.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignSite.cs new file mode 100644 index 000000000..990c3bbac --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignSite.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.Collections; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.Diagnostics; + + /// Links a component to its container. + internal class SampleDesignSite : ISite, IDictionaryService { + + private static Attribute[] designerNameAttribute = new Attribute[] {new SampleDesignerNameAttribute(true)}; + + private IComponent component; + private SampleDesignerHost host; + private string name; + private Hashtable dictionary; + + internal SampleDesignSite(SampleDesignerHost host, string name) { + this.host = host; + this.component = null; + this.name = name; + } + + + // IServiceProvider + + /// Pass on service requests to the host. + public object GetService(Type service) { + if (service == typeof(IDictionaryService)) + { + return this; + } + IServiceProvider sp = (IServiceProvider)host; + return sp.GetService(service); + } + + + // ISite + + /// Return this site's component. + public IComponent Component { + get { + Debug.Assert(component != null, "Need the component before we've established it"); + return component; + } + } + + /// Get the component container. + public IContainer Container { + get { + return host.Container; + } + } + + /// Get/Set the name of this component. + public string Name { + get { + return name; + } + set { + if (value == null) { + throw new ArgumentException("Bad Name Value - cannot be null"); + } + + if (value.Equals(name)) return; // No need to rename the same name. + + host.OnComponentRename(new ComponentRenameEventArgs(component, name, value)); + name = value; + } + } + + /// Are we in design mode? + public bool DesignMode { + get { + return true; + } + } + + /// Set the component for this site (can only be done once). + internal void SetComponent(IComponent component) { + Debug.Assert(this.component == null, "Cannot set a component twice"); + this.component = component; + + if (this.name == null) { + this.name = host.GetNewComponentName(component.GetType()); + } + } + + /// Set a new name on this component. + internal void SetName(string newName) { + name = newName; + } + + #region Implementation of IDictionaryService + + // IDictionaryService is a per-component cache used by + // many things in the designer. This must be implemented + // on a site that supports design mode. This is the only + // service that is per-component. All other services are + // per-designer host. + + /// Get a value from a key. + object IDictionaryService.GetValue(object key) + { + if (dictionary != null) + { + return dictionary[key]; + } + return null; + } + + /// Set a value with a key. + void IDictionaryService.SetValue(object key, object value) + { + if (dictionary == null) + { + dictionary = new Hashtable(); + } + dictionary[key] = value; + } + + /// Get a key from a value. + object IDictionaryService.GetKey(object value) + { + if (dictionary != null) + { + foreach(DictionaryEntry de in dictionary) + { + if (object.Equals(de.Value, value)) + { + return de.Key; + } + } + } + return null; + } + #endregion + } + +} + diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignerHost.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignerHost.cs new file mode 100644 index 000000000..7417d462c --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignerHost.cs @@ -0,0 +1,1651 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.ComponentModel.Design.Serialization; + using System.Diagnostics; + using System.Collections; + using System.Windows.Forms; + using System.Windows.Forms.Design; + using System.Drawing.Design; + using System.Reflection; + using System.Text; + using System.Collections.Generic; + using System.Drawing; + + public class SampleDesignerHost : + IContainer + , IDesignerHost + , IDesignerLoaderHost + , IComponentChangeService + , IExtenderProviderService + , IDesignerEventService + { + + // Service objects we are responsible for + internal ISelectionService selectionService; // selection services + private IMenuCommandService menuCommandService; // the menu command service + private IHelpService helpService; // the help service - UNIMPLEMENTED + private IReferenceService referenceService; // service to maintain references - UNIMPLEMENTED + private IMenuEditorService menuEditorService; // Menu editor service - UNIMPLEMENTED + private IToolboxService toolboxService; // toolbox service + + // User attached events, designers and services. + private IServiceContainer serviceContainer; // holds global services users have added + private Hashtable designerTable; // holds component<->designer mappings + + // The current Form Design + private DesignerLoader designerLoader; // the loader that reads/writes the document + private Hashtable sites; // name -> DesignSite mapping + private DesignerComponentCollection components; // public component collection. Tracks sites table. + + private ArrayList extenderProviders; // extenders that are on the current form + private IComponent rootComponent; // the base document component we're designing + + NETXP.Controls.ComboBoxExItem[] savedAllComponents = null; + internal Dictionary savedComponentItems = null; + internal Dictionary savedItemsComponent = null; + + + private string rootComponentClassName; // the name of the class the base component represents + private IRootDesigner rootDesigner; // the designer for the document + private SampleDocumentWindow documentWindow; // the thing being reparented by the docwin + private ITypeResolutionService typeResolver; // The object we load types through. + private Exception loadError; // The first load error, or null. + private INameCreationService nameService; // service we use to validate names of things. + private int transactionCount; // >0 means we're doing a transaction + private StringStack transactionDescriptions; // string descriptions of the current transactions + + // Flags that determine the validity of our code...are we in sync? + private bool loadingDesigner; // true if we are loading + private bool reloading; // true if we are reloading the document + + // Transient stuff + private SampleDesignSite newComponentSite; // used during new component creation + + public static Dictionary componentBitmaps = new Dictionary(); + private static ImageList controlImages = new ImageList(); + public Dictionary componentItems = new Dictionary(); + public Dictionary itemsComponent = new Dictionary(); + + internal NETXP.Controls.ComboBoxEx currentComponentsCombo; + + //SampleDesignerHost + public SampleDesignerHost() : this(new ServiceContainer()) { + } + + // We take a service provider in our constructor so that our main form can give us + // services (like the property grid and toolbox). + public SampleDesignerHost(IServiceProvider parentProvider) { + this.serviceContainer = new ServiceContainer(parentProvider); + designerTable = new Hashtable(); + sites = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default); + loadingDesigner = false; + transactionCount = 0; + reloading = false; + + // Services that we already have implemented on our object + serviceContainer.AddService(typeof(IDesignerHost), this); + serviceContainer.AddService(typeof(IContainer), this); + serviceContainer.AddService(typeof(IComponentChangeService), this); + serviceContainer.AddService(typeof(IExtenderProviderService), this); + serviceContainer.AddService(typeof(IDesignerEventService), this); + + // And services that we demand create. + ServiceCreatorCallback callback = new ServiceCreatorCallback(this.OnCreateService); + + serviceContainer.AddService(typeof(IToolboxService), callback); + serviceContainer.AddService(typeof(ISelectionService), callback); + serviceContainer.AddService(typeof(ITypeDescriptorFilterService), callback); + serviceContainer.AddService(typeof(IMenuCommandService), callback); +// serviceContainer.AddService(typeof(IMenuEditorService), callback); - UNIMPLEMENTED +// serviceContainer.AddService(typeof(IHelpService), callback); - UNIMPLEMENTED +// serviceContainer.AddService(typeof(IReferenceService), callback); - UNIMPLEMENTED +// serviceContainer.AddService(typeof(IPropertyValueUIService), callback); - UNIMPLEMENTED + + // Configure extender providers. + ((IExtenderProviderService)this).AddExtenderProvider(new SampleNameExtenderProvider(this)); + ((IExtenderProviderService)this).AddExtenderProvider(new SampleInheritedNameExtenderProvider(this)); + //defaultMenuCommands = new DefaultMenuCommands(this); + //defaultMenuCommands.AddTo(menuCommandService); + // +Add Serialization Service + serviceContainer.AddService(typeof(IDesignerSerializationService), callback); + // -Add Serialization Service + currentComponentsCombo = new NETXP.Controls.ComboBoxEx(); + currentComponentsCombo.Visible = false; + VisualPascalABC.Form1.Form1_object.PropertiesWindow.GetComponentsComboPanel().Controls.Add(currentComponentsCombo); + currentComponentsCombo.EnableMRU = false; + currentComponentsCombo.Dock = DockStyle.Fill; + NETXP.Controls.ComboBoxEx baseCombo = VisualPascalABC.Form1.Form1_object.PropertiesWindow.GetComponentsCombo(); + currentComponentsCombo.ItemHeight = baseCombo.ItemHeight; + currentComponentsCombo.Font = baseCombo.Font; + currentComponentsCombo.DrawMode = baseCombo.DrawMode; + currentComponentsCombo.DropDownStyle = baseCombo.DropDownStyle; + currentComponentsCombo.Flags = baseCombo.Flags; + currentComponentsCombo.SelectedIndexChanged += new EventHandler(currentComponentsCombo_SelectedIndexChanged); + currentComponentsCombo.Visible = true; + currentComponentsCombo.ImageList = controlImages; + } + + private void currentComponentsCombo_SelectedIndexChanged(object sender, EventArgs e) + { + if (currentComponentsCombo.SelectedItem == null) return; + IComponent comp = itemsComponent[currentComponentsCombo.SelectedItem as NETXP.Controls.ComboBoxExItem]; + selectionService.SetSelectedComponents(new IComponent[] { comp }); + } + + public void SetSelectedComponents(object[] selection) + { + switch (selection.Length) + { + case 0: + currentComponentsCombo.SelectedItem = null; + break; + case 1: + currentComponentsCombo.SelectedItem = componentItems[selection[0] as IComponent]; + break; + default: + currentComponentsCombo.SelectedItem = null; + break; + } + } + + public static string getComboText(IComponent comp) + { + if (comp.Site != null) + { + return comp.Site.Name + ": " + comp.GetType().FullName; + } + else + { + return comp.GetType().FullName; + } + } + + public void AddDesignedComponent(IComponent comp) + { + int num = -1; + Type type = comp.GetType(); + if (!componentBitmaps.TryGetValue(type, out num)) + { + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba == null) + { + num = -1; + } + else + { + num = currentComponentsCombo.ImageList.Images.Count; + currentComponentsCombo.ImageList.Images.Add(tba.GetImage(type)); + } + componentBitmaps.Add(type, num); + } + NETXP.Controls.ComboBoxExItem it = new NETXP.Controls.ComboBoxExItem(num, getComboText(comp), 0); + currentComponentsCombo.Items.Add(it); + componentItems.Add(comp, it); + itemsComponent.Add(it, comp); + } + + public void DeleteDesignedComponent(IComponent comp) + { + NETXP.Controls.ComboBoxExItem it; + bool exist = componentItems.TryGetValue(comp, out it); + if (!exist) return; + currentComponentsCombo.Items.Remove(it); + itemsComponent.Remove(componentItems[comp]); + componentItems.Remove(comp); + } + + //**** + //**** + //**** IDisposable Implementation + //**** + //**** + + /// Disposes of the DesignContainer. This cleans up any objects we may be holding + /// and removes any services that we created. + public void Dispose() { + + // Dispose the loader before destroying the designer. Otherwise, the + // act of destroying all the components on the designer surface will + // be reflected in the loader, deleting the user's file. + if (designerLoader != null) { + try + { + designerLoader.Flush(); + } + catch (Exception e1) + { + Debug.Fail("Designer loader '" + designerLoader.GetType().Name + "' threw during Flush: " + e1.ToString()); + e1 = null; + } + + try { + designerLoader.Dispose(); + } + catch (Exception e2) { + Debug.Fail("Designer loader '" + designerLoader.GetType().Name + "' threw during Dispose: " + e2.ToString()); + e2 = null; + } + designerLoader = null; + } + + // Unload the document. + UnloadDocument(); + + // No services after this! + serviceContainer = null; + + // Now tear down all of our services. + if (menuEditorService != null) { + IDisposable d = menuEditorService as IDisposable; + if (d != null) d.Dispose(); + menuEditorService = null ; + } + + if (selectionService != null) { + IDisposable d = selectionService as IDisposable; + if (d != null) d.Dispose(); + selectionService = null; + } + + if (menuCommandService != null) { + IDisposable d = menuCommandService as IDisposable; + if (d != null) d.Dispose(); + menuCommandService = null; + } + + if (toolboxService != null) + { + IDisposable d = toolboxService as IDisposable; + if (d != null) d.Dispose(); + toolboxService = null; + } + + if (helpService != null) { + IDisposable d = helpService as IDisposable; + if (d != null) d.Dispose(); + helpService = null; + } + + if (referenceService != null) { + IDisposable d = referenceService as IDisposable; + if (d != null) d.Dispose(); + referenceService = null; + } + + // Destroy our document window. + if (documentWindow != null) { + documentWindow.Dispose(); + documentWindow = null; + } + } + + + + //**** + //**** + //**** IContainer Implementation + //**** + //**** + + // Properties + ComponentCollection IContainer.Components { + get { + if (components == null) { + components = new DesignerComponentCollection(this); + } + return components; + } + } + + // Methods + + /// Adds the given component to the Designer. This sets up the lifetime and site + /// relationship between component / container and then adds the new component + /// to the formcore and code buffer. + /// This will fabricate a default name for the component. + void IContainer.Add(IComponent component) { + ((IContainer)this).Add(component, null); + } + + void IContainer.Add(IComponent component, string name) { + + if (null == component) return; + + if (rootComponent != null) { + // Compare to the class the root component represents, not it's actual class! + if (String.Compare(component.GetType().FullName, rootComponentClassName, true) == 0) { + Exception ex = new Exception("Can't add a component to itself " + component.GetType().FullName); + throw ex; + } + } + + ISite site = component.Site; + + // If the component is already added to us, all we have to do is check + // the name. If the name is different we rename it, otherwise we do + // nothing. + if (site != null && site.Container == this) { + if (name != null && !name.Equals(site.Name)) { + CheckName(name); + site.Name = name; + } + return; + } + + // Check to see if someone has already configured a site for us. If so, + // use it. Otherwise, fabricate a new site. + // newComponentSite is created by CreateComponent. + SampleDesignSite newSite = newComponentSite; + newComponentSite = null; + + if (newSite != null && name == null) { + name = newSite.Name; + } + + // Make sure the name is valid. + if (name != null) { + CheckName(name); + } + + ComponentEventArgs ce = new ComponentEventArgs(component); + OnComponentAdding(ce); + + // Remove this component from its current site + if (site != null) site.Container.Remove(component); + + if (newSite == null) { + newSite = new SampleDesignSite(this, name); + } + + // And set the relationship between this site and it's component. If the + // site has no name at this point, it will fabricate one. + newSite.SetComponent(component); + + // If we were given a site, the name we're given should always be null, + // or at least be the same name as that stored in the new site. + Debug.Assert(name == null || name.Equals(newSite.Name), "Name should match the one in newComponentSite"); + + if (component is IExtenderProvider && + !TypeDescriptor.GetAttributes(component).Contains(InheritanceAttribute.InheritedReadOnly)) { + ((IExtenderProviderService)this).AddExtenderProvider((IExtenderProvider)component); + } + + // And establish the component/site relationship + sites[newSite.Name] = newSite; + component.Site = newSite; + if (components != null) { + components.Add(newSite); + } + + try { + + CreateComponentDesigner(component); + + // The component has been added. Note that it is tempting to move this above the + // designer because the designer will never need to know that its own component just + // got added, but this would be bad because the designer is needed to extract + // shadowed properties from the component. + // + OnComponentAdded(ce); + } + catch (Exception) { + // If we're loading, then don't remove the component. We are about to + // fail the load anyway here, and we don't want to be firing remove events during + // a load. + if (!loadingDesigner) { + ((IContainer)this).Remove(component); + } + throw; + } + } + + + void IContainer.Remove(IComponent component) { + if (component == null) return; + ISite site = component.Site; + if (!sites.ContainsValue(site)) return; + if (site == null || site.Container != this) return; + if (!(site is SampleDesignSite)) return; + + ComponentEventArgs ce = new ComponentEventArgs(component); + OnComponentRemoving(ce); + + SampleDesignSite csite = (SampleDesignSite)site; + if (csite.Component != rootComponent) { + if (component is IExtenderProvider) { + ((IExtenderProviderService)this).RemoveExtenderProvider((IExtenderProvider)component); + } + } + + // and remove it's designer, should one exist. + IDesigner designer = (IDesigner)designerTable[component]; + if (designer != null) { + designer.Dispose(); + } + + designerTable.Remove(component); + + sites.Remove(csite.Name); + if (components != null) { + components.Remove(site); + } + + // By this time, the component is dead. If someone + // threw an exception, there's nothing we can do about it. + // + try { + OnComponentRemoved(ce); + } + catch (Exception) { + } + + // Finally, rip the site instance. + // + component.Site = null; + } + + //**** + //**** + //**** IServiceProvider Implementation + //**** + //**** + object IServiceProvider.GetService(Type serviceType) { + Debug.Assert(serviceContainer != null, "We have no sevice container. Either the host has not been initialized yet or it has been disposed."); + object service = null; + if (serviceContainer != null) { + service = serviceContainer.GetService(serviceType); + + // Record the success or failure of service requests in case someone + // wants to see in the Main Form. + // + SampleDesignerApplication.ServiceRequests requests = (SampleDesignerApplication.ServiceRequests)serviceContainer.GetService(typeof(SampleDesignerApplication.ServiceRequests)); + if (requests != null) + { + if (service != null) + { + requests.ServiceSucceeded(serviceType); + } + else + { + requests.ServiceFailed(serviceType); + } + } + } + return service; + } + + //**** + //**** + //**** IServiceContainer Implementation + //**** + //**** + void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback) { + Debug.Assert(serviceContainer != null, "We have no sevice container. Either the host has not been initialized yet or it has been disposed."); + if (serviceContainer != null) { + serviceContainer.AddService(serviceType, callback); + } + } + + void IServiceContainer.AddService(Type serviceType, ServiceCreatorCallback callback, bool promote) { + Debug.Assert(serviceContainer != null, "We have no sevice container. Either the host has not been initialized yet or it has been disposed."); + if (serviceContainer != null) { + serviceContainer.AddService(serviceType, callback, promote); + } + } + + void IServiceContainer.AddService(Type serviceType, object serviceInstance) { + Debug.Assert(serviceContainer != null, "We have no sevice container. Either the host has not been initialized yet or it has been disposed."); + if (serviceContainer != null) { + serviceContainer.AddService(serviceType, serviceInstance); + } + } + + void IServiceContainer.AddService(Type serviceType, object serviceInstance, bool promote) { + Debug.Assert(serviceContainer != null, "We have no sevice container. Either the host has not been initialized yet or it has been disposed."); + if (serviceContainer != null) { + serviceContainer.AddService(serviceType, serviceInstance, promote); + } + } + + void IServiceContainer.RemoveService(Type serviceType) { + if (serviceContainer != null) { + serviceContainer.RemoveService(serviceType); + } + } + + void IServiceContainer.RemoveService(Type serviceType, bool promote) { + if (serviceContainer != null) { + serviceContainer.RemoveService(serviceType, promote); + } + } + + //**** + //**** + //**** IDesignerLoaderHost Implementation + //**** + //**** + + // Methods + + /// This is called by the designer loader to indicate that the load has + /// terminated. If there were errors, they should be passed in the errorCollection + /// as a collection of exceptions (if they are not exceptions the designer + /// loader host may just call ToString on them). If the load was successful then + /// errorCollection should either be null or contain an empty collection. + void IDesignerLoaderHost.EndLoad(string baseClassName, bool successful, ICollection errorCollection) { + + bool wasReload = reloading; + bool wasLoading = loadingDesigner; + + // Set our state back to the starting point. + this.loadingDesigner = false; + this.reloading = false; + + if (baseClassName != null) { + this.rootComponentClassName = baseClassName; + } + + // If we had errors, report them. + // + if (successful && rootComponent == null) { + ArrayList errorList = new ArrayList(); + errorList.Add(new Exception("No Base Class")); + errorCollection = errorList; + successful = false; + } + + if (!successful) { + + // The document is partially loaded. Unload it here. + try { + UnloadDocument(); + } + catch (Exception ex) { + Debug.Fail("Failed to unload after a...failed load.", ex.ToString()); + } + + if (errorCollection != null) { + foreach(object errorObj in errorCollection) { + if (errorObj is Exception) { + loadError = (Exception)errorObj; + } + else { + loadError = new Exception(errorObj.ToString()); + } + break; + } + } + else { + loadError = new Exception("Unknown Load Error"); + } + + documentWindow.SetDesigner(null); + } + else { + + // We may be invoked to do an EndLoad when we are already loaded. This can happen + // if the user called AddLoadDependency, essentially putting us in a loading state + // while we are already loaded. This is OK, and is used as a hint that the user + // is going to monkey with settings but doesn't want the code engine to report + // it. + if (wasLoading) { + + // and let everyone know that we're loaded + if (LoadComplete != null) { + LoadComplete(this, EventArgs.Empty); + } + } + } + + documentWindow.ReportErrors(errorCollection); + documentWindow.DocumentVisible = true; + } + + /// This is called by the designer loader when it wishes to reload the + /// design document. The reload may happen immediately or it may be deferred + /// until idle time. The designer loader should unload itself before calling + /// this method, to reset its state to that before BeginLoad was originally + /// called. + void IDesignerLoaderHost.Reload() { + + // If the DesignerLoader has been destroyed already, then there + // is no need to reload + if (designerLoader == null || documentWindow == null) { + return; + } + + // Before reloading, flush any changes! + designerLoader.Flush(); + + Cursor oldCursor = Cursor.Current; + Cursor.Current = Cursors.WaitCursor; + + ICollection selectedObjects = null; + ArrayList selectedNames = null; + + IServiceProvider sp = (IServiceProvider)this; + ISelectionService selectionService = (ISelectionService)sp.GetService(typeof(ISelectionService)); + if (selectionService != null) { + selectedObjects = selectionService.GetSelectedComponents(); + selectedNames = new ArrayList(); + + foreach(object comp in selectedObjects) { + if (comp is IComponent && ((IComponent)comp).Site != null) { + selectedNames.Add(((IComponent)comp).Site.Name); + } + } + } + + try { + UnloadDocument(); + Load(true); + } + finally { + + if (selectionService != null) { + + ArrayList selection = new ArrayList(); + foreach(string name in selectedNames) { + if (name != null) { + IComponent comp = ((IContainer)this).Components[name]; + if (comp != null) { + selection.Add(comp); + } + } + } + + selectionService.SetSelectedComponents(selection); + } + Cursor.Current = oldCursor; + } + } + + + //**** + //**** + //**** IDesignerHost Implementation + //**** + //**** + + // Properties + public IContainer Container { + get { + return (IContainer)this; + } + } + + // Gets a value indicating whether the designer host is currently in a transaction. + public bool InTransaction { + get { + return transactionCount > 0; + } + } + + /// Is the document currently being loaded. + public bool Loading { + get { + return loadingDesigner || (designerLoader != null && designerLoader.Loading); + } + } + + /// Retrieves the instance of the base class that is being used as the basis + /// for this design. This is typically a Form or UserControl instance; it + /// defines the class for which the user's derived class will extend. + public IComponent RootComponent { + get { + return rootComponent; + } + } + + + /// Retrieves the fully qualified name of the class that is being designed. + /// This class is not available at design time because it is the class that + /// is being designed, so the class's superclass is substituted. This allows + /// you to get at the fully qualified name of the class that will be used + /// at runtime. + public string RootComponentClassName { + get { + return rootComponentClassName; + } + } + + // Gets the description of the current transaction. + public string TransactionDescription { + get { + if (transactionDescriptions != null) { + return transactionDescriptions.GetNonNull(); + } + return ""; + } + } + + // Events + public event EventHandler Activated; + public event EventHandler Deactivated; + public event EventHandler LoadComplete; + public event DesignerTransactionCloseEventHandler TransactionClosed; + public event DesignerTransactionCloseEventHandler TransactionClosing; + public event EventHandler TransactionOpened; + public event EventHandler TransactionOpening; + + // Methods + + /// Causes the designer that this host is hosting to become activated. + public void Activate() { + documentWindow.Focus(); + } + + /// Creates a new component from the given class. A component name will be fabricated. + public IComponent CreateComponent(Type componentClass) { + string name = this.GetNewComponentName(componentClass); + return CreateComponent(componentClass, name); + } + + public IComponent CreateComponent(Type componentClass, string name) { + + object obj = null; + IComponent comp = null; + + // Create the site we are going to use here so that our Container.Add implementation + // can pick it up - need to do this here because name is not passed to Container.Add + // by Foo(IContainer) constructor below. + newComponentSite = new SampleDesignSite(this,name); + + // Create the Component - there are 2 possible ways to do this: + // Foo(IComponent) or Foo(). + + try { + // See if we can create the component using an IContainer constructor... + try { + object[] args = new object[] {this}; + Type[] argTypes = new Type[] {typeof(IContainer)}; + obj = CreateObject(componentClass, args, argTypes, false); + } + catch (Exception) { + } + + // If it failed, try to create it with a default constructor + if (null == obj) { + obj = CreateObject(componentClass, null, null, false); + } + + //Make sure we have a component + comp = obj as Component ; + if (comp == null) { + Exception ex = new Exception("The class is not a component " + componentClass.FullName); + throw ex; + } + + // If we didn't have a constructor that took a Container or the site is not + // a SampleDesignSite the we will do the Container.Add() work + SampleDesignSite site = comp.Site as SampleDesignSite; + if (site == null) { + ((IContainer)this).Add(comp); + } + + // At this point, our add call should have used the new site we gave it (if there was + // one), and nulled out the holder pointer. + Debug.Assert(newComponentSite == null, "add didn't use newComponentSite"); + } + catch (Exception) { + if (comp != null) { + try { + DestroyComponent(comp); + } + catch (Exception) { + } + } + + throw; + } + if (comp != null) + { + AddDesignedComponent(comp); + } + return comp; + } + + /// Lengthy operations that involve multiple components may raise many events. These events + /// may cause other side-effects, such as flicker or performance degradation. When operating + /// on multiple components at one time, or setting multiple properties on a single component, + /// you should encompass these changes inside a transaction. Transactions are used + /// to improve performance and reduce flicker. Slow operations can listen to + /// transaction events and only do work when the transaction completes. + public DesignerTransaction CreateTransaction() { + return CreateTransaction(null); + } + + public DesignerTransaction CreateTransaction(string description) { + if (description == null) { + description = string.Empty; + } + + return new SampleDesignerTransaction(this, description); + } + + + /// Destroys the given component, removing it from the design container. + public void DestroyComponent(IComponent comp) { + string name; + + if (comp.Site != null && comp.Site.Name != null) { + name = comp.Site.Name; + } + else { + name = comp.GetType().Name; + } + + // Make sure the component is not being inherited -- we can't delete these! + InheritanceAttribute ia = (InheritanceAttribute)TypeDescriptor.GetAttributes(comp)[typeof(InheritanceAttribute)]; + if (ia != null && ia.InheritanceLevel != InheritanceLevel.NotInherited) { + throw new InvalidOperationException("CantDestroyInheritedComponent" + name); + } + + DesignerTransaction t = null; + try { + // We try to remove the component from the container before destroying it. + t = CreateTransaction("DestroyComponentTransaction" + name); + + // We need to signal changing and then perform the remove. Remove must be done by us and not + // by Dispose because (a) people need a chance to cancel through a Removing event, and (b) + // Dispose removes from the container last and anything that would sync Removed would end up + // with a dead component. + // + ((IComponentChangeService)this).OnComponentChanging(comp, null); + if (comp.Site != null) { + Remove(comp); + } + DeleteDesignedComponent(comp); + comp.Dispose(); + ((IComponentChangeService)this).OnComponentChanged(comp, null, null, null); + } + finally { + if (t != null) { + t.Commit(); + } + } + } + + // Retrieves the designer for the given component. + public IDesigner GetDesigner(IComponent component) { + Debug.Assert(component != null, "Cannot call GetDesigner with a NULL component. Check that the root hasn't been disposed."); + if (component == null) throw new ArgumentNullException("component"); + return(IDesigner)designerTable[component]; + } + + + /// Retrieves the Type instance for the given type name. The type name must be + /// fully qualified, or it must be contained in an assembly that has been referenced + /// by the designer. + public Type GetType(string typeName) { + if (typeResolver == null) { + IServiceProvider sp = (IServiceProvider)this; + typeResolver = (ITypeResolutionService)sp.GetService(typeof(ITypeResolutionService)); + } + if (typeResolver != null) { + return typeResolver.GetType(typeName); + } + return Type.GetType(typeName); + } + + + //**** + //**** + //**** IComponentChangeService Implementation + //**** + //**** + + // Events + public event ComponentEventHandler ComponentAdded; + public event ComponentEventHandler ComponentAdding; + public event ComponentChangedEventHandler ComponentChanged; + public event ComponentChangingEventHandler ComponentChanging; + public event ComponentEventHandler ComponentRemoved; + public event ComponentEventHandler ComponentRemoving; + public event ComponentRenameEventHandler ComponentRename; + + // Methods + + /// This is called after a property has been changed. It allows + /// the implementor to do any post-processing that may be needed + /// after a property change. For example, a designer will typically + /// update the source code that sets the property with the new value. + void IComponentChangeService.OnComponentChanged(object component, MemberDescriptor member, object oldValue, object newValue) { + + // If we're loading then eat changes. This just slows us down. + if (Loading) { + return; + } + + if (ComponentChanged != null) { + ComponentChangedEventArgs ce = new ComponentChangedEventArgs(component, member, oldValue, newValue); + ComponentChanged(this, ce); + } + } + + /// This is called when a property is about to change. Before the + /// property descriptor commits the property it will call this + /// method. This method should throw an exception if the property + /// cannot be changed. This is not intended to validate the values + /// of a particular property. Instead, it is intended to be a global + /// way of preventing a component from changing. For example, if + /// a designer file is checked into source code control, this would + /// typically throw an exception if the user refused to check out + /// the file. + void IComponentChangeService.OnComponentChanging(object component, MemberDescriptor member) { + // If we're loading then eat changes. This just slows us down. + if (Loading) { + if (member.Name == "Size") + { + string _DEBUG_ = member.Name; + } + return; + } + + if (ComponentChanging != null) { + ComponentChangingEventArgs ce = new ComponentChangingEventArgs(component, member); + ComponentChanging(this, ce); + } + + } + + //**** + //**** + //**** IExtenderProviderService Implementation + //**** + //**** + + // Methods + + void IExtenderProviderService.AddExtenderProvider(IExtenderProvider provider) { + if (extenderProviders == null) { + extenderProviders = new ArrayList(); + } + extenderProviders.Add(provider); + } + + + void IExtenderProviderService.RemoveExtenderProvider(IExtenderProvider provider) { + if (extenderProviders != null) { + extenderProviders.Remove(provider); + } + } + + + //**** + //**** + //**** Sample Designer Host methods + //**** + //**** + + + + /// Validates that the given name is OK to use. Not only does it have to + /// be a valid identifier, but it must not already be in our container. + internal void CheckName(string name) { + + if (name == null || name.Length == 0) { + Exception ex = new Exception("Components must have a name"); + throw ex; + } + + if (((IContainer)this).Components[name] != null) { + Exception ex = new Exception("We already have a component named " + name); + throw ex; + } + + if (nameService == null) { + IServiceProvider sp = (IServiceProvider)this; + nameService = (INameCreationService)sp.GetService(typeof(INameCreationService)); + } + + if (nameService != null) { + nameService.ValidateName(name); + } + } + + + private void CreateComponentDesigner(IComponent component) { + + // Is this the first component the loader has created? If so, then it must + // be the base component (by definition) so we will expect there to be a document + // designer associated with the component. Otherwise, we search for a + // normal designer, which can be optionally provided. + + IDesigner designer = null; + + if (rootComponent == null) { + rootComponent = component; + + // Get the root designer. We check right here to see if the document window supports + // hosting this type of designer. If not, we bail early. + rootDesigner = (IRootDesigner)TypeDescriptor.CreateDesigner(component, typeof(IRootDesigner)); + + if (rootDesigner == null) { + rootComponent = null; + Exception ex = new Exception("No Top Level Designer for " + component.GetType().FullName); + throw ex; + } + + ViewTechnology[] technologies = rootDesigner.SupportedTechnologies; + bool supported = false; + foreach(ViewTechnology tech in technologies) { + if (tech == ViewTechnology.WindowsForms) { + supported = true; + break; + } + } + + if (!supported) { + Exception ex = new Exception("This designer host does not support the designer for " + component.GetType().FullName); + throw ex; + } + + designer = rootDesigner; + + // Check and see if anyone has set the class name of the base component. + // We default to the component name. + if (rootComponentClassName == null) { + rootComponentClassName = component.Site.Name; + } + } + else { + designer = TypeDescriptor.CreateDesigner(component, typeof(IDesigner)); + } + + if (designer != null) { + designerTable[component] = designer; + try { + designer.Initialize(component); + } + catch { + designerTable.Remove(component); + + if (designer == rootDesigner) { + rootDesigner = null; + } + + throw; + } + + if (designer is IExtenderProvider && + !TypeDescriptor.GetAttributes(designer).Contains(InheritanceAttribute.InheritedReadOnly)) { + ((IExtenderProviderService)this).AddExtenderProvider((IExtenderProvider)designer); + } + + // Now, if this is the root designer, initialize the designer window with it. + if (designer == rootDesigner) { + documentWindow.SetDesigner(rootDesigner); + } + } + } + + /// Create an instance of a type given arguments and their types. + private object CreateObject(Type objectClass, object []args, Type[] argTypes, bool fThrowException) { + ConstructorInfo ctr = null; + + if (args != null && args.Length > 0) { + if (argTypes == null) { + argTypes = new Type[args.Length]; + + for (int i = args.Length - 1; i>= 0; i--) { + if (args[i] != null) argTypes[i] = args[i].GetType(); + } + } + + ctr = objectClass.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, argTypes, null); + + if (ctr == null && fThrowException) { + Exception ex = new Exception("Cannot find a constructor with the right arguments for " + objectClass.FullName); + throw ex; + } + else + return null; + } + + try { + return(ctr == null) ? Activator.CreateInstance(objectClass) : ctr.Invoke(args); + } + catch (Exception e) { + if (e is TargetInvocationException) { + e = e.InnerException; + } + + string message = e.Message; + if (message == null) { + message = e.ToString(); + } + + throw new Exception( "Cannot create an instance of " + + objectClass.FullName + + " because " + e.ToString(), e); + } + } + + /// Create a name from a new component of a given type. + internal string GetNewComponentName(Type compClass) { + IServiceProvider sp = (IServiceProvider)this; + INameCreationService nameCreate = (INameCreationService)sp.GetService(typeof(INameCreationService)); + if (nameCreate != null) { + return nameCreate.CreateName(Container, compClass); + } + + // Do a default thing... + // + string baseName = compClass.Name; + + // Camel case the base name. + // + StringBuilder b = new StringBuilder(baseName.Length); + for (int i = 0; i < baseName.Length; i++) { + if (Char.IsUpper(baseName[i]) && (i == 0 || i == baseName.Length - 1 || Char.IsUpper(baseName[i+1]))) { + b.Append(Char.ToLower(baseName[i])); + } + else { + b.Append(baseName.Substring(i)); + break; + } + } + baseName = b.ToString(); + + int idx = 1; + string finalName = baseName + idx.ToString(); + while(Container.Components[finalName] != null) { + idx++; + finalName = baseName + idx.ToString(); + } + + return finalName; + } + + /// Loads the design document using the DesignerLoader + private void Load(bool reloading) { + Cursor oldCursor = Cursor.Current; + Cursor.Current = Cursors.WaitCursor; + this.reloading = reloading; + + try { + if (!reloading && designerLoader is IExtenderProvider) { + ((IExtenderProviderService)this).AddExtenderProvider((IExtenderProvider)designerLoader); + } + + loadingDesigner = true; + loadError = null; + designerLoader.BeginLoad(this); + } + catch (Exception e) { + Exception exNew = e; + + if (e is TargetInvocationException) { + exNew = e.InnerException; + } + + string message = exNew.Message; + + // We must handle the case of an exception with no message. + if (message == null || message.Length == 0) { + Debug.Fail("Parser has thrown an exception that has no friendly message", exNew.ToString()); + exNew = new Exception("Parser has thrown an exception that has no friendly message" + exNew.ToString()); + } + + // Loader blew up. Add this exception to our error list + ArrayList errorList = new ArrayList(); + errorList.Add(exNew); + ((IDesignerLoaderHost)this).EndLoad(null, false, errorList); + } + + Cursor.Current = oldCursor; + } + + + /// Load the contents of the designer + public void LoadDocument(DesignerLoader designerLoader) { + try { + this.designerLoader = designerLoader; + + // Create the Design View + documentWindow = new SampleDocumentWindow(this); + + // Load the document + Load(false); + + } + catch (Exception t) { + Debug.Fail(t.ToString()); + throw; + } + } + + /// This is called after a component has been added to the container. + private void OnComponentAdded(ComponentEventArgs ce) { + if (ComponentAdded != null) { + + // This is just to double-check that our TypeResolutionService has the + // necessary assemblies in its internal set. After all, compilation depends + // on it! Normally our ToolboxItems do this for us, but if we open an XML + // document and load it, we get no help from the ToolboxItems. + // + ITypeResolutionService trs = ((IServiceContainer)this).GetService(typeof(ITypeResolutionService)) as ITypeResolutionService; + trs.ReferenceAssembly(ce.Component.GetType().Assembly.GetName()); + + ComponentAdded(this, ce); + } + } + + /// This is called when a component is about to be added to our container. + private void OnComponentAdding(ComponentEventArgs ce) { + if (ComponentAdding != null) { + ComponentAdding(this, ce); + } + } + + + + /// This is called after a component has been removed from the container, but before + /// the component's site has been destroyed. + private void OnComponentRemoved(ComponentEventArgs ce) { + if (ComponentRemoved != null) { + ComponentRemoved(this, ce); + } + } + + /// This is called when a component is about to be removed from our container. + private void OnComponentRemoving(ComponentEventArgs ce) { + if (ComponentRemoving != null) { + ComponentRemoving(this, ce); + } + } + + /// This is called when a component has been renamed. + internal void OnComponentRename(ComponentRenameEventArgs ce) { + if (ComponentRename != null) { + ComponentRename(this, ce); + } + } + + /// Creates some of the more infrequently used services + private object OnCreateService(IServiceContainer container, Type serviceType) { + + // Create SelectionService + if (serviceType == typeof(ISelectionService)) { + if (selectionService == null) { + selectionService = new SampleSelectionService(this); + } + return selectionService; + } + + if (serviceType == typeof(ITypeDescriptorFilterService)) { + return new SampleTypeDescriptorFilterService(this); + } + + + if (serviceType == typeof(IToolboxService)) { + if (toolboxService == null) { + toolboxService = new SampleToolboxService(this); + } + return toolboxService; + } + + + if (serviceType == typeof(IMenuCommandService)) { + if (menuCommandService == null) { + menuCommandService = new SampleMenuCommandService(this); + } + return menuCommandService; + } + +// UNIMPLEMENTED +// if (serviceType == typeof(IHelpService)) { +// if (helpService == null) { +// helpService = new SampleHelpService(this); +// } +// return helpService; +// } +// +// if (serviceType == typeof(IReferenceService)) { +// if (referenceService == null) { +// referenceService = new SampleReferenceService(this, true); +// } +// return referenceService; +// } +// +// if (serviceType == typeof(IPropertyValueUIService)) { +// return new SamplePropertyValueUIService(); +// } +// +// if (serviceType == typeof(IMenuEditorService)) { +// if (menuEditorService == null) { +// menuEditorService = new SampleMenuEditorService(this); +// } +// return menuEditorService; +// } + + if (serviceType == typeof(IDesignerSerializationService)) + { + if (serializationService == null) + { + serializationService = new SampleDesignerSerializationService(this); + } + return serializationService; + } + + Debug.Fail("Service type " + serviceType.FullName + " requested but we don't support it"); + return null; + } + + internal void OnTransactionOpened(EventArgs e) { + if (TransactionOpened != null) + TransactionOpened(this, e); + } + + internal void OnTransactionOpening(EventArgs e) { + if (TransactionOpening != null) + TransactionOpening(this, e); + } + + internal void OnTransactionClosed(DesignerTransactionCloseEventArgs e) { + if (TransactionClosed != null) + TransactionClosed(this, e); + } + + internal void OnTransactionClosing(DesignerTransactionCloseEventArgs e) { + if (TransactionClosing != null) + TransactionClosing(this, e); + } + + /// Called to remove a component from its container. + private void Remove(IComponent component) { + + // Bail early if this component hasn't been added to us. + if (component == null) return; + ISite site = component.Site; + if (!sites.ContainsValue(site)) return; + if (site == null || site.Container != this) return; + if (!(site is SampleDesignSite)) return; + + ComponentEventArgs ce = new ComponentEventArgs(component); + OnComponentRemoving(ce); + + // Remove the component from extender provider list if its an extender provider + SampleDesignSite csite = (SampleDesignSite)site; + + if (csite.Component != rootComponent) { + if (component is IExtenderProvider) { + ((IExtenderProviderService)this).RemoveExtenderProvider((IExtenderProvider)component); + } + } + + // and remove it's designer, should one exist. + IDesigner designer = (IDesigner)designerTable[component]; + if (designer != null) { + designer.Dispose(); + } + + designerTable.Remove(component); + + sites.Remove(csite.Name); + if (components != null) { + components.Remove(site); + } + + // By this time, the component is dead. If some bonehead + // threw, there's nothing we can do about it. + // + try { + OnComponentRemoved(ce); + } + catch (Exception) { + } + + // Finally, rip the site instance. + component.Site = null; + } + + // Exposed to allow ancillary classes to access this internal state. + internal Hashtable Sites { + get { + return sites; + } + } + + // Get descriptions of all of our transactions. + internal StringStack TransactionDescriptions { + get { + if (transactionDescriptions == null) { + transactionDescriptions = new StringStack(); + } + return transactionDescriptions; + } + } + + // Get or set the number of transactions we have. + internal int TransactionCount { + get { + return transactionCount; + } + set { + transactionCount = value ; + } + } + + // This is called during Dispose and Reload methods to unload the current designer. + private void UnloadDocument() { + + if (helpService != null && rootDesigner != null) { + helpService.RemoveContextAttribute("Keyword", "Designer_" + rootDesigner.GetType().FullName); + } + + // Note: Because this can be called during Dispose, we are very anal here + // about checking for null references. + + // If we can get a selection service, clear the selection... + // we don't want the property browser browsing disposed components... + // or components who's designer has been destroyed. + IServiceProvider sp = (IServiceProvider)this; + ISelectionService selectionService = (ISelectionService)sp.GetService(typeof(ISelectionService)); + Debug.Assert(selectionService != null, "ISelectionService not found"); + if (selectionService != null) { + selectionService.SetSelectedComponents(null); + } + + // Stash off the base designer and component. We are + // going to be destroying these and we don't want them + // to be accidently referenced after they're dead. + // + IDesigner rootDesignerHolder = rootDesigner; + IComponent rootComponentHolder = rootComponent; + + rootDesigner = null; + rootComponent = null; + rootComponentClassName = null; + + SampleDesignSite[] siteArray = new SampleDesignSite[sites.Values.Count]; + sites.Values.CopyTo(siteArray, 0); + + // Destroy all designers. We save the base designer for last. + // + IDesigner[] designers = new IDesigner[designerTable.Values.Count]; + designerTable.Values.CopyTo(designers, 0); + designerTable.Clear(); + + // Loading, unloading, it's all the same. It indicates that you + // shouldn't dirty or otherwise mess with the buffer. We also + // create a transaction here to limit the effects of making + // so many changes. + loadingDesigner = true; + DesignerTransaction trans = CreateTransaction(); + + try { + for (int i = 0; i < designers.Length; i++) { + if (designers[i] != rootDesignerHolder) { + try { + designers[i].Dispose(); + } + catch { + Debug.Fail("Designer " + designers[i].GetType().Name + " threw an exception during Dispose."); + } + } + } + + // Now destroy all components. + for (int i = 0; i < siteArray.Length; i++) { + SampleDesignSite site = siteArray[i]; + IComponent comp = site.Component; + if (comp != null && comp != rootComponentHolder) { + try { + comp.Dispose(); + } + catch { + Debug.Fail("Component " + site.Name + " threw during dispose. Bad component!!"); + } + if (comp.Site != null) { + Debug.Fail("Component " + site.Name + " did not remove itself from its container"); + Remove(comp); + } + } + } + + // Finally, do the base designer and component. + // + if (rootDesignerHolder != null) { + try { + rootDesignerHolder.Dispose(); + } + catch { + Debug.Fail("Designer " + rootDesignerHolder.GetType().Name + " threw an exception during Dispose."); + } + } + + if (rootComponentHolder != null) { + try { + rootComponentHolder.Dispose(); + } + catch { + Debug.Fail("Component " + rootComponentHolder.GetType().Name + " threw during dispose. Bad component!!"); + } + + if (rootComponentHolder.Site != null) { + Debug.Fail("Component " + rootComponentHolder.Site.Name + " did not remove itself from its container"); + Remove(rootComponentHolder); + } + } + + sites.Clear(); + if (components != null) { + components.Clear(); + } + } + finally { + loadingDesigner = false; + trans.Commit(); + } + + // And clear the document window + // + if (documentWindow != null) { + documentWindow.SetDesigner(null); + } + } + + //Return the designer control. + public Control View { + get { + return documentWindow; + } + } + + /// The IDesignerEventService is responsible for designer events. Since we have only + /// our one designer host, we always return it when asked for the ActiveDesigner or + /// Designers. + #region Implementation of IDesignerEventService + + public DesignerCollection Designers + { + get + { + return new DesignerCollection(new IDesignerHost[] { this }); + } + } + + public event System.ComponentModel.Design.DesignerEventHandler DesignerDisposed; + + public IDesignerHost ActiveDesigner + { + get + { + return this; + } + } + + public event System.ComponentModel.Design.DesignerEventHandler DesignerCreated; + + public event System.ComponentModel.Design.ActiveDesignerEventHandler ActiveDesignerChanged; + + public event System.EventHandler SelectionChanged; + + #endregion + + //public void ChangeSelectionExecute(object sender, EventArgs e) + //{ + // throw new Exception(); + // + //} + + // START OF ADD TO SampleDesignerHost + + private IDesignerSerializationService serializationService; // service de serialisation + + // +Add for the copy function + internal void WriteComponentCollection(System.Xml.XmlDocument document, IList list, System.Xml.XmlNode parent) + { + ((SampleDesignerLoader)designerLoader).WriteComponentCollection(document, list, parent); + } + + internal ICollection CreateComponents(System.Xml.XmlDocument xSource, ArrayList errors) + { + return ((SampleDesignerLoader)designerLoader).CreateComponents(xSource, errors); + } + // -Add for the copy function + // END OF ADD TO SampleDesignerHost + + public void HideCombo() + { + currentComponentsCombo.Visible = false; + currentComponentsCombo.Parent = null; + //savedComponentItems = VisualPascalABC.Form1.Form1_object.PropertiesWindow.componentItems; + //savedItemsComponent = VisualPascalABC.Form1.Form1_object.PropertiesWindow.itemsComponent; + //NETXP.Controls.ComboBoxExItemCollection c = VisualPascalABC.Form1.Form1_object.PropertiesWindow.GetItemsControls(); + //savedAllComponents = new NETXP.Controls.ComboBoxExItem[c.Count]; + //if (c.Count > 0) + //{ + // c.CopyTo(savedAllComponents, 0); + //} + } + + public void ShowCombo() + { + Panel p = VisualPascalABC.Form1.Form1_object.PropertiesWindow.GetComponentsComboPanel(); + currentComponentsCombo.Parent = p; + currentComponentsCombo.Visible = true; + //VisualPascalABC.Form1.Form1_object.PropertiesWindow.componentItems = savedComponentItems; + //VisualPascalABC.Form1.Form1_object.PropertiesWindow.itemsComponent = savedItemsComponent; + //NETXP.Controls.ComboBoxExItemCollection c = VisualPascalABC.Form1.Form1_object.PropertiesWindow.GetItemsControls(); + //c.Clear(); + //c.AddRange(savedAllComponents); + } + + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignerLoader.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignerLoader.cs new file mode 100644 index 000000000..e2d2639b3 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignerLoader.cs @@ -0,0 +1,1537 @@ +///------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.ComponentModel.Design.Serialization; + using System.Collections; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Reflection; + using System.Runtime.Serialization.Formatters.Binary; + using System.Text; + using System.Windows.Forms; + using System.Xml; + using System.CodeDom.Compiler; + using System.CodeDom; + using Microsoft.CSharp; + using Microsoft.VisualBasic; + using SampleDesignerApplication; + using System.Resources; + + /// This is a designer loader that is based on XML. We use reflection + /// to write out values into an XML document. The techniques used in this + /// designer loader to discover, via reflection, the properties and + /// objects that need to be saved or loaded can be applied to any + /// persistence format. + /// + /// The XML format we use here is not terribly user-friendly, but + /// is fairly straightforward. It handles the vast majority of + /// persistence requirements including collections, instance descriptors, + /// and binary data. + /// + /// In addition to maintaining the buffer in the form of an XmlDocument, + /// we also maintain it in a CodeCompileUnit. We use this DOM to generate + /// C# and VB code, as well as to compile the buffer into an executable. + public delegate void ModifyDelegate(); + + public class SampleDesignerLoader : DesignerLoader + { + private bool _dirty; + public bool dirty + { + get + { + return _dirty; + } + set + { + _dirty = value; + if (value && modify != null) modify(); + } + } + + public ModifyDelegate modify; + private bool unsaved; + private string fileName; + private string executable; + internal IDesignerLoaderHost host; + private XmlDocument xmlDocument; + private CodeCompileUnit codeCompileUnit; + private Process run; + + private static readonly Attribute[] propertyAttributes = new Attribute[] + { + DesignOnlyAttribute.No + }; + + /// Empty constructor simply creates a new form. + public SampleDesignerLoader() + { + } + + /// This constructor takes a file name. This file + /// should exist on disk and consist of XML that + /// can be read by a data set. + public SampleDesignerLoader(string fileName) + { + if (fileName == null) + { + throw new ArgumentNullException("fileName"); + } + this.fileName = fileName; + } + + // Called by the host when we load a document. + public override void BeginLoad(IDesignerLoaderHost host) + { + if (host == null) + { + throw new ArgumentNullException("SampleDesignerLoader.BeginLoad: Invalid designerLoaderHost."); + } + + this.host = host; + + // The loader will put error messages in here. + // + ArrayList errors = new ArrayList(); + bool successful = true; + string baseClassName; + + // The loader is responsible for providing certain services to the host. + // + host.AddService(typeof(IDesignerSerializationManager), new SampleDesignerSerializationManager(this)); + host.AddService(typeof(IEventBindingService), new SampleEventBindingService(host)); + host.AddService(typeof(ITypeResolutionService), new SampleTypeResolutionService()); + host.AddService(typeof(CodeDomProvider), new CSharpCodeProvider()); + host.AddService(typeof(IResourceService), new SampleResourceService(host)); + + // If no filename was passed in, just create a form and be done with it. If a file name + // was passed, read it. + // + if (fileName == null) + { + baseClassName = host.CreateComponent(typeof(System.Windows.Forms.Form)).Site.Name; + } + else + { + baseClassName = ReadFile(fileName, errors, out xmlDocument); + } + + // Now that we are done with the load work, we need to begin to listen to events. + // Listening to event notifications is how a designer "Loader" can also be used + // to save data. If we wanted to integrate this loader with source code control, + // we would listen to the "ing" events as well as the "ed" events. + // + IComponentChangeService cs = host.GetService(typeof(IComponentChangeService)) as IComponentChangeService; + if (cs != null) + { + cs.ComponentChanged += new ComponentChangedEventHandler(OnComponentChanged); + cs.ComponentAdded += new ComponentEventHandler(OnComponentAddedRemoved); + cs.ComponentRemoved += new ComponentEventHandler(OnComponentAddedRemoved); + } + + // Let the host know we are done loading. + host.EndLoad(baseClassName, successful, errors); + + // We've just loaded a document, so you can bet we need to flush changes. + dirty = true; + unsaved = false; + } + + public override void Dispose() + { + // Always remove attached event handlers in Dispose. + IComponentChangeService cs = host.GetService(typeof(IComponentChangeService)) as IComponentChangeService; + if (cs != null) + { + cs.ComponentChanged -= new ComponentChangedEventHandler(OnComponentChanged); + cs.ComponentAdded -= new ComponentEventHandler(OnComponentAddedRemoved); + cs.ComponentRemoved -= new ComponentEventHandler(OnComponentAddedRemoved); + } + } + + /// This method is called by the designer host whenever it wants the + /// designer loader to flush any pending changes. Flushing changes + /// does not mean the same thing as saving to disk. For example, + /// In Visual Studio, flushing changes causes new code to be generated + /// and inserted into the text editing window. The user can edit + /// the new code in the editing window, but nothing has been saved + /// to disk. This sample adheres to this separation between flushing + /// and saving, since a flush occurs whenever the code windows are + /// displayed or there is a build. Neither of those items demands a save. + public override void Flush() + { + // Nothing to flush if nothing has changed. + if (!dirty) + { + return; + } + + // We use an XmlDocument to build up the XML for + // the designer. Here is a sample XML chunk: + // + XmlDocument document = new XmlDocument(); + + // This element will serve as the undisputed DocumentElement (root) + // of our document. This allows us to have objects of equal level below, + // which we need, since component tray items are not children of the form. + // + document.AppendChild(document.CreateElement("DOCUMENT_ELEMENT")); + + // We start with the root component and then continue + // to all the rest of the components. The nametable + // object we create keeps track of which objects we have + // seen. As we write out an object's contents, we save + // it in the nametable, so we don't write out an object + // twice. + // + IComponent root = host.RootComponent; + Hashtable nametable = new Hashtable(host.Container.Components.Count); + + resources_file_name = Path.GetDirectoryName(full_file_name) + '\\' + Path.GetFileNameWithoutExtension(file_name) + '.' + root.Site.Name + ".resources"; + resources_not_empty = false; + + current_component = root; + document.DocumentElement.AppendChild(WriteObject(document, nametable, root)); + + foreach(IComponent comp in host.Container.Components) + { + if (comp != root && !nametable.ContainsKey(comp)) + { + current_component = comp; + document.DocumentElement.AppendChild(WriteObject(document, nametable, comp)); + } + } + + FinishResources(); + + // Along with the XML, we also represent the designer in a CodeCompileUnit, + // which we can use to generate C# and VB, and which we can compile from. + // + CodeCompileUnit code = new CodeCompileUnit(); + + // Our dummy namespace is the name of our main form + "Namespace". Creative, eh? + CodeNamespace ns = new CodeNamespace(root.Site.Name + "Namespace"); + ns.Imports.Add(new CodeNamespaceImport("System")); + + // We need to look at our type resolution service to find out what references + // to import. + // + SampleTypeResolutionService strs = host.GetService(typeof(ITypeResolutionService)) as SampleTypeResolutionService; + foreach (Assembly assm in strs.RefencedAssemblies) + { + ns.Imports.Add(new CodeNamespaceImport(assm.GetName().Name)); + } + + //ssyy + host.RemoveService(typeof(IDesignerSerializationManager)); + host.AddService(typeof(IDesignerSerializationManager), new SampleDesignerSerializationManager(this)); + + // Autogenerates member declaration and InitializeComponent() + // in a new CodeTypeDeclaration + // + RootDesignerSerializerAttribute a = TypeDescriptor.GetAttributes(root)[typeof(RootDesignerSerializerAttribute)] as RootDesignerSerializerAttribute; + Type t = host.GetType(a.SerializerTypeName); + CodeDomSerializer cds = Activator.CreateInstance(t) as CodeDomSerializer; + IDesignerSerializationManager manager = host.GetService(typeof(IDesignerSerializationManager)) as IDesignerSerializationManager; + CodeTypeDeclaration td = cds.Serialize(manager, root) as CodeTypeDeclaration; + + // We need a constructor that will call the InitializeComponent() + // that we just generated. + // + CodeConstructor con = new CodeConstructor(); + con.Attributes = MemberAttributes.Public; + con.Statements.Add(new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), "InitializeComponent"))); + td.Members.Add(con); + + // Finally our Main method, where the magic begins. + CodeEntryPointMethod main = new CodeEntryPointMethod(); + main.Name = "Main"; + main.Attributes = MemberAttributes.Public | MemberAttributes.Static; + main.CustomAttributes.Add(new CodeAttributeDeclaration("System.STAThreadAttribute")); + main.Statements.Add(new CodeMethodInvokeExpression(new CodeMethodReferenceExpression( + new CodeTypeReferenceExpression( + typeof(System.Windows.Forms.Application)), "Run"), + new CodeExpression[] { + new CodeObjectCreateExpression(new CodeTypeReference(root.Site.Name)) + })); + td.Members.Add(main); + + + ns.Types.Add(td); + code.Namespaces.Add(ns); + + // Now we reset our dirty bit and set the member + // variables. + dirty = false; + xmlDocument = document; + codeCompileUnit = code; + + // Now we update the code windows to show what new stuff we've learned. + UpdateCodeWindows(); + resources_not_empty = false; + } + + public string file_name; + public string full_file_name; + public string form_name; + public string resources_file_name; + public bool resources_not_empty = false; + private ResourceWriter resource_writer = null; + private IComponent current_component = null; + private PropertyDescriptor current_property = null; + + /// This method writes out the contents of our designer in C#, VB, and XML. + /// For the first two, it generates code from our codeCompileUnit. For the XML, + /// it writes out the contents of xmlDocument. + private void UpdateCodeWindows() + { + // The main form's TabControl was added to the host's lists of services + // just so we could get at it here. Fortunately for us, each tab page + // has but one Control--a textbox. + // + + CodeStrings codes = host.GetService(typeof(CodeStrings)) as CodeStrings; + //TabControl tc = host.GetService(typeof(TabControl)) as TabControl; + //TextBox csWindow = tc.TabPages[1].Controls[0] as TextBox; + //TextBox vbWindow = tc.TabPages[2].Controls[0] as TextBox; + //TextBox xmlWindow = tc.TabPages[3].Controls[0] as TextBox; + + // The string writer we'll generate code to. + StringWriter sw; + + // The options for our code generation. + CodeGeneratorOptions o = new CodeGeneratorOptions(); + o.BlankLinesBetweenMembers = false; + o.BracingStyle = "C"; + o.ElseOnClosing = false; + o.IndentString = " "; + + // CSharp Code Generation + //sw = new StringWriter(); + //CSharpCodeProvider cs = new CSharpCodeProvider(); + //cs.CreateGenerator().GenerateCodeFromCompileUnit(codeCompileUnit, sw, o); + //csWindow.Text = sw.ToString(); + //sw.Close(); + + // PABC Code Generation + sw = new StringWriter(); + if (resources_not_empty) + { + sw.WriteLine("{$resource " + Path.GetFileName(resources_file_name) + '}'); + sw.Write(" "); + } + //VBCodeProvider vb = new VBCodeProvider(); + //vb.CreateGenerator().GenerateCodeFromCompileUnit(codeCompileUnit, sw, o); + ICodeGenerator abc = new PABCCodeGenerator(); + //sw.Write(string.Format(string_consts.begin_unit, file_name, form_name)); + abc.GenerateCodeFromCompileUnit(codeCompileUnit, sw, o); + //sw.Write(string_consts.end_unit); + + codes.PascalABCCode = sw.ToString(); + sw.Close(); + + // XML Output + sw = new StringWriter(); + XmlTextWriter xtw = new XmlTextWriter(sw); + xtw.Formatting = Formatting.Indented; + xmlDocument.WriteTo(xtw); + + // Get rid of our artificial super-root before we display the XML. + // + string cleanup = sw.ToString().Replace("", ""); + cleanup = cleanup.Replace("", ""); + //xmlWindow.Text = cleanup; + codes.XMLCode = cleanup; + sw.Close(); + } + + /// Simple helper method that returns true if the given type converter supports + /// two-way conversion of the given type. + private bool GetConversionSupported(TypeConverter converter, Type conversionType) + { + return (converter.CanConvertFrom(conversionType) && converter.CanConvertTo(conversionType)); + } + + // As soon as things change, we're dirty, so Flush()ing will give us a new + // xmlDocument and codeCompileUnit. + private void OnComponentChanged(object sender, ComponentChangedEventArgs ce) + { + dirty = true; + unsaved = true; + } + + private void OnComponentAddedRemoved(object sender, ComponentEventArgs ce) + { + dirty = true; + unsaved = true; + } + + /// This method prompts the user to see if it is OK to dispose this document. + /// The prompt only happens if the user has made changes. + internal bool PromptDispose() + { + if (dirty || unsaved) + { + switch(MessageBox.Show("Save changes to existing designer?", "Unsaved Changes", MessageBoxButtons.YesNoCancel)) + { + case DialogResult.Yes: + Save(false); + break; + case DialogResult.Cancel: + return false; + } + } + return true; + } + + /// Reads an Event node and binds the event. + private void ReadEvent(XmlNode childNode, object instance, ArrayList errors) + { + IEventBindingService bindings = host.GetService(typeof(IEventBindingService)) as IEventBindingService; + if (bindings == null) + { + errors.Add("Unable to contact event binding service so we can't bind any events"); + return; + } + + XmlAttribute nameAttr = childNode.Attributes["name"]; + if (nameAttr == null) + { + errors.Add("No event name"); + return; + } + + XmlAttribute methodAttr = childNode.Attributes["method"]; + if (methodAttr == null || methodAttr.Value == null || methodAttr.Value.Length == 0) + { + errors.Add(string.Format("Event {0} has no method bound to it")); + return; + } + + EventDescriptor evt = TypeDescriptor.GetEvents(instance)[nameAttr.Value]; + if (evt == null) + { + errors.Add(string.Format("Event {0} does not exist on {1}", nameAttr.Value, instance.GetType().FullName)); + return; + } + + PropertyDescriptor prop = bindings.GetEventProperty(evt); + Debug.Assert(prop != null, "Bad event binding service"); + + try + { + prop.SetValue(instance, methodAttr.Value); + } + catch(Exception ex) + { + errors.Add(ex.Message); + } + } + + /// This method is used to parse the given file. Before calling this + /// method the host member variable must be setup. This method will + /// create a data set, read the data set from the XML stored in the + /// file, and then walk through the data set and create components + /// stored within it. The data set is stored in the persistedData + /// member variable upon return. + /// + /// This method never throws exceptions. It will set the successful + /// ref parameter to false when there are catastrophic errors it can't + /// resolve (like being unable to parse the XML). All error exceptions + /// are added to the errors array list, including minor errors. + private string ReadFile(string fileName, ArrayList errors, out XmlDocument document) + { + string baseClass = null; + + // Anything unexpected is a fatal error. + // + try + { + // The main form and items in the component tray will be at the + // same level, so we have to create a higher super-root in order + // to construct our XmlDocument. + // + StreamReader sr = new StreamReader(fileName); + string cleandown = sr.ReadToEnd(); + cleandown = "" + cleandown + ""; + XmlDocument doc = new XmlDocument(); + doc.LoadXml(cleandown); + + // Now, walk through the document's elements. + // + foreach(XmlNode node in doc.DocumentElement.ChildNodes) + { + if (baseClass == null) + { + baseClass = node.Attributes["name"].Value; + } + if (node.Name.Equals("Object")) + { + ReadObject(node, errors); + } + else + { + errors.Add(string.Format("Node type {0} is not allowed here.", node.Name)); + } + } + + document = doc; + } + catch(Exception ex) + { + document = null; + errors.Add(ex); + } + + return baseClass; + } + + private object ReadInstanceDescriptor(XmlNode node, ArrayList errors) + { + // First, need to deserialize the member + // + XmlAttribute memberAttr = node.Attributes["member"]; + if (memberAttr == null) + { + errors.Add("No member attribute on instance descriptor"); + return null; + } + + byte[] data = Convert.FromBase64String(memberAttr.Value); + BinaryFormatter formatter = new BinaryFormatter(); + MemoryStream stream = new MemoryStream(data); + MemberInfo mi = (MemberInfo)formatter.Deserialize(stream); + object[] args = null; + + // Check to see if this member needs arguments. If so, gather + // them from the XML. + if (mi is MethodBase) + { + ParameterInfo[] paramInfos = ((MethodBase)mi).GetParameters(); + args = new object[paramInfos.Length]; + int idx = 0; + + foreach(XmlNode child in node.ChildNodes) + { + if (child.Name.Equals("Argument")) + { + object value; + if (!ReadValue(child, TypeDescriptor.GetConverter(paramInfos[idx].ParameterType), errors, out value)) + { + return null; + } + + args[idx++] = value; + } + } + + if (idx != paramInfos.Length) + { + errors.Add(string.Format("Member {0} requires {1} arguments, not {2}.", mi.Name, args.Length, idx)); + return null; + } + } + + InstanceDescriptor id = new InstanceDescriptor(mi, args); + object instance = id.Invoke(); + + // Ok, we have our object. Now, check to see if there are any properties, and if there are, + // set them. + // + foreach(XmlNode prop in node.ChildNodes) + { + if (prop.Name.Equals("Property")) + { + ReadProperty(prop, instance, errors); + } + } + + return instance; + } + + /// Reads the "Object" tags. This returns an instance of the + /// newly created object. Returns null if there was an error. + private object ReadObject(XmlNode node, ArrayList errors) + { + XmlAttribute typeAttr = node.Attributes["type"]; + if (typeAttr == null) + { + errors.Add(" tag is missing required type attribute"); + return null; + } + + Type type = Type.GetType(typeAttr.Value); + if (type == null) + { + errors.Add(string.Format("Type {0} could not be loaded.", typeAttr.Value)); + return null; + } + + // This can be null if there is no name for the object. + // + XmlAttribute nameAttr = node.Attributes["name"]; + + object instance; + + if (typeof(IComponent).IsAssignableFrom(type)) + { + if (nameAttr == null) + { + instance = host.CreateComponent(type); + } + else + { + instance = host.CreateComponent(type, nameAttr.Value); + } + } + else + { + instance = Activator.CreateInstance(type); + } + + // Got an object, now we must process it. Check to see if this tag + // offers a child collection for us to add children to. + // + XmlAttribute childAttr = node.Attributes["children"]; + IList childList = null; + if (childAttr != null) + { + PropertyDescriptor childProp = TypeDescriptor.GetProperties(instance)[childAttr.Value]; + if (childProp == null) + { + errors.Add(string.Format("The children attribute lists {0} as the child collection but this is not a property on {1}", childAttr.Value, instance.GetType().FullName)); + } + else + { + childList = childProp.GetValue(instance) as IList; + if (childList == null) + { + errors.Add(string.Format("The property {0} was found but did not return a valid IList", childProp.Name)); + } + } + } + + // Now, walk the rest of the tags under this element. + // + foreach(XmlNode childNode in node.ChildNodes) + { + if (childNode.Name.Equals("Object")) + { + // Another object. In this case, create the object, and + // parent it to ours using the children property. If there + // is no children property, bail out now. + if (childAttr == null) + { + errors.Add("Child object found but there is no children attribute"); + continue; + } + + // no sense doing this if there was an error getting the property. We've already reported the + // error above. + if (childList != null) + { + object childInstance = ReadObject(childNode, errors); + childList.Add(childInstance); + } + } + else if (childNode.Name.Equals("Property")) + { + // A property. Ask the property to parse itself. + // + ReadProperty(childNode, instance, errors); + } + else if (childNode.Name.Equals("Event")) + { + // An event. Ask the event to parse itself. + // + ReadEvent(childNode, instance, errors); + } + } + return instance; + } + + /// Parses the given XML node and sets the resulting property value. + private void ReadProperty(XmlNode node, object instance, ArrayList errors) + { + XmlAttribute nameAttr = node.Attributes["name"]; + if (nameAttr == null) + { + errors.Add("Property has no name"); + return; + } + + PropertyDescriptor prop = TypeDescriptor.GetProperties(instance)[nameAttr.Value]; + if (prop == null) + { + errors.Add(string.Format("Property {0} does not exist on {1}", nameAttr.Value, instance.GetType().FullName)); + return; + } + + // Get the type of this property. We have three options: + // 1. A normal read/write property. + // 2. A "Content" property. + // 3. A collection. + // + bool isContent = prop.Attributes.Contains(DesignerSerializationVisibilityAttribute.Content); + + if (isContent) + { + object value = prop.GetValue(instance); + + // Handle the case of a content property that is a collection. + // + if (value is IList) + { + foreach(XmlNode child in node.ChildNodes) + { + if (child.Name.Equals("Item")) + { + object item; + XmlAttribute typeAttr = child.Attributes["type"]; + if (typeAttr == null) + { + errors.Add("Item has no type attribute"); + continue; + } + + Type type = Type.GetType(typeAttr.Value); + if (type == null) + { + errors.Add(string.Format("Item type {0} could not be found.", typeAttr.Value)); + continue; + } + + if (ReadValue(child, TypeDescriptor.GetConverter(type), errors, out item)) + { + try + { + ((IList)value).Add(item); + } + catch(Exception ex) + { + errors.Add(ex.Message); + } + } + } + else + { + errors.Add(string.Format("Only Item elements are allowed in collections, not {0} elements.", child.Name)); + } + } + } + else + { + // Handle the case of a content property that consists of child properties. + // + foreach(XmlNode child in node.ChildNodes) + { + if (child.Name.Equals("Property")) + { + ReadProperty(child, value, errors); + } + else + { + errors.Add(string.Format("Only Property elements are allowed in content properties, not {0} elements.", child.Name)); + } + } + } + } + else + { + object value; + if (ReadValue(node, prop.Converter, errors, out value)) + { + // ReadValue succeeded. Fill in the property value. + // + try + { + prop.SetValue(instance, value); + } + catch(Exception ex) + { + errors.Add(ex.Message); + } + } + } + } + + /// Generic function to read an object value. Returns true if the read + /// succeeded. + private bool ReadValue(XmlNode node, TypeConverter converter, ArrayList errors, out object value) + { + try + { + foreach(XmlNode child in node.ChildNodes) + { + if (child.NodeType == XmlNodeType.Text) + { + value = converter.ConvertFromInvariantString(node.InnerText); + return true; + } + else if (child.Name.Equals("Binary")) + { + byte[] data = Convert.FromBase64String(child.InnerText); + + // Binary blob. Now, check to see if the type converter + // can convert it. If not, use serialization. + // + if (GetConversionSupported(converter, typeof(byte[]))) + { + value = converter.ConvertFrom(null, CultureInfo.InvariantCulture, data); + return true; + } + else + { + BinaryFormatter formatter = new BinaryFormatter(); + MemoryStream stream = new MemoryStream(data); + value = formatter.Deserialize(stream); + return true; + } + } + else if (child.Name.Equals("InstanceDescriptor")) + { + value = ReadInstanceDescriptor(child, errors); + return (value != null); + } + else + { + errors.Add(string.Format("Unexpected element type {0}", child.Name)); + value = null; + return false; + } + } + + // If we get here, it is because there were no nodes. No nodes and no inner + // text is how we signify null. + // + value = null; + return true; + } + catch(Exception ex) + { + errors.Add(ex.Message); + value = null; + return false; + } + } + + /// This method writes a given byte[] into the XML document, returning the node that + /// it just created. Byte arrays have the following XML: + /// + /// + /// + /// 64 bit encoded string representing binary data + /// + /// + private XmlNode WriteBinary(XmlDocument document, byte[] value) + { + XmlNode node = document.CreateElement("Binary"); + node.InnerText = Convert.ToBase64String(value); + return node; + } + + /// Writes the given IList contents into the given parent node. + private void WriteCollection(XmlDocument document, IList list, XmlNode parent) + { + foreach(object obj in list) + { + XmlNode node = document.CreateElement("Item"); + XmlAttribute typeAttr = document.CreateAttribute("type"); + typeAttr.Value = obj.GetType().AssemblyQualifiedName; + node.Attributes.Append(typeAttr); + WriteValue(document, obj, node); + parent.AppendChild(node); + } + } + + /// This method writes a given instance descriptor into the XML document, returning a node + /// that it just created. Instance descriptors have the following XML: + /// + /// + /// + /// + /// // param value + /// + /// + /// + /// + /// Here, member is a 64 bit encoded string representing the member, and there is one Parameter + /// tag for each parameter of the descriptor. + private XmlNode WriteInstanceDescriptor(XmlDocument document, InstanceDescriptor desc, object value) + { + XmlNode node = document.CreateElement("InstanceDescriptor"); + BinaryFormatter formatter = new BinaryFormatter(); + MemoryStream stream = new MemoryStream(); + formatter.Serialize(stream, desc.MemberInfo); + XmlAttribute memberAttr = document.CreateAttribute("member"); + memberAttr.Value = Convert.ToBase64String(stream.ToArray()); + node.Attributes.Append(memberAttr); + + foreach(object arg in desc.Arguments) + { + XmlNode argNode = document.CreateElement("Argument"); + if (WriteValue(document, arg, argNode)) + { + node.AppendChild(argNode); + } + } + + // Instance descriptors also support "partial" creation, where + // properties must also be persisted. + // + if (!desc.IsComplete) + { + PropertyDescriptorCollection props = TypeDescriptor.GetProperties(value, propertyAttributes); + WriteProperties(document, props, value, node, "Property"); + } + + return node; + } + + /// This method writes the given object out to the XML document. Objects have + /// the following XML: + /// + /// + /// + /// + /// + /// + /// + /// Here, Object is the element that defines a custom object. Type is required + /// and specifies the data type of the object. Name is optional. If present, it names + /// this object, adding it to the container if the object is an IComponent. + /// Finally, the children attribute is optional. If present, this object can have + /// nested objects, and those objects will be added to the given property name. The + /// property must be a collection property that returns an object that implements IList. + /// + /// Inside the object tag there can be zero or more of the following subtags: + /// + /// InstanceDescriptor -- describes how to create an instance of the object. + /// Property -- a property set on the object + /// Event -- an event binding + /// Binary -- binary data + private XmlNode WriteObject(XmlDocument document, IDictionary nametable, object value) + { + Debug.Assert(value != null, "Should not invoke WriteObject with a null value"); + + XmlNode node = document.CreateElement("Object"); + + XmlAttribute typeAttr = document.CreateAttribute("type"); + typeAttr.Value = value.GetType().AssemblyQualifiedName; + node.Attributes.Append(typeAttr); + + // Does this object have a name? + // + IComponent component = value as IComponent; + if (component != null && component.Site != null && component.Site.Name != null) + { + XmlAttribute nameAttr = document.CreateAttribute("name"); + nameAttr.Value = component.Site.Name; + node.Attributes.Append(nameAttr); + Debug.Assert(nametable[component] == null, "WriteObject should not be called more than once for the same object. Use WriteReference instead"); + nametable[value] = component.Site.Name; + } + + // Special case: We want Windows Forms controls to "nest", so child + // elements are child controls on the form. This requires either an + // extensible serialization mechanism (like the existing CodeDom + // serialization scheme), or it requires special casing in the + // serialization code. We choose the latter in order to make + // this example easier to understand. + // + bool isControl = (value is Control); + + if (isControl) + { + XmlAttribute childAttr = document.CreateAttribute("children"); + childAttr.Value = "Controls"; + node.Attributes.Append(childAttr); + } + + if (component != null) + { + // We have a component. Write out the definition for the component here. If the + // component is also a control, recurse so we build up the parent hierarchy. + // + if (isControl) + { + IComponent tmp_component = current_component; + foreach(Control child in ((Control)value).Controls) + { + if (child.Site != null && child.Site.Container == host.Container) + { + current_component = child; + node.AppendChild(WriteObject(document, nametable, child)); + } + } + current_component = tmp_component; + } + + // Now do our own properties. + // + PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value, propertyAttributes); + + if (isControl) + { + // If we are a control and we can locate the control property, we should remove + // the property from the collection. The collection that comes back from TypeDescriptor + // is read-only, however, so we must clone it first. + // + PropertyDescriptor controlProp = properties["Controls"]; + if (controlProp != null) + { + PropertyDescriptor[] propArray = new PropertyDescriptor[properties.Count - 1]; + int idx = 0; + foreach(PropertyDescriptor p in properties) + { + if (p != controlProp) + { + propArray[idx++] = p; + } + } + + properties = new PropertyDescriptorCollection(propArray); + } + } + + WriteProperties(document, properties, value, node, "Property"); + + EventDescriptorCollection events = TypeDescriptor.GetEvents(value, propertyAttributes); + IEventBindingService bindings = host.GetService(typeof(IEventBindingService)) as IEventBindingService; + if (bindings != null) + { + properties = bindings.GetEventProperties(events); + WriteProperties(document, properties, value, node, "Event"); + } + } + else + { + // Not a component, so we just write out the value. + // + WriteValue(document, value, node); + } + + return node; + } + + /// This method writes zero or more property elements into the given parent node. + private void WriteProperties(XmlDocument document, PropertyDescriptorCollection properties, object value, XmlNode parent, string elementName) + { + PropertyDescriptor tmp_property = current_property; + foreach(PropertyDescriptor prop in properties) + { + current_property = prop; + if (prop.Name == "AutoScaleBaseSize") + { + string _DEBUG_ = prop.Name; + } + + if (prop.ShouldSerializeValue(value)) + { + XmlNode node = document.CreateElement(elementName); + XmlAttribute attr = document.CreateAttribute("name"); + attr.Value = prop.Name; + node.Attributes.Append(attr); + + DesignerSerializationVisibilityAttribute visibility = (DesignerSerializationVisibilityAttribute)prop.Attributes[typeof(DesignerSerializationVisibilityAttribute)]; + switch(visibility.Visibility) + { + case DesignerSerializationVisibility.Visible: + if (!prop.IsReadOnly && WriteValue(document, prop.GetValue(value), node)) + { + PropertyDescriptor tmp_prop = current_property; + current_property = prop; + parent.AppendChild(node); + current_property = tmp_prop; + } + break; + + case DesignerSerializationVisibility.Content: + // A "Content" property needs to have its properties stored here, not the actual value. We + // do another special case here to account for collections. Collections are content properties + // that implement IList and are read-only. + // + object propValue = prop.GetValue(value); + + if (typeof(IList).IsAssignableFrom(prop.PropertyType)) + { + WriteCollection(document, (IList)propValue, node); + } + else + { + PropertyDescriptorCollection props = TypeDescriptor.GetProperties(propValue, propertyAttributes); + WriteProperties(document, props, propValue, node, elementName); + } + if (node.ChildNodes.Count > 0) + { + parent.AppendChild(node); + } + break; + + default: + break; + } + } + } + current_property = tmp_property; + } + + /// Writes a reference to the given component. Emits the following + /// XML: + /// + /// + /// + /// + private XmlNode WriteReference(XmlDocument document, IComponent value) + { + Debug.Assert(value != null && value.Site != null && value.Site.Container == host.Container, "Invalid component passed to WriteReference"); + + XmlNode node = document.CreateElement("Reference"); + XmlAttribute attr = document.CreateAttribute("name"); + attr.Value = value.Site.Name; + node.Attributes.Append(attr); + return node; + } + + /// This method writes the given object into the given parent node. It returns + /// true if it was successful, or false if it was unable to convert the object + /// to XML. + private bool WriteValue(XmlDocument document, object value, XmlNode parent) + { + // For empty values, we just return. This creates an empty node. + if (value == null) + { + return true; + } + + TypeConverter converter = TypeDescriptor.GetConverter(value); + + if (GetConversionSupported(converter, typeof(string))) + { + // Strings have the most fidelity. If this object + // supports being converted to a string, do so, and then + // we're done. + // + parent.InnerText = (string)converter.ConvertTo(null, CultureInfo.InvariantCulture, value, typeof(string)); + } + else if (GetConversionSupported(converter, typeof(byte[]))) + { + if (value.GetType().IsSerializable) + { + WriteToResources(value); + } + // Binary blobs are converted by encoding as a binary element. + // + byte[] data = (byte[])converter.ConvertTo(null, CultureInfo.InvariantCulture, value, typeof(byte[])); + parent.AppendChild(WriteBinary(document, data)); + } + else if (GetConversionSupported(converter, typeof(InstanceDescriptor))) + { + // InstanceDescriptors are encoded as an InstanceDescriptor element. + // + InstanceDescriptor id = (InstanceDescriptor)converter.ConvertTo(null, CultureInfo.InvariantCulture, value, typeof(InstanceDescriptor)); + parent.AppendChild(WriteInstanceDescriptor(document, id, value)); + } + else if (value is IComponent && ((IComponent)value).Site != null && ((IComponent)value).Site.Container == host.Container) + { + // IComponent. Treat this as a reference. + // + parent.AppendChild(WriteReference(document, (IComponent)value)); + } + else if (value.GetType().IsSerializable) + { + // Finally, check to see if this object is serializable. If it is, we serialize it here + // and then write it as a binary. + // + WriteToResources(value); + BinaryFormatter formatter = new BinaryFormatter(); + MemoryStream stream = new MemoryStream(); + formatter.Serialize(stream, value); + XmlNode binaryNode = WriteBinary(document, stream.ToArray()); + parent.AppendChild(binaryNode); + } + else + { + return false; + } + return true; + } + + public object GetService(Type serviceType) + { + return host.GetService(serviceType); + } + + public IDesignerLoaderHost LoaderHost + { + get + { + return host as IDesignerLoaderHost; + } + } + + /// Save the current state of the loader. If the user loaded the file + /// or saved once before, then he doesn't need to select a file again. + /// Unless this is being called as a result of "Save As..." being clicked, + /// in which case forceFilePrompt will be true. + internal void Save(bool forceFilePrompt) + { + try + { + if (dirty) + { + // Flush any changes to the buffer. + Flush(); + } + + + // If the buffer has no name or this is a "Save As...", + // prompt the user for a file name. The user can save + // either the C#, VB, or XML (though only the XML can be loaded). + // + int filterIndex = 3; + if ((fileName == null) || forceFilePrompt) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.DefaultExt = "xml"; + dlg.Filter = "Python Files|*.py|C# Files|*.cs|Visual Basic Files|*.vb|XML Files|*.xml"; + + if (dlg.ShowDialog() == DialogResult.OK) + { + fileName = dlg.FileName; + filterIndex = dlg.FilterIndex; + } + } + + if (fileName != null) + { + switch (filterIndex) + { + case 1: + { + // Generate C# code from our codeCompileUnit and save it. + CodeGeneratorOptions o = new CodeGeneratorOptions(); + o.BlankLinesBetweenMembers = true; + o.BracingStyle = "C"; + o.ElseOnClosing = false; + o.IndentString = " "; + StreamWriter sw = new StreamWriter(fileName); + CSharpCodeProvider cs = new CSharpCodeProvider(); + cs.CreateGenerator().GenerateCodeFromCompileUnit(codeCompileUnit, sw, o); + sw.Close(); + } break; + case 2: + { + // Generate VB code from our codeCompileUnit and save it. + CodeGeneratorOptions o = new CodeGeneratorOptions(); + o.BlankLinesBetweenMembers = true; + o.BracingStyle = "C"; + o.ElseOnClosing = false; + o.IndentString = " "; + StreamWriter sw = new StreamWriter(fileName); + VBCodeProvider vb = new VBCodeProvider(); + vb.CreateGenerator().GenerateCodeFromCompileUnit(codeCompileUnit, sw, o); + sw.Close(); + } break; + case 3: + { + // Write out our xmlDocument to a file. + StringWriter sw = new StringWriter(); + XmlTextWriter xtw = new XmlTextWriter(sw); + xtw.Formatting = Formatting.Indented; + xmlDocument.WriteTo(xtw); + + // Get rid of our artificial super-root before we save out + // the XML. + // + string cleanup = sw.ToString().Replace("", ""); + cleanup = cleanup.Replace("", ""); + xtw.Close(); + StreamWriter file = new StreamWriter(fileName); + file.Write(cleanup); + file.Close(); + } break; + } + unsaved = false; + } + } + catch(Exception ex) + { + MessageBox.Show("Error during save: " + ex.Message); + } + } + + /// Called when we want to build an executable. Returns true if we succeeded. + internal bool Build() + { + if (dirty) + { + // Flush any changes made to the buffer. + Flush(); + } + + // If we haven't already chosen a spot to write the executable to, + // do so now. + // + if (executable == null) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.DefaultExt = "exe"; + dlg.Filter = "Executables|*.exe"; + + if (dlg.ShowDialog() == DialogResult.OK) + { + executable = dlg.FileName; + } + } + + if (executable != null) + { + // We'll need our type resolution service in order to find out what + // assemblies we're dealing with. + // + SampleTypeResolutionService strs = host.GetService(typeof(ITypeResolutionService)) as SampleTypeResolutionService; + + // We need to collect the parameters that our compiler will use. + CompilerParameters cp = new CompilerParameters(); + + // First, we tell our compiler to reference the assemblies which + // our designers have referenced (the ones which have import statements + // in our codeCompileUnit)..... + // + foreach(Assembly assm in strs.RefencedAssemblies) + { + cp.ReferencedAssemblies.Add(assm.Location); + + // .....then we have to look at each one of those assemblies, + // see which assemblies they reference, and make sure our compiler + // references those too! Phew! + // + foreach (AssemblyName refAssmName in assm.GetReferencedAssemblies()) + { + Assembly refAssm = Assembly.Load(refAssmName); + cp.ReferencedAssemblies.Add(refAssm.Location); + } + } + + cp.GenerateExecutable = true; + cp.OutputAssembly = executable; + + // Remember our main class is not Form, but Form1 (or whatever the user calls it)! + cp.MainClass = host.RootComponent.Site.Name + "Namespace." + host.RootComponent.Site.Name; + ICodeCompiler cc = new CSharpCodeProvider().CreateCompiler(); + CompilerResults cr = cc.CompileAssemblyFromDom(cp, codeCompileUnit); + if (cr.Errors.HasErrors) + { + string errors = ""; + foreach (CompilerError error in cr.Errors) + { + errors += error.ErrorText + "\n"; + } + MessageBox.Show(errors, "Errors during compile."); + } + return !cr.Errors.HasErrors; + } + + return false; + } + + // Here we build the executable and then run it. We make sure to not start + // two of the same process. + internal void Run() + { + if ((run == null) || (run.HasExited)) + { + if (Build()) + { + run = new Process(); + run.StartInfo.FileName = executable; + run.Start(); + } + } + } + + // Just in case the red X in the upper right isn't good enough, + // we can kill our process here. + internal void Stop() + { + if ((run != null) && (!run.HasExited)) + { + run.Kill(); + } + } + + // START OF ADD TO SampleDesignerLoader + + // +Add for the copy function + public void WriteComponentCollection(XmlDocument document, IList list, XmlNode parent) + { + Hashtable arr = new Hashtable(); + foreach (object obj in list) + { + XmlNode xNode = WriteObject(document, arr, obj); + document.DocumentElement.AppendChild(xNode); + } + } + + public ICollection CreateComponents(XmlDocument xSource, ArrayList errors) + { + System.Collections.ArrayList components = new ArrayList(); + string baseClass = null; + + try + { + XmlDocument doc = xSource; + + foreach (XmlNode node in doc.DocumentElement.ChildNodes) + { + if (node.Name.Equals("Object")) + { + Object obj = CreateObject(node, errors); + if (!(obj.GetType().IsSubclassOf(typeof(System.Windows.Forms.Form)))) + { + components.Add(obj); + } + } + else + { + errors.Add(string.Format("Node type {0} is not allowed here.", node.Name)); + } + } + return components; + } + catch (Exception ex) + { + errors.Add(ex); + return null; + } + } + private object CreateObject(XmlNode node, ArrayList errors) + { + XmlAttribute typeAttr = node.Attributes["type"]; + if (typeAttr == null) + { + errors.Add(" tag is missing required type attribute"); + return null; + } + + Type type = Type.GetType(typeAttr.Value); + if (type == null) + { + errors.Add(string.Format("Type {0} could not be loaded.", typeAttr.Value)); + return null; + } + + // This can be null if there is no name for the object. + // + XmlAttribute nameAttr = node.Attributes["name"]; + + object instance; + + instance = Activator.CreateInstance(type); + + // Got an object, now we must process it. Check to see if this tag + // offers a child collection for us to add children to. + // + XmlAttribute childAttr = node.Attributes["children"]; + IList childList = null; + if (childAttr != null) + { + PropertyDescriptor childProp = TypeDescriptor.GetProperties(instance)[childAttr.Value]; + if (childProp == null) + { + errors.Add(string.Format("The children attribute lists {0} as the child collection but this is not a property on {1}", childAttr.Value, instance.GetType().FullName)); + } + else + { + childList = childProp.GetValue(instance) as IList; + if (childList == null) + { + errors.Add(string.Format("The property {0} was found but did not return a valid IList", childProp.Name)); + } + } + } + + // Now, walk the rest of the tags under this element. + // + foreach (XmlNode childNode in node.ChildNodes) + { + if (childNode.Name.Equals("Object")) + { + // Another object. In this case, create the object, and + // parent it to ours using the children property. If there + // is no children property, bail out now. + if (childAttr == null) + { + errors.Add("Child object found but there is no children attribute"); + continue; + } + + // no sense doing this if there was an error getting the property. We've already reported the + // error above. + if (childList != null) + { + object childInstance = CreateObject(childNode, errors); + childList.Add(childInstance); + } + } + else if (childNode.Name.Equals("Property")) + { + // A property. Ask the property to parse itself. + // + ReadProperty(childNode, instance, errors); + } + else if (childNode.Name.Equals("Event")) + { + // An event. Ask the event to parse itself. + // + ReadEvent(childNode, instance, errors); + } + } + return instance; + } + // -Add for the copy function + + // END OF ADD TO SampleDesignerLoader + + public void WriteToResources(object data) + { + if (!resources_not_empty) + { + resource_writer = new ResourceWriter(resources_file_name); + resources_not_empty = true; + } + if (current_component == null || current_property == null) + { + return; + } + string name = current_component.Site.Name + '.' + current_property.Name; + resource_writer.AddResource(name, data); + } + + public void FinishResources() + { + if (resources_not_empty) + { + resource_writer.Generate(); + resource_writer.Close(); + resource_writer.Dispose(); + resource_writer = null; + } + } + } +} + diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignerNameAttribute.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignerNameAttribute.cs new file mode 100644 index 000000000..d533c0dcd --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignerNameAttribute.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + + /// This attribute is used to mark "Name" properties that have been provided + /// by our IExtenderProvider in order to differentiate them from other Name properties + /// which we are not interested in. It's just a bool set to true if it's what we want. + /// The attribute target is a Method, since the IExtenderProvider uses methods to specify + /// the get/set for our "Name" property. + [AttributeUsage(AttributeTargets.Method, AllowMultiple=false, Inherited=true)] + internal sealed class SampleDesignerNameAttribute : Attribute { + private bool designerName; + + public static SampleDesignerNameAttribute Default = new SampleDesignerNameAttribute(false); + + public SampleDesignerNameAttribute() : this(false){ + } + + public SampleDesignerNameAttribute(bool designerName) { + this.designerName = designerName; + } + + public override bool Equals(object obj) { + SampleDesignerNameAttribute da = obj as SampleDesignerNameAttribute; + + if (da == null) { + return false; + } + return da.designerName == this.designerName; + } + + public override int GetHashCode() { + return base.GetHashCode(); + } + } + +} + + diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationManager.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationManager.cs new file mode 100644 index 000000000..e623e7c6c --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationManager.cs @@ -0,0 +1,569 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.Collections; +using System.ComponentModel.Design.Serialization; +using System.ComponentModel; +using System.Reflection; +using System.Text; +using System.Diagnostics; + +namespace SampleDesignerHost +{ + /// Our implementation of IDesignerSerializationManager. This is a private + /// implementation and we only have one. So, it could have been implemented + /// as a private interface implementation on top of the loader class + /// itself. I decided against this because there is a lot of + /// state associated with the serialization manager and it could get + /// confusing. + internal class SampleDesignerSerializationManager : IDesignerSerializationManager + { + private SampleDesignerLoader _loader; + private ResolveNameEventHandler _resolveNameEventHandler; + private EventHandler _serializationCompleteEventHandler; + private ArrayList _designerSerializationProviders; + private Hashtable _instancesByName; + private Hashtable _namesByInstance; + private Hashtable _serializers; + private ArrayList _errorList; + private ContextStack _contextStack; + private PropertyDescriptorCollection _propertyCollection; + + /// Initializes the serialization manager. + internal SampleDesignerSerializationManager(SampleDesignerLoader loader) + { + _loader = loader; + } + + /// This method is called by dependent loads to add additional + /// errors to the error list. It is not called for the last + /// dependent load, nor is it called if IDesignerLoaderService + /// is not implemented. If outside parties want to implement + /// IDesignerLoaderService, they may, but they will have + /// to provide their own storage for the dependent + /// error list. We are just re-using _errorList here to be + /// efficient. + internal void AddErrors(ICollection errors) + { + if (errors != null && errors.Count > 0) + { + if (_errorList == null) + { + _errorList = new ArrayList(); + } + _errorList.AddRange(errors); + } + } + + /// This starts the loading process. Normally, everything + /// should be cleared out when this is called. + internal void Initialize() + { + if (_errorList != null) + { + _errorList.Clear(); + } + } + + /// This ends the loading process. This resets the state + /// of the serialization manager and merges the provided + /// error collection into the manager's own error list and + /// returns the merged list. + internal ICollection Terminate(ICollection errors) + { + + // Let interested parties know that we're finished. + // + try + { + if (_serializationCompleteEventHandler != null) + { + _serializationCompleteEventHandler(this, EventArgs.Empty); + } + } + catch {} + + // Merge the error list + // + if (_errorList != null && _errorList.Count > 0) + { + if (errors != null && errors.Count > 0) + { + _errorList.AddRange(errors); + } + errors = _errorList; + } + + // Now disolve our state. The serialization manager + // should remain stateless. + // + _resolveNameEventHandler = null; + _serializationCompleteEventHandler = null; + _instancesByName = null; + _namesByInstance = null; + _serializers = null; + _errorList = null; + _contextStack = null; + + return errors; + } + + /// The Context property provides a user-defined storage area + /// implemented as a stack. This storage area is a useful way + /// to provide communication across serializers, as serialization + /// is a generally hierarchial process. + ContextStack IDesignerSerializationManager.Context + { + get + { + if (_contextStack == null) + { + _contextStack = new ContextStack(); + } + return _contextStack; + } + } + + /// The Properties property provides a set of custom properties + /// the serialization manager may surface. The set of properties + /// exposed here is defined by the implementor of + /// IDesignerSerializationManager. + PropertyDescriptorCollection IDesignerSerializationManager.Properties + { + get + { + if (_propertyCollection == null) + { + _propertyCollection = new PropertyDescriptorCollection(new PropertyDescriptor[] {}); + } + return _propertyCollection; + } + } + + /// ResolveName event. This event + /// is raised when GetName is called, but the name is not found + /// in the serialization manager's name table. It provides a + /// way for a serializer to demand-create an object so the serializer + /// does not have to order object creation by dependency. This + /// delegate is cleared immediately after serialization or deserialization + /// is complete. + event ResolveNameEventHandler IDesignerSerializationManager.ResolveName + { + add + { + _resolveNameEventHandler += value; + } + remove + { + _resolveNameEventHandler -= value; + } + } + + /// This event is raised when serialization or deserialization + /// has been completed. Generally, serialization code should + /// be written to be stateless. Should some sort of state + /// be necessary to maintain, a serializer can listen to + /// this event to know when that state should be cleared. + /// An example of this is if a serializer needs to write + /// to another file, such as a resource file. In this case + /// it would be inefficient to design the serializer + /// to close the file when finished because serialization of + /// an object graph generally requires several _serializers. + /// The resource file would be opened and closed many times. + /// Instead, the resource file could be accessed through + /// an object that listened to the SerializationComplete + /// event, and that object could close the resource file + /// at the end of serialization. + event EventHandler IDesignerSerializationManager.SerializationComplete + { + add + { + _serializationCompleteEventHandler += value; + } + remove + { + _serializationCompleteEventHandler -= value; + } + } + + /// This method adds a custom serialization provider to the + /// serialization manager. A custom serialization provider will + /// get the opportunity to return a serializer for a data type + /// before the serialization manager looks in the type's + /// metadata. + void IDesignerSerializationManager.AddSerializationProvider(IDesignerSerializationProvider provider) + { + if (_designerSerializationProviders == null) + { + _designerSerializationProviders = new ArrayList(); + } + _designerSerializationProviders.Add(provider); + } + + /// Creates an instance of the given type and adds it to a collection + /// of named instances. Objects that implement IComponent will be + /// added to the design time container if addToContainer is true. + object IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, string name, bool addToContainer) + { + object[] argArray = null; + + if (arguments != null && arguments.Count > 0) + { + argArray = new object[arguments.Count]; + arguments.CopyTo(argArray, 0); + } + + object instance = null; + + // We do some special casing here. If we are adding to the container, and if this type + // is an IComponent, then we don't create the instance through Activator, we go + // through the loader host. The reason for this is that if we went through activator, + // and if the object already specified a constructor that took an IContainer, our + // deserialization mechanism would equate the container to the designer host. This + // is the correct thing to do, but it has the side effect of adding the component + // to the designer host twice -- once with a default name, and a second time with + // the name we provide. This equates to a component rename, which isn't cheap, + // so we don't want to do it when we load each and every component. + // + if (addToContainer && typeof(IComponent).IsAssignableFrom(type)) + { + IDesignerLoaderHost host = _loader.LoaderHost; + if (host != null) + { + if (name == null) + { + instance = host.CreateComponent(type); + } + else + { + instance = host.CreateComponent(type, name); + } + } + } + + if (instance == null) + { + + // If we have a name but the object wasn't a component + // that was added to the design container, save the + // name/value relationship in our own nametable. + // + if (name != null && _instancesByName != null) + { + if (_instancesByName.ContainsKey(name)) + { + Exception ex = new InvalidOperationException("Duplicate component declaration for " + name + "."); + throw ex; + } + } + + try + { + instance = Activator.CreateInstance(type, BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance, null, argArray, null); + } + catch(MissingMethodException) + { + StringBuilder argTypes = new StringBuilder(); + foreach (object o in argArray) + { + if (argTypes.Length > 0) + { + argTypes.Append(", "); + } + + if (o != null) + { + argTypes.Append(o.GetType().Name); + } + else + { + argTypes.Append("null"); + } + + } + + Exception ex = new InvalidOperationException("No matching constructor for " + type.FullName + "(" + argTypes.ToString() + ")"); + throw ex; + } + + // If we have a name but the object wasn't a component + // that was added to the design container, save the + // name/value relationship in our own nametable. + // + if (name != null) + { + if (_instancesByName == null) + { + _instancesByName = new Hashtable(); + _namesByInstance = new Hashtable(); + } + + _instancesByName[name] = instance; + _namesByInstance[instance] = name; + } + } + + return instance; + } + + /// Retrieves an instance of a created object of the given name, or + /// null if that object does not exist. + object IDesignerSerializationManager.GetInstance(string name) + { + object instance = null; + + if (name == null) + { + throw new ArgumentNullException("name"); + } + + // Check our local nametable first + // + if (_instancesByName != null) + { + instance = _instancesByName[name]; + } + + if (instance == null && _loader.LoaderHost != null) + { + instance = _loader.LoaderHost.Container.Components[name]; + } + + if (instance == null && _resolveNameEventHandler != null) + { + ResolveNameEventArgs e = new ResolveNameEventArgs(name); + _resolveNameEventHandler(this, e); + instance = e.Value; + } + + return instance; + } + + /// Retrieves a name for the specified object, or null if the object + /// has no name. + string IDesignerSerializationManager.GetName(object value) + { + string name = null; + + if (value == null) + { + throw new ArgumentNullException("value"); + } + + // Check our local nametable first + // + if (_namesByInstance != null) + { + name = (string)_namesByInstance[value]; + } + + if (name == null && value is IComponent) + { + ISite site = ((IComponent)value).Site; + if (site != null) + { + name = site.Name; + } + } + return name; + } + + /// Retrieves a serializer of the requested type for the given + /// object type. + object IDesignerSerializationManager.GetSerializer(Type objectType, Type serializerType) + { + object serializer = null; + + if (objectType != null) + { + + if (_serializers != null) + { + // I don't double hash here. It will be a very rare day where + // multiple types of serializers will be used in the same scheme. + // We still handle it, but we just don't cache. + // + serializer = _serializers[objectType]; + if (serializer != null && !serializerType.IsAssignableFrom(serializer.GetType())) + { + serializer = null; + } + } + + // Now actually look in the type's metadata. + // + IDesignerLoaderHost host = _loader.LoaderHost; + if (serializer == null && host != null) + { + AttributeCollection attributes = TypeDescriptor.GetAttributes(objectType); + foreach(Attribute attr in attributes) + { + if (attr is DesignerSerializerAttribute) + { + DesignerSerializerAttribute da = (DesignerSerializerAttribute)attr; + string typeName = da.SerializerBaseTypeName; + + // This serializer must support a CodeDomSerializer or we're not interested. + // + if (typeName != null && host.GetType(typeName) == serializerType && da.SerializerTypeName != null && da.SerializerTypeName.Length > 0) + { + Type type = host.GetType(da.SerializerTypeName); + Debug.Assert(type != null, "Type " + objectType.FullName + " has a serializer that we couldn't bind to: " + da.SerializerTypeName); + if (type != null) + { + serializer = Activator.CreateInstance(type, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, null, null); + break; + } + } + } + } + + // And stash this little guy for later. + // + if (serializer != null) + { + if (_serializers == null) + { + _serializers = new Hashtable(); + } + _serializers[objectType] = serializer; + } + } + } + + // Designer serialization providers can override our metadata discovery. + // We loop until we reach steady state. This breaks order dependencies + // by allowing all providers a chance to party on each other's serializers. + // + if (_designerSerializationProviders != null) + { + bool continueLoop = true; + for(int i = 0; continueLoop && i < _designerSerializationProviders.Count; i++) + { + + continueLoop = false; + + foreach(IDesignerSerializationProvider provider in _designerSerializationProviders) + { + object newSerializer = provider.GetSerializer(this, serializer, objectType, serializerType); + if (newSerializer != null) + { + continueLoop = (serializer != newSerializer); + serializer = newSerializer; + } + } + } + } + + return serializer; + } + + /// Retrieves a type of the given name. + Type IDesignerSerializationManager.GetType(string typeName) + { + Type t = null; + + if (_loader.LoaderHost != null) + { + while (t == null) + { + t = _loader.LoaderHost.GetType(typeName); + + if (t == null && typeName != null && typeName.Length > 0) + { + int dotIndex = typeName.LastIndexOf('.'); + if (dotIndex == -1 || dotIndex == typeName.Length - 1) + break; + + typeName = typeName.Substring(0, dotIndex) + "+" + typeName.Substring(dotIndex + 1, typeName.Length - dotIndex - 1); + } + } + } + + return t; + } + + /// Removes a previously added serialization provider. + void IDesignerSerializationManager.RemoveSerializationProvider(IDesignerSerializationProvider provider) + { + if (_designerSerializationProviders != null) + { + _designerSerializationProviders.Remove(provider); + } + } + + /// Reports a non-fatal error in serialization. The serialization + /// manager may implement a logging scheme to alert the caller + /// to all non-fatal errors at once. If it doesn't, it should + /// immediately throw in this method, which should abort + /// serialization. + /// Serialization may continue after calling this function. + void IDesignerSerializationManager.ReportError(object errorInformation) + { + if (errorInformation != null) + { + if (_errorList == null) + { + _errorList = new ArrayList(); + } + + _errorList.Add(errorInformation); + } + } + + /// Provides a way to set the name of an existing object. + /// This is useful when it is necessary to create an + /// instance of an object without going through CreateInstance. + /// An exception will be thrown if you try to rename an existing + /// object or if you try to give a new object a name that + /// is already taken. + void IDesignerSerializationManager.SetName(object instance, string name) + { + + if (instance == null) + { + throw new ArgumentNullException("instance"); + } + + if (name == null) + { + throw new ArgumentNullException("name"); + } + + if (_instancesByName == null) + { + _instancesByName = new Hashtable(); + _namesByInstance = new Hashtable(); + } + + if (_instancesByName[name] != null) + { + Exception ex = new ArgumentException("Designer Loader name " + name + " in use."); + throw ex; + } + + if (_namesByInstance[instance] != null) + { + Exception ex = new ArgumentException("Designer loader object has name " + name + "."); + throw ex; + } + + _instancesByName[name] = instance; + _namesByInstance[instance] = name; + } + + /// Retrieves the requested service. + object IServiceProvider.GetService(Type serviceType) + { + return _loader.GetService(serviceType); + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationService.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationService.cs new file mode 100644 index 000000000..30a9810a9 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignerSerializationService.cs @@ -0,0 +1,49 @@ +using System; +using System.Xml; +using System.Collections; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.ComponentModel.Design.Serialization; + +namespace SampleDesignerHost +{ + /// + /// Implementation de IDesignerSerializationService + /// + public class SampleDesignerSerializationService : IDesignerSerializationService + { + private IDesignerHost host; + + public SampleDesignerSerializationService(IDesignerHost host) + { + this.host = host; + } + + public object Serialize(ICollection objects) + { + XmlDocument xDoc = new XmlDocument(); + xDoc.AppendChild(xDoc.CreateElement("COPY")); + + object[] list = new object[objects.Count]; + objects.CopyTo(list, 0); + ((SampleDesignerHost)host).WriteComponentCollection(xDoc, list, xDoc.DocumentElement); + + return xDoc.OuterXml; + } + + public ICollection Deserialize(object serializationData) + { + ArrayList errors = new ArrayList(); + XmlDocument xDoc = new XmlDocument(); + xDoc.LoadXml(serializationData.ToString()); + ICollection objects = ((SampleDesignerHost)host).CreateComponents(xDoc, errors); + + foreach (string s in errors) + { + System.Diagnostics.Debug.WriteLine(s); + } + return objects; + } + + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/SampleDesignerTransaction.cs b/VisualPascalABCNETLinux/SSYY/SampleDesignerTransaction.cs new file mode 100644 index 000000000..45f13e43b --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDesignerTransaction.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.ComponentModel.Design.Serialization; + using System.Diagnostics; + using System.Collections; + using System.Windows.Forms; + using System.Reflection; + using System.Text; + + /// Designer transactions offer a mechanism to improve performance by wrapping around + /// a series of component changes. The changes are not actually committed until the + /// entire batch is processed. They can be aborted if the transaction is canceled. + internal class SampleDesignerTransaction : DesignerTransaction { + private SampleDesignerHost host; + + public SampleDesignerTransaction(SampleDesignerHost host, string description) : base(description) { + this.host = host; + + // The host keeps a string stack of the transaction descriptions. + host.TransactionDescriptions.Push(description); + + // If this is first transaction to be opened, have the host raise + // opening/opened events. + // + if (host.TransactionCount++ == 0) { + host.OnTransactionOpening(EventArgs.Empty); + host.OnTransactionOpened(EventArgs.Empty); + } + } + + protected override void OnCancel() { + if (host != null) { + Debug.Assert(host.TransactionDescriptions != null, "End batch operation with no desription?!?"); + string s = (string)host.TransactionDescriptions.Pop(); + + // If this is the last transaction to be closed, have the host raise + // closing/closed events. + // + if (--host.TransactionCount == 0) { + DesignerTransactionCloseEventArgs dtc = new DesignerTransactionCloseEventArgs(false); + host.OnTransactionClosing(dtc); + host.OnTransactionClosed(dtc); + } + host = null; + } + } + + protected override void OnCommit() { + if (host != null) { + Debug.Assert(host.TransactionDescriptions != null, "End batch operation with no desription?!?"); + string s = (string)host.TransactionDescriptions.Pop(); + + // If this is the last transaction to be closed, have the host raise + // closing/closed events. + // + if (--host.TransactionCount == 0) + { + DesignerTransactionCloseEventArgs dtc = new DesignerTransactionCloseEventArgs(true); + host.OnTransactionClosing(dtc); + host.OnTransactionClosed(dtc); + } + host = null; + } + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.cs b/VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.cs new file mode 100644 index 000000000..d05a0344b --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.cs @@ -0,0 +1,153 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.Diagnostics; + using System.Collections; + using System.Windows.Forms; + using System.Drawing; + using System.Drawing.Design; + using System.Windows.Forms.Design; + + /// This class implements the actual document window for a form design. This is the + /// window that the base designer will be parented into. + internal class SampleDocumentWindow : Control { + + private IDesignerHost designerHost; + private Control designerView; + + internal SampleDocumentWindow(IDesignerHost designerHost) { + SetStyle(ControlStyles.ResizeRedraw, true); + this.designerHost = designerHost; + TabStop = false; + Visible = false; // The host will tell us when to be visible. + Text = "DocumentWindow"; + BackColor = SystemColors.Window; + this.AllowDrop = true; + } + + /// Allows you to affect the visibility of the document. + public bool DocumentVisible { + get { + return (designerView == null ? false : designerView.Visible); + } + + set { + if (designerView != null) { + designerView.Visible = value; + } + } + } + + /// Disposes of the document. + protected override void Dispose(bool disposing) { + if (disposing) { + SetDesigner(null); + + designerHost = null; + } + base.Dispose(disposing); + } + + /// The document window itself never really has focus. Instead + /// it passes focus to the designerView. + protected override void OnGotFocus(EventArgs e) { + if (designerView != null) { + designerView.Focus(); + } + else { + base.OnGotFocus(e); + } + } + + /// Likewise, when we check the document window for focus, + /// we really want to know if the designerView has it. The only + /// time we do this check is when intercepting keyboard messages. + public override bool Focused + { + get + { + if (designerView != null) + { + return designerView.Focused; + } + else + { + return base.Focused; + } + } + } + + /// Paints the surface of the document window with the given error collection. + public void ReportErrors(ICollection errors) { + if (errors.Count > 0) + { + ListBox list = new ListBox(); + foreach(object err in errors) + { + list.Items.Add(err); + } + + list.Dock = DockStyle.Fill; + list.Height = 200; + Controls.Add(list); + } + } + + /// Establishes the given designer as the main top level designer for the document. + public void SetDesigner(IRootDesigner document) { + + if (designerView != null) { + Controls.Clear(); + designerView.Dispose(); + designerView = null; + } + + if (document != null) { + // Demand create the designer holder, if it doesn't already exist. + ViewTechnology[] technologies = document.SupportedTechnologies; + bool supportedTechnology = false; + + // Search for supported technologies that we know how to design. + // In our case, we only know how to design WindowsForms. + // + foreach(ViewTechnology tech in technologies) { + switch(tech) { + case ViewTechnology.WindowsForms: { + designerView = (Control)document.GetView(ViewTechnology.WindowsForms); + designerView.Dock = DockStyle.Fill; + Controls.Add(designerView); + supportedTechnology = true; + break; + } + } + + // Stop looping if we found one + // + if (supportedTechnology) { + break; + } + } + + // If we didn't find a supported technology, report it. + // + if (!supportedTechnology) { + throw new Exception("Unsupported Technology " + designerHost.RootComponent.GetType().FullName); + } + + } + } + } +} + diff --git a/VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.resx b/VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.resx new file mode 100644 index 000000000..7e323966c --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleDocumentWindow.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/VisualPascalABCNETLinux/SSYY/SampleEventBindingService.cs b/VisualPascalABCNETLinux/SSYY/SampleEventBindingService.cs new file mode 100644 index 000000000..bda0c5db8 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleEventBindingService.cs @@ -0,0 +1,771 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.Collections; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.Design; + using System.Diagnostics; + using System.Globalization; + using System.Text; + using System.Reflection; + using System.Collections.Generic; + using System.Windows.Forms; + + public class EventDescription + { + public string EventName; + public EventDescriptor e; + + public int line_num = 0; + public int column_num = 0; + + public VisualPascalABC.CodeFileDocumentTextEditorControl editor = null; + + public EventDescription(string event_name, EventDescriptor descriptor) + { + EventName = event_name; + e = descriptor; + } + } + + /// This class provides a default implementation of the event + /// binding service. + public class SampleEventBindingService : IEventBindingService + { + private Hashtable _eventProperties; + private IServiceProvider _provider; + + /// You must provide a service provider to the binding + /// service. We give it our host. + public SampleEventBindingService(IServiceProvider provider) + { + if (provider == null) + { + throw new ArgumentNullException("provider"); + } + _provider = provider; + } + + /// Creates a unique method name. The name must be + /// compatible with the script language being used and + /// it must not conflict with any other name in the user's + /// code. Since we have no code editor, we can guarantee this + /// method name will be unique. However, if code were editable, + /// we would have to check our codeCompileUnit's methods. + protected string CreateUniqueMethodName(IComponent component, EventDescriptor e) + { + string name = component.ToString().Split(new char[] { ' ' })[0]; + //return "handler_" + name + "_" + e.Name; + return name + "_" + e.Name; + } + + /// This provides a notification that a particular method + /// is no longer being used by an event handler. Some implementations + /// may want to remove the event hander when no events are using + /// it. By overriding UseMethod and FreeMethod, an implementation + /// can know when a method is no longer needed. + protected virtual void FreeMethod(object component, EventDescriptor e, string methodName) + { + // UNIMPLEMENTED - We don't add method signatures for our handlers, so + // don't need to worry about removing them. + } + + /// Returns a collection of strings. Each string is + /// the method name of a method whose signature is + /// compatible with the delegate contained in the + /// event descriptor. This should return an empty + /// collection if no names are compatible. + protected ICollection GetCompatibleMethods(EventDescriptor e) + { + // EMPTY IMPLEMENTATION + return new string[] {}; + } + + /// Generates a key based on a method name and it's parameters by just concatenating the + /// parameters. + private string GetEventDescriptorHashCode(EventDescriptor eventDesc) + { + StringBuilder builder = new StringBuilder(eventDesc.Name); + builder.Append(eventDesc.EventType.GetHashCode().ToString()); + + foreach(Attribute a in eventDesc.Attributes) + { + builder.Append(a.GetHashCode().ToString()); + } + + return builder.ToString(); + } + + /// Gets the requested service from our service provider (the host). + protected object GetService(Type serviceType) + { + if (_provider != null) + { + return _provider.GetService(serviceType); + } + return null; + } + + /// Shows the user code. This method does not show any + /// particular code; generally it shows the last code the + /// user typed. This returns true if it was possible to + /// show the code, or false if not. We are never showing code + /// since we do not generate handler methods. + protected bool ShowCode() + { + return false; + } + + /// Shows the user code at the given line number. Line + /// numbers are one-based. This returns true if it was + /// possible to show the code, or false if not. We are + /// never showing code since we do not generate handler methods. + protected bool ShowCode(int lineNumber) + { + return false; + } + + /// Shows the body of the user code with the given method + /// name. This returns true if it was possible to show + /// the code, or false if not. We are never showing code + /// since we do not generate handler methods. + protected bool ShowCode(object component, EventDescriptor e, string methodName) + { + EventDescription ev = new EventDescription(methodName, e); + VisualPascalABC.CodeFileDocumentControl cfdc = VisualPascalABC.Form1.Form1_object._currentCodeFileDocument; + cfdc.GenerateDesignerCode(ev); + if (ev.editor != null) + { + cfdc.DesignerAndCodeTabs.SelectedTab = cfdc.TextPage; + VisualPascalABC.VisualPABCSingleton.MainForm.VisualEnvironmentCompiler.ExecuteSourceLocationAction( + new PascalABCCompiler.SourceLocation(cfdc.FileName, ev.line_num, ev.column_num, ev.line_num, ev.column_num), + VisualPascalABCPlugins.SourceLocationAction.GotoBeg); + } + return false; + } + + protected void ShowMessageBadCode() + { + VisualPascalABC.Form1.Form1_object._currentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = + VisualPascalABC.Form1.Form1_object._currentCodeFileDocument.TextPage; + MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_CAN_NOT_NAVIGATE_TO_EVENT_HANDLER"), + PascalABCCompiler.StringResources.Get("VP_MF_FORM_DESIGNER"), + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + /// This provides a notification that a particular method + /// is being used by an event handler. Some implementations + /// may want to remove the event hander when no events are using + /// it. By overriding UseMethod and FreeMethod, an implementation + /// can know when a method is no longer needed. + protected virtual void UseMethod(object component, EventDescriptor e, string methodName) + { + // UNIMPLEMENTED - We do not add method signatures to our code. + } + + /// This validates that the provided method name is valid for + /// the language / script being used. The default does nothing. + /// You may override this and throw an exception if the name + /// is invalid for your use. + protected virtual void ValidateMethodName(string methodName) + { + // UNIMPLEMENTED - We are guaranteed our method names are valid. + } + + /// This creates a name for an event handling method for the given component + /// and event. The name that is created is guaranteed to be unique in the user's source + /// code. + string IEventBindingService.CreateUniqueMethodName(IComponent component, EventDescriptor e) + { + if (component == null) + { + throw new ArgumentNullException("component"); + } + + if (e == null) + { + throw new ArgumentNullException("e"); + } + + return CreateUniqueMethodName(component, e); + } + + /// Retrieves a collection of strings. Each string is the name of a method + /// in user code that has a signature that is compatible with the given event. + ICollection IEventBindingService.GetCompatibleMethods(EventDescriptor e) + { + if (e == null) + { + throw new ArgumentNullException("e"); + } + + return GetCompatibleMethods(e); + } + + /// For properties that are representing events, this will return the event + /// that the property represents. + EventDescriptor IEventBindingService.GetEvent(PropertyDescriptor property) + { + if (property is EventPropertyDescriptor) + { + return ((EventPropertyDescriptor)property).Event; + } + else + { + return null; + } + } + + /// Converts a set of events to a set of properties. + PropertyDescriptorCollection IEventBindingService.GetEventProperties(EventDescriptorCollection events) + { + + if (events == null) + { + throw new ArgumentNullException("events"); + } + + PropertyDescriptor[] props = new PropertyDescriptor[events.Count]; + + // We cache the property descriptors here for speed. Create those for + // events that we don't have yet. + // + if (_eventProperties == null) + { + _eventProperties = new Hashtable(); + } + + for (int i = 0; i < events.Count; i++) + { + + object eventHashCode = GetEventDescriptorHashCode(events[i]); + + props[i] = (PropertyDescriptor)_eventProperties[eventHashCode]; + + if (props[i] == null) + { + props[i] = new EventPropertyDescriptor(events[i], this); + _eventProperties[eventHashCode] = props[i]; + } + } + + return new PropertyDescriptorCollection(props); + } + + /// Converts a single event to a property. + PropertyDescriptor IEventBindingService.GetEventProperty(EventDescriptor e) + { + + if (e == null) + { + throw new ArgumentNullException("e"); + } + + if (_eventProperties == null) + { + _eventProperties = new Hashtable(); + } + + object eventHashCode = GetEventDescriptorHashCode(e); + + PropertyDescriptor prop = (PropertyDescriptor)_eventProperties[eventHashCode]; + + if (prop == null) + { + prop = new EventPropertyDescriptor(e, this); + _eventProperties[eventHashCode] = prop; + } + + return prop; + } + + /// Displays the user code for this designer. This will return true if the user + /// code could be displayed, or false otherwise. + bool IEventBindingService.ShowCode() + { + return ShowCode(); + } + + /// Displays the user code for the designer. This will return true if the user + /// code could be displayed, or false otherwise. + bool IEventBindingService.ShowCode(int lineNumber) + { + return ShowCode(lineNumber); + } + + /// Displays the user code for the given event. This will return true if the user + /// code could be displayed, or false otherwise. + bool IEventBindingService.ShowCode(IComponent component, EventDescriptor e) + { + if (component == null) + { + throw new ArgumentNullException("component"); + } + + if (e == null) + { + throw new ArgumentNullException("e"); + } + + PropertyDescriptor prop = ((IEventBindingService)this).GetEventProperty(e); + + string methodName = (string)prop.GetValue(component); + if (methodName == null) + { + return false; // the event is not bound to a method. + } + + return ShowCode(component, e, methodName); + } + + /// This is an EventDescriptor cleverly wrapped in a PropertyDescriptor + /// of type String. Note that we now handle subobjects by storing their + /// event information in their base component's site's dictionary. + /// Note also that when a value is set for this property we will code-gen + /// the event method. If the property is set to a new value we will + /// remove the old event method ONLY if it is empty. + private class EventPropertyDescriptor : PropertyDescriptor + { + private EventDescriptor _eventDesc; + private SampleEventBindingService _eventSvc; + private TypeConverter _converter; + + /// Creates a new EventPropertyDescriptor. + internal EventPropertyDescriptor(EventDescriptor eventDesc, SampleEventBindingService eventSvc) : base(eventDesc, null) + { + _eventDesc = eventDesc; + _eventSvc = eventSvc; + } + + /// Indicates whether reset will change the value of the component. If there + /// is a DefaultValueAttribute, then this will return true if getValue returns + /// something different than the default value. If there is a reset method and + /// a shouldPersist method, this will return what shouldPersist returns. + /// If there is just a reset method, this always returns true. If none of these + /// cases apply, this returns false. + public override bool CanResetValue(object component) + { + return GetValue(component) != null; + } + + /// Retrieves the type of the component this PropertyDescriptor is bound to. + public override Type ComponentType + { + get + { + return _eventDesc.ComponentType; + } + } + + /// Retrieves the type converter for this property. + public override TypeConverter Converter + { + get + { + if (_converter == null) + { + _converter = new EventConverter(_eventDesc); + } + + return _converter; + } + } + + /// Retrieves the event descriptor we are representing. + internal EventDescriptor Event + { + get + { + return _eventDesc; + } + } + + /// Indicates whether this property is read only. + public override bool IsReadOnly + { + get + { + return Attributes[typeof(ReadOnlyAttribute)].Equals(ReadOnlyAttribute.Yes); + } + } + + /// Retrieves the type of the property. + public override Type PropertyType + { + get + { + return _eventDesc.EventType; + } + } + + /// Retrieves the current value of the property on component, + /// invoking the getXXX method. An exception in the getXXX + /// method will pass through. + public override object GetValue(object component) + { + + if (component == null) + { + throw new ArgumentNullException("component"); + } + + // We must locate the sited component, because we store data on the dictionary + // service for the component. + // + ISite site = null; + + if (component is IComponent) + { + site = ((IComponent)component).Site; + } + + if (site == null) + { + IReferenceService rs = _eventSvc._provider.GetService(typeof(IReferenceService)) as IReferenceService; + if (rs != null) + { + IComponent baseComponent = rs.GetComponent(component); + if (baseComponent != null) + { + site = baseComponent.Site; + } + } + } + + if (site == null) + { + Exception ex = new InvalidOperationException("There is no site for component" + component.ToString() + "."); + throw ex; + } + + IDictionaryService ds = (IDictionaryService)site.GetService(typeof(IDictionaryService)); + if (ds == null) + { + Exception ex = new InvalidOperationException("Cannot find IDictionaryService."); + throw ex; + } + + return (string)ds.GetValue(new ReferenceEventClosure(component, this)); + } + + /// Will reset the default value for this property on the component. If + /// there was a default value passed in as a DefaultValueAttribute, that + /// value will be set as the value of the property on the component. If + /// there was no default value passed in, a ResetXXX method will be looked + /// for. If one is found, it will be invoked. If one is not found, this + /// is a nop. + public override void ResetValue(object component) + { + SetValue(component, null); + } + + /// This will set value to be the new value of this property on the + /// component by invoking the setXXX method on the component. If the + /// value specified is invalid, the component should throw an exception + /// which will be passed up. The component designer should design the + /// property so that getXXX following a setXXX should return the value + /// passed in if no exception was thrown in the setXXX call. + public override void SetValue(object component, object value) + { + // Argument, state checking. Is it ok to set this event? + // + if (IsReadOnly) + { + Exception ex = new InvalidOperationException("Tried to set a read only event."); + throw ex; + } + + if (value != null && !(value is string)) + { + Exception ex = new ArgumentException("Cannot set to value " + value.ToString() + "."); + throw ex; + } + + string name = (string)value; + if (name != null && name.Length == 0) + { + name = null; + } + + // Obtain the site for the component. Note that this can be a site + // to a parent component if we can get to the reference service. + // + ISite site = null; + + if (component is IComponent) + { + site = ((IComponent)component).Site; + } + + if (site == null) + { + IReferenceService rs = _eventSvc._provider.GetService(typeof(IReferenceService)) as IReferenceService; + if (rs != null) + { + IComponent baseComponent = rs.GetComponent(component); + if (baseComponent != null) + { + site = baseComponent.Site; + } + } + } + + if (site == null) + { + Exception ex = new InvalidOperationException("There is no site for component " + component.ToString() + "."); + throw ex; + } + + // The dictionary service is where we store the actual event method name. + // + IDictionaryService ds = (IDictionaryService)site.GetService(typeof(IDictionaryService)); + if (ds == null) + { + Exception ex = new InvalidOperationException("Cannot find IDictionaryService"); + throw ex; + } + + // Get the old method name, ensure that they are different, and then continue. + // + ReferenceEventClosure key = new ReferenceEventClosure(component, this); + string oldName = (string)ds.GetValue(key); + + if (object.ReferenceEquals(oldName, name)) + { + return; + } + + if (oldName != null && name != null && oldName.Equals(name)) + { + return; + } + + // Before we continue our work, ensure that the name is + // actually valid. + // + if (name != null) + { + _eventSvc.ValidateMethodName(name); + } + + // Ok, the names are different. Fire a changing event to make + // sure it's OK to perform the change. + // + IComponentChangeService change = (IComponentChangeService)site.GetService(typeof(IComponentChangeService)); + if (change != null) + { + try + { + change.OnComponentChanging(component, this); + } + catch(CheckoutException coEx) + { + if (coEx == CheckoutException.Canceled) + { + return; + } + throw; + } + } + + // Less chance of success of adding a new method name, so + // don't release the old name until we verify that adding + // the new one actually succeeded. + // + if (name != null) + { + _eventSvc.UseMethod(component, _eventDesc, name); + } + + if (oldName != null) + { + _eventSvc.FreeMethod(component, _eventDesc, oldName); + } + + ds.SetValue(key, name); + + if (change != null) + { + change.OnComponentChanged(component, this, oldName, name); + } + + OnValueChanged(component, EventArgs.Empty); + } + + /// Indicates whether the value of this property needs to be persisted. In + /// other words, it indicates whether the state of the property is distinct + /// from when the component is first instantiated. If there is a default + /// value specified in this PropertyDescriptor, it will be compared against the + /// property's current value to determine this. If there is't, the + /// shouldPersistXXX method is looked for and invoked if found. If both + /// these routes fail, true will be returned. + /// + /// If this returns false, a tool should not persist this property's value. + public override bool ShouldSerializeValue(object component) + { + return CanResetValue(component); + } + + /// Implements a type converter for event objects. + private class EventConverter : TypeConverter + { + + private EventDescriptor _evt; + + + /// Creates a new EventConverter. + + internal EventConverter(EventDescriptor evt) + { + _evt = evt; + } + + + /// Determines if this converter can convert an object in the given source + /// type to the native type of the converter. + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + if (sourceType == typeof(string)) + { + return true; + } + return base.CanConvertFrom(context, sourceType); + } + + /// Determines if this converter can convert an object to the given destination + /// type. + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(string)) + { + return true; + } + return base.CanConvertTo(context, destinationType); + } + + /// Converts the given object to the converter's native type. + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (value == null) + { + return value; + } + if (value is string) + { + if (((string)value).Length == 0) + { + return null; + } + return value; + } + return base.ConvertFrom(context, culture, value); + } + + /// Converts the given object to another type. The most common types to convert + /// are to and from a string object. The default implementation will make a call + /// to ToString on the object if the object is valid and if the destination + /// type is string. If this cannot convert to the desitnation type, this will + /// throw a NotSupportedException. + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(string)) + { + return value == null ? string.Empty : value; + } + return base.ConvertTo(context, culture, value, destinationType); + } + + /// Retrieves a collection containing a set of standard values + /// for the data type this validator is designed for. This + /// will return null if the data type does not support a + /// standard set of values. + public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) + { + // We cannot cache this because it depends on the contents of the source file. + // + string[] eventMethods = null; + + if (context != null) + { + IEventBindingService ebs = (IEventBindingService)context.GetService(typeof(IEventBindingService)); + if (ebs != null) + { + ICollection methods = ebs.GetCompatibleMethods(_evt); + eventMethods = new string[methods.Count]; + int i = 0; + foreach(string s in methods) + { + eventMethods[i++] = s; + } + } + } + + return new StandardValuesCollection(eventMethods); + } + + /// Determines if the list of standard values returned from + /// GetStandardValues is an exclusive list. If the list + /// is exclusive, then no other values are valid, such as + /// in an enum data type. If the list is not exclusive, + /// then there are other valid values besides the list of + /// standard values GetStandardValues provides. + public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) + { + return false; + } + + /// Determines if this object supports a standard set of values + /// that can be picked from a list. + public override bool GetStandardValuesSupported(ITypeDescriptorContext context) + { + return true; + } + } + + /// This is a combination of a reference and a property, so that it can be used + /// as the key of a hashtable. This is because we may have subobjects that share + /// the same property. + private class ReferenceEventClosure + { + object reference; + EventPropertyDescriptor propertyDescriptor; + + public ReferenceEventClosure(object reference, EventPropertyDescriptor prop) + { + this.reference = reference; + this.propertyDescriptor = prop; + } + + public override int GetHashCode() + { + return reference.GetHashCode() * propertyDescriptor.GetHashCode(); + } + + public override bool Equals(Object otherClosure) + { + if (otherClosure is ReferenceEventClosure) + { + ReferenceEventClosure typedClosure = (ReferenceEventClosure) otherClosure; + return(typedClosure.reference == reference && + typedClosure.propertyDescriptor == propertyDescriptor); + } + return false; + } + } + } + } +} + + + diff --git a/VisualPascalABCNETLinux/SSYY/SampleMenuCommandService.cs b/VisualPascalABCNETLinux/SSYY/SampleMenuCommandService.cs new file mode 100644 index 000000000..48d3c8538 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleMenuCommandService.cs @@ -0,0 +1,320 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.Collections; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Windows.Forms; +using System.Drawing; + +namespace SampleDesignerHost +{ + /// The IMenuCommandService keeps track of MenuCommands and Designer Verbs + /// that are available at any single moment. It can invoke these commands + /// and also handles the displaying of ContextMenus for designers that support them. + public class SampleMenuCommandService : System.ComponentModel.Design.IMenuCommandService + { + private Hashtable commands; // added MenuCommands + private Hashtable verbsFromMenuItems; // DesignerVerb values mapped to MenuItem keys + private Hashtable menuItemsFromVerbs; // MenuItem values mapped to DesignerVerb keys + private ArrayList globalVerbs; // verbs currently available to all designers + private IDesignerHost host; + private ContextMenu cm; + private IComponent lastSelection; // needed to clean up local verbs from a previous selection + private DefaultMenuCommands defaultCommands; + + public SampleMenuCommandService(IDesignerHost host) + { + this.host = host; + } + + /// The IMenuCommandService deals with two kinds of verbs: 1) local verbs specific + /// to each designer (i.e. Add/Remove Tab on a TabControl) which are added + /// and removed on-demand, each time a designer is right-clicked, 2) the rarer + /// global verbs, which once added are available to all designers, + /// until removed. This method (not a standard part of IMenuCommandService) is used + /// to add a local verb. If the verb is already in our global list, we don't add it + /// again. It is called through IMenuCommandService.ShowContextMenu(). + public void AddLocalVerb(DesignerVerb verb) + { + if ((globalVerbs == null) || (!globalVerbs.Contains(verb))) + { + if (cm == null) + { + cm = new ContextMenu(); + verbsFromMenuItems = new Hashtable(); + menuItemsFromVerbs = new Hashtable(); + } + + // Verbs and MenuItems are dually mapped to each other, so that we can + // check for association given either half of the pair. All of our MenuItems + // use the same event handler, but we can check the event sender to see + // what verb to invoke. MenuItems like to only be assigned to one Menu in their + // lifetime, so we have to create a single ContextMenu and use that thereafter. + // If we were to instead create a ContextMenu every time we need to show one, + // the MenuItems' click events might not work properly. + // + MenuItem menuItem = new MenuItem(verb.Text); + menuItem.Click += new EventHandler(menuItem_Click); + verbsFromMenuItems.Add(menuItem, verb); + menuItemsFromVerbs.Add(verb, menuItem); + cm.MenuItems.Add(menuItem); + } + } + + /// Remove a local verb, but only if it isn't in our global list. + /// It is also called through IMenuCommandService.ShowContextMenu(). + public void RemoveLocalVerb(DesignerVerb verb) + { + if ((globalVerbs == null) || (!globalVerbs.Contains(verb))) + { + if (cm != null) + { + // Remove the verb and its mapped MenuItem from our tables and menu. + MenuItem key = menuItemsFromVerbs[verb] as MenuItem; + verbsFromMenuItems.Remove(key); + menuItemsFromVerbs.Remove(verb); + cm.MenuItems.Remove(key); + } + } + } + + #region Implementation of IMenuCommandService + + /// If a designer supports a MenuCommand, it will add it here. + public void AddCommand(System.ComponentModel.Design.MenuCommand command) + { + if (commands == null) + { + commands = new Hashtable(); + defaultCommands = new DefaultMenuCommands(host as IServiceProvider); + defaultCommands.AddTo(this); + } + + // Only add a command if we haven't already. + if (FindCommand(command.CommandID) == null) + { + commands.Add(command.CommandID, command); + } + } + + /// This is only called by external callers if someone wants to + /// remove a verb that is available for all designers. We keep track of + /// such verbs to make sure that they are not re-added or removed + /// when we frequently manipulate our local verbs. + public void RemoveVerb(System.ComponentModel.Design.DesignerVerb verb) + { + if (globalVerbs != null) + { + globalVerbs.Remove(verb); + + if (cm != null) + { + // Remove the verb and its mapped MenuItem from our tables and menu. + MenuItem key = menuItemsFromVerbs[verb] as MenuItem; + verbsFromMenuItems.Remove(key); + menuItemsFromVerbs.Remove(verb); + cm.MenuItems.Remove(key); + } + } + } + + /// If a command is no longer viable for a designer, it is removed. + public void RemoveCommand(System.ComponentModel.Design.MenuCommand command) + { + if (commands != null) + { + // Hashtable already has nothing happen if the command isn't there. + commands.Remove(command.CommandID); + } + } + + /// Find a command based on its CommandID. + public System.ComponentModel.Design.MenuCommand FindCommand(System.ComponentModel.Design.CommandID commandID) + { + if (commands != null) + { + MenuCommand command = commands[commandID] as MenuCommand; + if (command != null) + { + return command; + } + } + return null; + } + + /// We only invoke commands that have been added. + public bool GlobalInvoke(System.ComponentModel.Design.CommandID commandID) + { + MenuCommand command = FindCommand(commandID); + if (command != null) + { + command.Invoke(); + return true; + } + return false; + } + + /// This is called whenever the user right-clicks on a designer. It removes any local verbs + /// added by a previous, different selection and adds the local verbs for the current (primary) + /// selection. Then it displays the ContextMenu. + public void ShowContextMenu(System.ComponentModel.Design.CommandID menuID, int x, int y) + { + ISelectionService ss = host.GetService(typeof(ISelectionService)) as ISelectionService; + + // If this is the same component as was last right-clicked on, then we don't need to + // make any changes to our collection of local verbs. + // + if ((lastSelection != null) && (lastSelection != ss.PrimarySelection)) + { + IDesigner d = host.GetDesigner(lastSelection); + if (d != null) + { + foreach (DesignerVerb verb in d.Verbs) + { + RemoveLocalVerb(verb); + } + } + } + + // Update the local verbs for the new selection, if it is indeed new. + if (lastSelection != ss.PrimarySelection) + { + IDesigner d = host.GetDesigner(ss.PrimarySelection as IComponent); + if (d.Verbs.Count == 0) + { + FillVerbs(ss.PrimarySelection as IComponent, d); + } + foreach (DesignerVerb verb in d.Verbs) + { + AddLocalVerb(verb); + } + } + + // Display our ContextMenu! Note that the coordinate parameters to this method + // are in screen coordinates, so we've got to translate them into client coordinates. + // + //if (cm != null) + { + Control ps = ss.PrimarySelection as Control; + if (ps == null) + { + ps = VisualPascalABC.Form1.Form1_object; + } + Point s = ps.PointToScreen(new Point(0, 0)); + VisualPascalABC.Form1.Form1_object.cm_Designer.Show(ps, new Point(x - s.X, y - s.Y)); + //VisualPascalABC.Form1.Form1_object.cm_Designer.Show(ps, Cursor.Position); + } + + // ss.PrimarySelection might be old news by the next right-click. We need to + // be able to remove its verbs if we get a different selection next time + // this method is called. We can't remove them right now because we aren't sure + // if the MenuItem click events have finished yet (and removing verbs kills + // their MenuItem mapping). So we save the selection and do it next time if necessary. + // + lastSelection = ss.PrimarySelection as IComponent; + } + + public void FillVerbs(IComponent comp, IDesigner d) + { + //DesignerVerb dv = new DesignerVerb("horiz", new EventHandler(VisualPascalABC.Form1.Form1_object.ExecSendToBack)); + + //d.Verbs.Add(dv); + } + + /// This is only called by external callers if someone wants to + /// remove a verb that is available for all designers. We keep track of + /// such verbs to make sure that they are not re-added or removed + /// when we frequently manipulate our local verbs. + public void AddVerb(System.ComponentModel.Design.DesignerVerb verb) + { + if (globalVerbs == null) + { + globalVerbs = new ArrayList(); + } + + globalVerbs.Add(verb); + + if (cm == null) + { + cm = new ContextMenu(); + verbsFromMenuItems = new Hashtable(); + menuItemsFromVerbs = new Hashtable(); + } + + // Verbs and MenuItems are dually mapped to each other, so that we can + // check for association given either half of the pair. All of our MenuItems + // use the same event handler, but we can check the event sender to see + // what verb to invoke. We have to have a stable ContextMenu, and we need + // to add the MenuItems to it now. If we try to add the MenuItems on-demand + // right before we show a ContextMenu, the clicks events won't work. + // + MenuItem menuItem = new MenuItem(verb.Text); + menuItem.Click += new EventHandler(menuItem_Click); + verbsFromMenuItems.Add(menuItem, verb); + menuItemsFromVerbs.Add(verb, menuItem); + cm.MenuItems.Add(menuItem); + } + + /// This is frequently called to get the current list of available verbs. We have + /// to be careful in what verbs we return, however, because the information contained + /// in menuItemsFromVerbs and verbsFromMenuItems will not be current if there has been + /// no right-click since the last selection change. Thus we return the global verbs + /// plus any additional local verbs for the current selection. + public System.ComponentModel.Design.DesignerVerbCollection Verbs + { + get + { + ISelectionService ss = host.GetService(typeof(ISelectionService)) as ISelectionService; + ArrayList currentVerbs; + if (globalVerbs != null) + { + currentVerbs = new ArrayList(globalVerbs); + } + else + { + currentVerbs = new ArrayList(); + } + + foreach (DesignerVerb verb in host.GetDesigner(ss.PrimarySelection as IComponent).Verbs) + { + if (!currentVerbs.Contains(verb)) + { + currentVerbs.Add(verb); + } + } + + if (currentVerbs.Count > 0) + { + DesignerVerb[] ret = new DesignerVerb[currentVerbs.Count]; + currentVerbs.CopyTo(ret); + return new DesignerVerbCollection(ret); + } + else + { + return new DesignerVerbCollection(); + } + } + } + + #endregion + + /// All of our MenuItems' click events are handled by this method. It checks the + /// mapping to see which verb is associated with the MenuItem that sent the event + /// and then invokes that verb. + private void menuItem_Click(object sender, EventArgs e) + { + MenuItem key = sender as MenuItem; + DesignerVerb v = verbsFromMenuItems[key] as DesignerVerb; + v.Invoke(); + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleNameExtenderProvider.cs b/VisualPascalABCNETLinux/SSYY/SampleNameExtenderProvider.cs new file mode 100644 index 000000000..335530276 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleNameExtenderProvider.cs @@ -0,0 +1,133 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.Diagnostics; + using System.Collections; + + /// This extender provider provides a Name property to all components + /// Its used by the DesignerHost so that all components, not just controls + /// can have a name property + [ + ProvideProperty("Name", typeof(IComponent)) + ] + internal class SampleNameExtenderProvider : IExtenderProvider { + + // Any "Name" properties that we give out will have this attribute on them, + // so that we can tell it from any other "Name" properties which might be out there. + // We use this particular member as a filter to find the "Name"s we provided. + // + private static Attribute[] designerNameAttribute = new Attribute[] {new SampleDesignerNameAttribute(true)}; + + private SampleDesignerHost host; + + internal SampleNameExtenderProvider(SampleDesignerHost host) { + this.host = host; + } + + public virtual bool CanExtend(object o) { + + // We don't add name or modifiers to the base component. + if (o == Host.RootComponent) { + return false; + } + + // Now see if this object is inherited. If so, then we don't want to extend. + if (!TypeDescriptor.GetAttributes(o)[typeof(InheritanceAttribute)].Equals(InheritanceAttribute.NotInherited)) { + return false; + } + + return true; + } + + public SampleDesignerHost Host { + get { + return host; + } + } + + /// This is an extender property that we offer to all components + /// on the form. It implements the "Name" property. + [ + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + SampleDesignerName(true), // this is one of our "Name"s + ParenthesizePropertyName(true), + MergableProperty(false), + Description("The name property for the component"), + Category("Design") + ] + public virtual string GetName(IComponent comp) { + ISite site = comp.Site; + if (site != null) { + return site.Name; + } + return null; + } + + public void SetName(IComponent comp, string newName) { + + // trim any spaces off of the name + newName = newName.Trim(); + + SampleDesignSite cs = (SampleDesignSite) comp.Site; + if (newName.Equals(cs.Name)) return; + + // If the rename is only a case change + if (string.Compare(newName, cs.Name, true) != 0) { + Host.CheckName(newName); + } + + // Find the name property provided by us. + // + ((IComponentChangeService)Host).OnComponentChanging(comp, TypeDescriptor.GetProperties(comp, designerNameAttribute)["Name"]); + + Host.Sites.Remove(cs.Name); + Host.Sites[newName] = cs; + + string oldName = cs.Name; + cs.SetName(newName); + + Host.OnComponentRename(new ComponentRenameEventArgs(comp, oldName, newName)); + ((IComponentChangeService)Host).OnComponentChanged(comp, TypeDescriptor.GetProperties(comp, designerNameAttribute)["Name"], oldName, newName); + } + } + + internal class SampleInheritedNameExtenderProvider : SampleNameExtenderProvider { + + internal SampleInheritedNameExtenderProvider(SampleDesignerHost host) : base(host) { + } + + public override bool CanExtend(object o) { + // We don't add name or modifiers to the base component. + if (o == Host.RootComponent) { + return false; + } + + // Now see if this object is inherited. If so, then we are interested in it. + if (!TypeDescriptor.GetAttributes(o)[typeof(InheritanceAttribute)].Equals(InheritanceAttribute.NotInherited)) { + return true; + } + + return false; + } + + [ReadOnly(true)] + public override string GetName(IComponent comp) { + return base.GetName(comp); + } + } + +} + diff --git a/VisualPascalABCNETLinux/SSYY/SampleResourceService.cs b/VisualPascalABCNETLinux/SSYY/SampleResourceService.cs new file mode 100644 index 000000000..890d3823c --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleResourceService.cs @@ -0,0 +1,52 @@ +using System; +using System.Resources; +using System.IO; +using System.ComponentModel.Design; + +namespace SampleDesignerHost +{ + /// Empty implementation of a ResourceService. Here is where you can control the way in which + /// resources are read and written. This sample doesn't play with them though. + public class SampleResourceService : IResourceService + { + private ResourceReader reader; + private ResourceWriter writer; + private IDesignerHost host; + private MemoryStream ms; + + public SampleResourceService(IDesignerHost host) + { + this.host = host; + } + + #region Implementation of IResourceService + + public System.Resources.IResourceReader GetResourceReader(System.Globalization.CultureInfo info) + { + if (reader == null) + { + if (ms == null) + { + ms = new MemoryStream(); + } + reader = new ResourceReader(ms); + } + return reader; + } + + public System.Resources.IResourceWriter GetResourceWriter(System.Globalization.CultureInfo info) + { + if (writer == null) + { + if (ms == null) + { + ms = new MemoryStream(); + } + writer = new ResourceWriter(ms); + } + return writer; + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleSelectionItem.cs b/VisualPascalABCNETLinux/SSYY/SampleSelectionItem.cs new file mode 100644 index 000000000..4b8f8e169 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleSelectionItem.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost { + + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.Windows.Forms; + + // This class represents a single selected object. + internal class SampleSelectionItem { + + // Public objects this selection deals with + private Component component; // the component that's selected + private SampleSelectionService selectionMgr; // host interface + private bool primary; // is this the primary selection? + + /// Constructor + internal SampleSelectionItem(SampleSelectionService selectionMgr, Component component) { + this.component = component; + this.selectionMgr = selectionMgr; + } + + internal Component Component { + get { + return component; + } + } + + /// Determines if this is the primary selection. The primary selection uses a + /// different set of grab handles and generally supports sizing. The caller must + /// verify that there is only one primary object; this merely updates the + /// UI. + internal virtual bool Primary { + get { + return primary; + } + set { + if (this.primary != value) { + this.primary = value; + if (SelectionItemInvalidate != null) + SelectionItemInvalidate(this, EventArgs.Empty); + } + } + } + + internal event EventHandler SampleSelectionItemDispose ; + internal event EventHandler SelectionItemInvalidate ; + + /// Disposes of this selection. We dispose of our region object if it still exists and we + /// invalidate our UI so that we don't leave any turds laying around. + internal virtual void Dispose() { + if (primary) { + selectionMgr.SetPrimarySelection((SampleSelectionItem)null); + } + + if (SampleSelectionItemDispose != null) + SampleSelectionItemDispose(this, EventArgs.Empty); + } + } + +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleSelectionService.cs b/VisualPascalABCNETLinux/SSYY/SampleSelectionService.cs new file mode 100644 index 000000000..1bc54d907 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleSelectionService.cs @@ -0,0 +1,493 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.ComponentModel; + using System.ComponentModel.Design; + using System.Collections; + using System.Windows.Forms; + using System.Windows.Forms.Design; + + using System.Diagnostics; + + /// This class keeps track of the selected component(s) and provides events + /// to notify about selection changes. + internal class SampleSelectionService : ISelectionService { + + // These constitute the current selection at any moment. + private SampleSelectionItem primarySelection; // the primary selection + private Hashtable selectionsByComponent; // hashtable of selections + + // Hookups to other services + private IDesignerHost host; // The host interface + private IContainer container; // The container we're showing selection for + + // These are used when the host is in batch mode: we want to queue up selection + // changes in this case. + private bool batchMode; // Are we in batch mode? + private bool selectionChanged; // true, if the selection changed in batch mode + private bool selectionContentsChanged; // true, if the selection contents changed in batch mode + public bool need_clear_selection = false; + + internal SampleSelectionService(IDesignerHost host) { + this.host = host; + this.container = host.Container; + this.selectionsByComponent = new Hashtable(); + this.selectionChanged = false; + + // We initialize this to true to catch anything that would cause + // an update during load. + this.batchMode = true; + + // And configure the events we want to listen to. + IComponentChangeService cs = (IComponentChangeService)host.GetService(typeof(IComponentChangeService)); + Debug.Assert(cs != null, "IComponentChangeService not found"); + if (cs != null) { + cs.ComponentAdded += new ComponentEventHandler(this.DesignerHost_ComponentAdd); + cs.ComponentRemoved += new ComponentEventHandler(this.DesignerHost_ComponentRemove); + cs.ComponentChanged += new ComponentChangedEventHandler(this.DesignerHost_ComponentChanged); + } + + host.TransactionOpened += new EventHandler(this.DesignerHost_TransactionOpened); + host.TransactionClosed += new DesignerTransactionCloseEventHandler(this.DesignerHost_TransactionClosed); + + // If our host is already in a transaction, we handle it. + if (host.InTransaction) { + DesignerHost_TransactionOpened(host, EventArgs.Empty); + } + + host.LoadComplete += new EventHandler(this.DesignerHost_LoadComplete); + } + + // Properties + + /// The primary selection is the last one to have been selected. + object ISelectionService.PrimarySelection { + get { + if (primarySelection == null) { + IDictionaryEnumerator selections = (IDictionaryEnumerator)selectionsByComponent.GetEnumerator(); + bool valueFound = selections.MoveNext(); + + if (valueFound) { + primarySelection = (SampleSelectionItem)selections.Value; + primarySelection.Primary = true; + } + } + + if (primarySelection != null) { + return primarySelection.Component; + } + + return null; + } + } + + /// Return the number of components we have selected. + int ISelectionService.SelectionCount { + get { + return selectionsByComponent.Count; + } + } + + // Events + public event EventHandler SelectionChanged; + public event EventHandler SelectionChanging; + + // Methods + + /// Check to see if the given component is in our selection group. + bool ISelectionService.GetComponentSelected(object component) { + return (component != null && null != selectionsByComponent[component]); + } + + /// Return our list of selected components. + ICollection ISelectionService.GetSelectedComponents() { + object[] sels = new object[selectionsByComponent.Values.Count]; + selectionsByComponent.Values.CopyTo(sels, 0); + object[] objects = new object[sels.Length]; + + for (int i = 0; i < sels.Length; i++) { + objects[i] = ((SampleSelectionItem)sels[i]).Component; + } + + return objects; + } + + /// Select the given components. + void ISelectionService.SetSelectedComponents(ICollection components) { + ((ISelectionService)this).SetSelectedComponents(components, SelectionTypes.Normal); + } + + /// Select the given components with the given SelectionType. + void ISelectionService.SetSelectedComponents(ICollection components, SelectionTypes selectionType) { + bool fToggle = false; + bool fControl = false; + bool fClick = false; + bool fChanged = false; // did we actually change something? + + // Catch a null input list + if (components == null){ + components = new Component[0]; + } + + if ((selectionType & SelectionTypes.Normal) == SelectionTypes.Normal + || (selectionType & SelectionTypes.Click) == SelectionTypes.Click) { + + fControl = ((Control.ModifierKeys & Keys.Control) == Keys.Control); + + // Only toggle when we are affecting a single control, and + // when we are handling the "mouse" state events (i.e. up/down + // used to show/hide the selection). + // + fToggle = ((Control.ModifierKeys & Keys.Control) != 0 || (Control.ModifierKeys & Keys.Shift) != 0) + && components.Count == 1 + && (selectionType & SelectionTypes.MouseUp) != SelectionTypes.MouseUp; + } + + if ((selectionType & SelectionTypes.Click) == SelectionTypes.Click) { + fClick = true; + } + + + // If we are replacing the selection, only remove the ones that are not in our new list. + // We also handle the special case here of having a singular component selected that's + // already selected. In this case we just move it to the primary selection. + // + if (!fToggle && !fControl) { + object firstSelection = null; + foreach(object o in components) { + firstSelection = o; + break; + } + + if (fClick && 1 == components.Count && ((ISelectionService)this).GetComponentSelected(firstSelection)) { + SampleSelectionItem oldPrimary = primarySelection; + SetPrimarySelection((SampleSelectionItem)selectionsByComponent[firstSelection]); + if (oldPrimary != primarySelection) { + fChanged = true; + } + } + else { + SampleSelectionItem[] selections = new SampleSelectionItem[selectionsByComponent.Values.Count]; + selectionsByComponent.Values.CopyTo(selections, 0); + + // Even with several hundred components this should be fairly fast + foreach(SampleSelectionItem item in selections) { + bool remove = true; + + foreach(object comp in components) { + if (comp == item.Component) { + remove = false; + break; + } + } + + if (remove) { + RemoveSelection(item); + fChanged = true; + } + } + } + } + + SampleSelectionItem primarySel = null; + int selectedCount = selectionsByComponent.Count; + + // Now do the selection. + foreach(Component comp in components) { + if (comp != null) { + SampleSelectionItem s = (SampleSelectionItem)selectionsByComponent[comp]; + + if (null == s) { + s = new SampleSelectionItem(this, comp); + AddSelection(s); + + if (fControl || fToggle) { + primarySel = s; + } + + fChanged = true; + } + else { + if (fToggle) { + // Remove the selection from our list. + RemoveSelection(s); + fChanged = true; + } + } + } + } + + if (primarySel != null) { + SetPrimarySelection(primarySel); + } + + // Now notify that our selection has changed + if (fChanged) { + OnSelectionChanged(); + } + } + + + + /// Adds the given selection to our selection list. + private void AddSelection(SampleSelectionItem sel) { + selectionsByComponent[sel.Component] = sel; + } + + + private void DesignerHost_LoadComplete(object sender, EventArgs e) { + // Flush any pending changes + batchMode = false; + FlushSelectionChanges(); + } + + + /// Called by the designer host when it is entering or leaving a batch + /// operation. Here we queue up selection notification and we turn off + /// our UI. + private void DesignerHost_TransactionClosed(object sender, DesignerTransactionCloseEventArgs e) { + batchMode = false; + FlushSelectionChanges(); + } + + /// Called by the designer host when it is entering or leaving a batch + /// operation. Here we queue up selection notification and we turn off + /// our UI. + private void DesignerHost_TransactionOpened(object sender, EventArgs e) { + batchMode = true; + } + + /// Called by the formcore when someone has added a component. + private void DesignerHost_ComponentAdd(object sender, ComponentEventArgs ce) { + OnSelectionContentsChanged(); + } + + /// Called when a component changes. Here we look to see if the component is + /// selected. If it is, we notify STrackSelection that the selection has changed. + private void DesignerHost_ComponentChanged(object sender, ComponentChangedEventArgs ce) { + if (selectionsByComponent[ce.Component] != null) { + OnSelectionContentsChanged(); + } + } + + /// Called by the formcore when someone has removed a component. This will + /// remove any selection on the component without disturbing the rest of + /// the selection. + private void DesignerHost_ComponentRemove(object sender, ComponentEventArgs ce) { + + SampleSelectionItem sel = (SampleSelectionItem)selectionsByComponent[ce.Component]; + + if (sel != null) { + RemoveSelection(sel); + + + // If we removed the last selection and we have a designer host, then select the base + // component of the host. Otherwise, it is OK to have an empty selection. + if (selectionsByComponent.Count == 0 && host != null) { + + // Now we have to run through all the components and pick + // the control with the highest z-order. + IComponent[] comps = new IComponent[host.Container.Components.Count]; + host.Container.Components.CopyTo(comps, 0); + + if (comps == null) { + return; + } + + int maxZOrder = -1; + int defaultIndex = -1; + object maxIndexComp = null; + object baseComp = host.RootComponent; + + if (baseComp == null) { + return; + } + + for (int i = comps.Length - 1; i >= 0; i--) { + if (comps[i] == baseComp) { + continue; + } + else if (defaultIndex == -1) { + defaultIndex = i; + } + + if (comps[i] is Control) { + int zorder = ((Control)comps[i]).TabIndex; + if (zorder > maxZOrder) { + maxZOrder = zorder; + maxIndexComp = (object)comps[i]; + } + } + } + + if (maxIndexComp == null) { + if (defaultIndex != -1) { + maxIndexComp = comps[defaultIndex]; + } + else { + maxIndexComp = baseComp; + } + } + + ((ISelectionService)this).SetSelectedComponents(new object[]{maxIndexComp}, SelectionTypes.Replace); + } + else { + OnSelectionChanged(); + } + } + else { + // Component isn't selected, but our list of selectable components is + // different. + OnSelectionContentsChanged(); + } + } + + + + /// Disposes the entire selection manager. + internal void Dispose() { + // We've got to be careful here. We're one of the last things to go away when + // a form is being torn down, and we've got to be wary if things have pulled out + // already. + host.RemoveService(typeof(ISelectionService)); + host.TransactionOpened -= new EventHandler(this.DesignerHost_TransactionOpened); + host.TransactionClosed -= new DesignerTransactionCloseEventHandler(this.DesignerHost_TransactionClosed); + if (host.InTransaction) { + DesignerHost_TransactionClosed(host, new DesignerTransactionCloseEventArgs(true)); + } + host.LoadComplete -= new EventHandler(this.DesignerHost_LoadComplete); + + IComponentChangeService cs = (IComponentChangeService)host.GetService(typeof(IComponentChangeService)); + if (cs != null) { + cs.ComponentAdded -= new ComponentEventHandler(this.DesignerHost_ComponentAdd); + cs.ComponentRemoved -= new ComponentEventHandler(this.DesignerHost_ComponentRemove); + cs.ComponentChanged -= new ComponentChangedEventHandler(this.DesignerHost_ComponentChanged); + } + + SampleSelectionItem[] sels = new SampleSelectionItem[selectionsByComponent.Values.Count]; + selectionsByComponent.Values.CopyTo(sels, 0); + + for (int i = 0; i < sels.Length; i++) { + sels[i].Dispose(); + } + + selectionsByComponent.Clear(); + primarySelection = null; + } + + + /// Called when our visiblity or batch mode changes. Flushes + /// any pending notifications or updates if possible. + private void FlushSelectionChanges() { + if (!batchMode) { + if (selectionChanged) OnSelectionChanged(); + if (selectionContentsChanged) OnSelectionContentsChanged(); + } + } + + + /// Called anytime the selection has changed. We update our UI for the selection, and + /// then we fire a change event. + private void OnSelectionChanged() { + if (batchMode) { + selectionChanged = true; + } + else { + selectionChanged = false; + + // Raise SelectionChanging event - this should be moved to OnSelectionChanging() + // if the implementation requires listening to changING events. + if (SelectionChanging != null) { + try { + SelectionChanging(this, EventArgs.Empty);; + } + catch(Exception) { + // It is an error to ever throw in this event. + Debug.Fail("Exception thrown in selectionChanging event"); + } + } + + if (need_clear_selection) + { + need_clear_selection = false; + selectionsByComponent.Clear(); + primarySelection = null; + } + + if (SelectionChanged != null) { + try { + SelectionChanged(this, EventArgs.Empty);; + } + catch(Exception) { + // It is an error to ever throw in this event. + Debug.Fail("Exception thrown in selectionChanging event"); + } + } + + + OnSelectionContentsChanged(); + } + } + + /// This should be called when the selection has changed, or when just the contents of + /// the selection has changed. It updates the document manager's notion of selection. + /// the selection have changed. + private void OnSelectionContentsChanged() { + if (batchMode) { + selectionContentsChanged = true; + } + else { + selectionContentsChanged = false; + + PropertyGrid grid = (PropertyGrid)host.GetService(typeof(PropertyGrid)); + if (grid != null) + { + ICollection col = ((ISelectionService)this).GetSelectedComponents(); + object[] selection = new Object[col.Count]; + col.CopyTo(selection, 0); + grid.SelectedObjects = selection; + (host as SampleDesignerHost).SetSelectedComponents(selection); + } + } + } + + /// Removes the given selection from our selection list + private void RemoveSelection(SampleSelectionItem s) { + selectionsByComponent.Remove(s.Component); + s.Dispose(); + } + + + /// Sets the given selection object to be the primary selection. + internal void SetPrimarySelection(SampleSelectionItem sel) { + if (sel != primarySelection) { + if (null != primarySelection) { + primarySelection.Primary = false; + } + + primarySelection = sel; + } + + if (null != primarySelection) { + primarySelection.Primary = true; + } + } + + //internal void SetSelectedComponent(IComponent comp) + //{ + // ((ISelectionService)this).SetSelectedComponents(new IComponent[] { comp }); + //} + + } +} + diff --git a/VisualPascalABCNETLinux/SSYY/SampleToolboxService.cs b/VisualPascalABCNETLinux/SSYY/SampleToolboxService.cs new file mode 100644 index 000000000..61168591f --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleToolboxService.cs @@ -0,0 +1,264 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.Drawing.Design; +using System.Windows.Forms; +using System.ComponentModel.Design; + +namespace SampleDesignerHost +{ + /// The IToolboxService is responsible for communication between the designer + /// and whatever implementation of a toolbox you have. This service can be + /// its own class (as it is here) or it can be implemented on the actual + /// toolbox control. + public class SampleToolboxService : System.Drawing.Design.IToolboxService + { + private IDesignerHost host; + private SampleDesignerApplication.ToolBoxPane toolbox; + + public SampleToolboxService(IDesignerHost host) + { + this.host = host; + + // Our MainForm adds our ToolboxPane to the host's services. + toolbox = host.GetService(typeof(SampleDesignerApplication.ToolBoxPane)) as SampleDesignerApplication.ToolBoxPane; + } + #region Implementation of IToolboxService + + /// Add a ToolboxItem to our toolbox, in a specific category, bound to a certain host. + public void AddLinkedToolboxItem(ToolboxItem toolboxItem, string category, System.ComponentModel.Design.IDesignerHost host) + { + // UNIMPLEMENTED - We didn't end up doing a project system, so there's no need + // to add custom tools (despite that we do have a tab for such tools). + } + + /// Add a ToolboxItem to our toolbox, bound to a certain host. + void System.Drawing.Design.IToolboxService.AddLinkedToolboxItem(ToolboxItem toolboxItem, System.ComponentModel.Design.IDesignerHost host) + { + // UNIMPLEMENTED - We didn't end up doing a project system, so there's no need + // to add custom tools (despite that we do have a tab for such tools). + } + + /// We deserialize a ToolboxItem when we drop it onto our design surface. + /// The ToolboxItem comes packaged in a DataObject. We're just working + /// with standard tools and one host, so the host parameter is ignored. + public ToolboxItem DeserializeToolboxItem(object serializedObject, System.ComponentModel.Design.IDesignerHost host) + { + return (ToolboxItem)((DataObject)serializedObject).GetData(typeof(ToolboxItem)); + } + + /// We deserialize a ToolboxItem when we drop it onto our design surface. + /// The ToolboxItem comes packaged in a DataObject. + ToolboxItem System.Drawing.Design.IToolboxService.DeserializeToolboxItem(object serializedObject) + { + return this.DeserializeToolboxItem(serializedObject, this.host); + } + + /// We serialize a toolbox by packaging it in a DataObject. Simple! + public object SerializeToolboxItem(ToolboxItem toolboxItem) + { + return new DataObject(toolboxItem); + } + + /// Remove a ToolboxItem from the specified category in our toolbox. + public void RemoveToolboxItem(ToolboxItem toolboxItem, string category) + { + // UNIMPLEMENTED - Our ToolboxPane handles its own creation and modification + // well enough, and our tool list stays constant. However, if you want a tool + // list to have Add/Remove capability, here's the best place to do it. + } + + /// Remove a ToolboxItem from our toolbox. + void System.Drawing.Design.IToolboxService.RemoveToolboxItem(ToolboxItem toolboxItem) + { + // UNIMPLEMENTED - Our ToolboxPane handles its own creation and modification + // well enough, and our tool list stays constant. However, if you want a tool + // list to have Add/Remove capability, here's the best place to do it. + } + + /// If we've got a tool selected, then perhaps we want to set our cursor to do + /// something interesting when its over the design surface. If we do, then + /// we do it here and return true. Otherwise we return false so the caller + /// can set the cursor in some default manor. + public bool SetCursor() + { + if (toolbox.SelectedTool != null && toolbox.SelectedTool.DisplayName != "") // is not a tool. + { + Cursor.Current = Cursors.Cross; + return true; + } + return false; + } + + /// Add a ToolboxItem to our toolbox under the specified category. + public void AddToolboxItem(ToolboxItem toolboxItem, string category) + { + // UNIMPLEMENTED - Our ToolboxPane handles its own creation and modification + // well enough, and our tool list stays constant. However, if you want a tool + // list to have Add/Remove capability, here's the best place to do it. + } + + /// Add a ToolboxItem to our toolbox. + void System.Drawing.Design.IToolboxService.AddToolboxItem(ToolboxItem toolboxItem) + { + // UNIMPLEMENTED - Our ToolboxPane handles its own creation and modification + // well enough, and our tool list stays constant. However, if you want a tool + // list to have Add/Remove capability, here's the best place to do it. + } + + /// Add a creator that will convert non-standard tools in the specified format into ToolboxItems, to be associated with a host. + public void AddCreator(System.Drawing.Design.ToolboxItemCreatorCallback creator, string format, System.ComponentModel.Design.IDesignerHost host) + { + // UNIMPLEMENTED - We aren't handling any non-standard tools here. Our toolset is constant. + } + + /// Add a creator that will convert non-standard tools in the specified format into ToolboxItems. + void System.Drawing.Design.IToolboxService.AddCreator(System.Drawing.Design.ToolboxItemCreatorCallback creator, string format) + { + // UNIMPLEMENTED - We aren't handling any non-standard tools here. Our toolset is constant. + } + + /// Remove the creator for the specified format, associated with a particular host. + public void RemoveCreator(string format, System.ComponentModel.Design.IDesignerHost host) + { + // UNIMPLEMENTED - We aren't handling any non-standard tools here. Our toolset is constant. + } + + /// Remove the creator for the specified format. + void System.Drawing.Design.IToolboxService.RemoveCreator(string format) + { + // UNIMPLEMENTED - We aren't handling any non-standard tools here. Our toolset is constant. + } + + /// Get all the tools in a category. + public ToolboxItemCollection GetToolboxItems(string category, System.ComponentModel.Design.IDesignerHost host) + { + return toolbox.GetToolsFromCategory(category); + } + + /// Get all of the tools. + ToolboxItemCollection System.Drawing.Design.IToolboxService.GetToolboxItems(string category) + { + return this.GetToolboxItems(category, this.host); + } + + /// Get all of the tools. We're always using our current host though. + ToolboxItemCollection System.Drawing.Design.IToolboxService.GetToolboxItems(System.ComponentModel.Design.IDesignerHost host) + { + return toolbox.GetAllTools(); + } + + /// Get all of the tools. + ToolboxItemCollection System.Drawing.Design.IToolboxService.GetToolboxItems() + { + return toolbox.GetAllTools(); + } + + /// Our toolbox has categories akin to those of Visual Studio, but you + /// could group them any which way. Just make sure your IToolboxService knows. + public CategoryNameCollection CategoryNames + { + get + { + return toolbox.CategoryNames; + } + } + + /// Return the selected ToolboxItem in our toolbox if it is associated with this host. + /// Since all of our tools are associated with our only host, the host parameter + /// is ignored. + public ToolboxItem GetSelectedToolboxItem(System.ComponentModel.Design.IDesignerHost host) + { + if (toolbox.SelectedTool.DisplayName != "") + { + return toolbox.SelectedTool; + } + return null; + } + + /// Return the selected ToolboxItem in our toolbox. + ToolboxItem System.Drawing.Design.IToolboxService.GetSelectedToolboxItem() + { + return this.GetSelectedToolboxItem(this.host); + } + + /// Set the selected ToolboxItem in our toolbox. + public void SetSelectedToolboxItem(ToolboxItem toolboxItem) + { + // UNIMPLEMENTED - We never had a need to do this, since + // our toolbox handles input and selection all by itself. + } + + /// Refreshes the toolbox. + public void Refresh() + { + toolbox.Refresh(); + } + + /// We are always using standard ToolboxItems, so they are always supported. + public bool IsSupported(object serializedObject, System.Collections.ICollection filterAttributes) + { + return true; + } + + /// We are always using standard ToolboxItems, so they are always supported. + bool System.Drawing.Design.IToolboxService.IsSupported(object serializedObject, System.ComponentModel.Design.IDesignerHost host) + { + return true; + } + + /// This gets called after our IToolboxUser (the designer) ToolPicked method is called. + /// In our case, we select the pointer. + public void SelectedToolboxItemUsed() + { + toolbox.SelectPointer(); + } + + /// Check if a serialized object is a ToolboxItem. In our case, all of our tools + /// are standard and from a constant set, and they all extend ToolboxItem, so if + /// we can deserialize it in our standard-way, then it is indeed a ToolboxItem. + /// The host is ignored. + public bool IsToolboxItem(object serializedObject, System.ComponentModel.Design.IDesignerHost host) + { + // If we can deserialize it, it's a ToolboxItem. + if (this.DeserializeToolboxItem(serializedObject, host) != null) + { + return true; + } + return false; + } + + /// Check if a serialized object is a ToolboxItem. In our case, all of our tools + /// are standard and from a constant set, and they all extend ToolboxItem, so if + /// we can deserialize it in our standard-way, then it is indeed a ToolboxItem. + bool System.Drawing.Design.IToolboxService.IsToolboxItem(object serializedObject) + { + return IsToolboxItem(serializedObject, this.host); + } + + /// If your toolbox is categorized, then it's good for others to know + /// which category is selected. + public string SelectedCategory + { + get + { + return toolbox.SelectedCategory; + } + set + { + // UNIMPLEMENTED - We don't give our IToolboxService control + // over tab selection. + } + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleTypeDescriptorFilterService.cs b/VisualPascalABCNETLinux/SSYY/SampleTypeDescriptorFilterService.cs new file mode 100644 index 000000000..4dc7c998d --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleTypeDescriptorFilterService.cs @@ -0,0 +1,192 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.ComponentModel; +using System.ComponentModel.Design; + +namespace SampleDesignerHost +{ + public class SYNamePropertyDescriptor : PropertyDescriptor + { + private static bool is_letter(char c) + { + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); + } + + private static bool is_valid_char(char c) + { + return is_letter(c) || c == '_' || c == '0' || (c >= '1' && c <= '9'); + } + + public static bool is_valid_id(string name) + { + if (name == null || name == "") return false; + if (!is_letter(name[0])) return false; + for (int i = 1; i < name.Length; ++i) + { + if (!is_valid_char(name[i])) + { + return false; + } + } + return true; + } + + private PropertyDescriptor _d; + AttributeCollection _ac; + + public SYNamePropertyDescriptor(PropertyDescriptor descr):base(descr) + { + _d = descr; + int count = _d.Attributes.Count; + Attribute[] attrs = new Attribute[count]; + Attribute vis_att = new System.ComponentModel.BrowsableAttribute(true); + for (int i = 0; i < count; ++i) + { + if (_d.Attributes[i].TypeId == vis_att.TypeId) + { + attrs[i] = vis_att; + } + else + { + attrs[i] = _d.Attributes[i]; + } + } + _ac = new AttributeCollection(attrs); + //Array.Resize(attrs, attrs.Length + 1); + //attrs[attrs.Length - 1] = new System.ComponentModel.BrowsableAttribute(true); + } + + public override bool CanResetValue(object component) + { + return _d.CanResetValue(component); + } + + public override Type ComponentType + { + get { return _d.ComponentType; } + } + + public override object GetValue(object component) + { + return _d.GetValue(component); + } + + public override bool IsReadOnly + { + get { return _d.IsReadOnly; } + } + + public override Type PropertyType + { + get { return _d.PropertyType; } + } + + public override void ResetValue(object component) + { + _d.ResetValue(component); + } + + public override void SetValue(object component, object value) + { + string s = value as string; + if (!is_valid_id(s)) + throw new Exception("Invalid identifer"); + _d.SetValue(component, value); + } + + public override bool ShouldSerializeValue(object component) + { + return _d.ShouldSerializeValue(component); + } + + public override bool IsBrowsable + { + get + { + return true; + } + } + + public override AttributeCollection Attributes + { + get + { + return _ac; //base.Attributes; + } + } + } + + + /// This service relays requests for filtering a component's exposed + /// attributes, properties, and events to that component's designer. + public class SampleTypeDescriptorFilterService : ITypeDescriptorFilterService + { + public IDesignerHost host; + + public SampleTypeDescriptorFilterService(IDesignerHost host) + { + this.host = host; + } + + /// Get the designer for the given component and cast it as a designer filter. + private IDesignerFilter GetDesignerFilter(IComponent component) + { + return host.GetDesigner(component) as IDesignerFilter; + } + + #region Implementation of ITypeDescriptorFilterService + /// Tell the given component's designer to filter properties. + public bool FilterProperties(System.ComponentModel.IComponent component, System.Collections.IDictionary properties) + { + IDesignerFilter filter = GetDesignerFilter(component); + if (filter != null) + { + filter.PreFilterProperties(properties); + filter.PostFilterProperties(properties); + PropertyDescriptor pd = properties["Name"] as PropertyDescriptor; + if (pd != null) + { + properties["Name"] = new SYNamePropertyDescriptor(pd); + } + return true; + } + return false; + } + + /// Tell the given component's designer to filter attributes. + public bool FilterAttributes(System.ComponentModel.IComponent component, System.Collections.IDictionary attributes) + { + IDesignerFilter filter = GetDesignerFilter(component); + if (filter != null) + { + filter.PreFilterAttributes(attributes); + filter.PostFilterAttributes(attributes); + return true; + } + return false; + } + + /// Tell the given component's designer to filter events. + public bool FilterEvents(System.ComponentModel.IComponent component, System.Collections.IDictionary events) + { + IDesignerFilter filter = GetDesignerFilter(component); + if (filter != null) + { + filter.PreFilterEvents(events); + filter.PostFilterEvents(events); + return true; + } + return false; + } + #endregion + } +} diff --git a/VisualPascalABCNETLinux/SSYY/SampleTypeResolutionService.cs b/VisualPascalABCNETLinux/SSYY/SampleTypeResolutionService.cs new file mode 100644 index 000000000..83eeb5e61 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/SampleTypeResolutionService.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.ComponentModel.Design; +using System.Collections; +using System.Reflection; + +namespace SampleDesignerHost +{ + + /// The ITypeResolutionService is used to load types at design time. It keeps an internal + /// set of assemblies that have been referenced thus far and can search them for types given + /// unqualified names. + public class SampleTypeResolutionService : System.ComponentModel.Design.ITypeResolutionService + { + private Hashtable assemblies; + public SampleTypeResolutionService() { } + + /// We use this property to help us generate code and compile. + public Assembly[] RefencedAssemblies + { + get + { + if (assemblies == null) + { + assemblies = new Hashtable(); + } + Assembly[] ret = new Assembly[assemblies.Values.Count]; + assemblies.Values.CopyTo(ret, 0); + return ret; + } + } + + #region Implementation of ITypeResolutionService + + /// Add an assembly to our internal set. + public void ReferenceAssembly(System.Reflection.AssemblyName name) + { + if (assemblies == null) + { + assemblies = new Hashtable(); + } + + if (!assemblies.Contains(name)) + { + assemblies.Add(name, Assembly.Load(name)); + } + } + + /// Search our internal set of assemblies for one with this AssemblyName. + /// If it cannot be located and throwOnError is true, throw an exception. + public System.Reflection.Assembly GetAssembly(System.Reflection.AssemblyName name, bool throwOnError) + { + Assembly a = null; + + if (assemblies != null) + { + a = assemblies[name] as Assembly; + } + + if ((a == null) && throwOnError) + { + throw new Exception("Assembly " + name.Name + " not found in referenced assemblies."); + } + return a; + } + + /// Search our internal set of assemblies for one with this AssemblyName. + System.Reflection.Assembly System.ComponentModel.Design.ITypeResolutionService.GetAssembly(System.Reflection.AssemblyName name) + { + return GetAssembly(name, false); + } + + /// Find a type based on a name that may or may not be fully qualified. + /// If the type cannot be found and throwOnError is true, throw an Exception. + /// Searching should ignore case based on ignoreCase's value. + public Type GetType(string name, bool throwOnError, bool ignoreCase) + { + // First we assume it is a fully qualified name, and that Type.GetType() + // can find it. + // + Type t = Type.GetType(name, throwOnError, ignoreCase); + + // If that didn't work, then we check our referenced assemblies' types. + if ((t == null) && (assemblies != null)) + { + foreach (Assembly a in assemblies.Values) + { + t = a.GetType(name, throwOnError, ignoreCase); + if (t != null) + { + break; + } + } + } + + // No luck. + if ((t == null) && throwOnError) + { + throw new Exception("The type " + name + " could not be found. " + + "If it is an unqualified name, then its assembly has not been referenced."); + } + return t; + } + + /// Find a type based on a name that may or may not be fully qualified. + /// If the type cannot be found and throwOnError is true, throw an Exception. + /// Do not ignore case while searching. + Type System.ComponentModel.Design.ITypeResolutionService.GetType(string name, bool throwOnError) + { + return GetType(name, throwOnError, false); + } + + /// Find a type based on a name that may or may not be fully qualified. + /// Do not ignore case while searching. + Type System.ComponentModel.Design.ITypeResolutionService.GetType(string name) + { + return GetType(name, false, false); + } + + /// Return the path to the file which the given assembly was loaded. + /// If that assembly has not been loaded, this returns null. + public string GetPathOfAssembly(System.Reflection.AssemblyName name) + { + Assembly a = GetAssembly(name, false); + if (a != null) + { + return a.Location; + } + return null; + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/SSYY/ServiceRequests.cs b/VisualPascalABCNETLinux/SSYY/ServiceRequests.cs new file mode 100644 index 000000000..1d53a24f8 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ServiceRequests.cs @@ -0,0 +1,189 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; + +namespace SampleDesignerApplication +{ + /// This form shows the service requests that have been made to the host. + /// It divides them into successful and unsuccessful requests. + public class ServiceRequests : System.Windows.Forms.Form + { + private System.Windows.Forms.TreeView treeView1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private TreeNode successfulNode; + private TreeNode unsuccessfulNode; + private Hashtable serviceRequests; + + private System.ComponentModel.Container components = null; + + public ServiceRequests() + { + InitializeComponent(); + InitializeTreeViewNodes(); + } + + /// Create a new tree node to describe a service request of the given type. + private TreeNode CreateNodeForType(Type type) + { + TreeNode node = new TreeNode(type.FullName); + string stack = Environment.StackTrace; + string[] entries = stack.Split('\r', '\n'); + + bool recordEntry = false; + foreach(string entry in entries) + { + if (entry.Length > 0) + { + // Skip the frames that we're currently on. + // + if (recordEntry) + { + node.Nodes.Add(new TreeNode(entry)); + } + else if (entry.IndexOf("GetService") != -1) + { + recordEntry = true; + } + } + } + return node; + } + + /// Set up our two root nodes. + private void InitializeTreeViewNodes() + { + successfulNode = new TreeNode("Successful Requests"); + unsuccessfulNode = new TreeNode("Unsuccessful Requests"); + + treeView1.Nodes.Add(successfulNode); + treeView1.Nodes.Add(unsuccessfulNode); + } + + public void ServiceFailed(Type type) + { + if (serviceRequests == null) + { + serviceRequests = new Hashtable(); + } + + if (!serviceRequests.ContainsKey(type)) + { + serviceRequests[type] = false; // Mark the request for this type as failed + unsuccessfulNode.Nodes.Add(CreateNodeForType(type)); // Add it to our tree + } + } + + public void ServiceSucceeded(Type type) + { + if (serviceRequests == null) + { + serviceRequests = new Hashtable(); + } + + if (!serviceRequests.ContainsKey(type)) + { + serviceRequests[type] = true; // Mark the request for this type as successful + successfulNode.Nodes.Add(CreateNodeForType(type)); // Add it to our tree + } + } + + /// Clean up any resources being used. + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + + private void InitializeComponent() + { + this.treeView1 = new System.Windows.Forms.TreeView(); + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // treeView1 + // + this.treeView1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.treeView1.ImageIndex = -1; + this.treeView1.Name = "treeView1"; + this.treeView1.SelectedImageIndex = -1; + this.treeView1.Size = new System.Drawing.Size(440, 328); + this.treeView1.TabIndex = 0; + // + // button1 + // + this.button1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right); + this.button1.Location = new System.Drawing.Point(360, 384); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(72, 24); + this.button1.TabIndex = 1; + this.button1.Text = "&Clear"; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right); + this.label1.Location = new System.Drawing.Point(8, 344); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(344, 72); + this.label1.TabIndex = 2; + this.label1.Text = "This window shows the services that have been requested by the designer. There a" + + "re two top-level categories: Successful and Unsuccessful. Unsuccessful service" + + " requests result in degraded designer functionality."; + // + // ServiceRequests + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(440, 422); + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.label1, + this.button1, + this.treeView1}); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ServiceRequests"; + this.Text = "ServiceRequests"; + this.ResumeLayout(false); + + } + #endregion + + /// Clear the trees. + private void button1_Click(object sender, System.EventArgs e) + { + treeView1.Nodes.Clear(); + InitializeTreeViewNodes(); + if (serviceRequests != null) + { + serviceRequests.Clear(); + } + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/ServiceRequests.resx b/VisualPascalABCNETLinux/SSYY/ServiceRequests.resx new file mode 100644 index 000000000..7e323966c --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ServiceRequests.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/VisualPascalABCNETLinux/SSYY/StringStack.cs b/VisualPascalABCNETLinux/SSYY/StringStack.cs new file mode 100644 index 000000000..1d0b9dddb --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/StringStack.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +namespace SampleDesignerHost +{ + using System; + using System.Collections; + + /// This is just a special stack to handle the transaction descriptions. + /// It functions like a normal stack, except it looks for the first + /// non-null (and non "") string. + internal class StringStack : Stack { + internal StringStack() { + } + + internal string GetNonNull() { + int items = this.Count; + object item; + object[] itemArr = this.ToArray(); + for (int i = items - 1; i >=0; i--) { + item = itemArr[i]; + if (item != null && item is string && ((string)item).Length > 0) { + return (string)item; + } + } + return ""; + } + } +} diff --git a/VisualPascalABCNETLinux/SSYY/ToolBoxForm.Designer.cs b/VisualPascalABCNETLinux/SSYY/ToolBoxForm.Designer.cs new file mode 100644 index 000000000..f131eddac --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolBoxForm.Designer.cs @@ -0,0 +1,65 @@ +namespace VisualPascalABC +{ + partial class ToolBoxForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.toolboxPane1 = new SampleDesignerApplication.ToolBoxPane(); + this.SuspendLayout(); + // + // toolboxPane1 + // + this.toolboxPane1.AllowDrop = true; + this.toolboxPane1.BackColor = System.Drawing.Color.Black; + this.toolboxPane1.Dock = System.Windows.Forms.DockStyle.Fill; + this.toolboxPane1.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.toolboxPane1.Host = null; + this.toolboxPane1.Location = new System.Drawing.Point(0, 0); + this.toolboxPane1.Margin = new System.Windows.Forms.Padding(2); + this.toolboxPane1.Name = "toolboxPane1"; + this.toolboxPane1.Size = new System.Drawing.Size(292, 266); + this.toolboxPane1.TabIndex = 0; + // + // ToolBoxForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 266); + this.Controls.Add(this.toolboxPane1); + this.HideOnClose = true; + this.Name = "ToolBoxForm"; + this.TabText = "ToolBoxForm"; + this.Text = "ToolBoxForm"; + this.ResumeLayout(false); + + } + + #endregion + + private SampleDesignerApplication.ToolBoxPane toolboxPane1; + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/ToolBoxForm.cs b/VisualPascalABCNETLinux/SSYY/ToolBoxForm.cs new file mode 100644 index 000000000..24645f9eb --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolBoxForm.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using SampleDesignerApplication; + +namespace VisualPascalABC +{ + public partial class ToolBoxForm : DockContent + { + public SampleDesignerApplication.ToolBoxPane ToolBox + { + get + { + return toolboxPane1; + } + } + + public ToolBoxForm() + { + //Hide(); + InitializeComponent(); + //ToolBox = new SampleDesignerApplication.ToolboxPane(); + //ToolBox.Hide(); + //this.Controls.Add(ToolBox); + //ToolBox.Dock = DockStyle.Fill; + //ToolBox.Show(); + TabText = PascalABCCompiler.StringResources.Get("VP_MF_M_TOOLBOX"); + } + + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/ToolBoxForm.resx b/VisualPascalABCNETLinux/SSYY/ToolBoxForm.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolBoxForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.Designer.cs b/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.Designer.cs new file mode 100644 index 000000000..c82e263b6 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.Designer.cs @@ -0,0 +1,100 @@ +namespace SampleDesignerApplication +{ + partial class ToolBoxPane + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.listBar1 = new NETXP.Controls.Bars.ListBar(); + this.listWindowsForms = new NETXP.Controls.Bars.ListBarGroup(); + this.listData = new NETXP.Controls.Bars.ListBarGroup(); + this.listComponents = new NETXP.Controls.Bars.ListBarGroup(); + ((System.ComponentModel.ISupportInitialize)(this.listBar1)).BeginInit(); + this.SuspendLayout(); + // + // listBar1 + // + this.listBar1.AllowDragItems = false; + this.listBar1.AllowDrop = true; + this.listBar1.Cursor = System.Windows.Forms.Cursors.Hand; + this.listBar1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listBar1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.listBar1.Groups.AddRange(new NETXP.Controls.Bars.ListBarGroup[] { + this.listWindowsForms, + this.listData, + this.listComponents}); + this.listBar1.Location = new System.Drawing.Point(0, 0); + this.listBar1.Name = "listBar1"; + this.listBar1.Size = new System.Drawing.Size(266, 337); + this.listBar1.TabIndex = 0; + this.listBar1.ToolTip = null; + this.listBar1.SelectedGroupChanged += new System.EventHandler(this.listBar1_SelectedGroupChanged); + this.listBar1.ItemClicked += new NETXP.Controls.Bars.ItemClickedEventHandler(this.listBar1_ItemClicked); + this.listBar1.Paint += new System.Windows.Forms.PaintEventHandler(this.listBar1_Paint); + this.listBar1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listBar1_MouseDown); + // + // listWindowsForms + // + this.listWindowsForms.Caption = "VP_MF_M_COMMON_COMPONENTS"; + this.listWindowsForms.Key = ""; + this.listWindowsForms.ToolTipText = ""; + this.listWindowsForms.View = NETXP.Controls.Bars.ListBarGroupView.TextRight; + // + // listData + // + this.listData.Caption = "VP_MF_M_DATA_COMPONENTS"; + this.listData.Key = ""; + this.listData.ToolTipText = ""; + this.listData.View = NETXP.Controls.Bars.ListBarGroupView.TextRight; + // + // listComponents + // + this.listComponents.Caption = "VP_MF_M_NON_VISUAL_COMPONENTS"; + this.listComponents.Key = ""; + this.listComponents.ToolTipText = ""; + this.listComponents.View = NETXP.Controls.Bars.ListBarGroupView.TextRight; + // + // ToolBoxPane + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listBar1); + this.Name = "ToolBoxPane"; + this.Size = new System.Drawing.Size(266, 337); + ((System.ComponentModel.ISupportInitialize)(this.listBar1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private NETXP.Controls.Bars.ListBar listBar1; + private NETXP.Controls.Bars.ListBarGroup listData; + private NETXP.Controls.Bars.ListBarGroup listWindowsForms; + private NETXP.Controls.Bars.ListBarGroup listComponents; + } +} diff --git a/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.cs b/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.cs new file mode 100644 index 000000000..80e000ccf --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.cs @@ -0,0 +1,406 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using System.Drawing.Design; +using System.ComponentModel.Design; +using NETXP.Controls.Bars; + +namespace SampleDesignerApplication +{ + public partial class ToolBoxPane : UserControl + { + private SampleDesignerHost.SampleDesignerHost host; + private ToolboxItem pointer; // a "null" tool + private ListBarItem pointerItem; + private int selectedIndex; // the index of the currently selected tool + private bool initialPaint = true; // see ToolboxPane_Paint method + + private List listData_ti = new List(); + private List listCustomControls_ti = new List(); + private List listWindowsForms_ti = new List(); + private List listComponents_ti = new List(); + + private List[] listAll; + private bool doubleClicked = false; + + // We load types into our categories in a rather primitive way. It is easier than + // dealing with type resolution, but we can only do this since our list of tools + // is standard and unchanging. + // + private Type[] windowsFormsToolTypes = new Type[] { + typeof(System.Windows.Forms.Button), + typeof(System.Windows.Forms.CheckBox), + typeof(System.Windows.Forms.CheckedListBox), + typeof(System.Windows.Forms.ComboBox), + typeof(System.Windows.Forms.DateTimePicker), + typeof(System.Windows.Forms.DomainUpDown), + typeof(System.Windows.Forms.FlowLayoutPanel), + typeof(System.Windows.Forms.GroupBox), + typeof(System.Windows.Forms.HScrollBar), + typeof(System.Windows.Forms.Label), + typeof(System.Windows.Forms.LinkLabel), + typeof(System.Windows.Forms.ListBox), + typeof(System.Windows.Forms.ListView), + typeof(System.Windows.Forms.MaskedTextBox), + typeof(System.Windows.Forms.MonthCalendar), + typeof(System.Windows.Forms.NotifyIcon), + typeof(System.Windows.Forms.NumericUpDown), + typeof(System.Windows.Forms.Panel), + typeof(System.Windows.Forms.PictureBox), + + typeof(System.Windows.Forms.ProgressBar), + typeof(System.Windows.Forms.PropertyGrid), + typeof(System.Windows.Forms.RadioButton), + typeof(System.Windows.Forms.RichTextBox), + typeof(System.Windows.Forms.SplitContainer), + + typeof(System.Windows.Forms.TabControl), + typeof(System.Windows.Forms.TableLayoutPanel), + typeof(System.Windows.Forms.TextBox), + typeof(System.Windows.Forms.ToolTip), + typeof(System.Windows.Forms.TrackBar), + typeof(System.Windows.Forms.TreeView), + typeof(System.Windows.Forms.VScrollBar), + typeof(System.Windows.Forms.WebBrowser), + typeof(System.Windows.Forms.ContextMenuStrip), + typeof(System.Windows.Forms.MenuStrip), + typeof(System.Windows.Forms.StatusStrip), + typeof(System.Windows.Forms.ToolStrip), + typeof(System.Windows.Forms.ToolStripContainer), + typeof(System.Windows.Forms.ColorDialog), + typeof(System.Windows.Forms.FontDialog), + typeof(System.Windows.Forms.FolderBrowserDialog), + typeof(System.Windows.Forms.OpenFileDialog), + typeof(System.Windows.Forms.SaveFileDialog), + + }; + + private Type[] componentsToolTypes = new Type[] { + typeof(System.ComponentModel.BackgroundWorker), + typeof(System.IO.FileSystemWatcher), + typeof(System.Windows.Forms.HelpProvider), + typeof(System.Windows.Forms.ImageList), + typeof(System.Diagnostics.Process), + typeof(System.IO.Ports.SerialPort), + typeof(System.Timers.Timer) + }; + + private Type[] dataToolTypes = new Type[] { + typeof(System.Windows.Forms.DataVisualization.Charting.Chart), + typeof(System.Windows.Forms.BindingNavigator), + typeof(System.Windows.Forms.BindingSource), + typeof(System.Windows.Forms.DataGridView), + typeof(System.Data.DataSet) + }; + + + private System.Reflection.FieldInfo thisMouseTrack; + + public ToolBoxPane() + { + InitializeComponent(); + listAll = new List[] { + listData_ti, + listCustomControls_ti, + listWindowsForms_ti, + listComponents_ti }; + pointer = new ToolboxItem(); + pointer.DisplayName = ""; + pointer.Bitmap = global::VisualPascalABC.Properties.Resources.Pointer; //new Bitmap(16, 16); + pointer.Bitmap.MakeTransparent(pointer.Bitmap.GetPixel(0, 0)); + pointerItem = new ListBarItem(pointer.DisplayName); + pointerItem.Image = pointer.Bitmap; + pointerItem.Tag = pointer; + FillToolbox(); + listData.Tag = listData_ti; + listWindowsForms.Tag = listWindowsForms_ti; + listComponents.Tag = listComponents_ti; + thisMouseTrack = typeof(ListBar).GetField("mouseTrack", + System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.NonPublic); + foreach (ListBarGroup lg in listBar1.Groups) + { + lg.Caption = PascalABCCompiler.StringResources.Get(lg.Caption); + } + //listBar1.SelectedGroup.Items. + } + + /// Clean up any resources being used. + //protected override void Dispose(bool disposing) + //{ + // if (disposing) + // { + // if (components != null) + // { + // components.Dispose(); + // } + // } + // base.Dispose(disposing); + //} + + private void AddBarItem(ListBarGroup group, ToolboxItem tbi) + { + ListBarItem lbi = new ListBarItem(tbi.DisplayName); + lbi.Image = tbi.Bitmap; + group.Items.Add(lbi); + lbi.Tag = tbi; + } + + // Fill our ListBoxes with the appropriate ToolboxItems. + private void FillToolbox() + { + foreach (ListBarGroup tab in listBar1.Groups) + { + tab.Items.Add(pointerItem); + } + + foreach (List t in listAll) + { + t.Add(pointer); + } + + foreach (Type type in windowsFormsToolTypes) + { + ToolboxItem tbi = new ToolboxItem(type); + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba != null) + { + tbi.Bitmap = (Bitmap)tba.GetImage(type); + } + listWindowsForms_ti.Add(tbi); + AddBarItem(listWindowsForms, tbi); + } + + foreach (Type type in componentsToolTypes) + { + ToolboxItem tbi = new ToolboxItem(type); + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba != null) + { + tbi.Bitmap = (Bitmap)tba.GetImage(type); + } + listComponents_ti.Add(tbi); + AddBarItem(listComponents, tbi); + } + + foreach (Type type in dataToolTypes) + { + ToolboxItem tbi = new ToolboxItem(type); + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba != null) + { + tbi.Bitmap = (Bitmap)tba.GetImage(type); + } + listData_ti.Add(tbi); + AddBarItem(listData, tbi); + } + } + + /// We need access to the designers. + public SampleDesignerHost.SampleDesignerHost Host + { + get + { + return host; + } + set + { + host = value; + } + } + + /// The currently selected tool is defined by our currently selected + /// category (ListBox) and our selectedIndex member. + public ToolboxItem SelectedTool + { + get + { + if (listBar1.SelectedGroup.SelectedItem == null) + return null; + ToolboxItem t = listBar1.SelectedGroup.SelectedItem.Tag as ToolboxItem; + return t; + } + } + + /// The name of our selected category (Windows Forms, Components, etc.) + /// This property (and the next few) are all in place to support + /// methods of the IToolboxService. + public string SelectedCategory + { + get + { + return listBar1.SelectedGroup.Caption; + } + } + + /// The names of all our categories. + public CategoryNameCollection CategoryNames + { + get + { + int count = listBar1.Groups.Count; + string[] categories = new string[count]; + for (int i = 0; i < count; i++) + { + categories[i] = listBar1.Groups[i].Caption; + } + return new CategoryNameCollection(categories); + } + } + + /// The IToolboxService has methods for getting tool collections using + /// an optional category parameter. We support that request here. + public ToolboxItemCollection GetToolsFromCategory(string category) + { + foreach (ListBarGroup g in listBar1.Groups) + { + if (g.Caption == category) + { + //ListBox list = tab.Controls[0] as ListBox; + List list = g.Tag as List; + ToolboxItem[] tools = new ToolboxItem[list.Count]; + list.CopyTo(tools, 0); + return new ToolboxItemCollection(tools); + } + } + + return null; + } + + /// Get all of our tools. + public ToolboxItemCollection GetAllTools() + { + List toolsAL = new List(); + foreach (List t in listAll) + { + toolsAL.AddRange(t); + } + //ToolboxItem[] tools = new ToolboxItem[toolsAL.Count]; + //toolsAL.CopyTo(tools); + return new ToolboxItemCollection(toolsAL.ToArray()); + } + + /// Resets the selection to the pointer. Note that this is the only method + /// which allows our IToolboxService to set our selection. It calls this method + /// after a tool has been used. + public void SelectPointer() + { + ListBarGroup list = listBar1.SelectedGroup; + deselectAll(); + //foreach (ListBarItem lbi in list.Items) + //{ + // lbi.Selected = false; + // //lbi.MouseOver = false; + // lbi.MouseDown = false; + //} + //list.Invalidate(list.GetItemRectangle(selectedIndex)); + selectedIndex = 0; + //list.SelectedItem = list.Items[0]; + list.Items[0].Selected = true; + listBar1.Refresh(); + //list.Invalidate(list.GetItemRectangle(selectedIndex)); + //listBar1.Padding; + } + + private void list_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + } + + private void list_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e) + { + } + + private void tabControl_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + } + + private void deselectAll() + { + foreach (ListBarItem lbi in listBar1.SelectedGroup.Items) + { + lbi.Selected = false; + lbi.MouseDown = false; + } + } + + private void listBar1_MouseDown(object sender, MouseEventArgs e) + { + ListBarItem selected = thisMouseTrack.GetValue(listBar1) as ListBarItem; + if (selected == null) + { + return; + } + else + { + deselectAll(); + selected.Selected = true; + selectedIndex = listBar1.SelectedGroup.Items.IndexOf(selected); + //deselectAll(); + } + if (selectedIndex != 0) + { + // If this is a double-click, then the user wants to add the selected component + // to the default location on the designer, with the default size. We call + // ToolPicked on the current designer (as a IToolboxUser) to place the tool. + // The IToolboxService calls SelectedToolboxItemUsed(), which calls this control's + // SelectPointer() method. + // + if (e.Clicks == 2) + { + IToolboxUser tbu = host.GetDesigner(host.RootComponent) as IToolboxUser; + if (tbu != null) + { + //tbu.ToolPicked((ToolboxItem)(lbSender.Items[selectedIndex])); + tbu.ToolPicked((ToolboxItem)(listBar1.SelectedGroup.SelectedItem.Tag)); + } + SelectPointer(); + } + // Otherwise this is either a single click or a drag. Either way, we do the same + // thing: start a drag--if this is just a single click, then the drag will + // abort as soon as there's a MouseUp event. + // + else if (e.Clicks < 2) + { + //ToolboxItem tbi = lbSender.Items[selectedIndex] as ToolboxItem; + ToolboxItem tbi = listBar1.SelectedGroup.SelectedItem.Tag as ToolboxItem; + IToolboxService tbs = ((IServiceContainer)host).GetService(typeof(IToolboxService)) as IToolboxService; + + // The IToolboxService serializes ToolboxItems by packaging them in DataObjects. + DataObject d = tbs.SerializeToolboxItem(tbi) as DataObject; + try + { + (sender as Control).DoDragDrop(d, DragDropEffects.Copy); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + + private void listBar1_SelectedGroupChanged(object sender, EventArgs e) + { + SelectPointer(); + } + + private void listBar1_Paint(object sender, PaintEventArgs e) + { + if (initialPaint) + { + SelectPointer(); + } + initialPaint = false; + } + + private void listBar1_ItemClicked(object sender, ItemClickedEventArgs e) + { + SelectPointer(); + } + + } +} diff --git a/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.resx b/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.resx new file mode 100644 index 000000000..d58980a38 --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolBoxPane2.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/SSYY/ToolboxPane.cs b/VisualPascalABCNETLinux/SSYY/ToolboxPane.cs new file mode 100644 index 000000000..3292d9d2d --- /dev/null +++ b/VisualPascalABCNETLinux/SSYY/ToolboxPane.cs @@ -0,0 +1,617 @@ +//------------------------------------------------------------------------------ +/// +/// Copyright (c) Microsoft Corporation. All Rights Reserved. +/// +/// This source code is intended only as a supplement to Microsoft +/// Development Tools and/or on-line documentation. See these other +/// materials for detailed information regarding Microsoft code samples. +/// +/// +//------------------------------------------------------------------------------ +using System; +using System.Collections; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing; +using System.Data; +using System.Windows.Forms; +using System.Drawing.Design; +using System.Windows.Forms.Design; +using System.IO; +using System.Reflection; + +namespace SampleDesignerApplication1 +{ + /// Our implementation of a toolbox. We kept the actual toolbox control + /// separate from the IToolboxService, but the toolbox could easily + /// implement the service itself. Note that IToolboxUser does not pertain + /// to the toolbox, but instead is implemented by the designers that receive + /// ToolboxItems. + public class ToolboxPane : System.Windows.Forms.UserControl + { + private SampleDesignerHost.SampleDesignerHost host; + private System.Windows.Forms.ListBox listData; + private System.Windows.Forms.ListBox listCustomControls; + private System.Windows.Forms.ListBox listWindowsForms; + private System.Windows.Forms.ListBox listComponents; + private System.Windows.Forms.TabPage tabWindowsForms; + private System.Windows.Forms.TabPage tabComponents; + private System.Windows.Forms.TabPage tabData; + private System.Windows.Forms.TabPage tabCustomControls; + private System.Windows.Forms.TabControl tabControl; + private ToolboxItem pointer; // a "null" tool + private int selectedIndex; // the index of the currently selected tool + private bool initialPaint = true; // see ToolboxPane_Paint method + + // We load types into our categories in a rather primitive way. It is easier than + // dealing with type resolution, but we can only do this since our list of tools + // is standard and unchanging. + // + private Type[] windowsFormsToolTypes = new Type[] { + typeof(System.Windows.Forms.PropertyGrid), + typeof(System.Windows.Forms.Label), + typeof(System.Windows.Forms.LinkLabel), + typeof(System.Windows.Forms.Button), + typeof(System.Windows.Forms.TextBox), + typeof(System.Windows.Forms.CheckBox), + typeof(System.Windows.Forms.RadioButton), + typeof(System.Windows.Forms.GroupBox), + typeof(System.Windows.Forms.PictureBox), + typeof(System.Windows.Forms.Panel), + typeof(System.Windows.Forms.DataGrid), + typeof(System.Windows.Forms.ListBox), + typeof(System.Windows.Forms.CheckedListBox), + typeof(System.Windows.Forms.ComboBox), + typeof(System.Windows.Forms.ListView), + typeof(System.Windows.Forms.TreeView), + typeof(System.Windows.Forms.TabControl), + typeof(System.Windows.Forms.DateTimePicker), + typeof(System.Windows.Forms.MonthCalendar), + typeof(System.Windows.Forms.HScrollBar), + typeof(System.Windows.Forms.VScrollBar), + typeof(System.Windows.Forms.Timer), + typeof(System.Windows.Forms.Splitter), + typeof(System.Windows.Forms.DomainUpDown), + typeof(System.Windows.Forms.NumericUpDown), + typeof(System.Windows.Forms.TrackBar), + typeof(System.Windows.Forms.ProgressBar), + typeof(System.Windows.Forms.RichTextBox), + typeof(System.Windows.Forms.ImageList), + typeof(System.Windows.Forms.HelpProvider), + typeof(System.Windows.Forms.ToolTip), + typeof(System.Windows.Forms.ToolBar), + typeof(System.Windows.Forms.StatusBar), + typeof(System.Windows.Forms.UserControl), + typeof(System.Windows.Forms.NotifyIcon), + typeof(System.Windows.Forms.OpenFileDialog), + typeof(System.Windows.Forms.SaveFileDialog), + typeof(System.Windows.Forms.FontDialog), + typeof(System.Windows.Forms.ColorDialog), + typeof(System.Windows.Forms.PrintDialog), + typeof(System.Windows.Forms.PrintPreviewDialog), + typeof(System.Windows.Forms.PrintPreviewControl), + typeof(System.Windows.Forms.ErrorProvider), + typeof(System.Drawing.Printing.PrintDocument), + typeof(System.Windows.Forms.PageSetupDialog) + }; + private Type[] componentsToolTypes = new Type[] { + typeof(System.IO.FileSystemWatcher), + typeof(System.Diagnostics.Process), + typeof(System.Timers.Timer) + }; + + private Type[] dataToolTypes = new Type[] { + typeof(System.Data.OleDb.OleDbCommandBuilder), + typeof(System.Data.OleDb.OleDbConnection), + typeof(System.Data.SqlClient.SqlCommandBuilder), + typeof(System.Data.SqlClient.SqlConnection), + }; + + private System.ComponentModel.Container components = null; + + public ToolboxPane() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + pointer = new ToolboxItem(); + pointer.DisplayName = ""; + pointer.Bitmap = new Bitmap(16, 16); + + // Populate our tool lists. + FillToolbox(); + ListBox list = this.tabControl.SelectedTab.Controls[0] as ListBox; + } + + /// Clean up any resources being used. + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + // Properties + + /// We need access to the designers. + public SampleDesignerHost.SampleDesignerHost Host + { + get + { + return host; + } + set + { + host = value; + } + } + + /// The currently selected tool is defined by our currently selected + /// category (ListBox) and our selectedIndex member. + public ToolboxItem SelectedTool + { + get + { + ListBox list = this.tabControl.SelectedTab.Controls[0] as ListBox; + return list.Items[selectedIndex] as ToolboxItem; + } + } + + /// The name of our selected category (Windows Forms, Components, etc.) + /// This property (and the next few) are all in place to support + /// methods of the IToolboxService. + public string SelectedCategory + { + get + { + return tabControl.SelectedTab.Text; + } + } + + /// The names of all our categories. + public CategoryNameCollection CategoryNames + { + get + { + string[] categories = new string[tabControl.TabPages.Count]; + for (int i = 0; i < tabControl.TabPages.Count; i++) + { + categories[i] = tabControl.TabPages[i].Text; + } + return new CategoryNameCollection(categories); + } + } + + // Methods + + /// The IToolboxService has methods for getting tool collections using + /// an optional category parameter. We support that request here. + public ToolboxItemCollection GetToolsFromCategory(string category) + { + foreach (TabPage tab in tabControl.TabPages) + { + if (tab.Text == category) + { + ListBox list = tab.Controls[0] as ListBox; + ToolboxItem[] tools = new ToolboxItem[list.Items.Count]; + list.Items.CopyTo(tools, 0); + return new ToolboxItemCollection(tools); + } + } + + return null; + } + + /// Get all of our tools. + public ToolboxItemCollection GetAllTools() + { + ArrayList toolsAL = new ArrayList(); + foreach (TabPage tab in tabControl.TabPages) + { + ListBox list = tab.Controls[0] as ListBox; + toolsAL.Add(list.Items); + } + ToolboxItem[] tools = new ToolboxItem[toolsAL.Count]; + toolsAL.CopyTo(tools); + return new ToolboxItemCollection(tools); + } + + /// Resets the selection to the pointer. Note that this is the only method + /// which allows our IToolboxService to set our selection. It calls this method + /// after a tool has been used. + public void SelectPointer() + { + ListBox list = this.tabControl.SelectedTab.Controls[0] as ListBox; + list.Invalidate(list.GetItemRectangle(selectedIndex)); + selectedIndex = 0; + list.SelectedIndex = 0; + list.Invalidate(list.GetItemRectangle(selectedIndex)); + } + + #region Component Designer generated code + + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + + private void InitializeComponent() + { + this.listData = new System.Windows.Forms.ListBox(); + this.listCustomControls = new System.Windows.Forms.ListBox(); + this.listWindowsForms = new System.Windows.Forms.ListBox(); + this.listComponents = new System.Windows.Forms.ListBox(); + this.tabWindowsForms = new System.Windows.Forms.TabPage(); + this.tabComponents = new System.Windows.Forms.TabPage(); + this.tabData = new System.Windows.Forms.TabPage(); + this.tabCustomControls = new System.Windows.Forms.TabPage(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tabWindowsForms.SuspendLayout(); + this.tabComponents.SuspendLayout(); + this.tabData.SuspendLayout(); + this.tabCustomControls.SuspendLayout(); + this.tabControl.SuspendLayout(); + this.SuspendLayout(); + // + // listData + // + this.listData.BackColor = System.Drawing.Color.LightSlateGray; + this.listData.Dock = System.Windows.Forms.DockStyle.Fill; + this.listData.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.listData.Location = new System.Drawing.Point(0, 0); + this.listData.Name = "listData"; + this.listData.Size = new System.Drawing.Size(280, 468); + this.listData.TabIndex = 0; + this.listData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.list_KeyDown); + this.listData.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_MouseDown); + this.listData.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.list_MeasureItem); + this.listData.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.list_DrawItem); + // + // listCustomControls + // + this.listCustomControls.BackColor = System.Drawing.Color.LightSlateGray; + this.listCustomControls.Dock = System.Windows.Forms.DockStyle.Fill; + this.listCustomControls.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.listCustomControls.Location = new System.Drawing.Point(0, 0); + this.listCustomControls.Name = "listCustomControls"; + this.listCustomControls.Size = new System.Drawing.Size(280, 508); + this.listCustomControls.TabIndex = 0; + this.listCustomControls.KeyDown += new System.Windows.Forms.KeyEventHandler(this.list_KeyDown); + this.listCustomControls.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_MouseDown); + this.listCustomControls.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.list_MeasureItem); + this.listCustomControls.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.list_DrawItem); + // + // listWindowsForms + // + this.listWindowsForms.AllowDrop = true; + this.listWindowsForms.BackColor = System.Drawing.Color.LightSlateGray; + this.listWindowsForms.Dock = System.Windows.Forms.DockStyle.Fill; + this.listWindowsForms.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.listWindowsForms.Location = new System.Drawing.Point(0, 0); + this.listWindowsForms.Name = "listWindowsForms"; + this.listWindowsForms.Size = new System.Drawing.Size(280, 508); + this.listWindowsForms.TabIndex = 0; + this.listWindowsForms.KeyDown += new System.Windows.Forms.KeyEventHandler(this.list_KeyDown); + this.listWindowsForms.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_MouseDown); + this.listWindowsForms.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.list_MeasureItem); + this.listWindowsForms.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.list_DrawItem); + // + // listComponents + // + this.listComponents.BackColor = System.Drawing.Color.LightSlateGray; + this.listComponents.Dock = System.Windows.Forms.DockStyle.Fill; + this.listComponents.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.listComponents.Location = new System.Drawing.Point(0, 0); + this.listComponents.Name = "listComponents"; + this.listComponents.Size = new System.Drawing.Size(280, 468); + this.listComponents.TabIndex = 0; + this.listComponents.KeyDown += new System.Windows.Forms.KeyEventHandler(this.list_KeyDown); + this.listComponents.MouseDown += new System.Windows.Forms.MouseEventHandler(this.list_MouseDown); + this.listComponents.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.list_MeasureItem); + this.listComponents.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.list_DrawItem); + // + // tabWindowsForms + // + this.tabWindowsForms.BackColor = System.Drawing.Color.LightSlateGray; + this.tabWindowsForms.Controls.AddRange(new System.Windows.Forms.Control[] { + this.listWindowsForms}); + this.tabWindowsForms.Location = new System.Drawing.Point(4, 40); + this.tabWindowsForms.Name = "tabWindowsForms"; + this.tabWindowsForms.Size = new System.Drawing.Size(280, 508); + this.tabWindowsForms.TabIndex = 0; + this.tabWindowsForms.Text = "Windows Forms"; + // + // tabComponents + // + this.tabComponents.BackColor = System.Drawing.Color.LightSlateGray; + this.tabComponents.Controls.AddRange(new System.Windows.Forms.Control[] { + this.listComponents}); + this.tabComponents.Location = new System.Drawing.Point(4, 40); + this.tabComponents.Name = "tabComponents"; + this.tabComponents.Size = new System.Drawing.Size(280, 468); + this.tabComponents.TabIndex = 1; + this.tabComponents.Text = "Components"; + // + // tabData + // + this.tabData.BackColor = System.Drawing.Color.LightSlateGray; + this.tabData.Controls.AddRange(new System.Windows.Forms.Control[] { + this.listData}); + this.tabData.Location = new System.Drawing.Point(4, 40); + this.tabData.Name = "tabData"; + this.tabData.Size = new System.Drawing.Size(280, 468); + this.tabData.TabIndex = 2; + this.tabData.Text = "Data"; + // + // tabCustomControls + // + this.tabCustomControls.BackColor = System.Drawing.Color.LightSlateGray; + this.tabCustomControls.Controls.AddRange(new System.Windows.Forms.Control[] { + this.listCustomControls}); + this.tabCustomControls.Location = new System.Drawing.Point(4, 40); + this.tabCustomControls.Name = "tabCustomControls"; + this.tabCustomControls.Size = new System.Drawing.Size(280, 508); + this.tabCustomControls.TabIndex = 3; + this.tabCustomControls.Text = "Custom Controls"; + // + // tabControl + // + this.tabControl.Controls.AddRange(new System.Windows.Forms.Control[] { + this.tabWindowsForms, + this.tabData, + this.tabComponents, + this.tabCustomControls}); + this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; + this.tabControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.tabControl.ItemSize = new System.Drawing.Size(99, 18); + this.tabControl.Location = new System.Drawing.Point(0, 0); + this.tabControl.Multiline = true; + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(288, 552); + this.tabControl.SizeMode = System.Windows.Forms.TabSizeMode.FillToRight; + this.tabControl.TabIndex = 1; + this.tabControl.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl_DrawItem); + this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); + // + // ToolboxPane + // + this.BackColor = System.Drawing.Color.Black; + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.tabControl}); + this.Name = "ToolboxPane"; + this.Size = new System.Drawing.Size(288, 552); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.ToolboxPane_Paint); + this.tabWindowsForms.ResumeLayout(false); + this.tabComponents.ResumeLayout(false); + this.tabData.ResumeLayout(false); + this.tabCustomControls.ResumeLayout(false); + this.tabControl.ResumeLayout(false); + this.ResumeLayout(false); + + } + #endregion + + // Fill our ListBoxes with the appropriate ToolboxItems. + private void FillToolbox() + { + foreach (TabPage tab in tabControl.TabPages) + { + ListBox list = tab.Controls[0] as ListBox; + list.Items.Add(pointer); + } + + foreach (Type type in windowsFormsToolTypes) + { + ToolboxItem tbi = new ToolboxItem(type); + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba != null) + { + tbi.Bitmap = (Bitmap)tba.GetImage(type); + } + listWindowsForms.Items.Add(tbi); + } + + foreach (Type type in componentsToolTypes) + { + ToolboxItem tbi = new ToolboxItem(type); + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba != null) + { + tbi.Bitmap = (Bitmap)tba.GetImage(type); + } + listComponents.Items.Add(tbi); + } + + foreach (Type type in dataToolTypes) + { + ToolboxItem tbi = new ToolboxItem(type); + ToolboxBitmapAttribute tba = TypeDescriptor.GetAttributes(type)[typeof(ToolboxBitmapAttribute)] as ToolboxBitmapAttribute; + if (tba != null) + { + tbi.Bitmap = (Bitmap)tba.GetImage(type); + } + listData.Items.Add(tbi); + } + } + + // Event Handlers + + /// Each ToolboxItem contains a string and a bitmap. We draw each of these each time + /// we draw a ListBox item (a tool). + private void list_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + ListBox lbSender = sender as ListBox; + + // If this tool is the currently selected tool, draw it with a highlight. + if (selectedIndex == e.Index) + { + e.Graphics.FillRectangle(Brushes.DarkSlateGray, e.Bounds); + } + else + { + e.Graphics.FillRectangle(Brushes.LightSlateGray, e.Bounds); + } + + ToolboxItem tbi = lbSender.Items[e.Index] as ToolboxItem; + Rectangle BitmapBounds = new Rectangle(e.Bounds.Location.X, e.Bounds.Location.Y, tbi.Bitmap.Width, e.Bounds.Height); + Rectangle StringBounds = new Rectangle(e.Bounds.Location.X + BitmapBounds.Width, e.Bounds.Location.Y, e.Bounds.Width - BitmapBounds.Width, e.Bounds.Height); + e.Graphics.DrawImage(tbi.Bitmap, BitmapBounds); + e.Graphics.DrawString(tbi.DisplayName, lbSender.Font, Brushes.White, StringBounds); + + } + + /// We measure each item by taking the combined width of the string and bitmap, + /// and the greater height of the two. + private void list_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e) + { + ListBox lbSender = sender as ListBox; + ToolboxItem tbi = lbSender.Items[e.Index] as ToolboxItem; + Size textSize = e.Graphics.MeasureString(tbi.DisplayName, lbSender.Font).ToSize(); + e.ItemWidth = tbi.Bitmap.Width + textSize.Width; + if (tbi.Bitmap.Height > textSize.Height) + { + e.ItemHeight = tbi.Bitmap.Height; + } + else + { + e.ItemHeight = textSize.Height; + } + } + + /// Owner draw for that rainbow look. + private void tabControl_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + TabControl tcSender = sender as TabControl; + string text = tcSender.TabPages[e.Index].Text; + Size textSize = e.Graphics.MeasureString(text, tcSender.Font).ToSize(); + + e.Graphics.FillRectangle(Brushes.SteelBlue, e.Bounds); + //switch (e.Index) + //{ + // case 0: e.Graphics.FillRectangle(Brushes.SteelBlue, e.Bounds); + // break; + // case 1: e.Graphics.FillRectangle(Brushes.Gold, e.Bounds); + // break; + // case 2: e.Graphics.FillRectangle(Brushes.Tomato, e.Bounds); + // break; + // case 3: e.Graphics.FillRectangle(Brushes.LimeGreen, e.Bounds); + // break; + //} + + Point textLocation = new Point( + e.Bounds.X + (e.Bounds.Width - textSize.Width) / 2, + e.Bounds.Y + (e.Bounds.Height - textSize.Height) / 2); + e.Graphics.DrawString(text, tcSender.Font, Brushes.White, textLocation); + } + + /// This method handles a MouseDown event, which might be one of three things: + /// 1) the start of a single click + /// 2) the start of a drag + /// 3) the start of a second of two consecutive clicks (double-click) + private void list_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) + { + // Regardless of which kind of click this is, we need to change the selection. + // First we grab the bounds of the old selected tool so that we can de-higlight it. + // + ListBox lbSender = sender as ListBox; + Rectangle lastSelectedBounds = lbSender.GetItemRectangle(selectedIndex); + + selectedIndex = lbSender.IndexFromPoint(e.X, e.Y); // change our selection + lbSender.SelectedIndex = selectedIndex; + + lbSender.Invalidate(lastSelectedBounds); // clear highlight from last selection + lbSender.Invalidate(lbSender.GetItemRectangle(selectedIndex)); // highlight new one + + if (selectedIndex != 0) + { + // If this is a double-click, then the user wants to add the selected component + // to the default location on the designer, with the default size. We call + // ToolPicked on the current designer (as a IToolboxUser) to place the tool. + // The IToolboxService calls SelectedToolboxItemUsed(), which calls this control's + // SelectPointer() method. + // + if (e.Clicks == 2) + { + IToolboxUser tbu = host.GetDesigner(host.RootComponent) as IToolboxUser; + if (tbu != null) + { + tbu.ToolPicked((ToolboxItem)(lbSender.Items[selectedIndex])); + } + } + // Otherwise this is either a single click or a drag. Either way, we do the same + // thing: start a drag--if this is just a single click, then the drag will + // abort as soon as there's a MouseUp event. + // + else if (e.Clicks < 2) + { + ToolboxItem tbi = lbSender.Items[selectedIndex] as ToolboxItem; + IToolboxService tbs = ((IServiceContainer)host).GetService(typeof(IToolboxService)) as IToolboxService; + + // The IToolboxService serializes ToolboxItems by packaging them in DataObjects. + DataObject d = tbs.SerializeToolboxItem(tbi) as DataObject; + try + { + lbSender.DoDragDrop(d, DragDropEffects.Copy); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + + /// Go to the pointer whenever we change categories. + private void tabControl_SelectedIndexChanged(object sender, System.EventArgs e) + { + SelectPointer(); + } + + /// On our first paint, select the pointer. + private void ToolboxPane_Paint(object sender, System.Windows.Forms.PaintEventArgs e) + { + if (initialPaint) + { + SelectPointer(); + } + initialPaint = false; + } + + /// The toolbox can also be navigated using the keyboard commands Up, Down, and Enter. + private void list_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) + { + ListBox lbSender = sender as ListBox; + Rectangle lastSelectedBounds = lbSender.GetItemRectangle(selectedIndex); + switch (e.KeyCode) + { + case Keys.Up: if (selectedIndex > 0) + { + selectedIndex--; // change selection + lbSender.SelectedIndex = selectedIndex; + lbSender.Invalidate(lastSelectedBounds); // clear old highlight + lbSender.Invalidate(lbSender.GetItemRectangle(selectedIndex)); // add new one + } + break; + case Keys.Down: if (selectedIndex + 1 < lbSender.Items.Count) + { + selectedIndex++; // change selection + lbSender.SelectedIndex = selectedIndex; + lbSender.Invalidate(lastSelectedBounds); // clear old highlight + lbSender.Invalidate(lbSender.GetItemRectangle(selectedIndex)); // add new one + } + break; + case Keys.Enter: IToolboxUser tbu = host.GetDesigner(host.RootComponent) as IToolboxUser; + if (tbu != null) + { + // Enter means place the tool with default location and default size. + tbu.ToolPicked((ToolboxItem)(lbSender.Items[selectedIndex])); + } + break; + } + } + } +} diff --git a/VisualPascalABCNETLinux/UserOptions.cs b/VisualPascalABCNETLinux/UserOptions.cs new file mode 100644 index 000000000..a8ee0d2de --- /dev/null +++ b/VisualPascalABCNETLinux/UserOptions.cs @@ -0,0 +1,279 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC +{ + public class UserOptions : VisualPascalABCPlugins.IUserOptions + { + public bool RedirectConsoleIO = false; + public bool ShowLineNums = false; + public bool EnableFolding = false; // SSM 4.09.08 + public bool ShowMathBraket = false; + public bool ConverTabsToSpaces = true; + public bool deleteEXEAfterExecute = false; + public bool deletePDBAfterExecute = true; + public bool UseOutputDirectory = true; + public string OutputDirectory = null; + public bool PauseInRunModeIfConsole = true; + public string DefaultSourceFileNameFormat = "Program{0}.pas"; + public int TabIndent = 2; + public int EditorFontSize = 12; + public bool AllowCodeCompletion = true; + public bool CodeCompletionHint = true; + public bool CodeCompletionDot = true; + public bool CodeCompletionParams = true; + public bool SaveSourceFilesIfComilationOk = false; + public int CodeCompletionNamespaceVisibleRange = 3; + public int CursorTabCount = 2; + public bool ShowCompletionInfoByGroup = true; + public bool EnableSmartIntellisense = false; + public bool ShowQuickClassBrowserPanel = false; + public bool UseSemanticIntellisense = false; + public bool AllowCodeFormatting = false; + public bool SkipStackTraceItemIfSourceFileInSystemDirectory = true; + public bool AlwaysAttachDebuggerAtStart = false; + public string CurrentFontFamily = "Consolas"; + public bool HighlightOperatorBrackets=true; + public bool UseDllForSystemUnits = true; + public bool PABCDllChecked = false; + public bool AutoInsertCodeIsEnabledOnStartup = true; + + public UserOptions() + { + try // SSM 25/04/22 + { + var installedFontCollection = new System.Drawing.Text.InstalledFontCollection(); + if (!Array.Exists(installedFontCollection.Families, f => f.Name == CurrentFontFamily)) + CurrentFontFamily = "Courier New"; + } + catch { } + } + + public bool DeleteEXEAfterExecute + { + get + { + if (ProjectFactory.Instance.CurrentProject != null) + return ProjectFactory.Instance.CurrentProject.DeleteEXE; + return deleteEXEAfterExecute; + } + set + { + deleteEXEAfterExecute = value; + } + } + + public bool DeletePDBAfterExecute + { + get + { + if (ProjectFactory.Instance.CurrentProject != null) + return ProjectFactory.Instance.CurrentProject.DeletePDB; + return deletePDBAfterExecute; + } + set + { + deletePDBAfterExecute = value; + } + } + + #region IUserOptions Member + + bool VisualPascalABCPlugins.IUserOptions.AllowCodeCompletion + { + get { return AllowCodeCompletion; } + set { AllowCodeCompletion = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.AllowCodeFormatting + { + get { return AllowCodeFormatting; } + set { AllowCodeFormatting = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.AlwaysAttachDebuggerAtStart + { + get { return AlwaysAttachDebuggerAtStart; } + set { AlwaysAttachDebuggerAtStart = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.CodeCompletionDot + { + get { return CodeCompletionDot; } + set { CodeCompletionDot = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.CodeCompletionHint + { + get { return CodeCompletionHint; } + set { CodeCompletionHint = value; } + } + + int VisualPascalABCPlugins.IUserOptions.CodeCompletionNamespaceVisibleRange + { + get { return CodeCompletionNamespaceVisibleRange; } + set { CodeCompletionNamespaceVisibleRange = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.CodeCompletionParams + { + get { return CodeCompletionParams; } + set { CodeCompletionParams = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.ConverTabsToSpaces + { + get { return ConverTabsToSpaces; } + set { ConverTabsToSpaces = value; } + } + + string VisualPascalABCPlugins.IUserOptions.CurrentFontFamily + { + get { return CurrentFontFamily; } + set { CurrentFontFamily = value; } + } + + int VisualPascalABCPlugins.IUserOptions.CursorTabCount + { + get { return CursorTabCount; } + set { CursorTabCount = value; } + } + + string VisualPascalABCPlugins.IUserOptions.DefaultSourceFileNameFormat + { + get { return DefaultSourceFileNameFormat; } + set { DefaultSourceFileNameFormat = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.DeleteEXEAfterExecute + { + get { return DeleteEXEAfterExecute; } + set { DeleteEXEAfterExecute = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.DeletePDBAfterExecute + { + get { return DeletePDBAfterExecute; } + set { DeletePDBAfterExecute = value; } + } + + int VisualPascalABCPlugins.IUserOptions.EditorFontSize + { + get { return EditorFontSize; } + set { EditorFontSize = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.EnableFolding + { + get { return EnableFolding; } + set { EnableFolding = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.EnableSmartIntellisense + { + get { return EnableSmartIntellisense; } + set { EnableSmartIntellisense = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.HighlightOperatorBrackets + { + get { return HighlightOperatorBrackets; } + set { HighlightOperatorBrackets = value; } + } + + string VisualPascalABCPlugins.IUserOptions.OutputDirectory + { + get { return OutputDirectory; } + set { OutputDirectory = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.PauseInRunModeIfConsole + { + get { return PauseInRunModeIfConsole; } + set { PauseInRunModeIfConsole = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.RedirectConsoleIO + { + get { return RedirectConsoleIO; } + set { RedirectConsoleIO = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.SaveSourceFilesIfComilationOk + { + get { return SaveSourceFilesIfComilationOk; } + set { SaveSourceFilesIfComilationOk = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.AutoInsertCodeIsEnabledOnStartup + { + get { return AutoInsertCodeIsEnabledOnStartup; } + set { AutoInsertCodeIsEnabledOnStartup = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.ShowCompletionInfoByGroup + { + get { return ShowCompletionInfoByGroup; } + set { ShowCompletionInfoByGroup = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.ShowLineNums + { + get { return ShowLineNums; } + set { ShowLineNums = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.ShowMathBraket + { + get { return ShowMathBraket; } + set { ShowMathBraket = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.ShowQuickClassBrowserPanel + { + get { return ShowQuickClassBrowserPanel; } + set { ShowQuickClassBrowserPanel = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory + { + get { return SkipStackTraceItemIfSourceFileInSystemDirectory; } + set { SkipStackTraceItemIfSourceFileInSystemDirectory = value; } + } + + int VisualPascalABCPlugins.IUserOptions.TabIndent + { + get { return TabIndent; } + set { TabIndent = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.UseOutputDirectory + { + get { return UseOutputDirectory; } + set { UseOutputDirectory = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.UseDllForSystemUnits + { + get { return UseDllForSystemUnits; } + set { UseDllForSystemUnits = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.PABCDllChecked + { + get { return PABCDllChecked; } + set { PABCDllChecked = value; } + } + + bool VisualPascalABCPlugins.IUserOptions.UseSemanticIntellisense + { + get { return UseSemanticIntellisense; } + set { UseSemanticIntellisense = value; } + } + + #endregion + } +} diff --git a/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj b/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj new file mode 100644 index 000000000..130fb52f2 --- /dev/null +++ b/VisualPascalABCNETLinux/VisualPascalABCNETLinux.csproj @@ -0,0 +1,805 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3BF3CEB4-0E08-485A-8E6D-924841818B01} + WinExe + Properties + VisualPascalABC + PascalABCNETLinux + _ABC13.ico + LocalIntranet + false + False + False + false + + + 4.0 + + + v4.7.1 + false + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + ..\bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + false + false + true + false + + + PdbOnly + true + ..\bin\ + RELEASE;TRACE + prompt + 4 + false + AllRules.ruleset + true + false + + + False + + + False + Auto + 4194304 + AnyCPU + 4096 + + + app.manifest + + + + ..\Libraries\Debugger.Core.dll + + + False + FormsDesignerBinding\Libs\ICSharpCode.SharpDevelop.Dom.dll + + + + + + ..\Libraries\SharpDisasm.dll + + + + + + + + + + + + + + False + ..\Libraries\WeifenLuo.WinFormsUI.Docking.ThemeVS2005Linux.dll + + + False + ..\Libraries\WeifenLuo.WinFormsUI.DockingLinux.dll + + + + + + + Form + + + ABCHealth.cs + + + Form + + + AboutBox.cs + + + Form + + + + Form + + + BottomDockContentForm.cs + + + UserControl + + + Form + + + CodeFileDocument.cs + + + + + + Form + + + CompilerConsoleWindowForm.cs + + + Form + + + DebugVariablesListWindowForm.cs + + + Form + + + DebugWatchListWindowForm.cs + + + Form + + + DisassemblyWindow.cs + + + Form + + + ImmediateWindow.cs + + + Form + + + WebBrowserControl.cs + + + Form + + + + + Form + + + Form + + + + + + + + + + + + + + + + + Config\GlobalAssemblyInfo.cs + + + Form + + + ErrorsListWindowForm.cs + + + Form + + + FindSymbolsResultWindow.cs + + + + Component + + + Form + + + Form1.cs + + + Form + + + CompilerForm.cs + + + + + Form + + + GotoLine.cs + + + + + + + + + + + + + + UserControl + + + + + Form + + + AddWatchForm.cs + + + + Form + + + BreakpointCondition.cs + + + + + + + + + + + Form + + + OutputWindowForm.cs + + + Form + + + + + + + + + + + UserControl + + + CompilerOptionsContent.cs + + + UserControl + + + EditorOptionsContent.cs + + + UserControl + + + IntelliseseOptionsContent.cs + + + + + Form + + + OptionsForm.cs + + + UserControl + + + ViewOptionsContent.cs + + + + + + + Form + + + Form + + + Form + + + Form + + + Form + + + Form + + + + + + Form + + + Form + + + + ABCHealth.cs + + + Designer + AboutBox.cs + + + Designer + CompilerForm.cs + + + CodeFileDocumentTextEditorControl.cs + + + DisassemblyWindow.cs + + + ImmediateWindow.cs + Designer + + + WebBrowserControl.cs + + + Form1.cs + Designer + + + QuickClassBrowserPanel.cs + Designer + + + AddWatchForm.cs + Designer + + + BreakpointCondition.cs + Designer + + + RenameForm.cs + Designer + + + NewFileForm.cs + Designer + + + NewProject.cs + Designer + + + ProjectExplorer.cs + Designer + + + ProjectProperties.cs + Designer + + + ReferenceForm.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + Designer + ReplaceConfirmDialog.cs + + + Designer + ReplaceForm.cs + + + + + Form + + + NewFileForm.cs + + + Form + + + NewProject.cs + + + Form + + + ProjectExplorer.cs + + + + + Form + + + ProjectProperties.cs + + + + Form + + + ReferenceForm.cs + + + + + True + Resources.resx + True + + + Designer + + + Designer + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Settings.settings + True + + + Form + + + ReplaceConfirmDialog.cs + + + Form + + + ReplaceForm.cs + + + Form + + + RunArguments.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + EditorOptionsContent.cs + + + + + + + + + + + + Designer + BottomDockContentForm.cs + + + Designer + CodeFileDocument.cs + + + Designer + CompilerConsoleWindowForm.cs + + + Designer + DebugVariablesListWindowForm.cs + + + Designer + DebugWatchListWindowForm.cs + + + Designer + ErrorsListWindowForm.cs + + + Designer + FindSymbolsResultWindow.cs + + + Designer + GotoLine.cs + + + Designer + OutputWindowForm.cs + + + Designer + CompilerOptionsContent.cs + + + Designer + IntelliseseOptionsContent.cs + + + Designer + OptionsForm.cs + + + Designer + ViewOptionsContent.cs + + + + + + + + + + + + + + + + + + + RunArguments.cs + Designer + + + + + {1AB15F6E-C22E-499A-A7ED-54BA7DE5CFA6} + CodeCompletion + + + {a25d26fb-3043-4bcf-833e-e3f4c3be795e} + CompilerTools + + + {1E42361A-EDA3-4872-88AF-A3AAF600D36D} + Compiler + + + {44A01F9E-DCE7-470C-AAE5-C3DE0CCBEE3B} + Errors + + + {2d18be89-d210-49eb-a9dd-2246fbb3df6d} + ICSharpCode.TextEditorLinux + + + {2DE2842F-0912-4251-BC0F-480854C44A13} + Localization + + + {AF2EFD7B-69DD-4B43-AF65-B59B29349C23} + ParserTools + + + {e009e776-9280-4061-b5ca-7f0c3e2d3c2a} + PluginsSupportLinux + + + {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} + SyntaxTree + + + {1C9C945A-586D-42A2-A06B-65D84FA7FF78} + TreeConverter + + + {a9ab4282-83b4-41a7-86c3-e5bf6a45e7e2} + SyntaxVisitors + + + + + False + Клиентский профиль .NET Framework 3.5 SP1 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Установщик Windows 3.1 + true + + + + + + + + \ No newline at end of file diff --git a/VisualPascalABCNETLinux/VisualStates.cs b/VisualPascalABCNETLinux/VisualStates.cs new file mode 100644 index 000000000..9f56d5c76 --- /dev/null +++ b/VisualPascalABCNETLinux/VisualStates.cs @@ -0,0 +1,13 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Text; + +namespace VisualPascalABC +{ + public class VisualStates + { + public bool FileOpened = false; + } +} diff --git a/VisualPascalABCNETLinux/Workbench/BuildService.cs b/VisualPascalABCNETLinux/Workbench/BuildService.cs new file mode 100644 index 000000000..5af494b31 --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/BuildService.cs @@ -0,0 +1,299 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public class WorkbenchBuildService : IWorkbenchBuildService + { + public PascalABCCompiler.CompilerOptions CompilerOptions1 = new PascalABCCompiler.CompilerOptions(); + bool __ForRun; + string __RuntimeServicesModule; + bool __savePCU; + public List ErrorsList = new List(); + + IWorkbench Workbench; + IWorkbenchProjectService ProjectService; + //IWorkbenchDesignerService DesignerService; + IWorkbenchDocumentService DocumentService; + + public WorkbenchBuildService() + { + Workbench = WorkbenchServiceFactory.Workbench; + ProjectService = WorkbenchServiceFactory.ProjectService; + //DesignerService = WorkbenchServiceFactory.DesignerService; + DocumentService = WorkbenchServiceFactory.DocumentService; + } + + public PascalABCCompiler.CompilerOptions CompilerOptions + { + get + { + return CompilerOptions1; + } + } + + List IWorkbenchBuildService.ErrorsList + { + get + { + return ErrorsList; + } + } + + //kompilacija proekta + public string Compile(PascalABCCompiler.IProjectInfo project, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment) + { + ProjectService.SaveProject(); + Workbench.WidgetController.CompilingButtonsEnabled = false; + Workbench.CompilerConsoleWindow.ClearConsole(); + CompilerOptions1.SourceFileName = project.Path; + CompilerOptions1.OutputDirectory = project.OutputDirectory; + CompilerOptions1.ProjectCompiled = true; + if (project.ProjectType == PascalABCCompiler.ProjectType.WindowsApp) + CompilerOptions1.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication; + ErrorsList.Clear(); + CompilerOptions1.Rebuild = rebuild; + CompilerOptions1.Locale = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + CompilerOptions1.UseDllForSystemUnits = false; + CompilerOptions1.RunWithEnvironment = RunWithEnvironment; + bool savePCU = Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate; + if (Path.GetDirectoryName(CompilerOptions1.SourceFileName).ToLower() == ((string)WorkbenchStorage.StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower()) + Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false; + if (RuntimeServicesModule != null) + CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage)); + + string ofn = Workbench.VisualEnvironmentCompiler.Compile(CompilerOptions1); + Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = savePCU; + + if (RuntimeServicesModule != null) + CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1); + + if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0) + { + List ErrorsAndWarnings = new List(); + List Errors = Workbench.ErrorsManager.CreateErrorsList(Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList); + AddErrors(ErrorsAndWarnings, Errors); + //if (!ForRun) + AddWarnings(ErrorsAndWarnings, Workbench.VisualEnvironmentCompiler.Compiler.Warnings); + Workbench.ErrorsListWindow.ShowErrorsSync(ErrorsAndWarnings, Errors.Count != 0 || (Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0 && !ForRun)); + } + return ofn; + } + + public string Compile(string FileName, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment) + { + Workbench.WidgetController.CompilingButtonsEnabled = false; + + var UserOptions = Workbench.UserOptions; + + Workbench.CompilerConsoleWindow.ClearConsole(); + + CompilerOptions1.SourceFileName = FileName; + CompilerOptions1.Locale = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + if (Path.GetDirectoryName(FileName) == "" && WorkbenchStorage.WorkingDirectoryExsist) + CompilerOptions1.OutputDirectory = WorkbenchStorage.WorkingDirectory; + + if (Workbench.UserOptions.UseOutputDirectory && Directory.Exists(UserOptions.OutputDirectory)) + CompilerOptions1.OutputDirectory = UserOptions.OutputDirectory; + + CompilerOptions1.Rebuild = rebuild; + CompilerOptions1.RunWithEnvironment = RunWithEnvironment; + //string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule; + //if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName)) + // CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain)); + if (RuntimeServicesModule != null) + CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage)); + + ErrorsList.Clear(); + + //CompilerOptions1.SavePCUInThreadPull = true; + bool savePCU = Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate; + if (Path.GetDirectoryName(FileName).ToLower() == ((string)WorkbenchStorage.StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower()) + Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false; + + //MessageBox.Show("111"); + string ofn = Workbench.VisualEnvironmentCompiler.Compile(CompilerOptions1); + + Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = savePCU; + + if (RuntimeServicesModule != null) + CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1); + //MessageBox.Show(Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count.ToString()); + + if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0) + { + //MessageBox.Show("555"); + List ErrorsAndWarnings = new List(); + List Errors = Workbench.ErrorsManager.CreateErrorsList(Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList); + AddErrors(ErrorsAndWarnings, Errors); + //if (!ForRun) + AddWarnings(ErrorsAndWarnings, Workbench.VisualEnvironmentCompiler.Compiler.Warnings); + Workbench.ErrorsListWindow.ShowErrorsSync(ErrorsAndWarnings, Errors.Count != 0 || (Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0 && !ForRun)); + } + return ofn; + } + + public void StartCompile(PascalABCCompiler.IProjectInfo project, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment) + { + ProjectService.SaveProject(); + __RuntimeServicesModule = RuntimeServicesModule; + __ForRun = ForRun; + Workbench.CompilerConsoleWindow.ClearConsole(); + var UserOptions = Workbench.UserOptions; + + CompilerOptions1.SourceFileName = project.Path; + CompilerOptions1.ProjectCompiled = true; + CompilerOptions1.Locale = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + if (UserOptions.UseOutputDirectory && Directory.Exists(UserOptions.OutputDirectory)) + CompilerOptions1.OutputDirectory = UserOptions.OutputDirectory; + + CompilerOptions1.Rebuild = rebuild; + CompilerOptions1.RunWithEnvironment = RunWithEnvironment; + //string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule; + //if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName)) + // CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain)); + if (__RuntimeServicesModule != null) + CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage)); + + + ErrorsList.Clear(); + + //CompilerOptions1.SavePCUInThreadPull = true; + __savePCU = Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate; + //if (Path.GetDirectoryName(FileName).ToLower() == ((string)StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower()) + // VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false; + + Workbench.VisualEnvironmentCompiler.Compiler.OnChangeCompilerState += CompilationOnChangeCompilerState; + + Workbench.VisualEnvironmentCompiler.StartCompile(CompilerOptions1); + } + + public void StartCompile(string FileName, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment) + { + __RuntimeServicesModule = RuntimeServicesModule; + __ForRun = ForRun; + Workbench.CompilerConsoleWindow.ClearConsole(); + var UserOptions = Workbench.UserOptions; + CompilerOptions1.SourceFileName = FileName; + CompilerOptions1.Locale = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + if (Path.GetDirectoryName(FileName) == "" && WorkbenchStorage.WorkingDirectoryExsist) + CompilerOptions1.OutputDirectory = WorkbenchStorage.WorkingDirectory; + + if (UserOptions.UseOutputDirectory && Directory.Exists(UserOptions.OutputDirectory)) + CompilerOptions1.OutputDirectory = UserOptions.OutputDirectory; + + + CompilerOptions1.Rebuild = rebuild; + CompilerOptions1.RunWithEnvironment = RunWithEnvironment; + //string runtimeModuleFileName = CompilerOptions1.SearchDirectory + "\\" + RuntimeServicesModule; + //if (RuntimeServicesModule!=null && File.Exists(runtimeModuleFileName)) + // CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(runtimeModuleFileName, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain)); + if (__RuntimeServicesModule != null) + CompilerOptions1.StandartModules.Add(new PascalABCCompiler.CompilerOptions.StandartModule(RuntimeServicesModule, PascalABCCompiler.CompilerOptions.StandartModuleAddMethod.RightToMain, PascalABCCompiler.SyntaxTree.LanguageId.C | PascalABCCompiler.SyntaxTree.LanguageId.PascalABCNET | PascalABCCompiler.SyntaxTree.LanguageId.CommonLanguage)); + + + ErrorsList.Clear(); + + //CompilerOptions1.SavePCUInThreadPull = true; + __savePCU = Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate; + if (Path.GetDirectoryName(FileName).ToLower() == ((string)WorkbenchStorage.StandartDirectories[Constants.LibSourceDirectoryIdent]).ToLower()) + Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = false; + + Workbench.VisualEnvironmentCompiler.Compiler.OnChangeCompilerState += CompilationOnChangeCompilerState; + + Workbench.VisualEnvironmentCompiler.StartCompile(CompilerOptions1); + + } + + public bool Build() + { + Workbench.OutputWindow.ClearTextBox(); + Workbench.ErrorsListWindow.ClearErrorList(); + //DesignerService.GenerateAllDesignersCode(); + CompilerOptions1.UseDllForSystemUnits = false; + if (!ProjectFactory.Instance.ProjectLoaded) + return Compile(DocumentService.CurrentCodeFileDocument.FileName, false, null, false, false) != null; + else + return Compile(ProjectFactory.Instance.CurrentProject, false, null, false, false) != null; + } + + public bool Build(string FileName) + { + Workbench.OutputWindow.ClearTextBox(); + Workbench.ErrorsListWindow.ClearErrorList(); + /*while (codeCompletionParserController.IsParsing()) + Thread.Sleep(10);*/ + CompilerOptions1.UseDllForSystemUnits = false; + return Compile(FileName, false, null, false, false) != null; + } + + public bool Rebuild() + { + Workbench.OutputWindow.ClearTextBox(); + Workbench.ErrorsListWindow.ClearErrorList(); + //DesignerService.GenerateAllDesignersCode(); + CompilerOptions1.UseDllForSystemUnits = false; + if (!ProjectFactory.Instance.ProjectLoaded) + return Compile(DocumentService.CurrentCodeFileDocument.FileName, true, null, false, false) != null; + else + return Compile(ProjectFactory.Instance.CurrentProject, true, null, false, false) != null; + } + + public void StartCompile(bool rebuild) + { + VisualPABCSingleton.MainForm.OutputWindow.outputTextBox.Clear(); + Workbench.ErrorsListWindow.ClearErrorList(); + //DesignerService.GenerateAllDesignersCode(); + CompilerOptions1.UseDllForSystemUnits = false; + if (!ProjectFactory.Instance.ProjectLoaded) + StartCompile(DocumentService.CurrentCodeFileDocument.FileName, rebuild, null, false, false); + else + StartCompile(ProjectFactory.Instance.CurrentProject, rebuild, null, false, false); + } + + void CompilationOnChangeCompilerState(PascalABCCompiler.ICompiler sender, PascalABCCompiler.CompilerState State, string FileName) + { + switch (State) + { + case PascalABCCompiler.CompilerState.CompilationFinished: + Workbench.VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate = __savePCU; + + if (__RuntimeServicesModule != null) + CompilerOptions1.RemoveStandartModuleAtIndex(CompilerOptions1.StandartModules.Count - 1); + + if (Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList.Count != 0 || Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0) + { + List ErrorsAndWarnings = new List(); + List Errors = Workbench.ErrorsManager.CreateErrorsList(Workbench.VisualEnvironmentCompiler.Compiler.ErrorsList); + AddErrors(ErrorsAndWarnings, Errors); + //if (!ForRun) + AddWarnings(ErrorsAndWarnings, Workbench.VisualEnvironmentCompiler.Compiler.Warnings); + Workbench.ErrorsListWindow.ShowErrorsSync(ErrorsAndWarnings, Errors.Count != 0 || (Workbench.VisualEnvironmentCompiler.Compiler.Warnings.Count != 0 && !__ForRun)); + } + Workbench.VisualEnvironmentCompiler.Compiler.OnChangeCompilerState -= CompilationOnChangeCompilerState; + break; + } + } + + public void AddWarnings(List Errors, List warns) + { + foreach (PascalABCCompiler.Errors.CompilerWarning w in warns) + Errors.Add(w); + } + + public void AddErrors(List Errors, List ers) + { + foreach (PascalABCCompiler.Errors.Error e in ers) + Errors.Add(e); + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/DebugService.cs b/VisualPascalABCNETLinux/Workbench/DebugService.cs new file mode 100644 index 000000000..aaf89b9c6 --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/DebugService.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public partial class WorkbenchDebugService : IWorkbenchDebugService + { + void IWorkbenchDebugService.AddDebugPage(ICodeFileDocument tabPage) + { + debuggedPage = tabPage; + AddDebugPage(debuggedPage as CodeFileDocumentControl); + DebugUtils.DebuggerManager.SetAsDebugPage(debuggedPage); + } + + private bool row_exists(string expr) + { + for (int i = 0; i < this.WdataGridView1.Rows.Count; i++) + { + if ((string)this.WdataGridView1.Rows[i].Cells[0].Value == expr) + return true; + } + return false; + } + + public void GotoWatch() + { + BottomTabsVisible = true; + SelectContent(DebugWatchListWindow, true); + DebugWatchListWindow.AddNewEntry(""); + } + + public void AddVariable(string expr, bool show_tab) + { + if (row_exists(expr)) return; + RetValue rv = DebugUtils.DebuggerManager.Evaluate(expr); + int i = this.WdataGridView1.Rows.Count - 1; + BottomTabsVisible = true; + if (show_tab) + SelectContent(DebugWatchListWindow, false); + //this.BottomTabControl.SelectTab(this.tpWarningList); + //if (this.WdataGridView1.Rows.Count == 1 && this.WdataGridView1.Rows[0].Cells[0].Value == null) i = 0; + if (this.WdataGridView1.Rows[0].Cells[0].Value == null) i = 0; + else //if (this.WdataGridView1.Rows[1].Cells[0].Value != null) + { + this.WdataGridView1.Rows.Insert(0, 1); i = 0; + //i = this.WdataGridView1.Rows.Count-1; + } + if (this.WdataGridView1.Rows.Count == 1) this.WdataGridView1.Rows.Insert(0, 1); + this.WdataGridView1.Rows[i].Cells[0].Value = expr; + DebugWatchListWindow.RefreshRow(i); + } + + public void AddVariable(ListItem nv) + { + if (row_exists(nv.Name)) return; + //this.WdataGridView1.Rows.Add(); + int i = this.WdataGridView1.Rows.Count - 1; + //this.BottomTabControl.SelectTab(this.tpWarningList); + BottomTabsVisible = true; + SelectContent(DebugWatchListWindow, false); + //if (this.WdataGridView1.Rows.Count == 1 && this.WdataGridView1.Rows[0].Cells[0].Value == null) i = 0; + if (this.WdataGridView1.Rows[0].Cells[0].Value == null) i = 0; + else //if (this.WdataGridView1.Rows[1].Cells[0].Value != null) + { + this.WdataGridView1.Rows.Insert(0, 1); i = 0; + //i = this.WdataGridView1.Rows.Count-1; + } + if (this.WdataGridView1.Rows.Count == 1) this.WdataGridView1.Rows.Insert(0, 1); + this.WdataGridView1.Rows[i].Cells[0].Value = nv.Name; + DebugWatchListWindow.RefreshRow(i); + } + + public void RefreshPad(IList items) + { + try + { + DebugWatchListWindow.RefreshWatch(); + AdvancedDataGridView.TreeGridNode.UpdateNodesForLocalList(DebugVariablesListWindow.watchList, DebugVariablesListWindow.watchList.Nodes, items); + } + catch (System.Exception e) + { + + } + } + + public void AddObjectVariable(NamedValue lv) + { + if (lv.IsArray) + { + AddArrayVariable(lv); + return; + } + NamedValueCollection nvc = lv.GetMembers(); + //System.Windows.Forms.TreeView obj = new System.Windows.Forms.TreeView(); + //obj.Nodes.Add( + // dgLocalVars.Rows.Add(lv.Name, ""); + } + + public void AddArrayVariable(NamedValue lv) + { + //dgLocalVars.Rows.Add(lv.Name, lv.AsString); + } + } +} \ No newline at end of file diff --git a/VisualPascalABCNETLinux/Workbench/DialogsService.cs b/VisualPascalABCNETLinux/Workbench/DialogsService.cs new file mode 100644 index 000000000..6acbf6903 --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/DialogsService.cs @@ -0,0 +1,56 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class Form1 + { + private void OpenProjectDialog(string InitialDirectory) + { + openProjectDialog.FileName = ""; + openProjectDialog.InitialDirectory = InitialDirectory; + openProjectDialog.ShowDialog(); + SetFocusToEditor(); + } + + private void openProjectDialog_FileOk(object sender, CancelEventArgs e) + { + WorkbenchServiceFactory.ProjectService.OpenProject(openProjectDialog.FileName); + } + + private void OpenFileDialog(string InitialDirectory) + { + openFileDialog1.FileName = ""; + openFileDialog1.InitialDirectory = InitialDirectory; + openFileDialog1.ShowDialog(); + SetFocusToEditor(); + } + + private void openFileDialog1_FileOk(object sender, CancelEventArgs e) + { + foreach (string FileName in openFileDialog1.FileNames) + WorkbenchServiceFactory.FileService.OpenFile(FileName, null); + } + + private void saveFileDialog1_FileOk(object sender, CancelEventArgs e) + { + //ReplaceLastFile(CurrentSourceFileName, saveFileDialog1.FileName); + string fn = Tools.FileNameToLower(saveFileDialog1.FileName); + if (OpenDocuments.ContainsKey(fn) && OpenDocuments[fn] != CurrentCodeFileDocument) + { + MessageBox.Show(Form1StringResources.Get("ERROR_FILE_EXISTS_IN_CODEPAGES"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + else + { + SaveFileAs(CurrentCodeFileDocument, saveFileDialog1.FileName); + AddLastFile(saveFileDialog1.FileName); + } + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/EditorServices.cs b/VisualPascalABCNETLinux/Workbench/EditorServices.cs new file mode 100644 index 000000000..4ebe7821e --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/EditorServices.cs @@ -0,0 +1,260 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public partial class Form1 : IEditorService + { + public CodeFileDocumentControl CurrentSyntaxEditor + { + get + { + return CurrentCodeFileDocument; + } + } + + public void ExecFind() + { + string selt = CurrentSyntaxEditor.SelectedText; + if (selt != string.Empty) + FindForm.tbTextToFind.Text = selt; + FindForm.Show(); + } + + public void ExecFindNext() + { + FindForm.FindNext(); + } + + public void ExecReplace() + { + string selt = CurrentSyntaxEditor.SelectedText; + if (selt != string.Empty) + ReplaceForm.tbTextToFind.Text = selt; + ReplaceForm.Show(); + } + + public void ExecUndo() + { + var d = CurrentCodeFileDocument; + /*if (d.DesignerAndCodeTabs != null) + { + if (d.DesignerPage != null && d.Designer != null && d.DesignerAndCodeTabs.SelectedTab == d.DesignerPage) + d.Designer.Undo(); + else + d.TextEditor.Undo(); + } + else*/ + d.TextEditor.Undo(); + UpdateUndoRedoEnabled(); + } + + public void ExecRedo() + { + var d = CurrentCodeFileDocument; + /*if (d.DesignerAndCodeTabs != null) + { + if (d.DesignerPage != null && d.Designer != null && d.DesignerAndCodeTabs.SelectedTab == d.DesignerPage) + d.Designer.Redo(); + else + d.TextEditor.Redo(); + } + else*/ + d.TextEditor.Redo(); + UpdateUndoRedoEnabled(); + } + + public void SetFocusToEditor() + { + CurrentSyntaxEditor.TextEditor.SetFocus(); + } + + public void SynEdit_SelectionChanged(object sender) + { + UpdateCutCopyButtonsEnabled(); + } + + //ìåíÿåì ñòðàòåãèþ ïîäñâåäêè â ñîîòâåòñâèè ñ ðàñøèðåíèåì ôàéëà + private void SetHighlightingStrategy(ICSharpCode.TextEditor.TextEditorControl edit, string FileName) + { + edit.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingManager.Manager.FindHighlighterForFile(FileName); + } + + internal bool editorDisabled; + + public void SetEditorDisabled(bool val) + { + this.editorDisabled = val; + if (!val) + foreach (var tab in OpenDocuments.Values) + tab.TextEditor.Document.ReadOnly = val; + CurrentCodeFileDocument.TextEditor.Document.ReadOnly = val; + } + + public void SynEdit_ChangeText(object sender, CodeFileDocumentControl cfdc) + { + CodeFileDocumentControl d = cfdc; + if (!d.DocumentChanged && !visualStates.FileOpened)//!((Data)tabControl1.SelectedTab.Tag).FileOpened) + { + d.DocumentChanged = true; + SetTabPageText(CurrentCodeFileDocument); + if (!d.FromMetadata) + SaveAllButtonsEnabled = SaveButtonsEnabled = true; + + } + + NavigationLocationChanged(); + UpdateUndoRedoEnabled(); + WorkbenchServiceFactory.CodeCompletionParserController.SetAsChanged(cfdc.FileName); + } + + public void UpdateLineColPosition() + { + slLine.Text = CurrentSyntaxEditor.CaretPosition.Y.ToString(); + slCol.Text = CurrentSyntaxEditor.CaretPosition.X.ToString(); + } + + public void ExecNavigateBackward() + { + NavigationManager.NavigateBackward(); + } + + public void ExecNavigateForward() + { + NavigationManager.NavigateForward(); + } + + public void ExecSelectAll() + { + CurrentSyntaxEditor.SelectAll(); + } + + public void ExecGotoLine() + { + GotoLineForm.ShowDialog(); + } + + public void ExecFindReferences() + { + FindSymbolsResultWindow.FindAllReferences(); + } + + public void ExecCut() + { + CurrentCodeFileDocument.Cut(); + } + + public void ExecCopy() + { + CurrentCodeFileDocument.Copy(); + } + + public void ExecPaste() + { + CurrentCodeFileDocument.Paste(true); + } + + internal void NavigationLocationChanged() + { + ICSharpCode.TextEditor.Caret c = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret; + NavigationManager.LocationChanged(c.Line + 1, c.Column + 1, CurrentSourceFileName); + } + + internal void ExecuteErrorPos(PascalABCCompiler.SourceLocation sl, int imageindex) + { + if (CurrentCodeFileDocument.DesignerAndCodeTabs != null) + { + CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = CurrentCodeFileDocument.TextPage; + } + ExecuteSourceLocationAction(sl, ErrorCursorPosStrategy); + if (imageindex == 1) + ErrorLineBookmark.SetPosition(CurrentSyntaxEditor.TextEditor, sl.BeginPosition.Line); + else if (imageindex == 2) + RuntimeErrorBookmark.SetPosition(CurrentSyntaxEditor.TextEditor, sl.BeginPosition.Line); + + } + + public void ExecuteSourceLocationAction(PascalABCCompiler.SourceLocation + SourceLocation, VisualPascalABCPlugins.SourceLocationAction Action) + { + if (Action != SourceLocationAction.NavigationGoto) + NavigationLocationChanged(); + if (SourceLocation.FileName != null) + WorkbenchServiceFactory.FileService.OpenFile(SourceLocation.FileName, null, true); + CodeFileDocumentTextEditorControl editor = CurrentSyntaxEditor.TextEditor; + editor.ActiveTextAreaControl.SelectionManager.ClearSelection(); + + //Point Beg = new Point(SourceLocation.BeginPosition.Column - 1, SourceLocation.BeginPosition.Line - 1); + //Point End = new Point(SourceLocation.EndPosition.Column, SourceLocation.EndPosition.Line - 1); + ICSharpCode.TextEditor.TextLocation Beg = new ICSharpCode.TextEditor.TextLocation(SourceLocation.BeginPosition.Column - 1, SourceLocation.BeginPosition.Line - 1); + ICSharpCode.TextEditor.TextLocation End = new ICSharpCode.TextEditor.TextLocation(SourceLocation.EndPosition.Column, SourceLocation.EndPosition.Line - 1); + switch (Action) + { + case SourceLocationAction.SelectAndGotoBeg: + case SourceLocationAction.SelectAndGotoEnd: + case SourceLocationAction.FindSelection: + if (Action == SourceLocationAction.SelectAndGotoBeg) + editor.ActiveTextAreaControl.Caret.Position = Beg; + else + editor.ActiveTextAreaControl.Caret.Position = End; + editor.ActiveTextAreaControl.SelectionManager.SetSelection(Beg, End); + if (Action != SourceLocationAction.FindSelection) + SetFocusToEditor(); + break; + case SourceLocationAction.NavigationGoto: + case SourceLocationAction.GotoBeg: + case SourceLocationAction.GotoEnd: + if (Action == SourceLocationAction.GotoBeg || Action == SourceLocationAction.NavigationGoto) + editor.ActiveTextAreaControl.Caret.Position = Beg; + else + editor.ActiveTextAreaControl.Caret.Position = End; + SetFocusToEditor(); + break; + } + if (Action != SourceLocationAction.NavigationGoto) + { + NavigationLocationChanged(); + CurrentSyntaxEditor.CenterView(); + } + } + + private void AddEditorHandlers(CodeFileDocumentControl tp) + { + tp.TextEditor.AddToolTipRequestHandler(TooltipServiceManager.ToolTipService_TextAreaToolTipRequest); + tp.TextEditor.AddMouseMoveHandler(TooltipServiceManager.ToolTipService_TextAreaMouseMove); + tp.TextEditor.AddKeyDownHandler(TooltipServiceManager.ToolTipService_TextAreaKeyDown); + tp.TextEditor.AddMouseWheelHandler(TooltipServiceManager.ToolTipService_TextAreaMouseEvent_HideToolTip); + tp.TextEditor.AddMouseDownHandler(TooltipServiceManager.ToolTipService_TextAreaMouseEvent_HideToolTip); + tp.TextEditor.AddMouseMoveHandler(DefinitionByMouseClickManager.DefinitionByMouseClickManager_TextAreaMouseMove); + tp.TextEditor.ActiveTextAreaControl.TextArea.Click += DefinitionByMouseClickManager.DefinitionByMouseClickManager_TextAreaMouseDown; + //tp.TextEditor.AddMouseDownHandler(DefinitionByMouseClickManager.DefinitionByMouseClickManager_TextAreaMouseDown); + } + + private void RemoveEditorHandlers(CodeFileDocumentControl tp) + { + tp.TextEditor.RemoveToolTipRequestHandler(TooltipServiceManager.ToolTipService_TextAreaToolTipRequest); + tp.TextEditor.RemoveMouseMoveHandler(TooltipServiceManager.ToolTipService_TextAreaMouseMove); + tp.TextEditor.RemoveKeyDownHandler(TooltipServiceManager.ToolTipService_TextAreaKeyDown); + tp.TextEditor.RemoveMouseWheelHandler(TooltipServiceManager.ToolTipService_TextAreaMouseEvent_HideToolTip); + tp.TextEditor.RemoveMouseDownHandler(TooltipServiceManager.ToolTipService_TextAreaMouseEvent_HideToolTip); + tp.TextEditor.RemoveMouseMoveHandler(DefinitionByMouseClickManager.DefinitionByMouseClickManager_TextAreaMouseMove); + tp.TextEditor.ActiveTextAreaControl.TextArea.Click -= DefinitionByMouseClickManager.DefinitionByMouseClickManager_TextAreaMouseDown; + //tp.TextEditor.RemoveMouseMoveHandler(DefinitionByMouseClickManager.DefinitionByMouseClickManager_TextAreaMouseDown); + } + + public void CollapseRegions() + { + CurrentCodeFileDocument.TextEditor.CollapseRegions(); + } + + public void CodeFormat() + { + (new CodeFormattingAction()).Execute(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea); + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/FileOperations.cs b/VisualPascalABCNETLinux/Workbench/FileOperations.cs new file mode 100644 index 000000000..c51e3eb7f --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/FileOperations.cs @@ -0,0 +1,604 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; +//using ICSharpCode.FormsDesigner; +using VisualPascalABCPlugins; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class Form1 : IWorkbenchFileService + { + List temp_open_files = new List(); + public List LastOpenFiles; + private VisualStates visualStates = new VisualStates(); + internal Dictionary OpenDocuments = new Dictionary(); + internal Dictionary OpenBrowserDocuments = new Dictionary(); + private int MaxLastOpenFiles = 10; + private int MaxCharsInLastOpenFileName = 80; + + public CodeFileDocumentControl OpenFileAndNoSelection(string FileName) + { + CodeFileDocumentControl tp = FindTab(FileName); + if (tp != null) + return tp; + tp = AddNewProgramToTab(MainDockPanel, FileName); + AddLastFile(FileName); + tp.LoadFromFile(FileName); + tp.DocumentSavedToDisk = true; + ShowAddedBreakpoints(tp); + return tp; + } + + public bool OpenFile(string FileName, string PreferedFileName, bool not_open_designer=false) + { + CodeFileDocumentControl tp = FindTab(FileName); + bool IsNewFile = FileName == null; + if (tp == null) + { + if (!IsNewFile && !File.Exists(FileName)) + { + MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!FILE_NOT_FOUND{0}"), FileName), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + return false; + } + visualStates.FileOpened = true;//????? + if (!IsNewFile) + openFileDialog1.InitialDirectory = Path.GetDirectoryName(FileName); + if (!IsBlankNewProgram(CurrentCodeFileDocument)) + { + if (IsNewFile) + if (PreferedFileName == null) + FileName = InstNameNewProgramm(MainDockPanel); + else + FileName = PreferedFileName; + tp = AddNewProgramToTab(MainDockPanel, FileName); + + } + else + if (!IsNewFile) + { + CheckErrorListAndClear(CurrentCodeFileDocument.FileName); + WorkbenchServiceFactory.CodeCompletionParserController.CloseFile(CurrentCodeFileDocument.FileName); + OpenDocuments.Remove(Tools.FileNameToLower(CurrentCodeFileDocument.FileName)); + CurrentCodeFileDocument.FileName = FileName; + SetTabPageText(CurrentCodeFileDocument); + if (!WorkbenchServiceFactory.RunService.HasRunArgument(FileName.ToLower())) + WorkbenchServiceFactory.RunService.AddRunArgument(FileName.ToLower(), ""); + tp = CurrentCodeFileDocument; + } + if (!IsNewFile) + { + AddLastFile(FileName); + WatcherService.AddWatcher(FileName); + int ticks = Environment.TickCount; + tp.LoadFromFile(FileName); + //MessageBox.Show((Environment.TickCount-ticks).ToString()); + + tp.DocumentSavedToDisk = true; + //ivan added + ShowAddedBreakpoints(tp); + //ShowAddedBreakpoints(tabControl1.TabPages[TabIndex]); + } + //CloseButtonsEnabled = OpenDocuments.Count > 1; + ChangedSelectedTab(); + if (FileName != null) // SS 09.08.08 + WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(FileName); + + } + if (tp != null) + { + if (MainDockPanel.ActiveDocument != tp) + { + CurrentCodeFileDocument = tp; + } + } + if (FileName != null) + { + string filename = Tools.FileNameToLower(FileName); + if (OpenDocuments.ContainsKey(filename)) + OpenDocuments[filename] = tp; + else + OpenDocuments.Add(filename, tp); + CloseButtonsEnabled = OpenDocuments.Count > 1;//Ivan 09.08.08 err 195 + } + visualStates.FileOpened = false; + + //ssyy + if (!IsNewFile) + { + if (Path.GetExtension(FileName) == ".pas") + { + /*string XMLFile = Path.ChangeExtension(FileName, string_consts.xml_form_extention); + if (File.Exists(XMLFile)) + { + if (not_open_designer) + { + if (VisualPascalABC.VisualPABCSingleton.MainForm._currentCodeFileDocument.DesignerAndCodeTabs != null) + { + //VisualPascalABC.Form1.Form1_object.CahngedSelectedTab(); + VisualPascalABC.VisualPABCSingleton.MainForm._currentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = + VisualPascalABC.VisualPABCSingleton.MainForm._currentCodeFileDocument.TextPage; + + } + } + else + _currentCodeFileDocument.AddDesigner(XMLFile); + }*/ + } + } + + return true; + } + + public void OpenFileWithForm() + { + OpenFile(null, null); + CurrentCodeFileDocument.AddDesigner(null); + } + + public CodeFileDocumentControl OpenFileForDebug(string FileName) + { + CodeFileDocumentControl tp = FindTab(FileName); + bool IsNewFile = FileName == null; + if (tp == null) + { + visualStates.FileOpened = true;//????? + if (!IsNewFile && !File.Exists(FileName)) + { + //MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!FILE_NOT_FOUND{0}"), FileName), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + bool exists = false; + foreach (string s in search_debug_paths) + { + FileName = String.Concat(s, Path.DirectorySeparatorChar, Path.GetFileName(FileName)); + if (File.Exists(FileName)) + { + tp = FindTab(FileName); + if (tp != null) + { + CurrentCodeFileDocument = tp; + //(CurrentTabPage.ag as CodeFileDocumentControl).DocumentSavedToDisk = !IsNewFile; + visualStates.FileOpened = false; + AddDebugPage(CurrentCodeFileDocument); + return CurrentCodeFileDocument; + } + else + { + exists = true; + break; + } + } + } + if (!exists) + { + visualStates.FileOpened = false; + return null; + } + } + openFileDialog1.InitialDirectory = Path.GetDirectoryName(FileName); + if (!IsBlankNewProgram(CurrentCodeFileDocument)) + { + if (IsNewFile) + FileName = InstNameNewProgramm(MainDockPanel); + tp = AddNewProgramToTab(MainDockPanel, FileName); + } + else + if (!IsNewFile) + { + //CheckErrorListAndClear((tabControl1.TabPages[TabIndex].ag as CodeFileDocumentControl).FileName); + CurrentCodeFileDocument.FileName = FileName; + if (!ProjectFactory.Instance.ProjectLoaded) + SetTabPageText(CurrentCodeFileDocument); + tp = CurrentCodeFileDocument; + } + if (!IsNewFile) + { + AddLastFile(FileName); + WatcherService.AddWatcher(FileName); + tp.LoadFromFile(FileName); + tp.DocumentSavedToDisk = true; + //ivan added + ShowAddedBreakpoints(tp); + //ShowAddedBreakpoints(tabControl1.TabPages[TabIndex]); + } + CloseButtonsEnabled = OpenDocuments.Count > 1; + } + if (tp != null) + { + CurrentCodeFileDocument = tp; + if (tp.DesignerAndCodeTabs != null) + tp.DesignerAndCodeTabs.SelectedTab = tp.TextPage; + //(CurrentTabPage.ag as CodeFileDocumentControl).DocumentSavedToDisk = !IsNewFile; + } + visualStates.FileOpened = false; + AddDebugPage(CurrentCodeFileDocument); + //CahngedSelectedTab(); + return CurrentCodeFileDocument; + } + + ICodeFileDocument VisualPascalABCPlugins.IWorkbenchFileService.OpenFileForDebug(string FileName) + { + return OpenFileForDebug(FileName); + } + + public void RenameFile(string OldFileName, string NewFileName) + { + CodeFileDocumentControl cfdc = FindTab(OldFileName); + if (cfdc == null) + { + try + { + File.Copy(OldFileName, NewFileName); + File.Delete(OldFileName); + } + catch + { + } + return; + } + SaveFileAs(cfdc, NewFileName); + try + { + File.Delete(OldFileName); + } + catch + { + } + } + + public void CloseFile(CodeFileDocumentControl tp, bool ask_for_save = true) + { + string FileName = tp.FileName.ToLower(); + string exeName = tp.EXEFileName; + if (WorkbenchServiceFactory.RunService.IsRun(exeName)) + WorkbenchServiceFactory.RunService.Stop(exeName); + if (ask_for_save) + if (tp.DocumentChanged && !tp.FromMetadata) + if (!QuestionAndSaveFile(tp)) + { + SaveCanceled = true; + return; + } + if (tp.DocumentSavedToDisk) + AddLastFile(CurrentSourceFileName); + if (LastSelectedTab != null && !LastSelectedTab.IsDisposed) + CurrentCodeFileDocument = LastSelectedTab; + if (tp == ActiveCodeFileDocument) + ActiveCodeFileDocument = null; + OutputTextBoxs.Remove(tp); + OpenDocuments.Remove(Tools.FileNameToLower(tp.FileName)); + //RunArgumentsTable.Remove(tp); + tp.Dispose(); + CheckErrorListAndClear(FileName); + WatcherService.RemoveWatcher(FileName); + if (OpenDocuments.Count == 1) + { + CloseButtonsEnabled = false; + } + SaveAllButtonsEnabled = !AllSaved(); + WorkbenchServiceFactory.CodeCompletionParserController.CloseFile(FileName); + WorkbenchServiceFactory.CodeCompletionParserController.ParseInformationUpdated -= tp.TextEditor.UpdateFolding; + CodeCompletionKeyHandler.Detach(tp.TextEditor); + tp.TextEditor.Document.DocumentChanged -= tp.Document_DocumentChanged; + tp.TextEditor.Document.TextContent = ""; + tp.TextEditor.Document.DocumentChanged += tp.Document_DocumentChanged; + GC.Collect(); + } + + public void CloseFile(string FileName) + { + CodeFileDocumentControl tp = FindTab(FileName); + if (tp != null) + { + CloseFile(tp); + if (OpenDocuments.Count == 0) + { + OpenFile(null, null); + } + } + } + + private void CloseFilesAndSaveState() + { + foreach (CodeFileDocumentControl cfdc in this.OpenDocuments.Values) + { + temp_open_files.Add(cfdc.FileName); + } + + CloseAllButThis(null); + } + + public void ReloadFile(string FileName) + { + CodeFileDocumentControl tab = FindTab(FileName); + if (tab != null) + { + tab.LoadFromFile(FileName); + tab.DocumentChanged = false; + SetTabPageText(tab); + } + } + + private void RestoreFiles() + { + foreach (string s in temp_open_files) + { + if (File.Exists(s)) + OpenFile(s, null); + else + OpenFile(null, null); + } + temp_open_files.Clear(); + } + + public void SetFileAsChanged(string FileName) + { + CodeFileDocumentControl tab = FindTab(FileName); + if (tab != null) + { + tab.DocumentChanged = true; + SetTabPageText(tab); + } + } + + private void SaveSelFile(CodeFileDocumentControl TbPage) + { + SaveSelFileAs(TbPage, TbPage.FileName); + } + + private void SaveSelFileAs(CodeFileDocumentControl TbPage, string FileName) + { + if (!TbPage.DocumentSavedToDisk) + ExecuteSaveAs(TbPage); + else + SaveFileAs(TbPage, FileName); + } + + internal void SaveFileAs(CodeFileDocumentControl TbPage, string FileName) + { + try + { + /*if (TbPage.DesignerAndCodeTabs != null) + { + TbPage.GenerateDesignerCode(null); + }*/ + CodeFileDocumentControl dt = TbPage; + WatcherService.DisableWatcher(FileName); + //dt.TextEditor.Encoding = VisualEnvironmentCompiler.DefaultFileEncoding; + if (!dt.TextEditor.CanSaveWithCurrentEncoding() || true) + { + dt.TextEditor.Encoding = Encoding.UTF8; + dt.TextEditor.SaveFile(FileName); + dt.TextEditor.Encoding = VisualEnvironmentCompiler.DefaultFileEncoding; + } + else + dt.TextEditor.SaveFile(FileName); + WatcherService.EnableWatcher(FileName); + OpenDocuments.Remove(Tools.FileNameToLower(dt.FileName)); + OpenDocuments.Add(Tools.FileNameToLower(FileName), TbPage); + WorkbenchServiceFactory.CodeCompletionParserController.RenameFile(dt.FileName, FileName); + //TbPage.SaveFormFile(FileName); + dt.DocumentChanged = false; + dt.FileName = FileName; + dt.DocumentSavedToDisk = true; + dt.SetHighlightingStrategyForFile(FileName); + SetTabPageText(TbPage); + if (!WorkbenchServiceFactory.RunService.HasRunArgument(FileName.ToLower())) + WorkbenchServiceFactory.RunService.AddRunArgument(FileName.ToLower(), ""); + if (TbPage == CurrentCodeFileDocument) + UpdateSaveButtonsEnabled(); + } + catch (Exception) + { + MessageBox.Show(String.Format(Form1StringResources.Get("SAVE_FILE_ERROR_TEXT{0}"), FileName), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + + public bool SaveAll(bool Question) + { + if (ProjectFactory.Instance.ProjectLoaded && Question) + { + return SaveAllInProject() != 2; + } + SaveCanceled = false; + CodeFileDocumentControl[] l = new CodeFileDocumentControl[OpenDocuments.Values.Count]; + OpenDocuments.Values.CopyTo(l, 0); + foreach (CodeFileDocumentControl tp in l) + if (tp.DocumentChanged && !tp.FromMetadata) + if (Question) + { + if (!QuestionAndSaveFile(tp)) + { + SaveCanceled = true; + return false; + } + } + else + SaveSelFile(tp); + UpdateSaveButtonsEnabled(); + return true; + } + + void IWorkbenchFileService.CloseAllButThis(ICodeFileDocument nonCloseTab) + { + this.CloseAllButThis(nonCloseTab as CodeFileDocumentControl); + } + + void CloseAllButThis(CodeFileDocumentControl nonCloseTab) + { + SaveCanceled = false; + CodeFileDocumentControl bakTab = CurrentCodeFileDocument; + /*foreach (TabPage tbPage in tabControl1.TabPages) + if (tbPage != tabControl1.SelectedTab) + CloseFile(tbPage);*/ + List to_close = new List(); + foreach (CodeFileDocumentControl tbPage in OpenDocuments.Values) + { + if (SaveCanceled) break; + if (tbPage != nonCloseTab) + { + if (tbPage == bakTab) + bakTab = null; + to_close.Add(tbPage); + } + } + if (!SaveCanceled) + foreach (CodeFileDocumentControl tbPage in to_close) + { + tbPage.Close(); + } + if (bakTab != null) + if (bakTab != CurrentCodeFileDocument) + CurrentCodeFileDocument = bakTab; + List todelete = new List(); + foreach (WebBrowserControl browserTab in OpenBrowserDocuments.Values) + todelete.Add(browserTab); + foreach (WebBrowserControl browserTab in todelete) + browserTab.Close(); + //OpenBrowserDocuments.Clear(); + } + + bool QuestionAndSaveFile(CodeFileDocumentControl tp) + { + CurrentCodeFileDocument = tp; + DialogResult result = MessageBox.Show(string.Format(Form1StringResources.Get("SAVE_CHANGES_IN_FILE{0}"), Path.GetFileName(tp.FileName)), PascalABCCompiler.StringResources.Get("!CONFIRM"), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (result == DialogResult.Yes) + SaveSelFile(CurrentCodeFileDocument); + else + if (result == DialogResult.Cancel) + return false; + return true; + } + + private void ExecuteSaveAs(CodeFileDocumentControl TbPage) + { + //if (TbPage.DesignerAndCodeTabs != null) + //{ + // TbPage.GenerateDesignerCode(); + //} + CodeFileDocumentControl bakTab = CurrentCodeFileDocument; + CurrentCodeFileDocument = TbPage; + var s = Path.GetFileName(CurrentSourceFileName); + if (s.ToLower().StartsWith("program")) + s = ""; + saveFileDialog1.FileName = s; + string id = Path.GetDirectoryName(CurrentSourceFileName); + if (id == "") + { + if (WorkbenchStorage.WorkingDirectoryExsist) + saveFileDialog1.InitialDirectory = WorkbenchStorage.WorkingDirectory; + } + else + saveFileDialog1.InitialDirectory = Path.GetDirectoryName(CurrentSourceFileName); + DialogResult dr = saveFileDialog1.ShowDialog(); + CurrentCodeFileDocument = bakTab; + + } + + string GetLastFileCaption(string FullFileName) + { + if (FullFileName.Length > MaxCharsInLastOpenFileName + 5) + { + string DriveName = Path.GetPathRoot(FullFileName);//FullFileName.Substring(0, 3); + string FileName = Path.GetFileName(FullFileName); + int FreeSpace = MaxCharsInLastOpenFileName - DriveName.Length - FileName.Length; + string DirectoryName = Path.GetDirectoryName(FullFileName); + if (FreeSpace > 0 && DirectoryName.Length > FreeSpace) + DirectoryName = DirectoryName.Substring(DirectoryName.Length - FreeSpace); + else + return FullFileName; + return DriveName + "..." + DirectoryName + "\\" + FileName; + } + return FullFileName; + } + + bool ReplaceLastFile(string OldFileName, string NewFileName) + { + ToolStripMenuItem mI; + for (int i = 0; i < LastOpenFiles.Count; i++) + if (LastOpenFiles[i].ToLower() == OldFileName.ToLower()) + { + LastOpenFiles.RemoveAt(i); + LastOpenFiles.Insert(0, NewFileName); + mI = (ToolStripMenuItem)miRecentFiles.DropDownItems[i]; + miRecentFiles.DropDownItems.RemoveAt(i); + mI.Text = GetLastFileCaption(NewFileName); + mI.Tag = NewFileName; + miRecentFiles.DropDownItems.Insert(0, mI); + return true; + } + return false; + } + + void AddLastFile(string FileName) + { + if (Path.GetDirectoryName(FileName) == "") return; + ToolStripMenuItem mI; + if (ReplaceLastFile(FileName, FileName)) return; + if (LastOpenFiles.Count >= MaxLastOpenFiles) + { + LastOpenFiles.RemoveAt(LastOpenFiles.Count - 1); + miRecentFiles.DropDownItems.RemoveAt(miRecentFiles.DropDownItems.Count - 1); + } + LastOpenFiles.Insert(0, FileName); + mI = new ToolStripMenuItem(); + mI.Text = GetLastFileCaption(FileName); + mI.Tag = FileName; + miRecentFiles.DropDownItems.Insert(0, mI); + mI.Click += new System.EventHandler(this.OpenLastFile_ToolStripMenuItem_Click); + // mI.ToolTipText = mI.Text; + } + + private string InstNameNewProgramm(DockPanel tabControl) + { + int NumbNewProg = 1; + string FileNameFormat = Path.Combine(WorkbenchStorage.WorkingDirectory, UserOptions.DefaultSourceFileNameFormat), FileName; + while (true) + { + FileName = string.Format(FileNameFormat, NumbNewProg); + if (FindTab(FileName) == null && !File.Exists(FileName)) + return FileName; + NumbNewProg++; + } + } + + bool IsBlankNewProgram(CodeFileDocumentControl tp) + { + return (!tp.DocumentSavedToDisk && !tp.DocumentChanged); + } + + internal bool IsForm(string FileName) + { + //string XMLFile = Path.ChangeExtension(FileName, string_consts.xml_form_extention); + // return File.Exists(XMLFile); + return false; + } + + internal bool AllSaved() + { + foreach (CodeFileDocumentControl tp in OpenDocuments.Values) + if (tp.DocumentChanged) return false; + return true; + } + + void IWorkbenchFileService.PrintActiveDocument() + { + ExecPrint(); + } + + public void ExecPrint() + { + printDialog1.AllowSelection = true; + printDialog1.Document = this.CurrentCodeFileDocument.TextEditor.PrintDocument; + if (printDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + printDialog1.Document.Print(); + } + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/HelpService.cs b/VisualPascalABCNETLinux/Workbench/HelpService.cs new file mode 100644 index 000000000..f16ec82d9 --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/HelpService.cs @@ -0,0 +1,244 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.IO; +using System.Windows.Forms; +using System.Collections.Generic; +using VisualPascalABCPlugins; +using System.Threading; +using PascalABCCompiler.Parsers; +using System.Text; + +namespace VisualPascalABC +{ + partial class Form1 : IMessageFilter, IHelpService + { + private Dictionary HelpPrograms; + string HelpFileName = null; + string HelpExamplesFileName = null; + string HelpExamplesMapFileName = null; + string HelpExamplesDirectory = null; + string HelpTutorialExamplesDirectory = null; + private string DotNetHelpFileName = null; + private CodeSampleManager sampleManager; + + private void OpenHelpProgram(string name, bool compileandexecute) + { + VisualPascalABC.VisualPascalABCProgram.MainForm.Activate(); + ExecuteVisualEnvironmentCompilerAction(VisualEnvironmentCompilerAction.OpenFile, name); + if (compileandexecute) + ExecuteVisualEnvironmentCompilerAction(VisualEnvironmentCompilerAction.Run, null); + } + + private void InitHelpProgramsDictionary() // Èíèöèàëèçàöèÿ êàðòû ïðîãðàìì, ïðåäíàçíà÷åííûõ äëÿ çàïóñêà èç ñïðàâêè + { + HelpPrograms = new Dictionary(); + try + { + using (StreamReader sr = new StreamReader(HelpExamplesMapFileName)) + { + string s; + while (!sr.EndOfStream) + { + s = sr.ReadLine(); + int p = s.IndexOf('='); + int num; + if (p >= 0 && int.TryParse(s.Substring(0, p), out num)) + { + string name = s.Substring(p + 1); + HelpPrograms[num] = name; + } + } + } + + } + catch { } + sampleManager = new CodeSampleManager(); + } + + public void OpenMSDN() + { + AddTabWithUrl(MainDockPanel, PascalABCCompiler.StringResources.Get("VP_MF_M_DOTNET_HELP"), "http://msdn.microsoft.com/ru-ru/library/w0x726c2%28v=vs.100%29.aspx"); + } + + private string getMSDNUrlByName(string s, Position pos) + { + StringBuilder sb = new StringBuilder(); + sb.Append("http://msdn.microsoft.com/ru-ru/library/"); + string title = pos.full_metadata_title; + if (pos.full_metadata_title.IndexOf('`') != -1 && pos.full_metadata_title.IndexOf('.') != -1) + title = pos.full_metadata_title.Substring(0, pos.full_metadata_title.LastIndexOf('.')); + sb.Append(title); + sb.Append("(v=vs.100).aspx"); + return sb.ToString(); + } + + private bool isDotNetItem(string s, ref Position position) + { + /*if (!File.Exists(DotNetHelpFileName)) + return false;*/ + switch (s.ToLower()) + { + case "integer": + case "real": + case "byte": + case "shortint": + case "smallint": + case "boolean": + case "single": + case "word": + case "longword": + case "uint64": + case "longint": + case "int64": + case "char": + case "string": + return false; + } + if (CodeCompletion.CodeCompletionController.CurrentParser == null) return false; + List poses = CodeCompletionActionsManager.GetDefinitionPosition(CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea, true); + if (poses == null || poses.Count == 0) return false; + foreach (Position pos in poses) + if (pos.from_metadata) + { + position = pos; + return true; + } + return false; + } + + public bool PreFilterMessage(ref Message m) + { + if (m.Msg == 0x0052) // îáðàáîòêà ñîîáùåíèÿ WM_TCARD (äëÿ âûçîâà äåéñòâèé ïî ãèïåðññûëêàì â Helpå (ÑÑÌ 1.04.08) + { + if (HelpPrograms == null) + return false; + string name = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.WorkingDirectoryIdent, WorkbenchStorage.StandartDirectories); + name += "\\Samples\\"; + if (HelpPrograms.ContainsKey((int)m.WParam)) + { + name += HelpPrograms[(int)m.WParam]; + try + { + OpenHelpProgram(name, true); + } + catch { } + } + } + return false; + } + + public void ExecShowHelpF1() + { + if (checkForDotNetItem()) + __showDotNetHelp(); + else if (!ThreadPool.QueueUserWorkItem(__showhelpf1)) + __showhelpf1(null); + } + + bool checkForDotNetItem() + { + ICSharpCode.TextEditor.TextLocation cp = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret.Position; + ICSharpCode.TextEditor.Document.TextWord tw = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.GetLineSegment(cp.Line).GetWord(cp.Column); + + if (tw != null) + { + Position pos = default(Position); + if (isDotNetItem(tw.Word, ref pos)) + { + return true; + } + } + return false; + } + + + void __showDotNetHelp() + { + ICSharpCode.TextEditor.TextLocation cp = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret.Position; + ICSharpCode.TextEditor.Document.TextWord tw = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.GetLineSegment(cp.Line).GetWord(cp.Column); + + if (tw != null) + { + Position pos = default(Position); + if (isDotNetItem(tw.Word, ref pos)) + { + if (pos.full_metadata_title != null) + { + AddTabWithUrl(MainDockPanel, pos.full_metadata_title, getMSDNUrlByName(tw.Word, pos)); + } + } + } + } + + void __showhelpf1(object state) + { + ICSharpCode.TextEditor.TextLocation cp = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.Caret.Position; + ICSharpCode.TextEditor.Document.TextWord tw = CurrentSyntaxEditor.TextEditor.ActiveTextAreaControl.TextArea.Document.GetLineSegment(cp.Line).GetWord(cp.Column); + + if (tw != null) + { + MetadataType metadata_type = MetadataType.Class; + /*if (isDotNetItem(tw.Word, ref metadata_type)) + { + //Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex); + //Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word); + //Help.ShowHelp(this, DotNetHelpFileName); + //Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex); + //Help.ShowHelpIndex(this, DotNetHelpFileName); + //Help.ShowHelp(this, DotNetHelpFileName,HelpNavigator.KeywordIndex, tw.Word); + AddTabWithUrl(MainDockPanel, tw.Word, getMSDNUrlByName(tw.Word)); + Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.TableOfContents); + + switch (metadata_type) + { + case MetadataType.Class: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " êëàññ"); break; + case MetadataType.Constructor: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + "." + tw.Word + " êîíñòðóêòîðû"); break; + case MetadataType.Delegate: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " äåëåãàò"); break; + case MetadataType.Enumeration: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " ïåðå÷èñëåíèå"); break; + case MetadataType.EnumerationMember: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " ýëåìåíò ïåðå÷èñëåíèÿ"); break; + case MetadataType.Event: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " ñîáûòèå"); break; + case MetadataType.Field: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " ïîëå"); break; + case MetadataType.Interface: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " èíòåðôåéñ"); break; + case MetadataType.Method: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " ìåòîä"); break; + case MetadataType.Property: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " ñâîéñòâî"); break; + case MetadataType.Struct: Help.ShowHelp(this, DotNetHelpFileName, HelpNavigator.KeywordIndex, tw.Word + " çàïèñü"); break; + } + + } + else*/ + { + Help.ShowHelp(null, HelpFileName, HelpNavigator.TableOfContents); + Help.ShowHelp(null, HelpFileName, HelpNavigator.KeywordIndex, tw.Word); + } + } + else + { + Help.ShowHelp(null, HelpFileName, HelpNavigator.KeywordIndex, "PascalABC"); // ôèêòèâíûé âûçîâ. Íóæåí ÷òîáû îêíî ñïðàâêè íå ïîêàçûâàëîñü Always on Top + Help.ShowHelp(null, HelpFileName); + } + } + + void __showgettingstarted(object state) + { + Help.ShowHelp(null, HelpFileName, HelpNavigator.Topic, @"Common\features.html"); //this íå ïåðåïðàâëÿòü íà null - ñîîáùèòü ìíå ïðè îøèáêå - ÑÑÌ + } + + void __showhelp(object state) + { + Help.ShowHelp(null, HelpFileName);//zdes dolzhen stojat null, inache gluki pri perekluchenii okon + } + + void __showdotnethelp(object state) + { + Help.ShowHelp(null, DotNetHelpFileName); + } + + void __showhelpinqueue() + { + if (!ThreadPool.QueueUserWorkItem(__showhelp)) + __showhelp(null); + } + } +} + diff --git a/VisualPascalABCNETLinux/Workbench/OptionsManager.cs b/VisualPascalABCNETLinux/Workbench/OptionsManager.cs new file mode 100644 index 000000000..d4551d1ab --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/OptionsManager.cs @@ -0,0 +1,379 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using Microsoft.Win32; +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace VisualPascalABC +{ + public partial class Form1 : Form, VisualPascalABCPlugins.IWorkbench, VisualPascalABCPlugins.IWorkbenchOptionService + { + private string OldOptionsFileName = Path.ChangeExtension(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName, ".ini"); + private string OptionsFileName = Path.Combine(Constants.DefaultWorkingDirectory, "PascalABCNET.ini"); + public UserOptions UserOptions; + + private string OptionsItemNameLanguage = "Language"; + private string OptionsItemNameMainFormLeft = "MainFormLeft"; + private string OptionsItemNameMainFormTop = "MainFormTop"; + private string OptionsItemNameMainFormHeight = "MainFormHeight"; + private string OptionsItemNameMainFormWidth = "MainFormWidth"; + private string OptionsItemNameMainFormMaximized = "MainFormMaximized"; + private string OptionsItemNameShowLinesNum = "ShowLinesNum"; + private string OptionsItemNameEnableFolding = "EnableFolding"; + private string OptionsItemNameRedirectConsoleIO = "RedirectConsoleIO"; + private string OptionsItemNameGenerateDebugInfo = "GenerateDebugInfo"; + private string OptionsItemNameLastFile = "LastFile"; + private string OptionsItemNameLastProject = "LastProject"; + private string OptionsItemNameWorkDirectory = "WorkDirectory"; + private string OptionsItemNameShowOutputWindow = "ShowOutputWindow"; + private string OptionsItemNameErrorsStrategy = "ErrorsStrategy"; + private string OptionsItemNameEditorFontFamily = "EditorFontFamily"; + private string OptionsItemNameEditorFontSize = "EditorFontSize"; + private string OptionsItemNameErrorsCursorPosStrategy = "ErrorsCursorPosStrategy"; + private string OptionsItemNameShowMathBracket = "ShowMathBracket"; + private string OptionsItemNameShowMatchOperatorBracket = "ShowMatchOperatorBracket"; + private string OptionsItemNameConvertTabsToSpaces = "ConvertTabsToSpaces"; + private string OptionsItemNameTabIdent = "TabIdent"; + private string OptionsItemNameDeleteEXEAfterExecute = "DeleteEXEAfterExecute"; + private string OptionsItemNameDeletePDBAfterExecute = "DeletePDBAfterExecute"; + private string OptionsItemNameOutputDirectory = "OutputDirectory"; + private string OptionsItemNameUseOutputDirectory = "UseOutputDirectory"; + private string OptionsItemNameDefaultSourceFileNameFormat = "DefaultSourceFileNameFormat"; + private string OptionsItemNamePlayPauseButtonsVisibleInPanel = "PlayPauseButtonsVisibleInPanel"; + private string OptionsItemNamePauseInRunModeIfConsole = "PauseInRunModeIfConsole"; + private string OptionsItemNameMainFormTitle = "MainFormTitle"; + private string OptionsItemNameCodeCompletionDot = "CodeCompletionDot"; + private string OptionsItemNameCodeCompletionHint = "CodeCompletionHint"; + private string OptionsItemNameCodeCompletionParams = "CodeCompletionParams"; + private string OptionsItemNameCodeCompletionKeyPressed = "CodeCompletionKeyPressed"; + private string OptionsItemNameCodeCompletionNamespaceVisibleRange = "CodeCompletionNamespaceVisibleRange"; + private string OptionsItemNameAllowCodeCompletion = "AllowCodeCompletion"; + private string OptionsItemNameSaveSourceFilesIfComilationOk = "SaveSourceFilesIfComilationOk"; + private string OptionsItemNameDockBottomPortion = "DockBottomPortion"; + private string OptionsItemNameDockLeftPortion = "DockLeftPortion"; + private string OptionsItemNameDockRightPortion = "DockRightPortion"; + private string OptionsItemNameShowQuickClassBrowserPanel = "ShowQuickClassBrowserPanel"; + private string OptionsItemNameUseSemanticIntellisense = "UseSemanticIntellisense"; + private string OptionsItemNameSkipStackTraceItemIfSourceFileInSystemDirectory = "SkipStakTraceItemIfSourceFileInSystemDirectory"; + private string OptionsItemNameShowFoundedNamesTab = "ShowFoundedNamesTab"; + private string OptionsItemNameShowWatchTab = "ShowWatchTab"; + private string OptionsItemNameShowLocalVarsTab = "ShowLocalVarsTab"; + private string OptionsItemUseDllForSystemModules = "UseDllForSystemModules"; + private string OptionsItemPABCDllChecked = "PABCDllChecked"; + private string OptionsItemNameAutoInsertCode = "AutoInsertCodeIsEnabledOnStartup"; + + bool _mainFormWindowStateMaximized = false; + + VisualPascalABCPlugins.IUserOptions VisualPascalABCPlugins.IWorkbench.UserOptions + { + get + { + return UserOptions; + } + } + + public void LoadOptions() + { + string FileName = OptionsFileName; + try + { + if (!File.Exists(FileName)) + { + try + { + File.Copy(OldOptionsFileName, FileName, true); + } + catch + { + } + } + if (!File.Exists(FileName)) + { + string language = "Русский"; + try + { + var cp = Registry.CurrentUser.OpenSubKey("Software\\PascalABC.NET").GetValue("Installer Language").ToString(); + if (cp == "1033") + language = "English"; + } + catch(Exception ex) + { + //MessageBox.Show(ex.Message); + } + PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = language; + CodeCompletionParserController.CurrentTwoLetterISO = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + return; + } + Hashtable Options = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + PascalABCCompiler.AdvancedOptions adv_opt = new PascalABCCompiler.AdvancedOptions(); + PascalABCCompiler.StringResources.ReadStringsFromStreamAsXml(FileName, new StreamReader(FileName, VisualEnvironmentCompiler.DefaultFileEncoding), Options, adv_opt); + string value; + int val; + if ((value = (string)Options[OptionsItemNameWorkDirectory]) != null) + { + WorkbenchStorage.WorkingDirectoryInOptionsFile = value; + WorkbenchStorage.WorkingDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(value, WorkbenchStorage.StandartDirectories); + } + if ((value = (string)Options[OptionsItemNameLanguage]) != null) + { + PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName = value; + CodeCompletionParserController.CurrentTwoLetterISO = PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO; + } + if ((value = (string)Options[OptionsItemNameMainFormLeft]) != null) + { + val = Convert.ToInt32(value); + if (val < Screen.PrimaryScreen.WorkingArea.Size.Width && val >= 0) + FormLeft = this.Left = val; + } + if ((value = (string)Options[OptionsItemNameMainFormTop]) != null) + { + val = Convert.ToInt32(value); + if (val < Screen.PrimaryScreen.WorkingArea.Size.Height && val >= 0) + FormTop = this.Top = val; + } + if ((value = (string)Options[OptionsItemNameMainFormWidth]) != null) + { + val = Convert.ToInt32(value); + if (val < Screen.PrimaryScreen.WorkingArea.Size.Width && val >= 100) + FormWidth = this.Width = val; + } + if ((value = (string)Options[OptionsItemNameMainFormHeight]) != null) + { + val = Convert.ToInt32(value); + if (val < Screen.PrimaryScreen.WorkingArea.Size.Height && val >= 100) + FormHeight = this.Height = val; + } + if ((value = (string)Options[OptionsItemNameMainFormMaximized]) != null) + _mainFormWindowStateMaximized = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameShowLinesNum]) != null) + UserOptions.ShowLineNums = Convert.ToBoolean(value); + + if ((value = (string)Options[OptionsItemNameEnableFolding]) != null) + UserOptions.EnableFolding = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameSaveSourceFilesIfComilationOk]) != null) + UserOptions.SaveSourceFilesIfComilationOk = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameAutoInsertCode]) != null) + { + UserOptions.AutoInsertCodeIsEnabledOnStartup = Convert.ToBoolean(value); + tsAutoInsertCode.Checked = UserOptions.AutoInsertCodeIsEnabledOnStartup; + mAUTOINSERTToolStripMenuItem.Checked = UserOptions.AutoInsertCodeIsEnabledOnStartup; + } + + if ((value = (string)Options[OptionsItemNameMainFormTitle]) != null) + MainFormText = value; + if ((value = (string)Options[OptionsItemNameDeleteEXEAfterExecute]) != null) + UserOptions.DeleteEXEAfterExecute = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameDeletePDBAfterExecute]) != null) + UserOptions.DeletePDBAfterExecute = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameShowMathBracket]) != null) + UserOptions.ShowMathBraket = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameShowMatchOperatorBracket]) != null) + UserOptions.HighlightOperatorBrackets = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameEditorFontFamily]) != null) + UserOptions.CurrentFontFamily = Convert.ToString(value); + if ((value = (string)Options[OptionsItemNameEditorFontSize]) != null) + UserOptions.EditorFontSize = Convert.ToInt32(value); + if ((value = (string)Options[OptionsItemNameErrorsStrategy]) != null) + { + ErrorsManager.Strategy = (PascalABCCompiler.Errors.ErrorsStrategy)Convert.ToByte(value); + if (ErrorsManager.Strategy == PascalABCCompiler.Errors.ErrorsStrategy.All) + ErrorsManager.Strategy = PascalABCCompiler.Errors.ErrorsStrategy.FirstSemanticAndSyntax; + } + /*if ((value = (string)Options[OptionsItemNameErrorsCursorPosStrategy]) != null) + { + ErrorCursorPosStrategy = (VisualPascalABCPlugins.SourceLocationAction)Convert.ToByte(value); + if (ErrorCursorPosStrategy == VisualPascalABCPlugins.SourceLocationAction.GotoEnd) + ErrorCursorPosStrategy = VisualPascalABCPlugins.SourceLocationAction.GotoBeg; + else if (ErrorCursorPosStrategy == VisualPascalABCPlugins.SourceLocationAction.SelectAndGotoEnd) + ErrorCursorPosStrategy = VisualPascalABCPlugins.SourceLocationAction.SelectAndGotoBeg; + }*/ + if ((value = (string)Options[OptionsItemNameShowOutputWindow]) != null) + BottomTabsVisible = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameRedirectConsoleIO]) != null) + UserOptions.RedirectConsoleIO = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameConvertTabsToSpaces]) != null) + UserOptions.ConverTabsToSpaces = true;// Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameGenerateDebugInfo]) != null) + WorkbenchServiceFactory.BuildService.CompilerOptions.Debug = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameTabIdent]) != null) + UserOptions.TabIndent = Convert.ToInt32(value); + if ((value = (string)Options[OptionsItemNameOutputDirectory]) != null) + UserOptions.OutputDirectory = value; + if ((value = (string)Options[OptionsItemNameUseOutputDirectory]) != null) + UserOptions.UseOutputDirectory = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNamePlayPauseButtonsVisibleInPanel]) != null) + PlayPauseButtonsVisibleInPanel = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNamePauseInRunModeIfConsole]) != null) + UserOptions.PauseInRunModeIfConsole = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameCodeCompletionHint]) != null) + UserOptions.CodeCompletionHint = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameCodeCompletionDot]) != null) + UserOptions.CodeCompletionDot = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameCodeCompletionParams]) != null) + UserOptions.CodeCompletionParams = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameCodeCompletionKeyPressed]) != null) + UserOptions.EnableSmartIntellisense = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameShowQuickClassBrowserPanel]) != null) + UserOptions.ShowQuickClassBrowserPanel = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameDefaultSourceFileNameFormat]) != null) + UserOptions.DefaultSourceFileNameFormat = value; + if ((value = (string)Options[OptionsItemNameAllowCodeCompletion]) != null) + UserOptions.AllowCodeCompletion = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameSkipStackTraceItemIfSourceFileInSystemDirectory]) != null) + UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameCodeCompletionNamespaceVisibleRange]) != null) + UserOptions.CodeCompletionNamespaceVisibleRange = Convert.ToInt32(value); + if ((value = (string)Options[OptionsItemNameDockBottomPortion]) != null) + MainDockPanel.DockBottomPortion = Convert.ToDouble(value); + if ((value = (string)Options[OptionsItemNameDockLeftPortion]) != null) + MainDockPanel.DockLeftPortion = Convert.ToDouble(value); + if ((value = (string)Options[OptionsItemNameDockRightPortion]) != null) + MainDockPanel.DockRightPortion = Convert.ToDouble(value); + if ((value = (string)Options[OptionsItemUseDllForSystemModules]) != null) + UserOptions.UseDllForSystemUnits = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemPABCDllChecked]) != null) + UserOptions.PABCDllChecked = Convert.ToBoolean(value); + if ((value = (string)Options[OptionsItemNameUseSemanticIntellisense]) != null) + { + UserOptions.UseSemanticIntellisense = Convert.ToBoolean(value); + CodeCompletion.DomSyntaxTreeVisitor.use_semantic_for_intellisense = UserOptions.UseSemanticIntellisense; + } + + int i = 0; + while ((value = (string)Options[OptionsItemNameLastFile + (i++).ToString()]) != null) + AddLastFile(value); + i = 0; + while ((value = (string)Options[OptionsItemNameLastProject + (i++).ToString()]) != null) + WorkbenchServiceFactory.ProjectService.AddLastProject(value); + /*foreach (string w in adv_opt.watch_list) + { + AddVariable(w,false); + }*/ + System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO); + } + catch (Exception e) + { + } + UserOptions.AllowCodeCompletion = UserOptions.CodeCompletionHint || UserOptions.CodeCompletionDot || UserOptions.CodeCompletionParams; + } + + public void SaveOptions() + { + string FileName = OptionsFileName; + Hashtable Options = new Hashtable(StringComparer.CurrentCultureIgnoreCase); + + Options.Add(OptionsItemNameWorkDirectory, WorkbenchStorage.WorkingDirectoryInOptionsFile); + Options.Add(OptionsItemNameLanguage, PascalABCCompiler.StringResourcesLanguage.CurrentLanguageName); + Options.Add(OptionsItemNameMainFormLeft, FormLeft); + Options.Add(OptionsItemNameMainFormTop, FormTop); + Options.Add(OptionsItemNameMainFormHeight, FormHeight); + Options.Add(OptionsItemNameMainFormWidth, FormWidth); + Options.Add(OptionsItemNameMainFormMaximized, this.WindowState == FormWindowState.Maximized); + Options.Add(OptionsItemNameShowOutputWindow, CurrentWebBrowserControl != null?true:BottomTabsVisible); + Options.Add(OptionsItemNameErrorsStrategy, (byte)ErrorsManager.Strategy); + //Options.Add(OptionsItemNameErrorsCursorPosStrategy, (byte)ErrorCursorPosStrategy); + Options.Add(OptionsItemNameGenerateDebugInfo, WorkbenchServiceFactory.BuildService.CompilerOptions.Debug); + Options.Add(OptionsItemNameDeleteEXEAfterExecute, UserOptions.DeleteEXEAfterExecute); + Options.Add(OptionsItemNameDeletePDBAfterExecute, UserOptions.DeletePDBAfterExecute); + Options.Add(OptionsItemNameOutputDirectory, UserOptions.OutputDirectory); + Options.Add(OptionsItemNameUseOutputDirectory, UserOptions.UseOutputDirectory); + Options.Add(OptionsItemNameDefaultSourceFileNameFormat, UserOptions.DefaultSourceFileNameFormat); + Options.Add(OptionsItemNamePlayPauseButtonsVisibleInPanel, PlayPauseButtonsVisibleInPanel); + Options.Add(OptionsItemNamePauseInRunModeIfConsole, UserOptions.PauseInRunModeIfConsole); + Options.Add(OptionsItemNameAllowCodeCompletion, UserOptions.AllowCodeCompletion); + Options.Add(OptionsItemNameCodeCompletionDot, UserOptions.CodeCompletionDot); + Options.Add(OptionsItemNameCodeCompletionHint, UserOptions.CodeCompletionHint); + Options.Add(OptionsItemNameCodeCompletionParams, UserOptions.CodeCompletionParams); + Options.Add(OptionsItemNameCodeCompletionKeyPressed, UserOptions.EnableSmartIntellisense); + Options.Add(OptionsItemNameCodeCompletionNamespaceVisibleRange, UserOptions.CodeCompletionNamespaceVisibleRange); + Options.Add(OptionsItemNameSaveSourceFilesIfComilationOk, UserOptions.SaveSourceFilesIfComilationOk); + Options.Add(OptionsItemNameShowQuickClassBrowserPanel, UserOptions.ShowQuickClassBrowserPanel); + Options.Add(OptionsItemNameUseSemanticIntellisense, UserOptions.UseSemanticIntellisense); + Options.Add(OptionsItemNameSkipStackTraceItemIfSourceFileInSystemDirectory, UserOptions.SkipStackTraceItemIfSourceFileInSystemDirectory); + Options.Add(OptionsItemNameAutoInsertCode, UserOptions.AutoInsertCodeIsEnabledOnStartup); + + Options.Add(OptionsItemNameConvertTabsToSpaces, UserOptions.ConverTabsToSpaces); + Options.Add(OptionsItemNameTabIdent, UserOptions.TabIndent); + Options.Add(OptionsItemNameShowLinesNum, UserOptions.ShowLineNums); + Options.Add(OptionsItemNameEnableFolding, UserOptions.EnableFolding); // SSM 4.09.08 + Options.Add(OptionsItemNameShowMathBracket, UserOptions.ShowMathBraket); + Options.Add(OptionsItemNameShowMatchOperatorBracket, UserOptions.HighlightOperatorBrackets); + Options.Add(OptionsItemNameEditorFontFamily, UserOptions.CurrentFontFamily); + Options.Add(OptionsItemNameEditorFontSize, UserOptions.EditorFontSize); + Options.Add(OptionsItemNameRedirectConsoleIO, UserOptions.RedirectConsoleIO); + Options.Add(OptionsItemNameDockBottomPortion, MainDockPanel.DockBottomPortion); + Options.Add(OptionsItemNameDockLeftPortion, MainDockPanel.DockLeftPortion); + Options.Add(OptionsItemNameDockRightPortion, MainDockPanel.DockRightPortion); + Options.Add(OptionsItemUseDllForSystemModules, UserOptions.UseDllForSystemUnits); + Options.Add(OptionsItemPABCDllChecked, UserOptions.PABCDllChecked); + if (MainFormText != MainFormTitle) + Options.Add(OptionsItemNameMainFormTitle, MainFormText); + for (int i = 0; i < LastOpenFiles.Count; i++) + Options.Add(OptionsItemNameLastFile + (LastOpenFiles.Count - i - 1).ToString(), LastOpenFiles[i]); + for (int i = 0; i < LastOpenProjects.Count; i++) + Options.Add(OptionsItemNameLastProject + (LastOpenProjects.Count - i - 1).ToString(), LastOpenProjects[i]); + System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(PascalABCCompiler.StringResourcesLanguage.CurrentTwoLetterISO); + try + { + PascalABCCompiler.StringResources.WriteStringsToStreamAsXml(new StreamWriter(FileName, false, /*VisualEnvironmentCompiler.DefaultFileEncoding*/System.Text.Encoding.UTF8), Options, GetAdvancedOptions()); + } + catch (Exception) + { + //ãàñèì èñêëþ÷åíèÿ åñëè íå óäàëîñü çàïèñàòü ôàéë. ýòî íå ñìåðòåëüíî + } + } + + public void UpdateUserOptions() + { + foreach (CodeFileDocumentControl si in OpenDocuments.Values) + { + if (si.TextEditor.ShowLineNumbers != UserOptions.ShowLineNums) + si.TextEditor.ShowLineNumbers = UserOptions.ShowLineNums; + if (si.TextEditor.EnableFolding != UserOptions.EnableFolding) // SSM 4.09.08 + { + si.TextEditor.EnableFolding = UserOptions.EnableFolding; + si.TextEditor.UpdateFolding(); + } + if (si.TextEditor.ShowMatchingBracket != UserOptions.ShowMathBraket) + si.TextEditor.ShowMatchingBracket = UserOptions.ShowMathBraket; + if (si.FontSize != UserOptions.EditorFontSize) + si.FontSize = UserOptions.EditorFontSize; + if (si.TextEditor.ConvertTabsToSpaces != UserOptions.ConverTabsToSpaces) + si.TextEditor.ConvertTabsToSpaces = UserOptions.ConverTabsToSpaces; + si.TextEditor.ConvertTabsToSpaces = true; + if (si.TextEditor.TabIndent != UserOptions.TabIndent) + { + si.TextEditor.TabIndent = UserOptions.TabIndent; + si.TextEditor.TextEditorProperties.IndentationSize = UserOptions.TabIndent; + } + if (si.TextEditor.quickClassBrowserPanel.Visible != UserOptions.ShowQuickClassBrowserPanel) + si.TextEditor.quickClassBrowserPanel.Visible = UserOptions.ShowQuickClassBrowserPanel; + } + + foreach (var rtb in this.OutputTextBoxs.Values) + { + rtb.Font = OpenDocuments.Values.First().TextEditor.Font; + } + + tsViewIntellisensePanel.Checked = UserOptions.ShowQuickClassBrowserPanel; + tsViewIntellisensePanel.Visible = tssmIntellisence.Visible = tsGotoDefinition.Visible = tsGotoRealization.Visible = + tsFindAllReferences.Visible = miGenerateRealization.Visible = + miGenerateRealization.Visible = cmGenerateRealization.Visible = + cmsCodeCompletion.Visible = cmFindAllReferences.Visible = cmGotoDefinition.Visible = + cmGotoRealization.Visible = UserOptions.AllowCodeCompletion; + + } + + private PascalABCCompiler.AdvancedOptions GetAdvancedOptions() + { + PascalABCCompiler.AdvancedOptions adv_opt = new PascalABCCompiler.AdvancedOptions(); + return adv_opt; + } + + } +} diff --git a/VisualPascalABCNETLinux/Workbench/ProjectService.cs b/VisualPascalABCNETLinux/Workbench/ProjectService.cs new file mode 100644 index 000000000..7a64195f2 --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/ProjectService.cs @@ -0,0 +1,276 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using PascalABCCompiler; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public partial class Form1 : IWorkbenchProjectService + { + public List LastOpenProjects; + + public void NewProject() + { + NewProjectForm npf = new NewProjectForm(); + Form1StringResources.SetTextForAllControls(npf); + + if (npf.ShowDialog() == DialogResult.OK) + { + if (ProjectFactory.Instance.ProjectLoaded) + { + if (!CloseProject()) + return; + } + PascalABCCompiler.IProjectInfo proj = ProjectFactory.Instance.CreateProject(npf.ProjectName, npf.ProjectFileName, npf.ProjectType); + ProjectExplorerWindow.LoadProject(npf.ProjectName, ProjectFactory.Instance.CurrentProject); + ProjectExplorerWindow.Show(); + //ShowContent(ProjectExplorerWindow,true); + CloseFilesAndSaveState(); + ClearAndSaveWatch(); + SelectContent(ProjectExplorerWindow, false); + WorkbenchServiceFactory.FileService.OpenFile(proj.MainFile, null); + ActiveCodeFileDocument = CurrentCodeFileDocument; + AddLastProject(npf.ProjectFileName); + if (CodeCompletion.CodeCompletionController.comp != null) + { + CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = proj; + } + this.mRPROJECTToolStripMenuItem.Visible = true; + this.miCloseProject.Visible = true; + if (proj.ProjectType == PascalABCCompiler.ProjectType.WindowsApp) + { + //string s = ProjectFactory.Instance.GetFullUnitFileName(); + //OpenFile(null,s); + //CurrentCodeFileDocument.AddDesigner(null); + ProjectTask.NewForm(ProjectExplorerWindow, false);//roman// + //GenerateMainProgramForDesigner(proj.MainFile); + //OpenFile(s,null); + //SaveFileAs(CurrentCodeFileDocument,s); + //CurrentCodeFileDocument.DesignerAndCodeTabs.SelectedTab = CurrentCodeFileDocument.DesignerPage; + //ProjectTask.AddFile(ProjectExplorerWindow,Path.GetFileName(s)); + SaveAll(false); + } + } + } + + public void OpenProject(string projectFileName) + { + if (!File.Exists(projectFileName)) + { + MessageBox.Show(string.Format(PascalABCCompiler.StringResources.Get("!PROJECT_NOT_FOUND{0}"), projectFileName), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + if (ProjectFactory.Instance.ProjectLoaded) + { + CloseProject(); + } + try + { + PascalABCCompiler.IProjectInfo proj = ProjectFactory.Instance.OpenProject(projectFileName); + ProjectExplorerWindow.LoadProject(Path.GetFileNameWithoutExtension(projectFileName), ProjectFactory.Instance.CurrentProject); + //ICSharpCode.FormsDesigner.ToolboxProvider.ReloadSideTabs(false); + CloseFilesAndSaveState(); + ClearAndSaveWatch(); + this.miProjectExplorer.Visible = true; + ShowContent(ProjectExplorerWindow, false); + UserProjectSettings setts = ProjectUserOptionsManager.LoadOptions(projectFileName); + foreach (IReferenceInfo ri in ProjectFactory.Instance.CurrentProject.References) + { + var path = Compiler.get_assembly_path(Path.Combine(ProjectFactory.Instance.ProjectDirectory, ri.FullAssemblyName), false); + if (path == null) + path = Compiler.get_assembly_path(ri.FullAssemblyName, false); + //ICSharpCode.FormsDesigner.ToolboxProvider.AddComponentsFromAssembly(PascalABCCompiler.NetHelper.NetHelper.LoadAssembly(path)); + } + if (setts != null) + { + foreach (OpenedFileInfo fi in setts.OpenDocuments) + { + if (fi.InProject) + { + string f = Path.Combine(proj.ProjectDirectory, fi.FileName); + if (File.Exists(f)) + WorkbenchServiceFactory.FileService.OpenFile(f, null); + } + else + if (File.Exists(fi.FileName)) + WorkbenchServiceFactory.FileService.OpenFile(fi.FileName, null); + if (fi.CaretLine > 0) + CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line = fi.CaretLine; + if (fi.CaretColumn > 0) + CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Column = fi.CaretColumn; + } + if (!string.IsNullOrEmpty(setts.CurrentDocument)) + { + if (!setts.CurrentDocumentIsInProject) + { + if (File.Exists(setts.CurrentDocument)) + WorkbenchServiceFactory.FileService.OpenFile(setts.CurrentDocument, null); + } + else + { + string f = Path.Combine(proj.ProjectDirectory, setts.CurrentDocument); + if (File.Exists(f)) + WorkbenchServiceFactory.FileService.OpenFile(f, null); + } + } + else + WorkbenchServiceFactory.FileService.OpenFile(proj.MainFile, null); + foreach (WatchExprInfo wi in setts.WatchExprs) + { + AddVariable(wi.Expression, false); + } + } + else + WorkbenchServiceFactory.FileService.OpenFile(proj.MainFile, null); + ActiveCodeFileDocument = CurrentCodeFileDocument; + AddLastProject(projectFileName); + if (CodeCompletion.CodeCompletionController.comp != null) + { + CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = proj; + } + this.mRPROJECTToolStripMenuItem.Visible = true; + this.miCloseProject.Visible = true; + } + catch (PascalABCCompiler.TooOldProjectFileVersion) + { + MessageBox.Show(Form1StringResources.Get("TOO_OLD_PROJECT_FILE_VERSION"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (Exception) + { + MessageBox.Show(Form1StringResources.Get("ERROR_OPEN_PROJECT"), PascalABCCompiler.StringResources.Get("!ERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + public bool CloseProject() + { + if (SaveAllInProject() == 2) + return false; + BottomTabsVisible = true; + ProjectUserOptionsManager.SaveOptions(ProjectFactory.Instance.CurrentProject.Path); + CloseProjectFiles(); + ProjectFactory.Instance.CloseProject(); + ProjectExplorerWindow.Clear(); + HideContent(ProjectExplorerWindow); + //HideContent(PropertiesWindow); + //if (ToolBoxWindow != null) + // HideContent(ToolBoxWindow); + this.miProjectExplorer.Visible = false; + CodeFileDocumentControl tmp = CurrentCodeFileDocument; + //CloseAllButThis(CurrentCodeFileDocument); + RestoreFiles(); + RestoreWatch(); + //CloseFile(tmp, false); + WorkbenchServiceFactory.BuildService.CompilerOptions.ProjectCompiled = false; + mrDesigner.Visible = false; + miCloseProject.Visible = false; + this.mRPROJECTToolStripMenuItem.Visible = false; + CodeCompletion.CodeCompletionController.comp.CompilerOptions.CurrentProject = null; + return true; + } + + public void SaveProject() + { + if (ProjectFactory.Instance.Dirty) + { + ProjectFactory.Instance.SaveProject(); + UpdateSaveButtonsEnabled(); + } + } + + internal void CloseProjectFiles() + { + CodeFileDocumentControl[] l = new CodeFileDocumentControl[OpenDocuments.Values.Count]; + OpenDocuments.Values.CopyTo(l, 0); + + foreach (CodeFileDocumentControl tp in l) + if (ProjectFactory.Instance.CurrentProject.ContainsSourceFile(tp.FileName)) + { + CloseFile(tp, false); + } + } + + internal int SaveAllInProject() + { + SaveCanceled = false; + CodeFileDocumentControl[] l = new CodeFileDocumentControl[OpenDocuments.Values.Count]; + OpenDocuments.Values.CopyTo(l, 0); + bool changed = false; + foreach (CodeFileDocumentControl tp in l) + if (tp.DocumentChanged && !tp.FromMetadata && ProjectFactory.Instance.CurrentProject.ContainsSourceFile(tp.FileName)) + { + changed = true; + break; + } + if (!changed) + return 1; + int result = QuestionAndSaveProject(); + if (result == 2) + { + return result; + } + if (result == 0) + foreach (CodeFileDocumentControl tp in l) + if (tp.DocumentChanged && !tp.FromMetadata) + SaveSelFile(tp); + UpdateSaveButtonsEnabled(); + return result; + } + + int QuestionAndSaveProject() + { + DialogResult result = MessageBox.Show(string.Format(Form1StringResources.Get("SAVE_CHANGES_IN_PROJECT{0}"), ProjectFactory.Instance.CurrentProject.Name), PascalABCCompiler.StringResources.Get("!CONFIRM"), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (result == DialogResult.Yes) + { + ProjectFactory.Instance.SaveProject(); + UpdateSaveButtonsEnabled(); + return 0; + } + else + if (result == DialogResult.Cancel) + return 2; + return 1; + } + + bool ReplaceLastProject(string OldFileName, string NewFileName) + { + ToolStripMenuItem mI; + for (int i = 0; i < LastOpenProjects.Count; i++) + if (LastOpenProjects[i].ToLower() == OldFileName.ToLower()) + { + LastOpenProjects.RemoveAt(i); + LastOpenProjects.Insert(0, NewFileName); + mI = (ToolStripMenuItem)miRecentProjects.DropDownItems[i]; + miRecentProjects.DropDownItems.RemoveAt(i); + mI.Text = GetLastFileCaption(NewFileName); + mI.Tag = NewFileName; + miRecentProjects.DropDownItems.Insert(0, mI); + return true; + } + return false; + } + + public void AddLastProject(string FileName) + { + if (Path.GetDirectoryName(FileName) == "") return; + ToolStripMenuItem mI; + if (ReplaceLastProject(FileName, FileName)) return; + if (LastOpenProjects.Count >= MaxLastOpenFiles) + { + LastOpenProjects.RemoveAt(LastOpenProjects.Count - 1); + miRecentProjects.DropDownItems.RemoveAt(miRecentProjects.DropDownItems.Count - 1); + } + LastOpenProjects.Insert(0, FileName); + mI = new ToolStripMenuItem(); + mI.Text = GetLastFileCaption(FileName); + mI.Tag = FileName; + miRecentProjects.DropDownItems.Insert(0, mI); + mI.Click += new System.EventHandler(this.OpenLastProject_ToolStripMenuItem_Click); + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/RunService.cs b/VisualPascalABCNETLinux/Workbench/RunService.cs new file mode 100644 index 000000000..c8df64dab --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/RunService.cs @@ -0,0 +1,343 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public partial class WorkbenchRunService : IWorkbenchRunService + { + string RedirectIOModeModuleName = "__RedirectIOMode"; + string RunModeModuleName = "__RunMode"; + string RedirectIOModeName = "[REDIRECTIOMODE]"; + string RunModeName = "[RUNMODE]"; + private bool TerminateAllPrograms = false; + public RunManager RunnerManager; + private IWorkbench Workbench; + //private IWorkbenchDesignerService DesignerService; + private IWorkbenchBuildService BuildService; + private IWorkbenchDocumentService DocumentService; + private IWorkbenchDebuggerOperationsService DebuggerOperationsService; + private DebugHelper DebuggerManager; + private Dictionary RunTabs = new Dictionary(); + private Dictionary ReadRequests = new Dictionary(); + private Dictionary RunArgumentsTable = new Dictionary(); + bool RunActiveTabPage = false; + + // SSM 16/05/22 - добавил чтобы иметь возможность добавлять обработчики во внешнем плагине + public event RunnerManagerActionDelegate Starting + { + add + { + RunnerManager.Starting += value; + } + remove + { + RunnerManager.Starting -= value; + } + } + public event RunnerManagerActionDelegate Exited + { + add + { + RunnerManager.Exited += value; + } + remove + { + RunnerManager.Exited -= value; + } + } + + public WorkbenchRunService() + { + Workbench = WorkbenchServiceFactory.Workbench; + RunnerManager = new RunManager(ReadStringRequest); + RunnerManager.Exited += new RunnerManagerActionDelegate(RunnerManager_Exited); + RunnerManager.Starting += new RunnerManagerActionDelegate(RunnerManager_Started); + RunnerManager.OutputStringReceived += new RunManager.TextRecivedDelegate(RunnerManager_OutputStringReceived); + RunnerManager.RunnerManagerUnhanledRuntimeException += new RunManager.RunnerManagerUnhanledRuntimeExceptionDelegate(RunnerManager_RunnerManagerUnhanledRuntimeException); + //DesignerService = WorkbenchServiceFactory.DesignerService; + this.DebuggerManager = WorkbenchServiceFactory.DebuggerManager; + BuildService = WorkbenchServiceFactory.BuildService; + DebuggerOperationsService = WorkbenchServiceFactory.DebuggerOperationsService; + DocumentService = WorkbenchServiceFactory.DocumentService; + } + + public bool Run(bool RedirectConsoleIO) + { + Workbench.UserOptions.RedirectConsoleIO = RedirectConsoleIO; + + if (Workbench.UserOptions.RedirectConsoleIO) + if (!DebuggerManager.IsRunning) + return Run(DocumentService.CurrentCodeFileDocument, true, false, false); + else if (DebuggerManager.IsRunAndInThisTabPage()) + { + DebuggerManager.Continue(); + return true; + } + return Run(DocumentService.CurrentCodeFileDocument); + } + + public bool Run(bool forDebugging, bool startWithGoto, bool need_first_brpt) + { + return Run(DocumentService.CurrentCodeFileDocument, forDebugging, startWithGoto, need_first_brpt); + } + + public void Run(string fileName, bool redirectIO, string ModeName, bool RunWithPause, string WorkingDirectory, string CommandLineArguments, bool attachDebugger, bool fictive_attach) + { + RunnerManager.Run(fileName, + Workbench.UserOptions.RedirectConsoleIO, RedirectIOModeName, RunWithPause, + Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileDirectory, + CommandLineArguments, attachDebugger, fictive_attach); + } + + public bool Run(ICodeFileDocument tabPage, bool forDebugging, bool startWithGoto, bool needFirstBreakpoint) + { + lock (o) + { + bool attachdbg = forDebugging || startWithGoto || needFirstBreakpoint; //|| WorkbenchServiceFactory.DebuggerManager.HasBreakpoints(); + bool fictive_attach = false; + BuildService.CompilerOptions.UseDllForSystemUnits = false; + BuildService.CompilerOptions.OutputFileType = PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + if (ProjectFactory.Instance.ProjectLoaded) + tabPage = DocumentService.GetTabPageForMainFile(); + if (attachdbg && !Workbench.UserOptions.AlwaysAttachDebuggerAtStart) + fictive_attach = !startWithGoto && !needFirstBreakpoint && !DebuggerManager.HasBreakpoints(); + WorkbenchServiceFactory.OperationsService.ClearOutputTextBoxForTabPage(tabPage); + Workbench.ErrorsListWindow.ClearErrorList(); + //DesignerService.GenerateAllDesignersCode(); + string runtimeModule; + string ModeName; + bool RunWithPause = false; + if (Workbench.UserOptions.RedirectConsoleIO || forDebugging) + { + runtimeModule = RedirectIOModeModuleName; + ModeName = RedirectIOModeName; + if (Workbench.UserOptions.UseDllForSystemUnits && !Workbench.UserOptions.PABCDllChecked) + { + if (typeof(System.Runtime.CompilerServices.ExtensionAttribute).Assembly != typeof(int).Assembly || PascalABCCompiler.Compiler.get_assembly_path("PABCRtl.dll", false) == null) + Workbench.UserOptions.UseDllForSystemUnits = false; + Workbench.UserOptions.PABCDllChecked = true; + } + // SSM 09.02.20 - UseDllForSystemUnits включать когда флаг установлен - безо всяких доп. условий + if (/*Workbench.UserOptions.DeleteEXEAfterExecute &&*/ Workbench.UserOptions.UseDllForSystemUnits && !startWithGoto && !needFirstBreakpoint) + BuildService.CompilerOptions.UseDllForSystemUnits = true; + } + else + { + runtimeModule = RunModeModuleName; + ModeName = RunModeName; + RunWithPause = Workbench.UserOptions.PauseInRunModeIfConsole; + } + bool debug = BuildService.CompilerOptions.Debug; + if (forDebugging) + { + BuildService.CompilerOptions.Debug = true; + BuildService.CompilerOptions.ForDebugging = true; + Workbench.UserOptions.RedirectConsoleIO = true; + } + string OutputFileName = null; + if (!forDebugging) + { + if (!ProjectFactory.Instance.ProjectLoaded) + OutputFileName = BuildService.Compile(tabPage.FileName, false, runtimeModule, true, Workbench.UserOptions.RedirectConsoleIO); + else + OutputFileName = BuildService.Compile(ProjectFactory.Instance.CurrentProject, false, runtimeModule, true, Workbench.UserOptions.RedirectConsoleIO); + } + else + { + if (!ProjectFactory.Instance.ProjectLoaded) + OutputFileName = BuildService.Compile(tabPage.FileName, false, runtimeModule, true, true); + else + OutputFileName = BuildService.Compile(ProjectFactory.Instance.CurrentProject, false, runtimeModule, true, true); + } + if (RunWithPause) + RunWithPause = RunWithPause && Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.OutputFileType == PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton; + if (OutputFileName != null) + { + switch (Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.OutputFileType) + { + case PascalABCCompiler.CompilerOptions.OutputType.ClassLibrary: + if (DocumentService.ActiveCodeFileDocument != null && DocumentService.ActiveCodeFileDocument != DocumentService.CurrentCodeFileDocument && !DocumentService.ActiveCodeFileDocument.Run) + if (!RunActiveTabPage) + { + RunActiveTabPage = true; + return Run(DocumentService.ActiveCodeFileDocument, forDebugging, startWithGoto, needFirstBreakpoint); + } + MessageBox.Show(Form1StringResources.Get("RUN_DLL_WARNING_TEXT"), PascalABCCompiler.StringResources.Get("!WARNING"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + RunActiveTabPage = false; + break; + case PascalABCCompiler.CompilerOptions.OutputType.PascalCompiledUnit: + if (DocumentService.ActiveCodeFileDocument != null && DocumentService.ActiveCodeFileDocument != DocumentService.CurrentCodeFileDocument && !DocumentService.ActiveCodeFileDocument.Run) + if (!RunActiveTabPage) + { + RunActiveTabPage = true; + return Run(DocumentService.ActiveCodeFileDocument, forDebugging, startWithGoto, needFirstBreakpoint); + } + RunActiveTabPage = false; + MessageBox.Show(Form1StringResources.Get("RUN_PCU_WARNING_TEXT"), PascalABCCompiler.StringResources.Get("!WARNING"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + break; + case PascalABCCompiler.CompilerOptions.OutputType.ConsoleApplicaton: + case PascalABCCompiler.CompilerOptions.OutputType.WindowsApplication: + if (forDebugging) + { + BuildService.CompilerOptions.Debug = debug; + BuildService.CompilerOptions.ForDebugging = false; + if (startWithGoto) + { + DebuggerManager.ShowDebugTabs = true; + DebuggerManager.UpdateBreakpoints(); + DebuggerManager.CurrentBreakpoint = DebuggerManager.AddBreakPoint(DocumentService.CurrentCodeFileDocument.FileName, DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line + 1, false); + DebuggerManager.AddGoToBreakPoint(DebuggerManager.CurrentBreakpoint); + } + else if (needFirstBreakpoint) + { + DebuggerManager.ShowDebugTabs = true; + DebuggerManager.UpdateBreakpoints(); + if (Workbench.VisualEnvironmentCompiler.Compiler.VarBeginOffset != 0) + { + DebuggerManager.SetFirstBreakpoint(tabPage.FileName, Workbench.VisualEnvironmentCompiler.Compiler.VarBeginOffset); + DebuggerManager.AddGoToBreakPoint(tabPage.FileName, Workbench.VisualEnvironmentCompiler.Compiler.BeginOffset); + } + else + DebuggerManager.SetFirstBreakpoint(tabPage.FileName, Workbench.VisualEnvironmentCompiler.Compiler.BeginOffset); + } + else + { + DebuggerManager.UpdateBreakpoints(); + DebuggerManager.ShowDebugTabs = false; + } + + } + RunActiveTabPage = false; + try + { + RunTabsAdd(Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.OutputFileName, tabPage); + RunnerManager.Run(Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.OutputFileName, + Workbench.UserOptions.RedirectConsoleIO, ModeName, RunWithPause, + // Path.GetDirectoryName(Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.OutputFileName), // SSM 21.05.19 - исправил. Теперь текущим является каталог, в котором расположен исходник. + // Если компилировать программы на сетевом диске, а exe создавать локально, то работает шустро + Workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileDirectory, + RunArgumentsTable[tabPage.FileName.ToLower()], attachdbg, fictive_attach); + } + catch (System.Exception e) + { + // SSM 22/04/19 - исправляю вылет оболочки при отсутствии exe файла + // this.RunnerManager_Exited(OutputFileName); // - это всё равно не срабатывает. Кнопки оказываются в заблокированном состоянии + + WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(OutputFileName, "Произошла непредвиденная ошибка. Вероятно, на диске отсутствует .exe-файл. Повторите запуск"); + //throw; + return false; + } + if (!ProjectFactory.Instance.ProjectLoaded) + DocumentService.ActiveCodeFileDocument = tabPage; + if (forDebugging) + { + DebuggerOperationsService.AddDebugPage(tabPage); + } + WorkbenchStorage.SetCurrentTabPageIfWriteToOutputWindow = Workbench.UserOptions.RedirectConsoleIO; + //if (UserOptions1.ConsoleOutput) + //AddTextToOutputWindow("Ïðîãðàììà çàïóùåíà"); + return true; + } + } + RunActiveTabPage = false; + return false; + } + } + + public bool Run(ICodeFileDocument tabPage) + { + return Run(tabPage, false, false, false); + } + + private bool __runInThreadDebug; + private void __runInThread(object state) + { + Run(__runInThreadDebug); + } + + private void runInThread(bool debug) + { + __runInThreadDebug = debug; + if (!ThreadPool.QueueUserWorkItem(new WaitCallback(__runInThread))) + Run(debug); + } + + public bool Stop() // Èíòåðåñíî, çà÷åì ñäåëàëè private + { + if (RunnerManager.IsRun(Workbench.CurrentEXEFileName)) + { + RunnerManager.Stop(Workbench.CurrentEXEFileName); + return true; + } + return true; + } + + void RunTabsAdd(string name, ICodeFileDocument p) + { + name = Tools.FileNameToLower(name); + if (RunTabs.ContainsKey(name)) + RunTabs[name] = p; + else + RunTabs.Add(name, p); + } + + public void SendInputTextToProcess() + { + ReadRequests.Remove(DocumentService.CurrentCodeFileDocument); + RunnerManager.WritelnStringToProcess(Workbench.CurrentEXEFileName, Workbench.OutputWindow.InputTextBoxText); + Workbench.OutputWindow.AppendTextToOutputBox(Environment.NewLine); + WorkbenchServiceFactory.OperationsService.SendNewLineToInputTextBox(); + Workbench.OutputWindow.InputPanelVisible = false; + } + + public bool IsRun() + { + return RunnerManager.IsRun(); + } + + public bool IsRun(string FileName) + { + return RunnerManager.IsRun(FileName); + } + + public void Stop(string FileName) + { + RunnerManager.Stop(FileName); + } + + public bool HasRunArgument(string FileName) + { + return RunArgumentsTable.ContainsKey(FileName); + } + + public void AddRunArgument(string FileName, string argument) + { + RunArgumentsTable[FileName] = argument; + } + + public ICodeFileDocument GetRunTab(string FileName) + { + return RunTabs[FileName]; + } + + public string GetRunArgument(string FileName) + { + return RunArgumentsTable[FileName]; + } + + public void KillAll() + { + TerminateAllPrograms = true; + RunnerManager.KillAll(); + TerminateAllPrograms = false; + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/RunnerManagerHandlers.cs b/VisualPascalABCNETLinux/Workbench/RunnerManagerHandlers.cs new file mode 100644 index 000000000..f647c4cb6 --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/RunnerManagerHandlers.cs @@ -0,0 +1,247 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace VisualPascalABC +{ + public partial class WorkbenchRunService : VisualPascalABCPlugins.IWorkbenchRunService + { + void RunnerManager_Exited(string fileName) + { + if (System.Threading.Thread.CurrentThread != WorkbenchStorage.MainProgramThread) + Workbench.BeginInvoke(new SetTextDelegate(RunnerManager_Exited_Sync), fileName); + else + RunnerManager_Exited_Sync(fileName); + } + + void RunnerManager_Started(string fileName) + { + Workbench.BeginInvoke(new SetTextDelegate(RunnerManager_Started_Sync), fileName); + } + + void ButtonsEnableDisable_RunStart() + { + Workbench.WidgetController.SetStopEnabled(true); + Workbench.WidgetController.SetCompilingButtonsEnabled(false); + Workbench.WidgetController.SetDebugButtonsEnabled(false); + Workbench.WidgetController.SetOptionsEnabled(false); + } + + void ButtonsEnableDisable_RunStop() + { + Workbench.WidgetController.SetStopEnabled(false); + Workbench.WidgetController.SetCompilingButtonsEnabled(true); + Workbench.WidgetController.SetDebugButtonsEnabled(true); + Workbench.WidgetController.SetOptionsEnabled(true); + } + + Object o = new Object(); + void RunnerManager_Started_Sync(string fileName) + { + //lock (o) + { + if (!ProjectFactory.Instance.ProjectLoaded) + { + fileName = Tools.FileNameToLower(fileName); + if (Tools.FileNameToLower(Workbench.CurrentEXEFileName) == fileName) + { + ButtonsEnableDisable_RunStart(); + } + RunTabs[fileName].Run = true; + WorkbenchServiceFactory.DocumentService.SetTabPageText(RunTabs[fileName]); + } + else + { + fileName = Tools.FileNameToLower(fileName); + ButtonsEnableDisable_RunStart(); + RunTabs[fileName].Run = true; + } + } + } + + void RunnerManager_OutputStringReceived(string fileName, RunManager.StreamType streamType, string text) + { + WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(fileName, text); + } + + void RunnerManager_Exited_Sync(string fileName) + { + lock (o) + { + fileName = Tools.FileNameToLower(fileName); + if (!RunTabs.ContainsKey(fileName)) + { + string s = "Closing: " + fileName + " \nRunTabs: "; + foreach (string ss in RunTabs.Keys) + s += ss + " "; + throw new Exception(s); + } + RunTabs[fileName].Run = false; + WorkbenchServiceFactory.DocumentService.SetTabPageText(RunTabs[fileName]); + if (ReadRequests.ContainsKey(RunTabs[fileName])) + ReadRequests.Remove(RunTabs[fileName]); + UpdateReadRequest(false); + WorkbenchServiceFactory.EditorService.SetFocusToEditor(); + if (TerminateAllPrograms) + WaitCallback_DeleteEXEAndPDB(fileName); + else + System.Threading.ThreadPool.QueueUserWorkItem(WaitCallback_DeleteEXEAndPDB, fileName); + + if (!ProjectFactory.Instance.ProjectLoaded) + { + if (Tools.FileNameToLower(WorkbenchServiceFactory.Workbench.CurrentEXEFileName) == fileName) + { + ButtonsEnableDisable_RunStop(); + } + } + else + { + ButtonsEnableDisable_RunStop(); + } + } + } + + void RunnerManager_RunnerManagerUnhanledRuntimeException(string id, string ExceptionType, string ExceptionMessage, string StackTraceData, List StackTrace) + { + string localiseMsg = RuntimeExceptionsStringResources.Get(ExceptionMessage); + WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(id, string.Format(Form1StringResources.Get("OW_RUNTIME_EXCEPTION{0}_MESSAGE{1}"), ExceptionType, localiseMsg) + Environment.NewLine); + if (StackTraceData != null) + WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(id, string.Format(Form1StringResources.Get("OW_RUNTIME_EXCEPTION_STACKTRACE{0}"), StackTraceData) + Environment.NewLine); + RunManager.StackTraceItem ToSend = null; + foreach (RunManager.StackTraceItem StackTraceItem in StackTrace) + { + if (StackTraceItem.SourceFileName != null) + { + if (ToSend == null && File.Exists(StackTraceItem.SourceFileName)) + ToSend = StackTraceItem; + if (Workbench.UserOptions.SkipStakTraceItemIfSourceFileInSystemDirectory && + StackTraceItem.SourceFileName.StartsWith(WorkbenchServiceFactory.BuildService.CompilerOptions.SystemDirectory)) + continue; + if (!(bool)Workbench.VisualEnvironmentCompiler.SourceFilesProvider(StackTraceItem.SourceFileName, PascalABCCompiler.SourceFileOperation.Exists)) + { + string fn = Path.Combine(WorkbenchStorage.LibSourceDirectory, Path.GetFileName(StackTraceItem.SourceFileName)); + if (File.Exists(fn)) + StackTraceItem.SourceFileName = fn; + else + continue; + } + ToSend = StackTraceItem; + break; + } + } + if (ToSend != null) + { + List list = new List(); + list.Add(new RuntimeException( + string.Format( + Form1StringResources.Get("ERRORLIST_RUNTIME_EXCEPTION_MESSAGE{0}"), + localiseMsg.Replace(Environment.NewLine, " ")), + ToSend.SourceFileName, + 0, + ToSend.LineNumber) + ); + Workbench.ErrorsListWindow.ShowErrorsSync(list, true); + if (RunnerManager.Count > 0) + { + RunnerManager.KillAll(); + } + } + } + + void WaitCallback_DeleteEXEAndPDB(object state) + { + //int i = 0; + string fileName = (string)state; + //while (i < 20) // 20 раз пытаться удалять! Это сильно! + //{ + try + { + if (Workbench.UserOptions.DeleteEXEAfterExecute && File.Exists(fileName)) + File.Delete(fileName); + } + catch + { + WorkbenchServiceFactory.OperationsService.AddTextToCompilerMessagesSync("Не удалось удалить EXE-файл"); + } + try + { + if (Workbench.UserOptions.DeletePDBAfterExecute) + { + string pdbFileName = Path.ChangeExtension(fileName, ".pdb"); + if (File.Exists(pdbFileName)) + File.Delete(pdbFileName); + } + } + catch + { + WorkbenchServiceFactory.OperationsService.AddTextToCompilerMessagesSync("Не удалось удалить PDB-файл"); + } + try + { + if (RunnerManager.TempBatFiles.ContainsKey(fileName)) + { + string batname = RunnerManager.TempBatFiles[fileName]; + if (File.Exists(batname)) + { + File.Delete(batname); + RunnerManager.TempBatFiles.Remove(fileName); + } + } + } + catch + { + WorkbenchServiceFactory.OperationsService.AddTextToCompilerMessagesSync("Не удалось удалить bat-файл из словаря RunnerManager.TempBatFiles"); + } + } + + void ReadStringRequest(string ForId) + { + ForId = Tools.FileNameToLower(ForId); + if (!ReadRequests.ContainsKey(RunTabs[ForId])) + { + if (WorkbenchServiceFactory.DebuggerManager.IsRun(ForId) && WorkbenchServiceFactory.DebuggerManager.CurPage != null) + ReadRequests.Add(WorkbenchServiceFactory.DebuggerManager.CurPage, ""); + else if (IsRun(ForId)) + ReadRequests.Add(RunTabs[ForId], ""); + } + Workbench.BeginInvoke(new ReadStringRequestSyncDel(ReadStringRequestSync)); + } + + delegate void ReadStringRequestSyncDel(); + + void ReadStringRequestSync() + { + UpdateReadRequest(false); + } + + public void UpdateReadRequest(bool changeSelected) + { + if (changeSelected && Workbench.OutputWindow.InputPanelVisible) + { + ReadRequests[WorkbenchServiceFactory.DocumentService.LastSelectedTab] = Workbench.OutputWindow.InputTextBoxText; + } + if (ReadRequests.ContainsKey(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument)) + { + Workbench.OutputWindow.InputTextBoxText = ReadRequests[WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument]; + Workbench.OutputWindow.InputPanelVisible = true; + Workbench.OutputWindow.InputTextBoxCursorToEnd(); + return; + } + Workbench.OutputWindow.InputPanelVisible = false; + } + + bool IsOneProgramStarted() + { + int num = 0; + foreach (VisualPascalABCPlugins.ICodeFileDocument doc in RunTabs.Values) + if (doc.Run) + num++; + return num == 1; + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/UpdateService.cs b/VisualPascalABCNETLinux/Workbench/UpdateService.cs new file mode 100644 index 000000000..13ba4e65a --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/UpdateService.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using VisualPascalABCPlugins; +using System.Net; +using System.Reflection; +using Microsoft.Win32; + +namespace VisualPascalABC +{ + class WorkbenchUpdateService : IWorkbenchUpdateService + { + public WorkbenchUpdateService() + { + + } + + public bool IsDotnet71Installed() + { + if (Environment.OSVersion.Version.Major < 6) + return true; + try + { + using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full")) + { + return key != null && ((key.GetValue("Version") as string).StartsWith("4.7") || (key.GetValue("Version") as string).StartsWith("4.8")); + } + } + catch (Exception ex) + { + return true; + } + } + + public void CheckForUpdates() + { + int status = 1;//1 - up to date, 0 - not up to date, -1 error + string newVersion = null; + string curVersion = null; + if (!IsDotnet71Installed()) + { + if (MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_DOTNET_AVAILABLE"), + PascalABCCompiler.StringResources.Get("VP_MF_DOTNET_UPDATE_CHECK"), + MessageBoxButtons.YesNo) == DialogResult.Yes) + { + WorkbenchServiceFactory.OperationsService.AddTabWithUrl(".NET Framework", PascalABCCompiler.StringResources.Get("VP_MF_FRAMEWORK_DOWNLOAD_PAGE")); + } + } + try + { + WebClient client = new WebClient(); + newVersion = client.DownloadString("http://pascalabc.net/downloads/pabcversion.txt").Trim(); + curVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + if ((new Version(curVersion)).CompareTo(new Version(newVersion)) == -1) + status = 0; + + } + catch + { + status = -1; + } + switch (status) + { + case 1: + MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_VERSION_IS_UP_TO_DATE"), PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK"), MessageBoxButtons.OK); + break; + case 0: + if (MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_AVAILABLE") + Environment.NewLine + + string.Format(PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_AVAILABLE_CURRENT_VESION{0}"), curVersion) + Environment.NewLine + + string.Format(PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_AVAILABLE_NEW_VESION{0}"), newVersion), + PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK"), + MessageBoxButtons.YesNo) == DialogResult.Yes) + { + //System.Diagnostics.Process.Start(PascalABCCompiler.StringResources.Get("VP_MF_PABC_DOWNLOAD_PAGE")); + // SSM 24/04/19 - вернул назад, т.к. обновление закрывало оболочку из-за некорректно написанного асинхронного вызова. Обойдёмся без асинхронного вызова. Слишком много пользователей пострадало. + WorkbenchServiceFactory.OperationsService.AddTabWithUrl("PascalABC.NET", PascalABCCompiler.StringResources.Get("VP_MF_PABC_DOWNLOAD_PAGE")); + } + break; + case -1: + MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK_ERROR"), PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK"), MessageBoxButtons.OK); + break; + } + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/VisibilityService.cs b/VisualPascalABCNETLinux/Workbench/VisibilityService.cs new file mode 100644 index 000000000..0e7f295cb --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/VisibilityService.cs @@ -0,0 +1,686 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VisualPascalABCPlugins; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class Form1: VisualPascalABCPlugins.IWidgetStatusContoller + { + IWidgetStatusContoller VisualPascalABCPlugins.IWorkbench.WidgetController + { + get + { + return this; + } + } + + internal List BottomDockContent = new List(); + List VisibleBottomContent = new List(); + + public bool CompilingButtonsEnabled + { + get { return miRun.Enabled; } + set { SetCompilingButtonsEnabled(value); } + } + + bool SaveButtonsEnabled + { + set + { + cmSave.Enabled = tbSave.Enabled = miSave.Enabled = value; + } + get + { + return miSave.Enabled; + } + } + + internal bool SaveAllButtonsEnabled + { + set + { + tbSaveAll.Enabled = miSaveAll.Enabled = value; + } + get + { + return miSaveAll.Enabled; + } + } + + bool CloseButtonsEnabled + { + set + { + cmCloseAllButThis.Enabled = miCloseAllButThis.Enabled = miClose.Enabled = cmClose.Enabled = value; + } + get + { + return miClose.Enabled; + } + } + + bool UndoButtonsEnabled + { + get { return miUndo.Enabled; } + set { miUndo.Enabled = tsUndo.Enabled = value; } + } + + bool RedoButtonsEnabled + { + get { return miRedo.Enabled; } + set { miRedo.Enabled = tsRedo.Enabled = value; } + } + + bool CutButtonsEnabled + { + get { return miCut.Enabled; } + set { cmCut.Enabled = miCut.Enabled = tsCut.Enabled = value; } + } + + bool CopyButtonsEnabled + { + get { return miCopy.Enabled; } + set { cmCopy.Enabled = miCopy.Enabled = tsCopy.Enabled = value; } + } + + bool NavigBackButtonsEnabled + { + get { return miNavigBack.Enabled; } + set { miNavigBack.Enabled = tsNavigBack.Enabled = value; } + } + + bool NavigForwButtonsEnabled + { + get { return miNavigForw.Enabled; } + set { miNavigForw.Enabled = tsNavigForw.Enabled = value; } + } + + public void SetDedugButtonsEnabled(bool Enabled) + { + if (!DebuggerVisible) + return; + + StepIntoButton.Enabled = StepOverButton.Enabled = StartDebugButton.Enabled = + mDEBUGSTARTToolStripMenuItem.Enabled = mSTEPOVERToolStripMenuItem.Enabled = mSTEPINToolStripMenuItem.Enabled = mRUNTOCURToolStripMenuItem.Enabled = Enabled; + + //toolStrip1.Refresh(); + } + + + + bool BottomDockContentVisible + { + get + { + foreach (DockContent dc in BottomDockContent) + if (!dc.IsHidden) + return true; + return false; + } + } + + internal bool BottomTabsVisibleChekerEnabled + { + get + { + return miOutputWindow.Enabled; + } + set + { + miOutputWindow.Enabled = tsOutputWindow.Enabled = value; + } + } + + internal bool BrowserTabSelected; + + internal bool BottomTabsVisible + { + get + { + //return BottomDockContentVisible; + return BPanel.Visible; + } + set + { + if (value == BottomTabsVisible) + return; + SetVisibilityBottomPanel(value); + /*if (value) + { + if (VisibleBottomContent.Count > 0) + { + foreach (DockContent dc in VisibleBottomContent) + { + dc.Show(); + } + + VisibleBottomContent.Clear(); + } + else + if (BottomDockContent.Count > 0) + BottomDockContent[0].Show(); + } + else + { + VisibleBottomContent.Clear(); + DockContent dca = BottomDockContent[0].Pane.ActiveContent as DockContent; + foreach (DockContent dc in BottomDockContent) + if (!dc.IsHidden && !BottomPane.IsAutoHide) + { + if (dc != dca) + VisibleBottomContent.Add(dc); + dc.Hide(); + } + VisibleBottomContent.Add(dca); + }*/ + + UpdateOutputWindowVisibleButtons(); + if (!value && LoadComplete) + SetFocusToEditor(); + } + } + + private bool ToolBoxVisible_ = false; + + public bool ToolBoxVisible + { + get + { + return ToolBoxVisible_; + } + set + { + /*if (value && ToolBoxVisible_ && !ToolBoxWindow.IsActivated) + { + ToolBoxWindow.Show(); + ToolBoxWindow.Activate(); + return; + }*/ + if (ToolBoxVisible_ == value) return; + ToolBoxVisible_ = value; + /*if (value) + { + if (ToolBoxWindow == null) + { + AddToolBox(); + } + else + { + ToolBoxWindow.Show(); + } + } + else + { + ToolBoxWindow.Hide(); + }*/ + } + } + + public bool ProjectExplorerWindowVisible + { + get + { + return ProjectExplorerWindow != null && ProjectExplorerWindow.Visible; + } + set + { + if (value) + { + if (ProjectExplorerWindow == null) + { + AddProjectExplorerWindow(); + } + else + { + //ShowContent(PropertiesWindow, false); + ProjectExplorerWindow.Show(); + //PropertiesWindow.IsHidden = false; //Show(MainDockPanel, DockState.Hidden); + } + } + else + { + if (ProjectExplorerWindow != null) + { + //PropertiesWindow.IsHidden = true; + } + } + } + + } + + public bool DisassemblyWindowVisible + { + get + { + return DisassemblyWindow != null && DisassemblyWindow.Visible; + } + set + { + if (value) + { + if (DisassemblyWindow == null) + { + AddDisassemblyWindow(); + } + else + { + //ShowContent(PropertiesWindow, false); + DisassemblyWindow.Show(); + DisassemblyWindow.ShowDisassembly(); + //PropertiesWindow.IsHidden = false; //Show(MainDockPanel, DockState.Hidden); + } + } + } + + } + + public bool PropertiesWindowVisible + { + get + { + return false; // PropertiesWindow != null && PropertiesWindow.Visible; + } + set + { + if (value) + { + //if (PropertiesWindow == null) + { + //AddPropertiesWindow(); + } + //else + { + //ShowContent(PropertiesWindow, false); + //PropertiesWindow.Show(); + //PropertiesWindow.IsHidden = false; //Show(MainDockPanel, DockState.Hidden); + } + } + //else + { + //if (PropertiesWindow != null) + { + //PropertiesWindow.IsHidden = true; + } + } + } + } + + internal bool FindAllReferncesEnabled + { + get + { + return cmFindAllReferences.Enabled; + } + set + { + cmFindAllReferences.Enabled = tsFindAllReferences.Enabled = value; + } + } + + public void SetCompilingButtonsEnabled(bool Enabled) + { + if (Enabled) + { + miNewProject.Enabled = true; + } + //StepIntoButton.Enabled = StepOverButton.Enabled = + // mDEBUGSTARTToolStripMenuItem.Enabled = mSTEPOVERToolStripMenuItem.Enabled= + // StartDebugButton.Enabled = + StartNoDebugButton.Enabled = miRunNoDebug.Enabled = + miBuild.Enabled = miRebuild.Enabled = miRun.Enabled = ReCompileButton.Enabled = + CompileButton.Enabled = cmRun.Enabled = StartButton.Enabled = Enabled; + + toolStrip1.Refresh(); + } + + public void UpdateUndoRedoEnabled() //roman// public + { + CodeFileDocumentControl d = CurrentCodeFileDocument; //roman// + if (d.DesignerAndCodeTabs != null) + { + //if (d.DesignerPage != null && d.Designer != null && d.DesignerAndCodeTabs.SelectedTab == d.DesignerPage) + { + // UndoButtonsEnabled = d.Designer.EnableUndo; + // RedoButtonsEnabled = d.Designer.EnableRedo; + } + //else + { + UndoButtonsEnabled = d.CanUndo; + RedoButtonsEnabled = d.CanRedo; + } + } + else + { + UndoButtonsEnabled = d.CanUndo; + RedoButtonsEnabled = d.CanRedo; + } + } + + void UpdateCutCopyButtonsEnabled() + { + CutButtonsEnabled = CopyButtonsEnabled = CurrentSyntaxEditor.TextSelected; + } + + internal void UpdateOutputWindowVisibleButtons() + { + tsOutputWindow.Checked = miOutputWindow.Checked = BottomTabsVisible; + } + + public void UpdateSaveButtonsEnabled() + { + SaveButtonsEnabled = CurrentCodeFileDocument != null && CurrentCodeFileDocument.DocumentChanged; + SaveAllButtonsEnabled = !AllSaved(); + } + + public void SetDebugPausedEnabled() + { + this.mDEBUGSTOPToolStripMenuItem.Enabled = true; + this.StopDebugButton.Enabled = true; + SaveDebugContext(); + } + + public void SetDebugPausedDisabled() + { + this.mDEBUGSTOPToolStripMenuItem.Enabled = false; + this.StopDebugButton.Enabled = false; + SaveDebugContext(); + } + + public void SetDebugStopEnabled() + { + SetCompilingButtonsEnabled(false); + this.mDEBUGSTOPToolStripMenuItem.Enabled = true; + this.mDEBUGENDToolStripMenuItem.Enabled = true; + this.mSTEPToolStripMenuItem.Enabled = true; + this.StopDebugButton.Enabled = true; + this.StepOutButton.Enabled = true; + this.stopButton.Enabled = true; + this.miStop.Enabled = true; + ChangeDebugButtons(true); + SaveDebugContext(); + } + + public void ChangeStartDebugNameOnContinue() + { + this.StartDebugButton.ToolTipText = Form1StringResources.Get("M_DEBUGCONT"); + this.mDEBUGSTARTToolStripMenuItem.Text = Form1StringResources.Get("M_DEBUGCONT"); + } + + public void ChangeContinueDebugNameOnStart() + { + this.StartDebugButton.ToolTipText = Form1StringResources.Get("M_DEBUGSTART"); + this.mDEBUGSTARTToolStripMenuItem.Text = Form1StringResources.Get("M_DEBUGSTART"); + } + + public void SetStartDebugDisabled() + { + this.mDEBUGSTARTToolStripMenuItem.Enabled = false; + this.StartDebugButton.Enabled = false; + this.mSTEPINToolStripMenuItem.Enabled = false; + this.StepIntoButton.Enabled = false; + this.mSTEPOVERToolStripMenuItem.Enabled = false; + this.StepOverButton.Enabled = false; + this.mRUNTOCURToolStripMenuItem.Enabled = false; + this.mSTEPToolStripMenuItem.Enabled = false; + this.miRun.Enabled = false; + this.StartButton.Enabled = false; + SetDebugPausedEnabled(); + ChangeDebugButtons(true); + SaveDebugContext(); + } + + public void SetStartDebugEnabled() + { + this.mDEBUGSTARTToolStripMenuItem.Enabled = true; + this.StartDebugButton.Enabled = true; + this.mSTEPINToolStripMenuItem.Enabled = true; + this.StepIntoButton.Enabled = true; + this.mSTEPOVERToolStripMenuItem.Enabled = true; + this.StepOverButton.Enabled = true; + this.mRUNTOCURToolStripMenuItem.Enabled = true; + this.mSTEPToolStripMenuItem.Enabled = true; + this.miRun.Enabled = true; + this.StartButton.Enabled = true; + ChangeDebugButtons(false); + SaveDebugContext(); + } + + public void SetDebugStopDisabled() + { + this.mDEBUGSTOPToolStripMenuItem.Enabled = false; + this.mSTEPToolStripMenuItem.Enabled = false; + this.StopDebugButton.Enabled = false; + this.StepOutButton.Enabled = false; + if (!(clicked_stop_debug_in_menu && WorkbenchServiceFactory.RunService.IsRun() && debuggedPage != ActiveCodeFileDocument)) + { + SetCompilingButtonsEnabled(true); + this.stopButton.Enabled = false; + this.miStop.Enabled = false; + } + clicked_stop_debug_in_menu = false; + this.mDEBUGENDToolStripMenuItem.Enabled = false; + //Data fileInfo = debuggedPage.ag as CodeFileDocumentControl; + //debuggedPage.Text = Path.GetFileName(fileInfo.FileName); + //debuggedPage.ToolTipText = fileInfo.FileName; + SetTabPageText(debuggedPage); + ChangeDebugButtons(false); + SaveDebugContext(); + //this.mDEBUGSTARTToolStripMenuItem.Text = PascalABCCompiler.StringResources.Get("M_DEBUGSTART"); + } + + private bool play_pause_buttons_visible = true; + + public bool PlayPauseButtonsVisibleInPanel + { + get + { + return play_pause_buttons_visible; + } + set + { + play_pause_buttons_visible = value; + /*StopDebugButton.Visible = */ + if (DebuggerVisible) + StartDebugButton.Visible = value; + } + } + + public void SetAddExprMenuVisible(bool flag) + { + } + + public void SetDisassemblyMenuVisible(bool flag) + { + tsDisassembly.Visible = flag; + } + + public void SetPlayButtonsVisible(bool start) + { + if (play_pause_buttons_visible) + { + if (start) + { + this.StartDebugButton.Visible = false; + this.StopDebugButton.Visible = false; + } + else + { + this.StartDebugButton.Visible = true; + this.StopDebugButton.Visible = false; + } + } + } + + public void SetDebugButtonsEnabled(bool val) + { + if (!DebuggerVisible) + return; + if (val) + { + this.mDEBUGSTOPToolStripMenuItem.Enabled = false; + this.mDEBUGSTARTToolStripMenuItem.Enabled = false; + this.StartDebugButton.Enabled = true; + this.StopDebugButton.Enabled = true; + this.StepOutButton.Enabled = false; + this.StepOverButton.Enabled = true; + this.StepIntoButton.Enabled = true; + this.mDEBUGSTARTToolStripMenuItem.Enabled = true; + this.mSTEPINToolStripMenuItem.Enabled = true; + this.mSTEPOVERToolStripMenuItem.Enabled = true; + this.mSTEPToolStripMenuItem.Enabled = false; + this.mRUNTOCURToolStripMenuItem.Enabled = true; + this.miRun.Enabled = true; + this.StartButton.Enabled = true; + } + else + { + this.mDEBUGSTOPToolStripMenuItem.Enabled = false; + this.mSTEPToolStripMenuItem.Enabled = false; + this.StartDebugButton.Enabled = false; + this.StopDebugButton.Enabled = false; + this.StepOutButton.Enabled = false; + this.StepOverButton.Enabled = false; + this.StepIntoButton.Enabled = false; + this.mDEBUGSTARTToolStripMenuItem.Enabled = false; + this.mSTEPINToolStripMenuItem.Enabled = false; + this.mSTEPOVERToolStripMenuItem.Enabled = false; + this.mRUNTOCURToolStripMenuItem.Enabled = false; + this.mSTEPToolStripMenuItem.Enabled = false; + this.miRun.Enabled = false; + this.StartButton.Enabled = false; + } + } + + bool mDEBUGSTOPToolStripMenuItem_Enabled; + bool mDEBUGSTARTToolStripMenuItem_Enabled; + bool mSTEPToolStripMenuItem_Enabled; + bool StartDebugButton_Enabled; + bool StopDebugButton_Enabled; + bool StepOutButton_Enabled; + bool StepOverButton_Enabled; + bool StepIntoButton_Enabled; + bool mSTEPINToolStripMenuItem_Enabled; + bool mSTEPOVERToolStripMenuItem_Enabled; + bool mRUNTOCURToolStripMenuItem_Enabled; + bool miRun_Enabled; + + private void SaveDebugContext() + { + mDEBUGSTOPToolStripMenuItem_Enabled = this.mDEBUGSTOPToolStripMenuItem.Enabled; + mDEBUGSTARTToolStripMenuItem_Enabled = this.mDEBUGSTARTToolStripMenuItem.Enabled; + mSTEPToolStripMenuItem_Enabled = this.mSTEPToolStripMenuItem.Enabled; + StartDebugButton_Enabled = this.StartDebugButton.Enabled; + StopDebugButton_Enabled = this.StopDebugButton.Enabled; + StepOutButton_Enabled = this.StepOutButton.Enabled; + StepOverButton_Enabled = this.StepOverButton.Enabled; + StepIntoButton_Enabled = this.StepIntoButton.Enabled; + mSTEPINToolStripMenuItem_Enabled = this.mSTEPINToolStripMenuItem.Enabled; + mSTEPOVERToolStripMenuItem_Enabled = this.mSTEPOVERToolStripMenuItem.Enabled; + mRUNTOCURToolStripMenuItem_Enabled = this.mRUNTOCURToolStripMenuItem.Enabled; + mSTEPToolStripMenuItem_Enabled = this.mSTEPToolStripMenuItem.Enabled; + miRun_Enabled = this.miRun.Enabled; + } + + private void RestoreDebugContext() + { + this.mDEBUGSTOPToolStripMenuItem.Enabled = mDEBUGSTOPToolStripMenuItem_Enabled; + this.mDEBUGSTARTToolStripMenuItem.Enabled = mDEBUGSTARTToolStripMenuItem_Enabled; + this.mSTEPToolStripMenuItem.Enabled = mSTEPToolStripMenuItem_Enabled; + this.StartDebugButton.Enabled = StartDebugButton_Enabled; + this.StopDebugButton.Enabled = StopDebugButton_Enabled; + this.StepOutButton.Enabled = StepOutButton_Enabled; + this.StepOverButton.Enabled = StepOverButton_Enabled; + this.StepIntoButton.Enabled = StepIntoButton_Enabled; + this.mDEBUGSTARTToolStripMenuItem.Enabled = mDEBUGSTARTToolStripMenuItem_Enabled; + this.mSTEPINToolStripMenuItem.Enabled = mSTEPINToolStripMenuItem_Enabled; + this.mSTEPOVERToolStripMenuItem.Enabled = mSTEPOVERToolStripMenuItem_Enabled; + this.mRUNTOCURToolStripMenuItem.Enabled = mRUNTOCURToolStripMenuItem_Enabled; + this.mSTEPToolStripMenuItem.Enabled = mSTEPToolStripMenuItem_Enabled; + this.miRun.Enabled = miRun_Enabled; + this.StartButton.Enabled = miRun_Enabled; + } + + private void SetDebugButtonsAsByDebug() + { + RestoreDebugContext(); + } + + public void EnableCodeCompletionToolTips(bool flag) + { + if (flag) + { + foreach (CodeFileDocumentControl tp in this.OpenDocuments.Values) + { + AddEditorHandlers(tp); + } + } + else + { + foreach (CodeFileDocumentControl tp in this.OpenDocuments.Values) + { + RemoveEditorHandlers(tp); + } + } + } + + private bool watch_vis = false; + public void SetDebugTabsVisible(bool flag) + { + if (flag) + { + if (!DebugWatchListWindow.IsHidden) + { + watch_vis = true; + } + if (WorkbenchServiceFactory.DebuggerManager.ShowDebugTabs) + { + if (!BottomTabsVisible) + BottomTabsVisible = true; + ShowContent(DebugWatchListWindow, false); + ShowContent(DebugVariablesListWindow, false); + } + } + else + { + //HideContent(DebugWatchListWindow); + if (!watch_vis) + { + HideContent(DebugWatchListWindow); + } + watch_vis = false; + HideContent(DebugVariablesListWindow); + } + } + + private void ChangeDebugButtons(bool stop_as_visible) + { + if (PlayPauseButtonsVisibleInPanel) + if (stop_as_visible) + { + this.StartDebugButton.Visible = false; + this.StopDebugButton.Visible = true; + } + else + { + this.StartDebugButton.Visible = true; + this.StopDebugButton.Visible = false; + } + } + + public void SetStopEnabled(bool enabled) + { + stopButton.Enabled = miStop.Enabled = enabled; + } + + public void SetOptionsEnabled(bool val) + { + foreach (OptionsContent.IOptionsContent content in this.optionsContentEngine.ContentList) + content.Content.Enabled = val; + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/WindowOperations.cs b/VisualPascalABCNETLinux/Workbench/WindowOperations.cs new file mode 100644 index 000000000..53ea12c9e --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/WindowOperations.cs @@ -0,0 +1,698 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; +//using ICSharpCode.FormsDesigner; +//using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.TextEditor; +using VisualPascalABC.OptionsContent; +using VisualPascalABCPlugins; +using WeifenLuo.WinFormsUI.Docking; + +namespace VisualPascalABC +{ + public partial class Form1 : Form, VisualPascalABCPlugins.IWorkbench, VisualPascalABCPlugins.IWorkbenchOperationsService + { + internal CodeFileDocumentControl LastSelectedTab, BakSelectedTab; + Dictionary OutputTextBoxs = new Dictionary(); + + private void AddOutputWindow() + { + if (OutputWindow == null) + { + OutputWindow = new OutputWindowForm(this); + Form1StringResources.SetTextForAllControls(OutputWindow); + } + BottomPane = null; + //AddWindowToDockPanel(OutputWindow, MainDockPanel, DockStyle.Fill, DockState.DockBottom, OutputWindow.IsFloat, BottomPane, -1); + AddWindowToDockPanel(OutputWindow, BottomDockPanel, DockStyle.Fill, DockState.Document, OutputWindow.IsFloat, BottomPane, -1); + //BottomPane = OutputWindow.Pane; + } + + private void AddErrorsListWindow() + { + if (ErrorsListWindow == null) + { + ErrorsListWindow = new ErrorsListWindowForm(this); + Form1StringResources.SetTextForAllControls(ErrorsListWindow); + } + AddWindowToDockPanel(ErrorsListWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, null, int.MaxValue); + } + + private void AddCompilerConsoleWindow() + { + if (CompilerConsoleWindow == null) + { + CompilerConsoleWindow = new CompilerConsoleWindowForm(this); + Form1StringResources.SetTextForAllControls(CompilerConsoleWindow); + } + AddWindowToDockPanel(CompilerConsoleWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, null, int.MaxValue); + } + + private void AddFindSymbolsResultWindow() + { + if (FindSymbolsResultWindow == null) + { + FindSymbolsResultWindow = new FindSymbolsResultWindowForm(this); + Form1StringResources.SetTextForAllControls(FindSymbolsResultWindow); + } + AddWindowToDockPanel(FindSymbolsResultWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, BottomPane, int.MaxValue); + } + + private void AddImmediateWindow() + { + if (ImmediateWindow == null) + { + ImmediateWindow = new ImmediateWindow(this); + Form1StringResources.SetTextForAllControls(ImmediateWindow); + } + AddWindowToDockPanel(ImmediateWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, BottomPane, int.MaxValue); + } + + void AddDebugVariablesListWindow() + { + if (DebugVariablesListWindow == null) + { + DebugVariablesListWindow = new DebugVariablesListWindowForm(this); + Form1StringResources.SetTextForAllControls(DebugVariablesListWindow); + } + AddWindowToDockPanel(DebugVariablesListWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, BottomPane, int.MaxValue); + } + + void AddDisassemblyWindow() + { + if (DisassemblyWindow == null) + { + DisassemblyWindow = new DisassemblyWindow(this); + Form1StringResources.SetTextForAllControls(DisassemblyWindow); + } + + AddWindowToDockPanel(DisassemblyWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, BottomPane, int.MaxValue); + } + + void AddDebugWatchListWindow() + { + if (DebugWatchListWindow == null) + { + DebugWatchListWindow = new DebugWatchListWindowForm(this); + Form1StringResources.SetTextForAllControls(DebugWatchListWindow); + } + + AddWindowToDockPanel(DebugWatchListWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, BottomPane, int.MaxValue); + } + + void AddProjectExplorerWindow() + { + if (ProjectExplorerWindow == null) + { + ProjectExplorerWindow = new ProjectExplorerForm(); + Form1StringResources.SetTextForAllControls(ProjectExplorerWindow); + } + //ProjectPane = null; + AddWindowToDockPanel(ProjectExplorerWindow, BottomDockPanel, OutputWindow.Dock, DockState.Document, OutputWindow.IsFloat, ProjectPane, -1); + //ProjectPane = ProjectExplorerWindow.Pane; + } + + private void AddOptionsContent() + { + optionsContentEngine = new OptionsContentEngine(this); + optionsContentEngine.AddContent(new ViewOptionsContent(this)); + optionsContentEngine.AddContent(new EditorOptionsContent(this)); + optionsContentEngine.AddContent(new CompilerOptionsContent(this)); + optionsContentEngine.AddContent(new IntelliseseOptionsContent(this)); + } + + public void UpdateOptionsForm() + { + if (optionsContentEngine != null) + optionsContentEngine.UpdateOptionsForm(); + } + + public void AddWindowToDockPanel(DockContent dc, DockPanel dp, DockStyle dockStyle, DockState dockState, bool isFloat, DockPane dockToPane, int ind) + { + if (dc.Visible && dc.Pane != null) + return; + if (dp.DocumentStyle == DocumentStyle.SystemMdi) + { + dc.MdiParent = this; + dc.Show(); + } + else + { + dc.Show(dp); + } + + if (dockToPane != null) + if (ind == int.MaxValue) + dc.Pane.DockTo(dockToPane, dockStyle, dockToPane.Contents.Count - 1); + else + dc.Pane.DockTo(dockToPane, dockStyle, ind); + //MessageBox.Show(dockState.ToString() + " " + dc.ToString()); + dc.DockState = dockState; + dc.IsFloat = isFloat; + } + + /*public void AddToolBox() + { + if (ToolBoxWindow == null) + { + ToolBoxWindow = new ToolBoxForm(); + //SharpDevelopSideBar sideBar = FormsDesignerViewContent.FormsDesignerToolBox; + //sideBar.Dock = DockStyle.Fill; + //sideBar.Parent = ToolBoxWindow; + AddWindowToDockPanel(ToolBoxWindow, MainDockPanel, OutputWindow.Dock, DockState.DockLeft, OutputWindow.IsFloat, null, -1); + ToolBoxWindow.Show(); + } + else + ToolBoxWindow.Show(); + }*/ + + public void AddPropertiesWindow() + { + /*if (PropertiesWindow == null) + { + PropertiesWindow = new PropertiesForm(); + Form1StringResources.SetTextForAllControls(PropertiesWindow); + Panel properties = FormsDesignerViewContent.PropertyPad.PropertyPadPanel; + properties.Dock = DockStyle.Fill; + properties.Parent = PropertiesWindow; + AddWindowToDockPanel(PropertiesWindow, MainDockPanel, DockStyle.Fill, DockState.DockRight, OutputWindow.IsFloat, ProjectPane, int.MaxValue); + //PropertiesWindow.Show(); + } + else */ + PropertiesWindowVisible = true; + } + + private CodeFileDocumentControl AddNewTab(DockPanel tabControl, DockStyle dockStyle = DockStyle.Fill) + { + CodeFileDocumentControl tp = new CodeFileDocumentControl(this); + // SSM 03.06.22 - это надо убрать здесь - почему-то не работает активация - надо туда + //_currentCodeFileDocument = tp; // должно по DockStateChanged - но мб неверно + //tp.BorderStyle=BorderStyle.Fixed3D; + //tp.Font = new Font("MS Sans Serif", tp.Font.Size); + RichTextBox tb = OutputWindow.outputTextBox; + if (OpenDocuments.Count > 0) + tb = CopyTextBox(OutputWindow.outputTextBox); + AddWindowToDockPanel(tp, tabControl, tp.Dock != dockStyle?dockStyle:tp.Dock, DockState.Document, tp.IsFloat, null, 0); + tb.Font = tp.TextEditor.Font; + OutputTextBoxs.Add(tp, tb); + + WorkbenchServiceFactory.CodeCompletionParserController.ParseInformationUpdated += tp.TextEditor.UpdateFolding; + return tp; + //tabControl.SelectedTab = tp; + } + + public CodeFileDocumentControl FindTab(string FileName) + { + if (FileName == null) return null; + CodeFileDocumentControl tp = null; + OpenDocuments.TryGetValue(Tools.FileNameToLower(FileName), out tp); + return tp; + } + + public ICodeFileDocument GetDocument(string FileName) + { + return FindTab(FileName); + } + + bool VisualPascalABCPlugins.IWorkbenchDocumentService.ContainsTab(string FileName) + { + return FindTab(FileName) != null; + } + + public void CloseBrowserTab(string text) + { + if (OpenBrowserDocuments.ContainsKey(text)) + OpenBrowserDocuments.Remove(text); + } + + public void AddTabWithUrl(string title, string url) + { + AddTabWithUrl(MainDockPanel, title, url); + } + + public void AddTabWithUrl(DockPanel tabControl, string title, string url) + { + WebBrowserControl tp = null;//new WebBrowserControl(); + if (!OpenBrowserDocuments.TryGetValue(title, out tp)) + { + tp = new WebBrowserControl(); + tp.OpenPage(title, url); + AddWindowToDockPanel(tp, tabControl, tp.Dock, DockState.Document, tp.IsFloat, null, 0); + OpenBrowserDocuments.Add(title, tp); + } + else + tp.Activate(); + } + + private CodeFileDocumentControl AddNewProgramToTab(DockPanel tabControl, string FileName) + { + CodeFileDocumentControl edit = AddNewTab(tabControl); + + edit.FileName = FileName; + SetTabPageText(edit); + edit.SetHighlightingStrategyForFile(FileName); + OpenDocuments.Add(Tools.FileNameToLower(FileName), edit); + //this.codeCompletionParserController.SetAsChanged(FileName); + //ivan + AddBreakPointHandler(edit, FileName); + var RunService = WorkbenchServiceFactory.RunService; + if (!RunService.HasRunArgument(FileName.ToLower())) + RunService.AddRunArgument(FileName.ToLower(), ""); + if (!WorkbenchServiceFactory.DebuggerManager.IsRunning) + { + AddEditorHandlers(edit); + } + CodeCompletionKeyHandler.Attach(edit.TextEditor); + edit.TextEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += TextArea_KeyEventHandler; + + //HostCallbackImplementation.Register(this); + + //\ivan + return edit; + } + + private void AddDebugPage(CodeFileDocumentControl tp) + { + if (TabStack.Count > 0 && !TabStack.Contains(tp)) + { + CodeFileDocumentControl cfdc = TabStack[TabStack.Count - 1]; + //TabStack.RemoveAt(TabStack.Count-1); + RichTextBox tb = null; + if (OutputTextBoxs.ContainsKey(cfdc)) + { + tb = OutputTextBoxs[cfdc]; + RichTextBox new_tb = OutputTextBoxs[tp]; + new_tb.Text = tb.Text; + } + OutputWindow.OutputTextBoxScrolToEnd(); + } + if (!TabStack.Contains(tp)) + { + TabStack.Add(tp); + OutputBoxStack.Add(OutputTextBoxs[tp]); + } + if (DebugTabs[tp] != null) return; + DebugTabs[tp] = tp.TextEditor.ActiveTextAreaControl.TextArea; + TextAreaHelper.TextAreas[tp.TextEditor.ActiveTextAreaControl.TextArea] = tp.FileName; + tp.TextEditor.ActiveTextAreaControl.TextArea.ToolTipRequest += WorkbenchServiceFactory.DebuggerManager.TextAreaToolTipRequest; + + } + + private RichTextBox CopyTextBox(RichTextBox orig) + { + RichTextBox res = new RichTextBox(); + res.Visible = false; + res.Font = orig.Font; + res.Size = orig.Size; + res.Location = orig.Location; + res.ScrollBars = orig.ScrollBars; + res.ReadOnly = orig.ReadOnly; + res.Dock = orig.Dock; + res.Multiline = orig.Multiline; + res.ForeColor = orig.ForeColor; + res.BackColor = orig.BackColor; + res.Parent = orig.Parent; + res.ContextMenuStrip = orig.ContextMenuStrip; + return res; + } + + private void RestoreWatch() + { + DebugWatchListWindow.RemoveAll(); + foreach (string s in watches) + { + AddVariable(s, false); + } + watches.Clear(); + } + + private void RestoreDesktop() + { + AddOutputWindow(); + AddErrorsListWindow(); + AddCompilerConsoleWindow(); + AddFindSymbolsResultWindow(); + AddImmediateWindow(); + AddDisassemblyWindow(); + AddDebugVariablesListWindow(); + AddDebugWatchListWindow(); + if (!Tools.IsUnix()) + { + AddProjectExplorerWindow(); + AddPropertiesWindow(); + } + SelectContent(OutputWindow, false); + if (!Tools.IsUnix()) + SelectContent(ProjectExplorerWindow, false); + + HideContent(ImmediateWindow); + HideContent(DebugVariablesListWindow); + HideContent(DebugWatchListWindow); + HideContent(FindSymbolsResultWindow); + HideContent(DisassemblyWindow); + if (!Tools.IsUnix()) + { + //HideContent(PropertiesWindow); + HideContent(ProjectExplorerWindow); + } + OutputWindow.Activate(); + } + + bool VisualPascalABCPlugins.IWorkbenchDocumentService.ContainsTab(VisualPascalABCPlugins.ICodeFileDocument tab) + { + return TabStack.Contains(tab as CodeFileDocumentControl); + } + + internal void HideContent(DockContent dc) + { + if (!dc.IsDisposed) + dc.Hide(); + } + + internal void ShowContent(DockContent dc, bool activate) + { + if (activate || dc.Pane == null) + dc.Show(); + else + { + IDockContent a = dc.Pane.ActiveContent; + dc.Show(); + if (a != null) + dc.Pane.ActiveContent = a; + } + } + + internal void SelectContent(DockContent dc, bool Activate) + { + dc.Activate(); + } + + public void ChangedSelectedTab() + { + if (HealthLabel.Text != "") + HealthLabel.Text = ""; + if (BrowserTabSelected) + { + BottomTabsVisible = true; + BrowserTabSelected = false; + CurrentWebBrowserControl = null; + SetFocusToEditor(); + } + if (BakSelectedTab == CurrentCodeFileDocument) + return; + LastSelectedTab = BakSelectedTab; + BakSelectedTab = CurrentCodeFileDocument; + + if (LastSelectedTab != null && LastSelectedTab.DesignerAndCodeTabs != null) + { + //LastSelectedTab.Designer.host.HideCombo(); + } + + if (CurrentCodeFileDocument != null && CurrentCodeFileDocument.DesignerAndCodeTabs != null) + { + // CurrentCodeFileDocument.Designer.host.ShowCombo(); + } + + if (OutputTextBoxs[CurrentCodeFileDocument] != OutputWindow.outputTextBox) + { + OutputTextBoxs[CurrentCodeFileDocument].Visible = true; + OutputWindow.outputTextBox.Visible = false; + OutputWindow.outputTextBox = OutputTextBoxs[CurrentCodeFileDocument]; + } + CodeCompletion.CodeCompletionController.SetParser(Path.GetExtension(CurrentCodeFileDocument.FileName)); + SetFocusToEditor(); + bool run = WorkbenchServiceFactory.RunService.IsRun(CurrentEXEFileName); + WorkbenchServiceFactory.DebuggerManager.SetAsPossibleDebugPage(CurrentCodeFileDocument); + bool debug = WorkbenchServiceFactory.DebuggerManager.IsRunAndInThisTabPage(CurrentEXEFileName, CurrentCodeFileDocument); + if (!debug) + { + SetStopEnabled(run); + } + else SetStopEnabled(debug); + //if (debug) SetStopEnabled(debug); + if (VisualEnvironmentCompiler != null) + if (!debug) + { + SetCompilingButtonsEnabled(!run && VisualEnvironmentCompiler.compilerLoaded); + SetDebugButtonsEnabled(!run && VisualEnvironmentCompiler.compilerLoaded); + } + else + { + SetCompilingButtonsEnabled(!debug); + SetDebugButtonsAsByDebug(); + } + else + SetCompilingButtonsEnabled(false); + SaveButtonsEnabled = CurrentCodeFileDocument.DocumentChanged; + UpdateUndoRedoEnabled(); + UpdateCutCopyButtonsEnabled(); + UpdateLineColPosition(); + WorkbenchServiceFactory.RunService.UpdateReadRequest(true); + //UpdateDesignerIsActive(); + } + + public void OpenTabWithText(string tabName, string Text) + { + CodeFileDocumentControl edit = FindTab(tabName + ".pas"); + if (edit != null) + { + CurrentCodeFileDocument = edit; + return; + } + edit = AddNewTab(MainDockPanel); + edit.FromMetadata = true; + OpenDocuments.Add(Tools.FileNameToLower(tabName + ".pas"), edit); + CloseButtonsEnabled = OpenDocuments.Count > 1; + edit.FileName = tabName + ".pas"; + edit.Text = tabName; + edit.SetHighlightingStrategyForFile("prog.pas"); + edit.TextEditor.Document.Insert(0, Text); + if (!WorkbenchServiceFactory.DebuggerManager.IsRunning) + { + AddEditorHandlers(edit); + } + WorkbenchServiceFactory.CodeCompletionParserController.RegisterFileForParsing(tabName + ".pas"); + //edit.FileName = FileName; + //SetTabPageText(edit); + } + + public ICodeFileDocument GetTabPageForMainFile() + { + return OpenFileAndNoSelection(ProjectFactory.Instance.CurrentProject.MainFile); + } + + public void SetTabPageText(ICodeFileDocument tp) + { + //(ssyy) TODO: ðàçîáðàòüñÿ ñ ýòèì. + tp.Text = Path.GetFileName(tp.FileName); + tp.ToolTipText = tp.FileName; + if (tp.DocumentChanged && !tp.FromMetadata) + tp.Text += "*"; + if (tp.FromMetadata) + tp.Text += string.Format(" [{0}]", PascalABCCompiler.StringResources.Get("VP_MF_FROM_METADATA")); + if (!ProjectFactory.Instance.ProjectLoaded && !tp.FromMetadata) + { + if (tp.Run && (!WorkbenchServiceFactory.DebuggerManager.IsRun(tp.EXEFileName) || !WorkbenchServiceFactory.DebuggerManager.ShowDebugTabs)) + tp.Text += string.Format(" [{0}]", PascalABCCompiler.StringResources.Get("VP_MF_TS_RUN")); + else + if (WorkbenchServiceFactory.DebuggerManager.IsRun(tp.EXEFileName, tp.FileName)) + tp.Text += string.Format(" [{0}]", PascalABCCompiler.StringResources.Get("VP_MF_MR_DEBUG")); + } + if (tp == ActiveCodeFileDocument && !tp.FromMetadata) + tp.Text = Convert.ToChar(0x25CF) + tp.Text;//25CF //2022 + } + + void AddTextToOutputWindow(string ExeFileName, string Text) + { + //if ((DateTime.Now - dt).TotalSeconds >= 1) + // Application.DoEvents() + ExeFileName = Tools.FileNameToLower(ExeFileName); + if (WorkbenchStorage.SetCurrentTabPageIfWriteToOutputWindow) + { + WorkbenchStorage.SetCurrentTabPageIfWriteToOutputWindow = false; + CurrentCodeFileDocument = WorkbenchServiceFactory.RunService.GetRunTab(ExeFileName) as CodeFileDocumentControl; + } + BottomTabsVisible = true; + if (BottomActiveContent != OutputWindow) + { + OutputWindow.Activate(); + CurrentCodeFileDocument.Activate(); + OutputWindow.Activate(); + } + TextBoxBase textBox = OutputTextBoxs[WorkbenchServiceFactory.RunService.GetRunTab(ExeFileName) as CodeFileDocumentControl]; + textBox.BeginInvoke(new AppendTextInternalAsyncDelegate(AppendTextInternalAsync), textBox, Text); + if (textBox == OutputWindow.outputTextBox) + OutputWindow.OutputTextBoxScrolToEnd(); + if (WorkbenchServiceFactory.DebuggerManager.IsRun(ExeFileName)) + { + for (int i = 0; i < TabStack.Count; i++) + { + TextBoxBase tb = OutputTextBoxs[TabStack[i]]; + if (textBox != tb) + tb.BeginInvoke(new AppendTextInternalAsyncDelegate(AppendTextInternalAsync), tb, Text); + } + } + if (!WorkbenchServiceFactory.RunService.IsRun(ExeFileName)) + SetFocusToEditor(); + } + + delegate void AppendTextInternalAsyncDelegate(TextBoxBase textBox, string Text); + + private void AppendTextInternalAsync(TextBoxBase textBox, string Text) + { + textBox.AppendText(Text); + } + + delegate void InternalWriteToOutputBoxDel(string exc); + + private void InternalWriteToOutputBox(string exc) + { + OutputWindow.outputTextBox.AppendText(exc); + } + + public void WriteToOutputBox(string excep, bool is_exc) + { + if (is_exc) + SelectContent(OutputWindow, false); + OutputWindow.outputTextBox.Invoke(new InternalWriteToOutputBoxDel(InternalWriteToOutputBox), excep);//AppendText(excep); + } + + public void AddTextToOutputWindowSync(string fileName, string text) + { + //BeginInvoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), fileName, text); + Invoke(new SetFileNameAndTextDelegate(AddTextToOutputWindow), fileName, text); + } + + private void AppendTextToConsoleCompiler(object text) + { + CompilerConsoleWindow.AppendTextToConsoleCompiler(text); + } + + public void AddTextToCompilerMessages(string text) + { + CompilerConsoleWindow.AddTextToCompilerMessages(text); + } + + public void AddTextToCompilerMessagesSync(string text) + { + BeginInvoke(new SetTextDelegate(AddTextToCompilerMessages), text); + } + + public void ClearErrorList() + { + ErrorsListWindow.lvErrorsList.Items.Clear(); + //lvErrorsList.Update(); + WorkbenchServiceFactory.BuildService.ErrorsList.Clear(); + } + + void CheckErrorListAndClear(string FileName) + { + if (WorkbenchServiceFactory.BuildService.ErrorsList.Count > 0) + { + PascalABCCompiler.Errors.LocatedError er = WorkbenchServiceFactory.BuildService.ErrorsList[0] as PascalABCCompiler.Errors.LocatedError; + if (er != null && er.SourceLocation != null && er.SourceLocation.FileName.ToLower() == FileName.ToLower()) + ClearErrorList(); + + } + } + + public void ClearOutputTextBoxForTabPage(ICodeFileDocument tabPage) + { + ClearTextBox(OutputTextBoxs[tabPage]); + } + + public void SendNewLineToInputTextBox() + { + if (WorkbenchServiceFactory.DebuggerManager.IsRun(CurrentEXEFileName) && OutputBoxStack.Contains(OutputWindow.outputTextBox)) + { + + foreach (TextBoxBase tb in OutputBoxStack) + if (tb != OutputWindow.outputTextBox) + { + tb.AppendText(Environment.NewLine); + } + } + } + + private void ClearAndSaveWatch() + { + watches.AddRange(DebugWatchListWindow.GetExpressions()); + DebugWatchListWindow.RemoveAll(); + } + + private void ClearTextBox(RichTextBox rtb) + { + var zoomf = rtb.ZoomFactor; + rtb.Clear(); + rtb.ZoomFactor = zoomf; + } + + public void ClearTabStack() + { + foreach (CodeFileDocumentControl cfdc in TabStack) + { + if (cfdc != debuggedPage) + { + if (OutputTextBoxs.ContainsKey(cfdc)) + { + ClearTextBox(OutputTextBoxs[cfdc]); + } + } + } + OutputBoxStack.Clear(); + TabStack.Clear(); + } + + public void ClearWatch() + { + for (int i = 0; i < this.WdataGridView1.Rows.Count; i++) + { + DebugWatchListWindow.SetUndefinedValue(i); + } + } + + public void DisplayDisassembledCode(string code) + { + DisassemblyWindow.SetDisassembledCode(code); + } + + public void ClearDebugTabs() + { + foreach (TextArea ta in DebugTabs.Values) + { + ta.ToolTipRequest -= WorkbenchServiceFactory.DebuggerManager.TextAreaToolTipRequest; + } + DebugTabs.Clear(); + } + + public void ClearLocalVarTree() + { + DebugVariablesListWindow.ClearAllSubTrees(); + } + + public void RefreshPad(IList items) + { + try + { + DebugWatchListWindow.RefreshWatch(); + AdvancedDataGridView.TreeGridNode.UpdateNodesForLocalList(DebugVariablesListWindow.watchList, DebugVariablesListWindow.watchList.Nodes, items); + } + catch (System.Exception) + { + + } + } + + public void GotoWatch() + { + BottomTabsVisible = true; + SelectContent(DebugWatchListWindow, true); + DebugWatchListWindow.AddNewEntry(""); + } + } +} diff --git a/VisualPascalABCNETLinux/Workbench/WorkbenchServiceFactory.cs b/VisualPascalABCNETLinux/Workbench/WorkbenchServiceFactory.cs new file mode 100644 index 000000000..31e8ddd5e --- /dev/null +++ b/VisualPascalABCNETLinux/Workbench/WorkbenchServiceFactory.cs @@ -0,0 +1,244 @@ +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using VisualPascalABCPlugins; + +namespace VisualPascalABC +{ + public class WorkbenchServiceContainer: IWorkbenchServiceContainer + { + + public IWorkbenchDocumentService DocumentService + { + get { return WorkbenchServiceFactory.DocumentService; } + } + + public IWorkbenchOptionService OptionsService + { + get { return WorkbenchServiceFactory.OptionsService; } + } + + public IWorkbenchUpdateService UpdateService + { + get { return WorkbenchServiceFactory.UpdateService; } + } + + public IEditorService EditorService + { + get { return WorkbenchServiceFactory.EditorService; } + } + + public IHelpService HelpService + { + get { return WorkbenchServiceFactory.HelpService; } + } + + public IWorkbenchDebuggerOperationsService DebuggerOperationsService + { + get { return WorkbenchServiceFactory.DebuggerOperationsService; } + } + + public IWorkbenchBuildService BuildService + { + get { return WorkbenchServiceFactory.BuildService; } + } + + public IWorkbenchFileService FileService + { + get { return WorkbenchServiceFactory.FileService; } + } + + public IWorkbenchProjectService ProjectService + { + get { return WorkbenchServiceFactory.ProjectService; } + } + + public IWorkbenchRunService RunService + { + get { return WorkbenchServiceFactory.RunService; } + } + + public IWorkbenchDesignerService DesignerService + { + get { return null; /*WorkbenchServiceFactory.DesignerService;*/ } + } + + public IWorkbenchOperationsService OperationsService + { + get { return WorkbenchServiceFactory.OperationsService; } + } + + public ICodeCompletionService CodeCompletionService + { + get { return WorkbenchServiceFactory.CodeCompletionService; } + } + } + + public class WorkbenchServiceFactory + { + static IWorkbenchBuildService _buildService; + static IWorkbenchRunService _runService; + static IWorkbenchUpdateService _updateService; + static CodeCompletionParserController _codeCompletionParserController; + static DebugHelper _debuggerManager; + + public static IWorkbenchBuildService BuildService + { + get + { + if (_buildService == null) + _buildService = new WorkbenchBuildService(); + return _buildService; + } + } + + public static IWorkbenchRunService RunService + { + get + { + if (_runService == null) + _runService = new WorkbenchRunService(); + return _runService; + } + } + + public static IWorkbenchUpdateService UpdateService + { + get + { + if (_updateService == null) + _updateService = new WorkbenchUpdateService(); + return _updateService; + } + } + + public static IWorkbenchOptionService OptionsService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IWorkbenchOperationsService OperationsService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IEditorService EditorService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IWorkbenchDocumentService DocumentService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IWorkbenchDebuggerOperationsService DebuggerOperationsService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IWorkbenchProjectService ProjectService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IWorkbenchFileService FileService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static IHelpService HelpService + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + /*public static IWorkbenchDesignerService DesignerService + { + get + { + return VisualPABCSingleton.MainForm; + } + }*/ + + public static IWorkbench Workbench + { + get + { + return VisualPABCSingleton.MainForm; + } + } + + public static DebugHelper DebuggerManager + { + get + { + if (_debuggerManager == null) + _debuggerManager = new DebugHelper(); + return _debuggerManager; + } + } + + public static ICodeCompletionService CodeCompletionService + { + get + { + return CodeCompletionParserController; + } + } + + public static CodeCompletionParserController CodeCompletionParserController + { + get + { + if (_codeCompletionParserController == null) + _codeCompletionParserController = new CodeCompletionParserController(); + return _codeCompletionParserController; + } + } + } + + public static class WorkbenchStorage + { + internal static string WorkingDirectory = null; + internal static string WorkingDirectoryInOptionsFile = null; + internal static string LibSourceDirectory = null; + internal static Hashtable StandartDirectories; + internal static System.Threading.Thread MainProgramThread; + internal static bool SetCurrentTabPageIfWriteToOutputWindow = false; + internal static bool WorkingDirectoryExsist + { + get { return Directory.Exists(WorkingDirectory); } + + } + } + +} diff --git a/VisualPascalABCNETLinux/_ABC13.ico b/VisualPascalABCNETLinux/_ABC13.ico new file mode 100644 index 0000000000000000000000000000000000000000..d78e429624419cc5d549a039b5b74b104f4e0b74 GIT binary patch literal 42599 zcmeG_2|$fa*K=>(c3PxG(jsK7>|1rSRQBxq@>;Sh`x12{giu*3TP0DJ6w2Cykk^u> zlu#k0qSC76&VSC6C$}q<*ZaNS_kZ6o_j#U~IcLt9^~}sU6CoTTMRauuJY`6b3?a6J z5GAFm?>Rg|8p=WdI1bSzt91xj(U1^6zv|nt4@v5RjOd7(yu}%BGZ9;Q$x9zjVHBSPBS5MmC540k7FMko*+Pl#(CQT7J-qX2&v;I9IFJixyI_-qmQ zb^t#J;O7ARCV&qF`0D`w65w+IJ|Ex<0KN#|O91{ez?X}_8|e{Z(~S`O!GyTaAS84( zA@Ms2$vaAv={aITqsVX?M;6n^#DhL3Ve}1oNb|nZZv+KwqXF>x0N)Pay8=8P;0FTy zM1Wrm@S6etAi$pi_}c)VRt?Vu@+E& z0QQ4{{p*C#N6LgIn-Kb9IH4Jf3C;2#G%t+M;)m7r8>s?36rH^>z?%X55P%07n;2}?s=K%i(;J>z?cEpGb z0t|Bj!)Cw`2pD1k!%M)Br%cHw6G{q)Q&PN`k`fO}K8I0K{_t!2)dKkT0B;WPBLIE| zz^?#!SAh3XrsSvzCFh1ya&0js@g9^s52Gae;a7MWfX5PO4Deb2uLtlg0lpo;n<-N= z&IJ0-a7x@311=9rqQfXjc~}K6`7;lAA%6fm$Ym16p_Lx zh-cC=@tB&8$7hxM@&@qezQiL^bYDW?Q6pXo+7aNdH6DqSkf_R9LL44Y0%{2f35IM2 z#g}Zp;0FL{X#i)Q%uh}FFi5Ii@n0~B;I9e)Z9L?UgoFF?z*iCYY693~;_+V+RHOMO z9uoi)Qs2Rk>BSx9&*5;Gf`KQ81LeT2a!eRQUsbfUG_NWlB&bRS$e4I3fC4AQ;qaIz z#v>ZQP{kjE8Gjg@41A4v1_29>F=Fsi2>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S`I`)3JObUMLpEi@uA7;ho*= zH$Kschq2*I`6E0!77u=+XUl-a z^)-!X$XB?Up;ces%l~U$q&lCfu&TVjkR%pYm6pv%6o=?L8;{TL^j(y9(eNL= zvw7E+rat+9t@o<3uMJ;qVgGdgwb8_e{VVuq^Q!GxpZpP?t$()t)rRv&apLLgoBz++ z085{EKHvMUZ~lnqdo-|l|DF7^e2CJ(=8Iu$IGgTg&tKvHXE^HO#VQJxD(AwG)^=e-&t2%{usyd_oJsM9u}WyK5Q61MZ-nmzL!6y5ibKa?0dY6 z=kq)AuR-e%>YdFC)3a@^wlGnA82>%~nYb_c;d@^3ImG=u + + + + + + + + + + + + + diff --git a/VisualPascalABCNETLinux/app.manifest b/VisualPascalABCNETLinux/app.manifest new file mode 100644 index 000000000..c41fee879 --- /dev/null +++ b/VisualPascalABCNETLinux/app.manifest @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + diff --git a/VisualPascalABCNETLinux/bitmaps/ABCNET16.ico b/VisualPascalABCNETLinux/bitmaps/ABCNET16.ico new file mode 100644 index 0000000000000000000000000000000000000000..8097b0b229c5e29fd1e4c3718a4d50b12578bcb7 GIT binary patch literal 1406 zcmbu8F-ROi6o#L2VUNW^o2@Jot60CvRv}l(*;v~RX$~QcO^UJUMl&LRn<$Z=R3 zxGF__V5d#2t`H=s$2JQoUcQ+VL(*ng9Wm#ES zk=4~z+1}ok&CN|&UtgECwKeI#b=lf-Igm^7pC;cf@8$C5M&5n?f|1e!Ez)cjDw?7x znkLO>Qv!NG59k3spr>UKJ)%c~h#t}D#Lx}h&<(-Ro!E)pva@nm{FOw?A{Ccx&rM-a z7!(GDAtS+{FenTPgTjz8VNe(p28BUk$mlRA3<`t7pfIST!J%+y;&9IuK%q}(q!|r8 zy)rBT^MFwxX@Dh{fx*B-fF;0^%K}G$Bft^h2yo<5!4Y5xFa#J<=>i-9h5&=%<=k@# z@tK{(xxA@5P~jb!l}n9xgehVgF^Dilyd#5=BoXh3cixWdjgEiBKjNRZDB>TfO@txB z5UE4jHmZ`}9)+HJ+D2+%_!(>lhvApEHgQk`gToRBFP68PMFxw(Vn7&%`4fP}SZGW# z1cQZ(MjrOWV6jw>%#yx_vW_#4Tbh0dfvjzApX@SHo%3GzZd%FfP??CtHzU@(xw!$UbgKbO=~SAgk%wO{A5KpAkNZ?N{R62ZUyf4V6uRt>{yO$YWlmw?F!1B~qwbqDe|T{*Y@PXZo@+`x9r|$SDL(GjDc`VQnE0rB cob#Wx7*69y-5lQy7|!_^|Mz_<$A2Ba0YN-8Q2+n{ literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/ABCNET2.ico b/VisualPascalABCNETLinux/bitmaps/ABCNET2.ico new file mode 100644 index 0000000000000000000000000000000000000000..f69752efa76e6e836c1d6e3dc0a6593db745df3a GIT binary patch literal 3638 zcmeH}KS-ok5WvS}<@3Pegu}|hScF)=$}ZSTuCcazNfQ>Xu}L8oTirq6g5K+{NJ3IX zL`WI1IF2PgVy8{E681or#LX7Ems9S>3;1$)C)M{DkfU#AW)2^cnVfYgUtwGmO@~?TGM|ot=lsj6S2t=oML!HGAg37|0(86mSZn;^`Rz3;~7!Lx91NUvFa#JJ9fklyfFZyTUdZwedBf}C&9!V4l8e#D=V2msx zED;tj3mg%S2uFk?!r`TYBf=12h%i{`A{-Hh2ty{9GI|NgQ+<%VyjC5k$eq~br6zZR zDUmdhAi9GAyEf=Y*fWhkA|7i9wRl# zNP#6>jLetU1pfD&53V@P76HIYb zHbr7YG3P`WFs32-^B*E7kJT%X0z|J*=<8@w+vOYkYmfV-2>F_V|#zfzc2zK zxVzhne&aQtYQH(j?(zF$bN&1Y!09UYDt?u|wi93sKjCXM>@anGfveree7EiR``IVw ztMDiO;El7JyEVth{*K1Kga5SIJ;kmr%k;@TWpXcZ<=s7H{C2cA6R#sWcM0A}clQ+T z4b4wQT2o{Dk4t2M<1ea=6QX I!hh8M02Gd(8~^|S literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/ABCNET32.ico b/VisualPascalABCNETLinux/bitmaps/ABCNET32.ico new file mode 100644 index 0000000000000000000000000000000000000000..f9965425ae2ebbfdc2c459cc7bf5721f150f98d3 GIT binary patch literal 766 zcmc(cF>b>!3`LouLp!-sXG2SKj1B_gty5-SB72FzK$}TxHRUQkPDi7#QF>xOWycnR z?4?YJPoJLbZ3{uuN2*pK zvFr-l{wiu*W--*%QNbkE&7|Pu<{*WV6hob6+B_?uCq_F#U-(3!Te+af+MQ>;BYuoR z59wv*R~^4>zxY*8w;3%{|Ew=OMwDmdtV;|!W^4mv&JyEi&TvjK)V&Ydd#^|5T(Ef+ zltZQBaAn-6ihnm27rhWqD0HW`nESXGc;{KG->_{DDs58;o_$ILf)8T?QH literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/DynamicLib.bmp b/VisualPascalABCNETLinux/bitmaps/DynamicLib.bmp new file mode 100644 index 0000000000000000000000000000000000000000..306bda4ca122e229cda4f5f4c25c97097a28aeb7 GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpU(KQ?FDk(pBuPMf@KV)u@|?)rjsxcaS4#m{bE z{Qu(O|EH(_KRWvV!GZsGcmKb&_5bw^|F5k2e`)Evy-R_%z}4^WD0^}L>i^f*khT1| zyz1|j)etT3_pbmt60ZJGf7Po;xBtJp1JUy0(%#ow>IEa_-kueGa$e=%%PT${T#c;$ z#MIh1&+h;K_z0xs)s=wB2Lv;hn{Rm`TD?oGZ1snIeIE|5M^=A+PUE|mPyT;-0o1Z_ z+d-Ro*WLEKciV7Vdd_9;2}f&MIzJxWh^+qVqUH~8UjF~~_Wy^6Td!OWJNz;2_@^aH zmWb7?;hb@H%7KHQPHaV1e`jU;rw{L5zPoSHq2ROFLb5#}`oOiBGiO@N*kLsLATY!} zo!pM5{>$gj?R)F|o|oEOjnX;lB)3r`tlH-1jct$+`+Q~>n)+|wzJkz{3;ho*zGcy!`jx_gV3!OPB0A-Nn`^96mD<8e*@n zeL1;JE>|9^k|zRU%P9!_?e-d+b+3}gV^gHVjb0*b%dTHaThimVu-9w>#3?yc^)wzvf- Jf~FG41pq1j+Ohxu literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/Exit.bmp b/VisualPascalABCNETLinux/bitmaps/Exit.bmp new file mode 100644 index 0000000000000000000000000000000000000000..53f238ee13a99df4aecae5936a4ca3bfd927c3c5 GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpTufKg0jOfB*g`0{r^*8?5+W>$E%k23y6< zc1T$Q(RK;T-Qt!zh0XW!njYXXI>4^Kk4fhMgW9(G2^T?H{{I)WxFYXzQ_J_3e&8*= zz}q^3w>1OrsQBNP@qQrc{(#r%0jt#mMx*NtYFi<$kaWDK6Y$VH^07 z0t9!S{4SjIQP}$>m-7o2%Lh!_`yk><9``Mx9y=#LS+waBP-ORsZ$-T?lAN%T;`^+=z8N?jjm=`KxFSZ^3ar^Oa36BRt7Kb3>_VG`G z^PdCRjZ@zSeF>Wb5OLR(r%|OZpz3p;d8EVChdxmW zc#_im1}LTKcTd)SKSaHM&a>p&7weZr~kdCun%aRlca2_@^*55d2U-=(e)cULY3;vRhyEE_~lG{cV27>**^# zy!-G6BL4F2pU%1O9Fv|{#XL3$z9VP12O?hH_h#<8k39?CS55%glGXe&weDq7&CA$| z7h%QE{c@fGwE)eRwA=+$|M%~|P5Zx;^}b1Od=*{xBBbCs(EDDQ&%86Ax}`p~Pk3w{ V``9q#k+S=ZuG#lsNtA^23;>K75pMth literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/Icon1.ico b/VisualPascalABCNETLinux/bitmaps/Icon1.ico new file mode 100644 index 0000000000000000000000000000000000000000..af614a8516d187f9d5273ea1b06100fafc44aaf6 GIT binary patch literal 766 zcmc(du};H442E6A128d1x6sF6IEidbo%;@`0~=8kiDtUBH}NWY9A*?$XEML-OB$7l zi9hG$KHI;0X-l-hRaJLHbW5K%MEBTj5f$PQu|eL1+AQtXa5Y3&)HMFU9a}_0!!V#A zwn#*G2wa-NZFi+Tk}G}h3mpAfnEQOPMB)CF`lJbG&H!t0p0c~=`sC)NzyBlKybqmu z`Mhbxf`NI>obz$baJtI*XT-cQCK+RtHiYo1^J^3jwQxvnNZ>9)Z^~F;G)H(A=4a`i zMEPuWuGJ0>FIzkBfniq;$+&xmUHe z|M-Fj|LbQcroVe!##zQ}rNGuuaEPhH``n$wc|a91QVp}r9ZZ>Tva$aEubuMee?8|5 z-7hl^WHm4b2;WFsk=DqHF?hQAxvX? literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/WindowsApplication.bmp b/VisualPascalABCNETLinux/bitmaps/WindowsApplication.bmp new file mode 100644 index 0000000000000000000000000000000000000000..68c4a2ec04fbfa17f7e7632425480040d73cd202 GIT binary patch literal 822 zcmb7?%MpMe3`FDDfJaNP0t)bMPn5>dqX+wmE1wJ#5FxWfh|3G3?1!1jhe6&jmN+I_ zeVyX_ut=GShLra8J?%&U3A=OdyzXDYsr;c8HmV7hp{V@r7C9fSsv;c0OYx;%PNZqh yNAb%^%#h*-h-?w&%c=R%t0(09uq7>EaZ$1iV9Q?+azB3YZ-~F=?uoQXW`1vR$iUB4fJ$|PO8fKT)jA-UzgWX?SlW{ z_uhUl<&6kybsglFvON1)pJr0t@TIIgn1bP`CNE{YFDbLG$NXI3gMFlJ_oK%wHM`08+<2g_P2Zy>eP3&NC+bDl3Z2K-?^W_HK2Gb5nn+&s;76h zk@&m*zBSXF%d0UiXqc4<;MS;fj+lb&{_Y`69rHbqtkrJI|jpZdIJWl%fY=KC@uG zM4(cL_iT^p^>ODjNS9Z0OP{`~(y0|1$s#?qqXH#k#j;28;191b6Mw8W#1@`Zvez%5HE3cRk@$fhQx%TSS$g*TNJeXXg_sICg#^dJ zsMcCkF=D*K>5rU!UlD{2j}_+1FqLgl>$gFVAJqe#N3r`P&&1Qb2a3;ZqGo(%rF| literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/bookmark.png b/VisualPascalABCNETLinux/bitmaps/bookmark.png new file mode 100644 index 0000000000000000000000000000000000000000..c9a453e6d81234d99222df365500841b71726583 GIT binary patch literal 735 zcmV<50wDc~P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0006yNklA$!sKP>uD2gD6!Z2ipSr`QcMQ;@JA(Fs~MiPCHLMSLRl}3g5mYe3( z={9w4nlDqI%}ke5kMGN_?t8vOpY6c;@O=24b6xlEJUakuTT2hv&Q6C5-zGT!^m}?2 zIAff9GDiO6C})ZWIsG7l<9>*odjYcV`pCND<@hZ(SDoz=6?zQ^Bes5Qt+n5<`U@6U zU~Unn=V4+7#u6~}1N!3d{)^4!A`h0{`cHTbR#LDa;n@X9%)xjPMyFt40(xT*7=_w^ z;n0POzX!;rq$Iq&3iHd5l#-$TNz(;j734f}HjpfwnVt+}sFCoe0K956WagG&Z`~vC8R;!58v51u1gF09B(}9;>1li z$F9|J^hz~HF1a{-v66$*vsSfFrk&|1VUIXxWEZn5%So<;(@%LjKhl3W;1A?<9WbFi R6QuwE002ovPDHLkV1nF=L_Poj literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/compileroptions.bmp b/VisualPascalABCNETLinux/bitmaps/compileroptions.bmp new file mode 100644 index 0000000000000000000000000000000000000000..ff2b60232a6f1aebda513d97af8be06fb3fc24c4 GIT binary patch literal 822 zcmbV{!Al!a5XM*f4|w$0V~=}j@Zcd7f?f(zYeK2CtD=;mn>8YlLcO|`lnND-t$}<`ztPeH z7+H2zm8;hoEQR$05|g1$GZ5hV;}6{r3J-(FMtHZkH`UiOc+&@9e(9ILP57H_ST@&c zmhwb`k3^AIbv+l4tw)E!=Yt^x4Sc!y&$5yK0`coa!kK;kIv7O#YGhzv*Cp&(7JhoK zG?^7^<}9<~X0xTS_;T0%)KK`-z#w?qhj`?4=1kML`KbLQIej!eb-uarCzq{EB@UlP z!ShIDCo(KyDl9{*R;%1*ewF=L$$ejbBjT}A>`5VPSfkoy*fao(Et@g7U2`g_rPH@* zFyJxS{q2y2nFe;C$$)7{I+byRuq~5KB8*y?23j_=@H&N6SBNha_w1wvi&Nx+a~Men zPX#PAfv(8lu|w^A6FkeLP6ajrAjRWy8Kc|_7YC!HP6b->At;|eZet+EViUo=Ke}X* SS5aTMmWzCEyCC(e6@LLbKs)^a literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/compileroptions.ico b/VisualPascalABCNETLinux/bitmaps/compileroptions.ico new file mode 100644 index 0000000000000000000000000000000000000000..285a687c4f9cbc9d85c1c66978a06f70b827f7c8 GIT binary patch literal 2478 zcmds(F=!k|6o#MT3wK@wmKs$8%c`t;AfQS?V08jFYNKwF&gpbTKuZiKcgmq4n9fBK zNRcf>w!7loxUdFaCp8ubR453AyNd&Nkig`7Z}04gxQIhYkA3_wC!&N+L6I zOXlY0M5HG7XGA_?wzO3FKYbwb37RcSLq7XZWTPf>pFO%`37g@ZwyyQ>>T(e-$@6NU zXNu+0?RHs6c1cP)!}w82yJ_1^`{T4PG98;wwBhgUHFs2>jQ>Q>NuqH_qsjQW$c{Gd ziFAPD_QCOiaHqbMDzdCW;THWe1=}_uab3D1m|AzmU z_|0icRs6lZC)G9ar_0U1xBkD0&&zb9-n(N}-ae1ry_@SzJMea$xA4aPNj!T&wKM;m zi2sq@A& zGCMmf^Yinvu&^MDi;J?nyeum#E3&nuR=n)~J zC;Wt;qGfjUj^K_!jzf;`o2937FgO?-3=RfEg2BPyU~n)v7z`5z2ZMvb!QfypbQl~A z4h9EY$H}s@UD5Fw*N|qy~|E5w-|NB%eK6 z<)8);j;I{mm_2R|MOY#%5r{}adj(*L9E@y=2oV-8j5s`#2usv@7>m9Q`V`P$NH8QA z5)2831cSX!Fhm#<3<-t^17R@s!;oM|FeDfVjiJMkU`Q||0228l!4d}(n>;Z*zK0`O zY~ADKo_s6Y+uQmlP+F~)93CFZ@$s=79UaN(>8YHZoyo<;g{m=k%-Sm%F;PuX|L{}C_wKjQbhT0fCL09GV?`~Uy| literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/delete_bookmark.png b/VisualPascalABCNETLinux/bitmaps/delete_bookmark.png new file mode 100644 index 0000000000000000000000000000000000000000..baf7381c8b8934f49e372b8d6fb007aad57f85e7 GIT binary patch literal 782 zcmV+p1M&QcP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0007MNkln~URYCC*SqU&HSd<2xx4dqW>${{TIVp#x&8nDoqr|_5NY>@kO9AtE2IdQ zLIeVHB50fhjam9dSTHEm`+!u>q$qu`JxnYdmfQgjTzN_$2>yV?_X{R{Ffs-GW6

9+9)^~FaCU>e6>LpV?v(64 z`IdxpHf<*vs}AO8_b_l!X60Mz$@qa7+-lJa^< zX|1HlE{V;2Ws(TXtsY&RN>{}xbX6RA*WgA5^_@OGG=$KL9g-JS5PQ53hijIDmORAa zo1P_$lLhx7`w&J$V6W#uDV^)(maZ^8YYHO zb;C4;m6E~7`TE}8=+h*6Et7NHBwzhX@?|GUmmKW7XeTkdiuf#>PSYj^iTWkZCTX!E z*^yopGEieV619ZxGCQ1z!=DzduN8^fP`i%(VX!2LwOSJ>A^W2sW-T&d6Zuanh)I7L z+DHoo%g*z{!J~WhFHCHRU@~dT;#U5bfl6cRYSt+jH{|#a4G^J^%m! literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/find.bmp b/VisualPascalABCNETLinux/bitmaps/find.bmp new file mode 100644 index 0000000000000000000000000000000000000000..6f43bdc89115abfc56d649d29ddaecdfd29325bb GIT binary patch literal 822 zcmcIhze~eF7>)Q3WOQ)osCDU7LZ=|K)S(c!jB&DV0ckCQav*^YRt`b1x@7Q2MUkV$ z$>kKG>Xb<`W^}x<+xadDN2!BQFkFty`(Ez7?|tiy@}iMGW$Y_>&HP<3mQviv>)A)P zOGEzadOX<=J0A6H>Z%oNtZBJnu-$KOg}$RoPN`K{Mu|}(Co*~GQAj!Qh+WWpMm+JI zsM3J4jzj9I^e0~=Nx~WL`lMc(gU`>2lrq;1$!|Y1_rG49v92FB9dramm?V~Y+$iRt zTcQB%f^V7BRerw493@C3k!l%f5ZnBCeqhv3;z-01K-H{OczL?XqTrMWA>>4em?INN zoVphHxI}>w*WqM*?C1i_%oWnU*r~COrz}A(HL01o1iHo)kQ+sADrc30nhT2%LW)fP z@;SQ2AhP>|&5Ghg~a~2FL7r*lYKj JRgKJX_yN&g*#`gs literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/findnext.bmp b/VisualPascalABCNETLinux/bitmaps/findnext.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4a3523ee75ff4c353a635a7d8f0360a0c207acbc GIT binary patch literal 822 zcmbV}ze~eF6vrd}0~sA0I%-`ymCz{&Ep;fwEn}RlTR>Wipd3h`gOx)NtS%Y+QBmY* zadJ6Ds5)hmju{~?-H2}d!aV7MHY&->=yd*8R(D9;0`HG@!;VKio4RTRYb#nj3^x1ijnH>g$SJidiwH4FZ*D^#vCD}h$Gc9+#t63_ISsrA5S7Ni2zlzR^jR4 zDz$=BB7~4rAtoH2AjPq3L61umjJP%@)ni8&P^MME?X#^K>v*apq)Up_$}9!C#uVTi zg>TAd<%60Fi(o=RW`B7fU1JdG{lR)g=`kZs97VpZ+n|MN_iIJX2M60Ad(~x4W)Ckn V=cC>ZD%Wt#E{DB#zgg7;hcA$=!5;ts literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/internal.bmp b/VisualPascalABCNETLinux/bitmaps/internal.bmp new file mode 100644 index 0000000000000000000000000000000000000000..565ad5e48049534598155a292e1ed0e5fb1ab4dd GIT binary patch literal 306 zcmZ?rHDY7{12Z700mPh8%*Y@C7XJe#(TD~Hh6aX-k>Qg0gq zt{aom3T$kE5!PWIZUe@l!xSjD~w+ix)Bqz^FP0BSjW4P1acA&HzNUq7t zTiH~%xx5%Cw=panh(KmuZf|?g-#a%f49K2VnsYWU4+SoLs5$@PxJ zNj}>DQ2|gd#72;o{R_^e8$X|t^QG9RvfHWC2Z0O0`{)G{C8W{BeBbcp@CKXY$O1*0m1_^ jaH$750~^4p9`0rc1E?3spoaOtAi{%!qGOT$ODY=xFAN3) literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/next_bookmark.png b/VisualPascalABCNETLinux/bitmaps/next_bookmark.png new file mode 100644 index 0000000000000000000000000000000000000000..48ce25b3d43c7428d8a915cd31bb3c771302f9c7 GIT binary patch literal 708 zcmV;#0z3VQP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0006XNklM09NgnMw z)XABfF3uLa$toS-{2dP$?s>_+KaT0a1m?0J7b~V@3kLl*WaPJyRZ>m+Fm#W>;3SMr zLtqYO7a{TkqHD0Rq4p75n~WIJEls@m2(Jd={TJx4B+amet7Ev zryzY3Fe2mnzryqagqLA?71jkYmrFz)IB~6>noh90pwSI&f~Y=R(#L@G;gvonrH`2i z94qqE?~7t83v2n71h#|ZR{OR2JURQd=?A1Q^yWZn&NsX}Jd6Qt%m zqq-fQD&zyy_dxR}(4>z8nN|*-tL2cni6fWaP}Q~?TdR-+a6HFGdj6w0BBR&@ai~&d zl>Npk%%v_Y4?k1#I6!4xcpI`53C9nFN};+)%X5%nY35`>E5<@C1{e!8Ot+meq}Upy z(k@7AJc;TgaiWq>m;S7PqgNVZNFs?3#$L$>q%Bgk)s^0000r`(o=$8GUnp06l83Zdj>nQm3 z`SYJd-e-C!{Sjl9ZD>$tXHR|~xro9%&#hK|fA8oc?7MKwfO2`-P@r6ZPqYuFe011Q zE~bymlzrmp;JwPXBcm0zlS9AW_>j!az5*pptg{wG z8UarUD5OwRfX5Amy|~|h0ha(!gI^a5NM&Cc3{rKU5{&9a=-l7N5QHo)an`iJt< literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/options.ico b/VisualPascalABCNETLinux/bitmaps/options.ico new file mode 100644 index 0000000000000000000000000000000000000000..6b2077b2d8f356f047d3adbe0cd077340d250ad8 GIT binary patch literal 2478 zcmds(KWJn{9LK-$R(5#=F0n`zxR~lv4~VHEfusvulh$;jg>rUTLD+?Z>~(QD2~2l| z9$2_VAl(*gqhJQhq%jak5eYeV*AsR@Vf_4N-`-vH3Qxqs$(ujF@67yupZA-Ww@;eU zEzQl%Nvi1XjPwqprKO4e^BdCpXn9&SefXxdS&{Ct##Ss*XV_<@m)lo0O^Hj*=A@%# zNNuXu>oJk?rIc($<_3rqt#D7= z`)k)*?5R?3Px7>c`}e5RJT=Mbt4oulFhgE)N6YZ_^2GLBsyRPpgHk1%F+wLwkinn^d`2Q}rw|IYJbuQJ9o4U^Shw;Q%{2*o~Tl(s8*|K zc6L_t^YdC*SkU6)qL!DJwX(9J?d@%CZEb0NeO;@ot7?9hbnjl$Bb_K+M}2qF*U9Cj zKL7d~0y(Ou25Ov`4$YxCG-n#`8e8JgJp+&K(LK6t3+MqoUh!{A}C)Ok2O3?7D<-|TUcLgGyRuycAXJ5Uijur8;X*a4O{kgeAfffrtdmj{q!@jgdtWA;Q8%#Sdo^VTqQH%wkW2odOyR35Eni zf+4|>V91XX3=xI|LxLf~fEz07VMs6}7!nM)rlP};U`Q||021*d&Jr6Fi#$F&wud8S z-?qlJl5d1q%R*o z&c9Ve&lk>YL^Z$kG{v9G+FG@g{8JljZj{1D>B#Iyo10ni6LTt*v*n77kEgR)xZio% zEQ(I*Z`ee&V{LJrs$blHi$VKYr)YON34+n!=xMv%E=K)+|C*`pXwdBfFe-|E+cu4! z{W8ozMHQ_Wj?%Av(~FUr)uUl|dLNiw%1fp#D~sh}|59pwFFoM1<=Z>b`I+qzg9p+j-w{9Z9q~KsZ0{e(FdMhjbeX@ zHP~MRo}u1zPyfAhyyC}^J_0k=;L-BdfK+$7Dvx>(WpyuzhB z?1h{@0aEf9xP4?l*xxf1nMifg5cFC}<#S3g)yXA*oQeU*|FyM-dAgLMCC_B+soHhD zUe#)xT4t0&639#(#CN}7{@=SHQOl$jp}JA!bwoW1Mm-ihy@mtIT^-yZlD(es)AxkQYOov>$NCUTGo@1=v=>4Ob7 z=imG|7Cxoa(iOAQCas!Y<250#7BfmNE@z@r;smt+{045H8oH@=Ou0##m%3Qi_?*I} zI_zILbq1vPF>w3H{wsKBDl(Dkq#@|lqRMBLLb8*M0XcaJ9Djd(1@m+%MN5uJ+f%jc zdcC4mIkm(n`8bf7D2V>p!u&tKez5&sp(USXOu1#WL<2!82$BX0`wv_k1>lEwJ~_T4 zTfHDeZWzs~A(k|r1!^G)96z$_hYvXv3Q^0X7NNRksuGbJh8=_hYMB9U-DtvcKm4Mk60TDUmt!}<^5Z2!ct26xjm*quoY5p1a`YGodE4+H_CgL5s_U(%= h^TOJj%10l+JZ*O^JTJ~o*~~rxoNpApclwzjUje?uL81Tv literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/prev_bookmark.png b/VisualPascalABCNETLinux/bitmaps/prev_bookmark.png new file mode 100644 index 0000000000000000000000000000000000000000..db2017a14186dc754759ec82436f7f3bdd6a20b6 GIT binary patch literal 691 zcmV;k0!;mhP)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy7j#8fbW?9;ba!ELWdKlNX>N2bPDNB8b~7$8%`aC*0006GNklS%&Ea@P=U|0Ixs5GY>p@3;E`*41u}` zJKtdQD}3I7B>_ic5Lg6X1l&Ow^uu#6I7Z>|h!802&;?9&VYURko`l#s%&$Q3BTPnN zbQYWfe(8g!W6&YsRwv|@+I0bAZHTczfJKbP&LGu6{ zxzw%;oU0E~cr!vyc-@Iop=tt3rOMHY9tzCe`X3Wci64GxMRLH|Gy zhmJQoW^}x#%LvmVa2c4qWCsQtK>KNKOR@vB$jcADA8}t zM@Q-=l}RW;qc%V#9~3R@wkW-XM^sqmm%@<`Qd$W!G^cR`Q2o|l)w+#@1}|X literal 0 HcmV?d00001 diff --git a/VisualPascalABCNETLinux/bitmaps/run_nodebug.bmp b/VisualPascalABCNETLinux/bitmaps/run_nodebug.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b2bfeb5f760d6fb6c09a3ce0692cbd3218f19966 GIT binary patch literal 822 zcmZ?rHDhJ~12Z700mK4O%*Y@C7H5FULpTufKg0h4K}W8fCdppTWRXLcPZ6(0FhiOp zf&ak86GUo}%2(;zG99R8|M}x+T2_DfzWUMAHRsN(-Mw|)@;MM$Nn>RVY4e8o2g*#1R z=jp?65ln`Cn+HU2&cUVnWtKay970wDv;}Czx-Dzg&Fq4RyLS5l8LLig1}ffl6`#ov z_1=9UD~@jjD&BMLD6+}8*a4FwTv~kh-XKab&=BAL(ET^jLmrpmK=A{&iH%u2h5)4i DUB2(C literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/.gitignore b/WeifenLuoLinux/.gitignore new file mode 100644 index 000000000..c258adf6c --- /dev/null +++ b/WeifenLuoLinux/.gitignore @@ -0,0 +1,31 @@ +build/ +*.suo +*.user +_ReSharper* +*.csproj.user +*.resharper.user +*.userprefs +*.suo +*.cache +*.trx +*.pidb +Thumbs.db +[Bb]in +[Dd]ebug +[Oo]bj +[Rr]elease +[Tt]est[Rr]esult* +_UpgradeReport_Files +*[Pp]ublish.xml +*.project +*.metadata +logs +*.generated.cs +T4MVC.cs +/SharpSnmpLib/sharpsnmplib.snk +/packages +/Gendarme +*.nupkg +/.vs +/.idea +*.bak diff --git a/WeifenLuoLinux/WinFormsUI/Docking/AutoHideStripBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/AutoHideStripBase.cs new file mode 100644 index 000000000..cf044d254 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/AutoHideStripBase.cs @@ -0,0 +1,746 @@ +using System; +using System.Collections; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public abstract class AutoHideStripBase : Control + { + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + protected class Tab : IDisposable + { + private IDockContent m_content; + + protected internal Tab(IDockContent content) + { + m_content = content; + } + + ~Tab() + { + Dispose(false); + } + + public IDockContent Content + { + get { return m_content; } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + } + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + protected sealed class TabCollection : IEnumerable + { + #region IEnumerable Members + IEnumerator IEnumerable.GetEnumerator() + { + for (int i = 0; i < Count; i++) + yield return this[i]; + } + + IEnumerator IEnumerable.GetEnumerator() + { + for (int i = 0; i < Count; i++) + yield return this[i]; + } + #endregion + + internal TabCollection(DockPane pane) + { + m_dockPane = pane; + } + + private DockPane m_dockPane = null; + public DockPane DockPane + { + get { return m_dockPane; } + } + + public DockPanel DockPanel + { + get { return DockPane.DockPanel; } + } + + public int Count + { + get { return DockPane.DisplayingContents.Count; } + } + + public Tab this[int index] + { + get + { + IDockContent content = DockPane.DisplayingContents[index]; + if (content == null) + throw new ArgumentOutOfRangeException(nameof(index)); + if (content.DockHandler.AutoHideTab == null) + content.DockHandler.AutoHideTab = (DockPanel.AutoHideStripControl.CreateTab(content)); + return content.DockHandler.AutoHideTab as Tab; + } + } + + public bool Contains(Tab tab) + { + return (IndexOf(tab) != -1); + } + + public bool Contains(IDockContent content) + { + return (IndexOf(content) != -1); + } + + public int IndexOf(Tab tab) + { + if (tab == null) + return -1; + + return IndexOf(tab.Content); + } + + public int IndexOf(IDockContent content) + { + return DockPane.DisplayingContents.IndexOf(content); + } + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + protected class Pane : IDisposable + { + private DockPane m_dockPane; + + protected internal Pane(DockPane dockPane) + { + m_dockPane = dockPane; + } + + ~Pane() + { + Dispose(false); + } + + public DockPane DockPane + { + get { return m_dockPane; } + } + + public TabCollection AutoHideTabs + { + get + { + if (DockPane.AutoHideTabs == null) + DockPane.AutoHideTabs = new TabCollection(DockPane); + return DockPane.AutoHideTabs as TabCollection; + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + } + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + protected sealed class PaneCollection : IEnumerable + { + private class AutoHideState + { + public DockState m_dockState; + public bool m_selected = false; + + public AutoHideState(DockState dockState) + { + m_dockState = dockState; + } + + public DockState DockState + { + get { return m_dockState; } + } + + public bool Selected + { + get { return m_selected; } + set { m_selected = value; } + } + } + + private class AutoHideStateCollection + { + private AutoHideState[] m_states; + + public AutoHideStateCollection() + { + m_states = new[]{ + new AutoHideState(DockState.DockTopAutoHide), + new AutoHideState(DockState.DockBottomAutoHide), + new AutoHideState(DockState.DockLeftAutoHide), + new AutoHideState(DockState.DockRightAutoHide) + }; + } + + public AutoHideState this[DockState dockState] + { + get + { + for (int i = 0; i < m_states.Length; i++) + { + if (m_states[i].DockState == dockState) + return m_states[i]; + } + throw new ArgumentOutOfRangeException(nameof(dockState)); + } + } + + public bool ContainsPane(DockPane pane) + { + if (pane.IsHidden) + return false; + + for (int i = 0; i < m_states.Length; i++) + { + if (m_states[i].DockState == pane.DockState && m_states[i].Selected) + return true; + } + return false; + } + } + + internal PaneCollection(DockPanel panel, DockState dockState) + { + m_dockPanel = panel; + m_states = new AutoHideStateCollection(); + States[DockState.DockTopAutoHide].Selected = (dockState == DockState.DockTopAutoHide); + States[DockState.DockBottomAutoHide].Selected = (dockState == DockState.DockBottomAutoHide); + States[DockState.DockLeftAutoHide].Selected = (dockState == DockState.DockLeftAutoHide); + States[DockState.DockRightAutoHide].Selected = (dockState == DockState.DockRightAutoHide); + } + + private DockPanel m_dockPanel; + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + private AutoHideStateCollection m_states; + private AutoHideStateCollection States + { + get { return m_states; } + } + + public int Count + { + get + { + int count = 0; + foreach (DockPane pane in DockPanel.Panes) + { + if (States.ContainsPane(pane)) + count++; + } + + return count; + } + } + + public Pane this[int index] + { + get + { + int count = 0; + foreach (DockPane pane in DockPanel.Panes) + { + if (!States.ContainsPane(pane)) + continue; + + if (count == index) + { + if (pane.AutoHidePane == null) + pane.AutoHidePane = DockPanel.AutoHideStripControl.CreatePane(pane); + return pane.AutoHidePane as Pane; + } + + count++; + } + throw new ArgumentOutOfRangeException(nameof(index)); + } + } + + public bool Contains(Pane pane) + { + return (IndexOf(pane) != -1); + } + + public int IndexOf(Pane pane) + { + if (pane == null) + return -1; + + int index = 0; + foreach (DockPane dockPane in DockPanel.Panes) + { + if (!States.ContainsPane(pane.DockPane)) + continue; + + if (pane == dockPane.AutoHidePane) + return index; + + index++; + } + return -1; + } + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + for (int i = 0; i < Count; i++) + yield return this[i]; + } + + IEnumerator IEnumerable.GetEnumerator() + { + for (int i = 0; i < Count; i++) + yield return this[i]; + } + + #endregion + } + + protected AutoHideStripBase(DockPanel panel) + { + DockPanel = panel; + PanesTop = new PaneCollection(panel, DockState.DockTopAutoHide); + PanesBottom = new PaneCollection(panel, DockState.DockBottomAutoHide); + PanesLeft = new PaneCollection(panel, DockState.DockLeftAutoHide); + PanesRight = new PaneCollection(panel, DockState.DockRightAutoHide); + + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + SetStyle(ControlStyles.Selectable, false); + } + + protected DockPanel DockPanel { get; private set; } + + protected PaneCollection PanesTop { get; private set; } + protected PaneCollection PanesBottom { get; private set; } + protected PaneCollection PanesLeft { get; private set; } + protected PaneCollection PanesRight { get; private set; } + + protected PaneCollection GetPanes(DockState dockState) + { + if (dockState == DockState.DockTopAutoHide) + return PanesTop; + else if (dockState == DockState.DockBottomAutoHide) + return PanesBottom; + else if (dockState == DockState.DockLeftAutoHide) + return PanesLeft; + else if (dockState == DockState.DockRightAutoHide) + return PanesRight; + else + throw new ArgumentOutOfRangeException(nameof(dockState)); + } + + internal int GetNumberOfPanes(DockState dockState) + { + return GetPanes(dockState).Count; + } + + /// + /// The top left rectangle in auto hide strip area. + /// + protected Rectangle RectangleTopLeft + { + get + { + int standard = MeasureHeight(); + var padding = DockPanel.Theme.Measures.DockPadding; + var width = PanesLeft.Count > 0 ? standard : padding; + var height = PanesTop.Count > 0 ? standard : padding; + return new Rectangle(0, 0, width, height); + } + } + + /// + /// The top right rectangle in auto hide strip area. + /// + protected Rectangle RectangleTopRight + { + get + { + int standard = MeasureHeight(); + var padding = DockPanel.Theme.Measures.DockPadding; + var width = PanesRight.Count > 0 ? standard : padding; + var height = PanesTop.Count > 0 ? standard : padding; + return new Rectangle(Width - width, 0, width, height); + } + } + + /// + /// The bottom left rectangle in auto hide strip area. + /// + protected Rectangle RectangleBottomLeft + { + get + { + int standard = MeasureHeight(); + var padding = DockPanel.Theme.Measures.DockPadding; + var width = PanesLeft.Count > 0 ? standard : padding; + var height = PanesBottom.Count > 0 ? standard : padding; + return new Rectangle(0, Height - height, width, height); + } + } + + /// + /// The bottom right rectangle in auto hide strip area. + /// + protected Rectangle RectangleBottomRight + { + get + { + int standard = MeasureHeight(); + var padding = DockPanel.Theme.Measures.DockPadding; + var width = PanesRight.Count > 0 ? standard : padding; + var height = PanesBottom.Count > 0 ? standard : padding; + return new Rectangle(Width - width, Height - height, width, height); + } + } + + /// + /// Gets one of the four auto hide strip rectangles. + /// + /// Dock state. + /// The desired rectangle. + /// + /// As the corners are represented by , , , and , + /// the four strips can be easily calculated out as the borders. + /// + protected internal Rectangle GetTabStripRectangle(DockState dockState) + { + if (dockState == DockState.DockTopAutoHide) + return new Rectangle(RectangleTopLeft.Width, 0, Width - RectangleTopLeft.Width - RectangleTopRight.Width, RectangleTopLeft.Height); + + if (dockState == DockState.DockBottomAutoHide) + return new Rectangle(RectangleBottomLeft.Width, Height - RectangleBottomLeft.Height, Width - RectangleBottomLeft.Width - RectangleBottomRight.Width, RectangleBottomLeft.Height); + + if (dockState == DockState.DockLeftAutoHide) + return new Rectangle(0, RectangleTopLeft.Height, RectangleTopLeft.Width, Height - RectangleTopLeft.Height - RectangleBottomLeft.Height); + + if (dockState == DockState.DockRightAutoHide) + return new Rectangle(Width - RectangleTopRight.Width, RectangleTopRight.Height, RectangleTopRight.Width, Height - RectangleTopRight.Height - RectangleBottomRight.Height); + + return Rectangle.Empty; + } + + private GraphicsPath m_displayingArea; + + private GraphicsPath DisplayingArea + { + get + { + if (m_displayingArea == null) + m_displayingArea = new GraphicsPath(); + + return m_displayingArea; + } + } + + private void SetRegion() + { + DisplayingArea.Reset(); + DisplayingArea.AddRectangle(RectangleTopLeft); + DisplayingArea.AddRectangle(RectangleTopRight); + DisplayingArea.AddRectangle(RectangleBottomLeft); + DisplayingArea.AddRectangle(RectangleBottomRight); + DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockTopAutoHide)); + DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockBottomAutoHide)); + DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockLeftAutoHide)); + DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockRightAutoHide)); + Region = new Region(DisplayingArea); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (e.Button != MouseButtons.Left) + return; + + IDockContent content = HitTest(); + if (content == null) + return; + + SetActiveAutoHideContent(content); + + content.DockHandler.Activate(); + } + + protected override void OnMouseHover(EventArgs e) + { + base.OnMouseHover(e); + + if (!DockPanel.ShowAutoHideContentOnHover) + return; + + // IMPORTANT: VS2003/2005 themes only. + IDockContent content = HitTest(); + SetActiveAutoHideContent(content); + + // requires further tracking of mouse hover behavior, + ResetMouseEventArgs(); + } + + private void SetActiveAutoHideContent(IDockContent content) + { + if (content != null) + if (DockPanel.ActiveAutoHideContent != content) + DockPanel.ActiveAutoHideContent = content; + else if (!DockPanel.ShowAutoHideContentOnHover) + DockPanel.ActiveAutoHideContent = null; // IMPORTANT: Not needed for VS2003/2005 themes. + } + + protected override void OnLayout(LayoutEventArgs levent) + { + RefreshChanges(); + base.OnLayout (levent); + } + + internal void RefreshChanges() + { + if (IsDisposed) + return; + + SetRegion(); + OnRefreshChanges(); + } + + protected virtual void OnRefreshChanges() + { + } + + protected internal abstract int MeasureHeight(); + + private IDockContent HitTest() + { + Point ptMouse = PointToClient(Control.MousePosition); + return HitTest(ptMouse); + } + + protected virtual Tab CreateTab(IDockContent content) + { + return new Tab(content); + } + + protected virtual Pane CreatePane(DockPane dockPane) + { + return new Pane(dockPane); + } + + protected abstract IDockContent HitTest(Point point); + + protected override AccessibleObject CreateAccessibilityInstance() + { + return new AutoHideStripsAccessibleObject(this); + } + + protected abstract Rectangle GetTabBounds(Tab tab); + + internal static Rectangle ToScreen(Rectangle rectangle, Control parent) + { + if (parent == null) + return rectangle; + + return new Rectangle(parent.PointToScreen(new Point(rectangle.Left, rectangle.Top)), new Size(rectangle.Width, rectangle.Height)); + } + + public class AutoHideStripsAccessibleObject : Control.ControlAccessibleObject + { + private AutoHideStripBase _strip; + + public AutoHideStripsAccessibleObject(AutoHideStripBase strip) + : base(strip) + { + _strip = strip; + } + + public override AccessibleRole Role + { + get + { + return AccessibleRole.Window; + } + } + + public override int GetChildCount() + { + // Top, Bottom, Left, Right + return 4; + } + + public override AccessibleObject GetChild(int index) + { + switch (index) + { + case 0: + return new AutoHideStripAccessibleObject(_strip, DockState.DockTopAutoHide, this); + case 1: + return new AutoHideStripAccessibleObject(_strip, DockState.DockBottomAutoHide, this); + case 2: + return new AutoHideStripAccessibleObject(_strip, DockState.DockLeftAutoHide, this); + case 3: + default: + return new AutoHideStripAccessibleObject(_strip, DockState.DockRightAutoHide, this); + } + } + + public override AccessibleObject HitTest(int x, int y) + { + Dictionary rectangles = new Dictionary { + { DockState.DockTopAutoHide, _strip.GetTabStripRectangle(DockState.DockTopAutoHide) }, + { DockState.DockBottomAutoHide, _strip.GetTabStripRectangle(DockState.DockBottomAutoHide) }, + { DockState.DockLeftAutoHide, _strip.GetTabStripRectangle(DockState.DockLeftAutoHide) }, + { DockState.DockRightAutoHide, _strip.GetTabStripRectangle(DockState.DockRightAutoHide) }, + }; + + Point point = _strip.PointToClient(new Point(x, y)); + foreach (var rectangle in rectangles) + { + if (rectangle.Value.Contains(point)) + return new AutoHideStripAccessibleObject(_strip, rectangle.Key, this); + } + + return null; + } + } + + public class AutoHideStripAccessibleObject : AccessibleObject + { + private AutoHideStripBase _strip; + private DockState _state; + private AccessibleObject _parent; + + public AutoHideStripAccessibleObject(AutoHideStripBase strip, DockState state, AccessibleObject parent) + { + _strip = strip; + _state = state; + + _parent = parent; + } + + public override AccessibleObject Parent + { + get + { + return _parent; + } + } + + public override AccessibleRole Role + { + get + { + return AccessibleRole.PageTabList; + } + } + + public override int GetChildCount() + { + int count = 0; + foreach (Pane pane in _strip.GetPanes(_state)) + { + count += pane.AutoHideTabs.Count; + } + return count; + } + + public override AccessibleObject GetChild(int index) + { + List tabs = new List(); + foreach (Pane pane in _strip.GetPanes(_state)) + { + tabs.AddRange(pane.AutoHideTabs); + } + + return new AutoHideStripTabAccessibleObject(_strip, tabs[index], this); + } + + public override Rectangle Bounds + { + get + { + Rectangle rectangle = _strip.GetTabStripRectangle(_state); + return ToScreen(rectangle, _strip); + } + } + } + + protected class AutoHideStripTabAccessibleObject : AccessibleObject + { + private AutoHideStripBase _strip; + private Tab _tab; + + private AccessibleObject _parent; + + internal AutoHideStripTabAccessibleObject(AutoHideStripBase strip, Tab tab, AccessibleObject parent) + { + _strip = strip; + _tab = tab; + + _parent = parent; + } + + public override AccessibleObject Parent + { + get + { + return _parent; + } + } + + public override AccessibleRole Role + { + get + { + return AccessibleRole.PageTab; + } + } + + public override Rectangle Bounds + { + get + { + Rectangle rectangle = _strip.GetTabBounds(_tab); + return ToScreen(rectangle, _strip); + } + } + + public override string Name + { + get + { + return _tab.Content.DockHandler.TabText; + } + set + { + //base.Name = value; + } + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Configuration/PatchSection.cs b/WeifenLuoLinux/WinFormsUI/Docking/Configuration/PatchSection.cs new file mode 100644 index 000000000..8c8f0ab5f --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Configuration/PatchSection.cs @@ -0,0 +1,93 @@ +using System.Configuration; + +namespace WeifenLuo.WinFormsUI.Docking.Configuration +{ +#if NET35 || NET40 + public class PatchSection : ConfigurationSection + { + [ConfigurationProperty("enableAll", DefaultValue = null)] + public bool? EnableAll + { + get { return (bool?)base["enableAll"]; } + } + + [ConfigurationProperty("enableHighDpi", DefaultValue = true)] + public bool EnableHighDpi + { + get { return (bool)base["enableHighDpi"]; } + } + + [ConfigurationProperty("enableMemoryLeakFix", DefaultValue = true)] + public bool EnableMemoryLeakFix + { + get { return (bool)base["enableMemoryLeakFix"]; } + } + + [ConfigurationProperty("enableMainWindowFocusLostFix", DefaultValue = true)] + public bool EnableMainWindowFocusLostFix + { + get { return (bool)base["enableMainWindowFocusLostFix"]; } + } + + [ConfigurationProperty("enableNestedDisposalFix", DefaultValue = true)] + public bool EnableNestedDisposalFix + { + get { return (bool)base["enableNestedDisposalFix"]; } + } + + [ConfigurationProperty("enableFontInheritanceFix", DefaultValue = true)] + public bool EnableFontInheritanceFix + { + get { return (bool)base["enableFontInheritanceFix"]; } + } + + [ConfigurationProperty("enableContentOrderFix", DefaultValue = true)] + public bool EnableContentOrderFix + { + get { return (bool)base["enableContentOrderFix"]; } + } + + [ConfigurationProperty("enableActiveXFix", DefaultValue = false)] // disabled by default to avoid side effect. + public bool EnableActiveXFix + { + get { return (bool)base["enableActiveXFix"]; } + } + + [ConfigurationProperty("enableDisplayingPaneFix", DefaultValue = true)] + public bool EnableDisplayingPaneFix + { + get { return (bool)base["enableDisplayingPaneFix"]; } + } + + [ConfigurationProperty("enableActiveControlFix", DefaultValue = true)] + public bool EnableActiveControlFix + { + get { return (bool)base["enableActiveControlFix"]; } + } + + [ConfigurationProperty("enableFloatSplitterFix", DefaultValue = true)] + public bool EnableFloatSplitterFix + { + get { return (bool)base["enableFloatSplitterFix"]; } + } + + [ConfigurationProperty("enableActivateOnDockFix", DefaultValue = true)] + public bool EnableActivateOnDockFix + { + get { return (bool)base["enableActivateOnDockFix"]; } + } + + [ConfigurationProperty("enableSelectClosestOnClose", DefaultValue = true)] + public bool EnableSelectClosestOnClose + { + get { return (bool)base["enableSelectClosestOnClose"]; } + } + + [ConfigurationProperty("enablePerScreenDpi", DefaultValue = false)] + public bool EnablePerScreenDpi + { + get { return (bool)base["enablePerScreenDpi"]; } + } + } +#endif +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DefaultTheme.cs b/WeifenLuoLinux/WinFormsUI/Docking/DefaultTheme.cs new file mode 100644 index 000000000..568cb17de --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DefaultTheme.cs @@ -0,0 +1,261 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + internal class DefaultTheme : ThemeBase + { + internal DefaultTheme() + { + Extender.AutoHideStripFactory = new DefaultAutoHideStripFactory(); + Extender.AutoHideWindowFactory = new DefaultAutoHideWindowFactory(); + Extender.WindowSplitterControlFactory = new DefaultWindowSplitterControlFactory(); + Extender.DockWindowFactory = new DefaultDockWindowFactory(); + Extender.DockPaneSplitterControlFactory = new DefaultDockPaneSplitterControlFactory(); + Extender.DockPaneCaptionFactory = new DefaultDockPaneCaptionFactory(); + Extender.DockPaneStripFactory = new DefaultDockPaneStripFactory(); + Extender.DockIndicatorFactory = new DefaultDockIndicatorFactory(); + Extender.DockOutlineFactory = new DefaultDockOutlineFactory(); + Extender.PaneIndicatorFactory = new DefaultPaneIndicatorFactory(); + Extender.PanelIndicatorFactory = new DefaultPanelIndicatorFactory(); + } + + private class DefaultAutoHideStripFactory : DockPanelExtender.IAutoHideStripFactory + { + public AutoHideStripBase CreateAutoHideStrip(DockPanel panel) + { + return new DefaultAutoHideStripBase(panel); + } + + internal class DefaultAutoHideStripBase : AutoHideStripBase + { + public DefaultAutoHideStripBase(DockPanel panel) + : base(panel) + { + } + + protected override Rectangle GetTabBounds(Tab tab) + { + return Rectangle.Empty; + } + + protected override IDockContent HitTest(Point point) + { + return null; + } + + protected internal override int MeasureHeight() + { + return 0; + } + } + + } + + private class DefaultAutoHideWindowFactory : DockPanelExtender.IAutoHideWindowFactory + { + public DockPanel.AutoHideWindowControl CreateAutoHideWindow(DockPanel panel) + { + return new DefaultAutoHideWindowControl(panel); + } + + private class DefaultAutoHideWindowControl : DockPanel.AutoHideWindowControl + { + public DefaultAutoHideWindowControl(DockPanel dockPanel) : base(dockPanel) + { + } + } + } + + private class DefaultWindowSplitterControlFactory : DockPanelExtender.IWindowSplitterControlFactory + { + public SplitterBase CreateSplitterControl(ISplitterHost host) + { + return new SplitterBase(); + } + } + + private class DefaultDockWindowFactory : DockPanelExtender.IDockWindowFactory + { + public DockWindow CreateDockWindow(DockPanel dockPanel, DockState dockState) + { + return new DockWindow(dockPanel, dockState); + } + } + + private class DefaultDockPaneSplitterControlFactory : DockPanelExtender.IDockPaneSplitterControlFactory + { + public DockPane.SplitterControlBase CreateSplitterControl(DockPane pane) + { + return new DockPane.SplitterControlBase(pane); + } + } + + private class DefaultDockPaneCaptionFactory : DockPanelExtender.IDockPaneCaptionFactory + { + public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane) + { + return new DefaultDockPaneCaption(pane); + } + + private class DefaultDockPaneCaption : DockPaneCaptionBase + { + public DefaultDockPaneCaption(DockPane pane) : base(pane) + { + } + + protected internal override int MeasureHeight() + { + return 0; + } + } + } + + private class DefaultDockPaneStripFactory : DockPanelExtender.IDockPaneStripFactory + { + public DockPaneStripBase CreateDockPaneStrip(DockPane pane) + { + return new DefaultDockPaneStrip(pane); + } + + private class DefaultDockPaneStrip : DockPaneStripBase + { + public DefaultDockPaneStrip(DockPane pane) : base(pane) + { + } + + public override GraphicsPath GetOutline(int index) + { + return new GraphicsPath(); + } + + protected override Rectangle GetTabBounds(Tab tab) + { + return Rectangle.Empty; + } + + protected internal override void EnsureTabVisible(IDockContent content) + { + } + + protected internal override int HitTest(Point point) + { + return -1; + } + + protected internal override int MeasureHeight() + { + return 0; + } + } + } + + private class DefaultDockIndicatorFactory : DockPanelExtender.IDockIndicatorFactory + { + public DockPanel.DockDragHandler.DockIndicator CreateDockIndicator(DockPanel.DockDragHandler dockDragHandler) + { + return new DockPanel.DockDragHandler.DockIndicator(dockDragHandler); + } + } + + private class DefaultDockOutlineFactory : DockPanelExtender.IDockOutlineFactory + { + public DockOutlineBase CreateDockOutline() + { + return new DefaultDockOutline(); + } + + private class DefaultDockOutline : DockOutlineBase + { + protected override void OnClose() + { + } + + protected override void OnShow() + { + } + } + } + + private class DefaultPaneIndicatorFactory : DockPanelExtender.IPaneIndicatorFactory + { + public DockPanel.IPaneIndicator CreatePaneIndicator(ThemeBase theme) + { + return new DefaultPaneIndicator(theme); + } + + private class DefaultPaneIndicator : DockPanel.IPaneIndicator + { + private ThemeBase theme; + + public DefaultPaneIndicator(ThemeBase theme) + { + this.theme = theme; + } + + public Point Location { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + public bool Visible { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + + public int Left => throw new System.NotImplementedException(); + + public int Top => throw new System.NotImplementedException(); + + public int Right => throw new System.NotImplementedException(); + + public int Bottom => throw new System.NotImplementedException(); + + public Rectangle ClientRectangle => throw new System.NotImplementedException(); + + public int Width => throw new System.NotImplementedException(); + + public int Height => throw new System.NotImplementedException(); + + public GraphicsPath DisplayingGraphicsPath => throw new System.NotImplementedException(); + + public DockStyle Status { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + + public DockStyle HitTest(Point pt) + { + throw new System.NotImplementedException(); + } + } + } + + private class DefaultPanelIndicatorFactory : DockPanelExtender.IPanelIndicatorFactory + { + public DockPanel.IPanelIndicator CreatePanelIndicator(DockStyle style, ThemeBase theme) + { + return new DefaultPanelIndicator(style, theme); + } + + private class DefaultPanelIndicator : DockPanel.IPanelIndicator + { + private DockStyle style; + private ThemeBase theme; + + public DefaultPanelIndicator(DockStyle style, ThemeBase theme) + { + this.style = style; + this.theme = theme; + } + + public Point Location { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + public bool Visible { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + + public Rectangle Bounds => throw new System.NotImplementedException(); + + public int Width => throw new System.NotImplementedException(); + + public int Height => throw new System.NotImplementedException(); + + public DockStyle Status { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } + + public DockStyle HitTest(Point pt) + { + throw new System.NotImplementedException(); + } + } + } + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockAreasEditor.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockAreasEditor.cs new file mode 100644 index 000000000..4b88c994b --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockAreasEditor.cs @@ -0,0 +1,142 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Design; +using System.Windows.Forms; +using System.Windows.Forms.Design; + +namespace WeifenLuo.WinFormsUI.Docking +{ + internal class DockAreasEditor : UITypeEditor + { + private class DockAreasEditorControl : System.Windows.Forms.UserControl + { + private CheckBox checkBoxFloat; + private CheckBox checkBoxDockLeft; + private CheckBox checkBoxDockRight; + private CheckBox checkBoxDockTop; + private CheckBox checkBoxDockBottom; + private CheckBox checkBoxDockFill; + private DockAreas m_oldDockAreas; + + public DockAreas DockAreas + { + get + { + DockAreas dockAreas = 0; + if (checkBoxFloat.Checked) + dockAreas |= DockAreas.Float; + if (checkBoxDockLeft.Checked) + dockAreas |= DockAreas.DockLeft; + if (checkBoxDockRight.Checked) + dockAreas |= DockAreas.DockRight; + if (checkBoxDockTop.Checked) + dockAreas |= DockAreas.DockTop; + if (checkBoxDockBottom.Checked) + dockAreas |= DockAreas.DockBottom; + if (checkBoxDockFill.Checked) + dockAreas |= DockAreas.Document; + + if (dockAreas == 0) + return m_oldDockAreas; + else + return dockAreas; + } + } + + public DockAreasEditorControl() + { + checkBoxFloat = new CheckBox(); + checkBoxDockLeft = new CheckBox(); + checkBoxDockRight = new CheckBox(); + checkBoxDockTop = new CheckBox(); + checkBoxDockBottom = new CheckBox(); + checkBoxDockFill = new CheckBox(); + + SuspendLayout(); + + checkBoxFloat.Appearance = Appearance.Button; + checkBoxFloat.Dock = DockStyle.Top; + checkBoxFloat.Height = 24; + checkBoxFloat.Text = Strings.DockAreaEditor_FloatCheckBoxText; + checkBoxFloat.TextAlign = ContentAlignment.MiddleCenter; + checkBoxFloat.FlatStyle = FlatStyle.System; + + checkBoxDockLeft.Appearance = System.Windows.Forms.Appearance.Button; + checkBoxDockLeft.Dock = System.Windows.Forms.DockStyle.Left; + checkBoxDockLeft.Width = 24; + checkBoxDockLeft.FlatStyle = FlatStyle.System; + + checkBoxDockRight.Appearance = System.Windows.Forms.Appearance.Button; + checkBoxDockRight.Dock = System.Windows.Forms.DockStyle.Right; + checkBoxDockRight.Width = 24; + checkBoxDockRight.FlatStyle = FlatStyle.System; + + checkBoxDockTop.Appearance = System.Windows.Forms.Appearance.Button; + checkBoxDockTop.Dock = System.Windows.Forms.DockStyle.Top; + checkBoxDockTop.Height = 24; + checkBoxDockTop.FlatStyle = FlatStyle.System; + + checkBoxDockBottom.Appearance = System.Windows.Forms.Appearance.Button; + checkBoxDockBottom.Dock = System.Windows.Forms.DockStyle.Bottom; + checkBoxDockBottom.Height = 24; + checkBoxDockBottom.FlatStyle = FlatStyle.System; + + checkBoxDockFill.Appearance = System.Windows.Forms.Appearance.Button; + checkBoxDockFill.Dock = System.Windows.Forms.DockStyle.Fill; + checkBoxDockFill.FlatStyle = FlatStyle.System; + + this.Controls.AddRange(new Control[] { + checkBoxDockFill, + checkBoxDockBottom, + checkBoxDockTop, + checkBoxDockRight, + checkBoxDockLeft, + checkBoxFloat}); + + Size = new System.Drawing.Size(160, 144); + BackColor = SystemColors.Control; + ResumeLayout(); + } + + public void SetStates(DockAreas dockAreas) + { + m_oldDockAreas = dockAreas; + if ((dockAreas & DockAreas.DockLeft) != 0) + checkBoxDockLeft.Checked = true; + if ((dockAreas & DockAreas.DockRight) != 0) + checkBoxDockRight.Checked = true; + if ((dockAreas & DockAreas.DockTop) != 0) + checkBoxDockTop.Checked = true; + if ((dockAreas & DockAreas.DockTop) != 0) + checkBoxDockTop.Checked = true; + if ((dockAreas & DockAreas.DockBottom) != 0) + checkBoxDockBottom.Checked = true; + if ((dockAreas & DockAreas.Document) != 0) + checkBoxDockFill.Checked = true; + if ((dockAreas & DockAreas.Float) != 0) + checkBoxFloat.Checked = true; + } + } + + private DockAreasEditor.DockAreasEditorControl m_ui = null; + + public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) + { + return UITypeEditorEditStyle.DropDown; + } + + public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) + { + if (m_ui == null) + m_ui = new DockAreasEditor.DockAreasEditorControl(); + + m_ui.SetStates((DockAreas)value); + + IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); + edSvc.DropDownControl(m_ui); + + return m_ui.DockAreas; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockContent.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockContent.cs new file mode 100644 index 000000000..48c80b8ee --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockContent.cs @@ -0,0 +1,358 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class DockContent : Form, IDockContent + { + public DockContent() + { + m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString)); + m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged); + if (PatchController.EnableFontInheritanceFix != true) + { + //Suggested as a fix by bensty regarding form resize + this.ParentChanged += new EventHandler(DockContent_ParentChanged); + } + } + + //Suggested as a fix by bensty regarding form resize + private void DockContent_ParentChanged(object Sender, EventArgs e) + { + if (this.Parent != null) + this.Font = this.Parent.Font; + } + + private DockContentHandler m_dockHandler = null; + [Browsable(false)] + public DockContentHandler DockHandler + { + get { return m_dockHandler; } + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_AllowEndUserDocking_Description")] + [DefaultValue(true)] + public bool AllowEndUserDocking + { + get { return DockHandler.AllowEndUserDocking; } + set { DockHandler.AllowEndUserDocking = value; } + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_DockAreas_Description")] + [DefaultValue(DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.Document | DockAreas.Float)] + public DockAreas DockAreas + { + get { return DockHandler.DockAreas; } + set { DockHandler.DockAreas = value; } + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_AutoHidePortion_Description")] + [DefaultValue(0.25)] + public double AutoHidePortion + { + get { return DockHandler.AutoHidePortion; } + set { DockHandler.AutoHidePortion = value; } + } + + private string m_tabText = null; + [Localizable(true)] + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_TabText_Description")] + [DefaultValue(null)] + public string TabText + { + get { return m_tabText; } + set { DockHandler.TabText = m_tabText = value; } + } + + private bool ShouldSerializeTabText() + { + return (m_tabText != null); + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_CloseButton_Description")] + [DefaultValue(true)] + public bool CloseButton + { + get { return DockHandler.CloseButton; } + set { DockHandler.CloseButton = value; } + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_CloseButtonVisible_Description")] + [DefaultValue(true)] + public bool CloseButtonVisible + { + get { return DockHandler.CloseButtonVisible; } + set { DockHandler.CloseButtonVisible = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DockPanel DockPanel + { + get { return DockHandler.DockPanel; } + set { DockHandler.DockPanel = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DockState DockState + { + get { return DockHandler.DockState; } + set { DockHandler.DockState = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DockPane Pane + { + get { return DockHandler.Pane; } + set { DockHandler.Pane = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool IsHidden + { + get { return DockHandler.IsHidden; } + set { DockHandler.IsHidden = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DockState VisibleState + { + get { return DockHandler.VisibleState; } + set { DockHandler.VisibleState = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool IsFloat + { + get { return DockHandler.IsFloat; } + set { DockHandler.IsFloat = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DockPane PanelPane + { + get { return DockHandler.PanelPane; } + set { DockHandler.PanelPane = value; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public DockPane FloatPane + { + get { return DockHandler.FloatPane; } + set { DockHandler.FloatPane = value; } + } + + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] + protected virtual string GetPersistString() + { + return GetType().ToString(); + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_HideOnClose_Description")] + [DefaultValue(false)] + public bool HideOnClose + { + get { return DockHandler.HideOnClose; } + set { DockHandler.HideOnClose = value; } + } + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_ShowHint_Description")] + [DefaultValue(DockState.Unknown)] + public DockState ShowHint + { + get { return DockHandler.ShowHint; } + set { DockHandler.ShowHint = value; } + } + + [Browsable(false)] + public bool IsActivated + { + get { return DockHandler.IsActivated; } + } + + public bool IsDockStateValid(DockState dockState) + { + return DockHandler.IsDockStateValid(dockState); + } + +#if NET35 || NET40 + /// + /// Context menu. + /// + /// + /// This property should be obsolete as it does not support theming. Please use instead. + /// + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_TabPageContextMenu_Description")] + [DefaultValue(null)] + public ContextMenu TabPageContextMenu + { + get { return DockHandler.TabPageContextMenu; } + set { DockHandler.TabPageContextMenu = value; } + } +#endif + /// + /// Context menu strip. + /// + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockContent_TabPageContextMenuStrip_Description")] + [DefaultValue(null)] + public ContextMenuStrip TabPageContextMenuStrip + { + get { return DockHandler.TabPageContextMenuStrip; } + set { DockHandler.TabPageContextMenuStrip = value; } + } + + void IContextMenuStripHost.ApplyTheme() + { + DockHandler.ApplyTheme(); + + if (DockPanel != null) + { + if (MainMenuStrip != null) + DockPanel.Theme.ApplyTo(MainMenuStrip); + if (ContextMenuStrip != null) + DockPanel.Theme.ApplyTo(ContextMenuStrip); + } + } + + [Localizable(true)] + [Category("Appearance")] + [LocalizedDescription("DockContent_ToolTipText_Description")] + [DefaultValue(null)] + public string ToolTipText + { + get { return DockHandler.ToolTipText; } + set { DockHandler.ToolTipText = value; } + } + + public new void Activate() + { + DockHandler.Activate(); + } + + public new void Hide() + { + DockHandler.Hide(); + } + + public new void Show() + { + DockHandler.Show(); + } + + public void Show(DockPanel dockPanel) + { + DockHandler.Show(dockPanel); + } + + public void Show(DockPanel dockPanel, DockState dockState) + { + DockHandler.Show(dockPanel, dockState); + } + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")] + public void Show(DockPanel dockPanel, Rectangle floatWindowBounds) + { + DockHandler.Show(dockPanel, floatWindowBounds); + } + + public void Show(DockPane pane, IDockContent beforeContent) + { + DockHandler.Show(pane, beforeContent); + } + + public void Show(DockPane previousPane, DockAlignment alignment, double proportion) + { + DockHandler.Show(previousPane, alignment, proportion); + } + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")] + public void FloatAt(Rectangle floatWindowBounds) + { + DockHandler.FloatAt(floatWindowBounds); + } + + public void DockTo(DockPane paneTo, DockStyle dockStyle, int contentIndex) + { + DockHandler.DockTo(paneTo, dockStyle, contentIndex); + } + + public void DockTo(DockPanel panel, DockStyle dockStyle) + { + DockHandler.DockTo(panel, dockStyle); + } + + #region IDockContent Members + void IDockContent.OnActivated(EventArgs e) + { + this.OnActivated(e); + } + + void IDockContent.OnDeactivate(EventArgs e) + { + this.OnDeactivate(e); + } + #endregion + + #region Events + private void DockHandler_DockStateChanged(object sender, EventArgs e) + { + OnDockStateChanged(e); + } + + private static readonly object DockStateChangedEvent = new object(); + [LocalizedCategory("Category_PropertyChanged")] + [LocalizedDescription("Pane_DockStateChanged_Description")] + public event EventHandler DockStateChanged + { + add { Events.AddHandler(DockStateChangedEvent, value); } + remove { Events.RemoveHandler(DockStateChangedEvent, value); } + } + protected virtual void OnDockStateChanged(EventArgs e) + { + ((EventHandler)Events[DockStateChangedEvent])?.Invoke(this, e); + } + #endregion + + /// + /// Overridden to avoid resize issues with nested controls + /// + /// + /// http://blogs.msdn.com/b/alejacma/archive/2008/11/20/controls-won-t-get-resized-once-the-nesting-hierarchy-of-windows-exceeds-a-certain-depth-x64.aspx + /// http://support.microsoft.com/kb/953934 + /// + protected override void OnSizeChanged(EventArgs e) + { + if (DockPanel != null && DockPanel.SupportDeeplyNestedContent && IsHandleCreated) + { + BeginInvoke((MethodInvoker)delegate + { + base.OnSizeChanged(e); + }); + } + else + { + base.OnSizeChanged(e); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockContentCollection.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockContentCollection.cs new file mode 100644 index 000000000..d3fb50edf --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockContentCollection.cs @@ -0,0 +1,174 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class DockContentCollection : ReadOnlyCollection + { + private static List _emptyList = new List(0); + + internal DockContentCollection() + : base(new List()) + { + } + + internal DockContentCollection(DockPane pane) + : base(_emptyList) + { + m_dockPane = pane; + } + + private DockPane m_dockPane = null; + private DockPane DockPane + { + get { return m_dockPane; } + } + + public new IDockContent this[int index] + { + get + { + if (DockPane == null) + return Items[index] as IDockContent; + else + return GetVisibleContent(index); + } + } + + internal int Add(IDockContent content) + { +#if DEBUG + if (DockPane != null) + throw new InvalidOperationException(); +#endif + + if (Contains(content)) + return IndexOf(content); + + Items.Add(content); + return Count - 1; + } + + internal void AddAt(IDockContent content, int index) + { +#if DEBUG + if (DockPane != null) + throw new InvalidOperationException(); +#endif + + if (index < 0 || index > Items.Count - 1) + return; + + if (Contains(content)) + return; + + Items.Insert(index, content); + } + + public new bool Contains(IDockContent content) + { + if (DockPane == null) + return Items.Contains(content); + else + return (GetIndexOfVisibleContents(content) != -1); + } + + public new int Count + { + get + { + if (DockPane == null) + return base.Count; + else + return CountOfVisibleContents; + } + } + + public new int IndexOf(IDockContent content) + { + if (DockPane == null) + { + if (!Contains(content)) + return -1; + else + return Items.IndexOf(content); + } + else + return GetIndexOfVisibleContents(content); + } + + internal void Remove(IDockContent content) + { + if (DockPane != null) + throw new InvalidOperationException(); + + if (!Contains(content)) + return; + + Items.Remove(content); + } + + private int CountOfVisibleContents + { + get + { +#if DEBUG + if (DockPane == null) + throw new InvalidOperationException(); +#endif + + int count = 0; + foreach (IDockContent content in DockPane.Contents) + { + if (content.DockHandler.DockState == DockPane.DockState) + count++; + } + return count; + } + } + + private IDockContent GetVisibleContent(int index) + { +#if DEBUG + if (DockPane == null) + throw new InvalidOperationException(); +#endif + + int currentIndex = -1; + foreach (IDockContent content in DockPane.Contents) + { + if (content.DockHandler.DockState == DockPane.DockState) + currentIndex++; + + if (currentIndex == index) + return content; + } + throw (new ArgumentOutOfRangeException()); + } + + private int GetIndexOfVisibleContents(IDockContent content) + { +#if DEBUG + if (DockPane == null) + throw new InvalidOperationException(); +#endif + + if (content == null) + return -1; + + int index = -1; + foreach (IDockContent c in DockPane.Contents) + { + if (c.DockHandler.DockState == DockPane.DockState) + { + index++; + + if (c == content) + return index; + } + } + return -1; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockContentEventArgs.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockContentEventArgs.cs new file mode 100644 index 000000000..9650b3fb6 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockContentEventArgs.cs @@ -0,0 +1,19 @@ +using System; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class DockContentEventArgs : EventArgs + { + private IDockContent m_content; + + public DockContentEventArgs(IDockContent content) + { + m_content = content; + } + + public IDockContent Content + { + get { return m_content; } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockContentHandler.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockContentHandler.cs new file mode 100644 index 000000000..04b0677b6 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockContentHandler.cs @@ -0,0 +1,1260 @@ +using System; +using System.Windows.Forms; +using System.Drawing; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public delegate string GetPersistStringCallback(); + + public class DockContentHandler : IDisposable, IDockDragSource + { + public DockContentHandler(Form form) : this(form, null) + { + } + + public DockContentHandler(Form form, GetPersistStringCallback getPersistStringCallback) + { + if (!(form is IDockContent)) + throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, nameof(form)); + + m_form = form; + GetPersistStringCallback = getPersistStringCallback; + + Events = new EventHandlerList(); + Form.Disposed += new EventHandler(Form_Disposed); + Form.TextChanged += new EventHandler(Form_TextChanged); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + DockPanel = null; + if (m_autoHideTab != null) + m_autoHideTab.Dispose(); + if (m_tab != null) + m_tab.Dispose(); + + Form.Disposed -= new EventHandler(Form_Disposed); + Form.TextChanged -= new EventHandler(Form_TextChanged); + Events.Dispose(); + } + } + + private Form m_form; + public Form Form + { + get { return m_form; } + } + + public IDockContent Content + { + get { return Form as IDockContent; } + } + + public IDockContent PreviousActive { get; internal set; } + + public IDockContent NextActive { get; internal set; } + + private EventHandlerList Events { get; } + + public bool AllowEndUserDocking { get; set; } = true; + + internal bool SuspendAutoHidePortionUpdates { get; set; } = false; + + private double m_autoHidePortion = 0.25; + public double AutoHidePortion + { + get + { + return m_autoHidePortion; + } + + set + { + if (value <= 0) + throw (new ArgumentOutOfRangeException(Strings.DockContentHandler_AutoHidePortion_OutOfRange)); + + if (SuspendAutoHidePortionUpdates) + return; + + if (Math.Abs(m_autoHidePortion - value) < double.Epsilon) + return; + + m_autoHidePortion = value; + + if (DockPanel == null) + return; + + if (DockPanel.ActiveAutoHideContent == Content) + DockPanel.PerformLayout(); + } + } + + private bool m_closeButton = true; + public bool CloseButton + { + get + { + return m_closeButton; + } + + set + { + if (m_closeButton == value) + return; + + m_closeButton = value; + if (IsActiveContentHandler) + Pane.RefreshChanges(); + } + } + + private bool m_closeButtonVisible = true; + /// + /// Determines whether the close button is visible on the content + /// + public bool CloseButtonVisible + { + get + { + return m_closeButtonVisible; + } + + set + { + if (m_closeButtonVisible == value) + return; + + m_closeButtonVisible = value; + if (IsActiveContentHandler) + Pane.RefreshChanges(); + } + } + + private bool IsActiveContentHandler + { + get { return Pane != null && Pane.ActiveContent != null && Pane.ActiveContent.DockHandler == this; } + } + + private DockState DefaultDockState + { + get + { + if (ShowHint != DockState.Unknown && ShowHint != DockState.Hidden) + return ShowHint; + + if ((DockAreas & DockAreas.Document) != 0) + return DockState.Document; + if ((DockAreas & DockAreas.DockRight) != 0) + return DockState.DockRight; + if ((DockAreas & DockAreas.DockLeft) != 0) + return DockState.DockLeft; + if ((DockAreas & DockAreas.DockBottom) != 0) + return DockState.DockBottom; + if ((DockAreas & DockAreas.DockTop) != 0) + return DockState.DockTop; + + return DockState.Unknown; + } + } + + private DockState DefaultShowState + { + get + { + if (ShowHint != DockState.Unknown) + return ShowHint; + + if ((DockAreas & DockAreas.Document) != 0) + return DockState.Document; + if ((DockAreas & DockAreas.DockRight) != 0) + return DockState.DockRight; + if ((DockAreas & DockAreas.DockLeft) != 0) + return DockState.DockLeft; + if ((DockAreas & DockAreas.DockBottom) != 0) + return DockState.DockBottom; + if ((DockAreas & DockAreas.DockTop) != 0) + return DockState.DockTop; + if ((DockAreas & 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; + public DockAreas DockAreas + { + get { return m_allowedAreas; } + set + { + if (m_allowedAreas == value) + return; + + if (!DockHelper.IsDockStateValid(DockState, value)) + throw (new InvalidOperationException(Strings.DockContentHandler_DockAreas_InvalidValue)); + + m_allowedAreas = value; + + if (!DockHelper.IsDockStateValid(ShowHint, m_allowedAreas)) + ShowHint = DockState.Unknown; + } + } + + private DockState m_dockState = DockState.Unknown; + public DockState DockState + { + get + { + return m_dockState; + } + + set + { + if (m_dockState == value) + return; + + DockPanel.SuspendLayout(true); + + if (value == DockState.Hidden) + IsHidden = true; + else + SetDockState(false, value, Pane); + + DockPanel.ResumeLayout(true, true); + } + } + + private DockPanel m_dockPanel = null; + 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_tab != null) + { + m_tab.Dispose(); + m_tab = 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; + Form.WindowState = FormWindowState.Normal; + Content.ApplyTheme(); + if (Win32Helper.IsRunningOnMono) + return; + + NativeMethods.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); + } + } + } + + public Icon Icon + { + get { return Form.Icon; } + } + + public DockPane Pane + { + get + { + return IsFloat ? FloatPane : PanelPane; + } + + set + { + if (Pane == value) + return; + + DockPanel.SuspendLayout(true); + + 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); + + DockPanel.ResumeLayout(true, true); + } + } + + private bool m_isHidden = true; + public bool IsHidden + { + get + { + return m_isHidden; + } + + set + { + if (m_isHidden == value) + return; + + SetDockState(value, VisibleState, Pane); + } + } + + private string m_tabText = null; + public string TabText + { + get + { + return m_tabText == null || m_tabText == "" ? Form.Text : m_tabText; + } + + set + { + if (m_tabText == value) + return; + + m_tabText = value; + if (Pane != null) + Pane.RefreshChanges(); + } + } + + private DockState m_visibleState = DockState.Unknown; + public DockState VisibleState + { + get + { + return m_visibleState; + } + + set + { + if (m_visibleState == value) + return; + + SetDockState(IsHidden, value, Pane); + } + } + + private bool m_isFloat = false; + public bool IsFloat + { + get + { + return m_isFloat; + } + + set + { + if (m_isFloat == value) + return; + + DockState visibleState = CheckDockState(value); + + if (visibleState == DockState.Unknown) + throw new InvalidOperationException(Strings.DockContentHandler_IsFloat_InvalidValue); + + SetDockState(IsHidden, visibleState, Pane); + if (PatchController.EnableFloatSplitterFix == true) + { + if (PanelPane != null && PanelPane.IsHidden) + { + PanelPane.NestedDockingStatus.NestedPanes.SwitchPaneWithFirstChild(PanelPane); + } + } + } + } + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")] + public DockState CheckDockState(bool isFloat) + { + DockState dockState; + + if (isFloat) + { + if (!IsDockStateValid(DockState.Float)) + dockState = DockState.Unknown; + else + dockState = DockState.Float; + } + else + { + dockState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState; + if (dockState != DockState.Unknown && !IsDockStateValid(dockState)) + dockState = DockState.Unknown; + } + + return dockState; + } + + private DockPane m_panelPane = null; + 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(Strings.DockContentHandler_DockPane_InvalidValue); + } + + DockPane oldPane = Pane; + + if (m_panelPane != null) + RemoveFromPane(m_panelPane); + 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 void RemoveFromPane(DockPane pane) + { + pane.RemoveContent(Content); + SetPane(null); + if (pane.Contents.Count == 0) + pane.Dispose(); + } + + private DockPane m_floatPane = null; + 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(Strings.DockContentHandler_FloatPane_InvalidValue); + } + + DockPane oldPane = Pane; + + if (m_floatPane != null) + RemoveFromPane(m_floatPane); + 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(Strings.DockContentHandler_SetDockState_NullPanel); + + if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState))) + throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState); + + DockPanel dockPanel = DockPanel; + if (dockPanel != null) + dockPanel.SuspendLayout(true); + + SuspendSetDockState(); + + DockState oldDockState = DockState; + + if (m_isHidden != isHidden || oldDockState == DockState.Unknown) + { + m_isHidden = isHidden; + } + m_visibleState = visibleState; + m_dockState = isHidden ? DockState.Hidden : visibleState; + + //Remove hidden content (shown content is added last so removal is done first to invert the operation) + bool hidingContent = (DockState == DockState.Hidden) || (DockState == DockState.Unknown) || DockHelper.IsDockStateAutoHide(DockState); + if (PatchController.EnableContentOrderFix == true && oldDockState != DockState) + { + if (hidingContent) + { + if (!Win32Helper.IsRunningOnMono) + DockPanel.ContentFocusManager.RemoveFromList(Content); + } + } + + if (visibleState == DockState.Unknown) + Pane = null; + else + { + m_isFloat = (m_visibleState == DockState.Float); + + if (Pane == null) + Pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, visibleState, true); + else if (Pane.DockState != visibleState) + { + if (Pane.Contents.Count == 1) + Pane.SetDockState(visibleState); + else + Pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, visibleState, true); + } + } + + if (Form.ContainsFocus) + { + if (DockState == DockState.Hidden || DockState == DockState.Unknown) + { + if (!Win32Helper.IsRunningOnMono) + { + DockPanel.ContentFocusManager.GiveUpFocus(Content); + } + } + } + + SetPaneAndVisible(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)) + { + // Avoid early refresh of hidden AutoHide panes + if ((Pane.DockWindow == null || Pane.DockWindow.Visible || Pane.IsHidden) && !Pane.IsAutoHide) + { + RefreshDockPane(Pane); + } + } + } + + if (oldDockState != DockState) + { + if (PatchController.EnableContentOrderFix == true) + { + //Add content that is being shown + if (!hidingContent) + { + if (!Win32Helper.IsRunningOnMono) + DockPanel.ContentFocusManager.AddToList(Content); + } + } + else + { + if (DockState == DockState.Hidden || DockState == DockState.Unknown || + DockHelper.IsDockStateAutoHide(DockState)) + { + if (!Win32Helper.IsRunningOnMono) + { + DockPanel.ContentFocusManager.RemoveFromList(Content); + } + } + else if (!Win32Helper.IsRunningOnMono) + { + DockPanel.ContentFocusManager.AddToList(Content); + } + } + + ResetAutoHidePortion(oldDockState, DockState); + OnDockStateChanged(EventArgs.Empty); + } + + ResumeSetDockState(); + + if (dockPanel != null) + dockPanel.ResumeLayout(true, true); + } + + private void ResetAutoHidePortion(DockState oldState, DockState newState) + { + if (oldState == newState || DockHelper.ToggleAutoHideState(oldState) == newState) + return; + + switch (newState) + { + case DockState.DockTop: + case DockState.DockTopAutoHide: + AutoHidePortion = DockPanel.DockTopPortion; + break; + case DockState.DockLeft: + case DockState.DockLeftAutoHide: + AutoHidePortion = DockPanel.DockLeftPortion; + break; + case DockState.DockBottom: + case DockState.DockBottomAutoHide: + AutoHidePortion = DockPanel.DockBottomPortion; + break; + case DockState.DockRight: + case DockState.DockRightAutoHide: + AutoHidePortion = DockPanel.DockRightPortion; + break; + } + } + + private static void RefreshDockPane(DockPane pane) + { + pane.RefreshChanges(); + pane.ValidateActiveContent(); + } + + internal string PersistString + { + get { return GetPersistStringCallback == null ? Form.GetType().ToString() : GetPersistStringCallback(); } + } + + public GetPersistStringCallback GetPersistStringCallback { get; set; } + + public bool HideOnClose { get; set; } + + private DockState m_showHint = DockState.Unknown; + public DockState ShowHint + { + get + { + return m_showHint; + } + + set + { + if (!DockHelper.IsDockStateValid(value, DockAreas)) + throw (new InvalidOperationException(Strings.DockContentHandler_ShowHint_InvalidValue)); + + if (m_showHint == value) + return; + + m_showHint = value; + } + } + + private bool m_isActivated; + public bool IsActivated + { + get + { + return m_isActivated; + } + + internal set + { + if (m_isActivated == value) + return; + + m_isActivated = value; + } + } + + public bool IsDockStateValid(DockState dockState) + { + if (DockPanel != null && dockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.SystemMdi) + return false; + else + return DockHelper.IsDockStateValid(dockState, DockAreas); + } +#if NET35 || NET40 + public ContextMenu TabPageContextMenu { get; set; } +#endif + public string ToolTipText { get; set; } + + 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 == DocumentStyle.SystemMdi) + { + Form.Activate(); + return; + } + else if (DockHelper.IsDockStateAutoHide(DockState)) + { + if (DockPanel.ActiveAutoHideContent != Content) + { + DockPanel.ActiveAutoHideContent = null; + return; + } + } + + if (Form.ContainsFocus) + return; + + if (Win32Helper.IsRunningOnMono) + return; + + DockPanel.ContentFocusManager.Activate(Content); + } + } + + public void GiveUpFocus() + { + if (!Win32Helper.IsRunningOnMono) + DockPanel.ContentFocusManager.GiveUpFocus(Content); + } + + private IntPtr m_activeWindowHandle = IntPtr.Zero; + internal IntPtr ActiveWindowHandle + { + get { return m_activeWindowHandle; } + set { m_activeWindowHandle = value; } + } + + public void Hide() + { + IsHidden = true; + } + + internal void SetPaneAndVisible(DockPane pane) + { + SetPane(pane); + SetVisible(); + } + + private void SetPane(DockPane pane) + { + if (pane != null && pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.DockingMdi) + { + if (Form.Parent is DockPane) + SetParent(null); + if (Form.MdiParent != DockPanel.ParentForm) + { + FlagClipWindow = true; + + // The content form should inherit the font of the dock panel, not the font of + // the dock panel's parent form. However, the content form's font value should + // not be overwritten if it has been explicitly set to a non-default value. + if (PatchController.EnableFontInheritanceFix == true && Form.Font == Control.DefaultFont) + { + Form.MdiParent = DockPanel.ParentForm; + Form.Font = DockPanel.Font; + } + else + { + 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 == DocumentStyle.DockingMdi) + visible = true; + else if (Pane != null && Pane.ActiveContent == Content) + visible = true; + else if (Pane != null && Pane.ActiveContent != Content) + visible = false; + else + visible = Form.Visible; + + if (Form.Visible != visible) + Form.Visible = visible; + } + + private void SetParent(Control value) + { + if (Form.Parent == value) + return; + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // Workaround of .Net Framework bug: + // Change the parent of a control with focus may result in the first + // MDI child form get activated. + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + bool bRestoreFocus = false; + if (Form.ContainsFocus) + { + // Suggested as a fix for a memory leak by bugreports + if (value == null && !IsFloat) + { + if (!Win32Helper.IsRunningOnMono) + { + DockPanel.ContentFocusManager.GiveUpFocus(this.Content); + } + } + else + { + DockPanel.SaveFocus(); + bRestoreFocus = true; + } + } + + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + var parentChanged = value != Form.Parent; + Form.Parent = value; + if (PatchController.EnableMainWindowFocusLostFix == true && parentChanged) + { + Form.Focus(); + } + + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // Workaround of .Net Framework bug: + // Change the parent of a control with focus may result in the first + // MDI child form get activated. + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if (bRestoreFocus && !Win32Helper.IsRunningOnMono) + Activate(); + + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + } + + public void Show() + { + if (DockPanel == null) + Form.Show(); + else + Show(DockPanel); + } + + public void Show(DockPanel dockPanel) + { + if (dockPanel == null) + throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel)); + + if (DockState == DockState.Unknown) + Show(dockPanel, DefaultShowState); + else if (DockPanel != dockPanel) + Show(dockPanel, DockState == DockState.Hidden ? m_visibleState : DockState); + else + Activate(); + } + + public void Show(DockPanel dockPanel, DockState dockState) + { + if (dockPanel == null) + throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel)); + + if (dockState == DockState.Unknown || dockState == DockState.Hidden) + throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState)); + + if (dockPanel.Theme.GetType() == typeof(DefaultTheme)) + throw new ArgumentException(Strings.Theme_NoTheme); + + dockPanel.SuspendLayout(true); + + DockPanel = dockPanel; + + if (dockState == DockState.Float) + { + if (FloatPane == null) + Pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.Float, true); + } + else if (PanelPane == null) + { + DockPane paneExisting = null; + foreach (DockPane pane in DockPanel.Panes) + if (pane.DockState == dockState) + { + if (paneExisting == null || pane.IsActivated) + paneExisting = pane; + + if (pane.IsActivated) + break; + } + + if (paneExisting == null) + Pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, dockState, true); + else + Pane = paneExisting; + } + + DockState = dockState; + dockPanel.ResumeLayout(true, true); //we'll resume the layout before activating to ensure that the position + Activate(); //and size of the form are finally processed before the form is shown + } + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")] + public void Show(DockPanel dockPanel, Rectangle floatWindowBounds) + { + if (dockPanel == null) + throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel)); + + dockPanel.SuspendLayout(true); + + DockPanel = dockPanel; + if (FloatPane == null) + { + IsHidden = true; // to reduce the screen flicker + FloatPane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.Float, false); + FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual; + } + + FloatPane.FloatWindow.Bounds = floatWindowBounds; + + Show(dockPanel, DockState.Float); + Activate(); + + dockPanel.ResumeLayout(true, true); + } + + public void Show(DockPane pane, IDockContent beforeContent) + { + if (pane == null) + throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullPane)); + + if (beforeContent != null && pane.Contents.IndexOf(beforeContent) == -1) + throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidBeforeContent)); + + pane.DockPanel.SuspendLayout(true); + + DockPanel = pane.DockPanel; + Pane = pane; + pane.SetContentIndex(Content, pane.Contents.IndexOf(beforeContent)); + Show(); + + pane.DockPanel.ResumeLayout(true, true); + } + + public void Show(DockPane previousPane, DockAlignment alignment, double proportion) + { + if (previousPane == null) + throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidPrevPane)); + + if (DockHelper.IsDockStateAutoHide(previousPane.DockState)) + throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidPrevPane)); + + previousPane.DockPanel.SuspendLayout(true); + + DockPanel = previousPane.DockPanel; + DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, previousPane, alignment, proportion, true); + Show(); + + previousPane.DockPanel.ResumeLayout(true, true); + } + + public void Close() + { + DockPanel dockPanel = DockPanel; + if (dockPanel != null) + dockPanel.SuspendLayout(true); + Form.Close(); + if (dockPanel != null) + dockPanel.ResumeLayout(true, true); + } + + private DockPaneStripBase.Tab m_tab = null; + internal DockPaneStripBase.Tab GetTab(DockPaneStripBase dockPaneStrip) + { + if (m_tab == null) + m_tab = dockPaneStrip.CreateTab(Content); + + return m_tab; + } + + private IDisposable m_autoHideTab = null; + internal IDisposable AutoHideTab + { + get { return m_autoHideTab; } + set { m_autoHideTab = value; } + } + + #region Events + private static readonly object DockStateChangedEvent = new object(); + public event EventHandler DockStateChanged + { + add { Events.AddHandler(DockStateChangedEvent, value); } + remove { Events.RemoveHandler(DockStateChangedEvent, value); } + } + 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; + } + } + + private ContextMenuStrip m_tabPageContextMenuStrip; + + public ContextMenuStrip TabPageContextMenuStrip + { + get + { + return m_tabPageContextMenuStrip; + } + + set + { + if (value == m_tabPageContextMenuStrip) + return; + + m_tabPageContextMenuStrip = value; + ApplyTheme(); + } + } + + internal void ApplyTheme() + { + if (m_tabPageContextMenuStrip != null && DockPanel != null) + DockPanel.Theme.ApplyTo(m_tabPageContextMenuStrip); + } + + #region IDockDragSource Members + + Control IDragSource.DragControl + { + get { return Form; } + } + + bool IDockDragSource.CanDockTo(DockPane pane) + { + if (!IsDockStateValid(pane.DockState)) + return false; + + if (Pane == pane && pane.DisplayingContents.Count == 1) + return false; + + return true; + } + + Rectangle IDockDragSource.BeginDrag(Point ptMouse) + { + Size size; + DockPane floatPane = this.FloatPane; + if (DockState == DockState.Float || floatPane == null || floatPane.FloatWindow.NestedPanes.Count != 1) + size = DockPanel.DefaultFloatWindowSize; + else + size = floatPane.FloatWindow.Size; + + Point location; + Rectangle rectPane = Pane.ClientRectangle; + if (DockState == DockState.Document) + { + if (Pane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + location = new Point(rectPane.Left, rectPane.Bottom - size.Height); + else + location = new Point(rectPane.Left, rectPane.Top); + } + else + { + location = new Point(rectPane.Left, rectPane.Bottom); + location.Y -= size.Height; + } + location = Pane.PointToScreen(location); + + if (ptMouse.X > location.X + size.Width) + location.X += ptMouse.X - (location.X + size.Width) + DockPanel.Theme.Measures.SplitterSize; + + return new Rectangle(location, size); + } + + void IDockDragSource.EndDrag() + { + } + + public void FloatAt(Rectangle floatWindowBounds) + { + // TODO: where is the pane used? + DockPane pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, floatWindowBounds, true); + } + + public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex) + { + if (dockStyle == DockStyle.Fill) + { + bool samePane = (Pane == pane); + if (!samePane) + Pane = pane; + + int visiblePanes = 0; + int convertedIndex = 0; + while (visiblePanes <= contentIndex && convertedIndex < Pane.Contents.Count) + { + DockContent window = Pane.Contents[convertedIndex] as DockContent; + if (window != null && !window.IsHidden) + ++visiblePanes; + + ++convertedIndex; + } + + contentIndex = Math.Min(Math.Max(0, convertedIndex - 1), Pane.Contents.Count - 1); + + if (contentIndex == -1 || !samePane) + pane.SetContentIndex(Content, contentIndex); + else + { + DockContentCollection contents = pane.Contents; + int oldIndex = contents.IndexOf(Content); + int newIndex = contentIndex; + if (oldIndex < newIndex) + { + newIndex += 1; + if (newIndex > contents.Count - 1) + newIndex = -1; + } + pane.SetContentIndex(Content, newIndex); + } + } + else + { + DockPane paneFrom = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, pane.DockState, true); + INestedPanesContainer container = pane.NestedPanesContainer; + if (dockStyle == DockStyle.Left) + paneFrom.DockTo(container, pane, DockAlignment.Left, 0.5); + else if (dockStyle == DockStyle.Right) + paneFrom.DockTo(container, pane, DockAlignment.Right, 0.5); + else if (dockStyle == DockStyle.Top) + paneFrom.DockTo(container, pane, DockAlignment.Top, 0.5); + else if (dockStyle == DockStyle.Bottom) + paneFrom.DockTo(container, pane, DockAlignment.Bottom, 0.5); + + paneFrom.DockState = pane.DockState; + } + + if(PatchController.EnableActivateOnDockFix == true) + Pane.ActiveContent = Content; + } + + public void DockTo(DockPanel panel, DockStyle dockStyle) + { + if (panel != DockPanel) + throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, nameof(panel)); + + DockPane pane; + + if (dockStyle == DockStyle.Top) + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.DockTop, true); + else if (dockStyle == DockStyle.Bottom) + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.DockBottom, true); + else if (dockStyle == DockStyle.Left) + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.DockLeft, true); + else if (dockStyle == DockStyle.Right) + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.DockRight, true); + else if (dockStyle == DockStyle.Fill) + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(Content, DockState.Document, true); + else + return; + } + + #endregion + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockOutlineBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockOutlineBase.cs new file mode 100644 index 000000000..b8f11b83e --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockOutlineBase.cs @@ -0,0 +1,160 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public 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; } + } + + public bool FlagFullEdge + { + get { return m_contentIndex != 0; } + } + + 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(); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPane.SplitterControl.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPane.SplitterControl.cs new file mode 100644 index 000000000..3ec42a20d --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPane.SplitterControl.cs @@ -0,0 +1,141 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPane + { + [ToolboxItem(false)] + public class SplitterControlBase : Control, ISplitterDragSource + { + DockPane m_pane; + + public SplitterControlBase(DockPane pane) + { + SetStyle(ControlStyles.Selectable, false); + m_pane = pane; + } + + public DockPane DockPane + { + get { return m_pane; } + } + + private DockAlignment m_alignment; + public DockAlignment Alignment + { + get { return m_alignment; } + set + { + m_alignment = value; + if (m_alignment == DockAlignment.Left || m_alignment == DockAlignment.Right) + Cursor = Cursors.VSplit; + else if (m_alignment == DockAlignment.Top || m_alignment == DockAlignment.Bottom) + Cursor = Cursors.HSplit; + else + Cursor = Cursors.Default; + + if (DockPane.DockState == DockState.Document) + Invalidate(); + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (e.Button != MouseButtons.Left) + return; + + DockPane.DockPanel.BeginDrag(this, Parent.RectangleToScreen(Bounds)); + } + + #region ISplitterDragSource Members + + void ISplitterDragSource.BeginDrag(Rectangle rectSplitter) + { + } + + void ISplitterDragSource.EndDrag() + { + } + + bool ISplitterDragSource.IsVertical + { + get + { + NestedDockingStatus status = DockPane.NestedDockingStatus; + return (status.DisplayingAlignment == DockAlignment.Left || + status.DisplayingAlignment == DockAlignment.Right); + } + } + + Rectangle ISplitterDragSource.DragLimitBounds + { + get + { + NestedDockingStatus status = DockPane.NestedDockingStatus; + Rectangle rectLimit = Parent.RectangleToScreen(status.LogicalBounds); + if (((ISplitterDragSource)this).IsVertical) + { + rectLimit.X += MeasurePane.MinSize; + rectLimit.Width -= 2 * MeasurePane.MinSize; + } + else + { + rectLimit.Y += MeasurePane.MinSize; + rectLimit.Height -= 2 * MeasurePane.MinSize; + } + + return rectLimit; + } + } + + void ISplitterDragSource.MoveSplitter(int offset) + { + NestedDockingStatus status = DockPane.NestedDockingStatus; + double proportion = status.Proportion; + if (status.LogicalBounds.Width <= 0 || status.LogicalBounds.Height <= 0) + return; + else if (status.DisplayingAlignment == DockAlignment.Left) + proportion += ((double)offset) / (double)status.LogicalBounds.Width; + else if (status.DisplayingAlignment == DockAlignment.Right) + proportion -= ((double)offset) / (double)status.LogicalBounds.Width; + else if (status.DisplayingAlignment == DockAlignment.Top) + proportion += ((double)offset) / (double)status.LogicalBounds.Height; + else + proportion -= ((double)offset) / (double)status.LogicalBounds.Height; + + DockPane.SetNestedDockingProportion(proportion); + } + + #region IDragSource Members + + Control IDragSource.DragControl + { + get { return this; } + } + + #endregion + + #endregion + } + + private SplitterControlBase m_splitter; + private SplitterControlBase Splitter + { + get { return m_splitter; } + } + + internal Rectangle SplitterBounds + { + set { Splitter.Bounds = value; } + } + + internal DockAlignment SplitterAlignment + { + set { Splitter.Alignment = value; } + } + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPane.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPane.cs new file mode 100644 index 000000000..bac66eaf2 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPane.cs @@ -0,0 +1,1371 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using System.Security.Permissions; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ToolboxItem(false)] + public partial class DockPane : UserControl, IDockDragSource + { + public enum AppearanceStyle + { + ToolWindow, + Document + } + + private enum HitTestArea + { + Caption, + TabStrip, + Content, + None + } + + private struct HitTestResult + { + public HitTestArea HitArea; + public int Index; + + public HitTestResult(HitTestArea hitTestArea, int index) + { + HitArea = hitTestArea; + Index = index; + } + } + + private DockPaneCaptionBase m_captionControl; + private DockPaneCaptionBase CaptionControl + { + get { return m_captionControl; } + } + + private DockPaneStripBase m_tabStripControl; + + public DockPaneStripBase TabStripControl + { + get { return m_tabStripControl; } + } + + internal protected DockPane(IDockContent content, DockState visibleState, bool show) + { + InternalConstruct(content, visibleState, false, Rectangle.Empty, null, DockAlignment.Right, 0.5, show); + } + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")] + internal protected DockPane(IDockContent content, FloatWindow floatWindow, bool show) + { + if (floatWindow == null) + throw new ArgumentNullException(nameof(floatWindow)); + + InternalConstruct(content, DockState.Float, false, Rectangle.Empty, floatWindow.NestedPanes.GetDefaultPreviousPane(this), DockAlignment.Right, 0.5, show); + } + + internal protected DockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show) + { + if (previousPane == null) + throw (new ArgumentNullException(nameof(previousPane))); + InternalConstruct(content, previousPane.DockState, false, Rectangle.Empty, previousPane, alignment, proportion, show); + } + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")] + internal protected DockPane(IDockContent content, Rectangle floatWindowBounds, bool show) + { + InternalConstruct(content, DockState.Float, true, floatWindowBounds, null, DockAlignment.Right, 0.5, 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(Strings.DockPane_SetDockState_InvalidState); + + if (content == null) + throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent); + + if (content.DockHandler.DockPanel == null) + throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel); + + SuspendLayout(); + SetStyle(ControlStyles.Selectable, false); + + m_isFloat = (dockState == DockState.Float); + + m_contents = new DockContentCollection(); + m_displayingContents = new DockContentCollection(this); + m_dockPanel = content.DockHandler.DockPanel; + m_dockPanel.AddPane(this); + + m_splitter = content.DockHandler.DockPanel.Theme.Extender.DockPaneSplitterControlFactory.CreateSplitterControl(this); + + m_nestedDockingStatus = new NestedDockingStatus(this); + + m_captionControl = DockPanel.Theme.Extender.DockPaneCaptionFactory.CreateDockPaneCaption(this); + m_tabStripControl = DockPanel.Theme.Extender.DockPaneStripFactory.CreateDockPaneStrip(this); + Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl }); + + DockPanel.SuspendLayout(true); + if (flagBounds) + FloatWindow = DockPanel.Theme.Extender.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds); + else if (prevPane != null) + DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion); + + SetDockState(dockState); + if (show) + content.DockHandler.Pane = this; + else if (this.IsFloat) + content.DockHandler.FloatPane = this; + else + content.DockHandler.PanelPane = this; + + ResumeLayout(); + DockPanel.ResumeLayout(true, true); + } + + private bool m_isDisposing; + + protected override void Dispose(bool disposing) + { + if (disposing) + { + // IMPORTANT: avoid nested call into this method on Mono. + // https://github.com/dockpanelsuite/dockpanelsuite/issues/16 + if (Win32Helper.IsRunningOnMono) + { + if (m_isDisposing) + return; + + m_isDisposing = true; + } + + m_dockState = DockState.Unknown; + + if (NestedPanesContainer != null) + NestedPanesContainer.NestedPanes.Remove(this); + + if (DockPanel != null) + { + DockPanel.RemovePane(this); + m_dockPanel = null; + } + + Splitter.Dispose(); + if (m_autoHidePane != null) + m_autoHidePane.Dispose(); + } + base.Dispose(disposing); + } + + private IDockContent m_activeContent = null; + public virtual IDockContent ActiveContent + { + get { return m_activeContent; } + set + { + if (ActiveContent == value) + return; + + if (value != null) + { + if (!DisplayingContents.Contains(value)) + throw (new InvalidOperationException(Strings.DockPane_ActiveContent_InvalidValue)); + } + else + { + if (DisplayingContents.Count != 0) + throw (new InvalidOperationException(Strings.DockPane_ActiveContent_InvalidValue)); + } + + IDockContent oldValue = m_activeContent; + + if (DockPanel.ActiveAutoHideContent == oldValue) + DockPanel.ActiveAutoHideContent = null; + + m_activeContent = value; + + if (DockPanel.DocumentStyle == DocumentStyle.DockingMdi && DockState == DockState.Document) + { + 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 (IsActivated && m_activeContent != null) + m_activeContent.DockHandler.Activate(); + } + + if (FloatWindow != null) + FloatWindow.SetText(); + + if (DockPanel.DocumentStyle == DocumentStyle.DockingMdi && + DockState == DockState.Document) + RefreshChanges(false); // delayed layout to reduce screen flicker + else + RefreshChanges(); + + if (m_activeContent != null) + TabStripControl.EnsureTabVisible(m_activeContent); + } + } + + internal void ClearLastActiveContent() + { + m_activeContent = null; + } + + private bool m_allowDockDragAndDrop = true; + public virtual bool AllowDockDragAndDrop + { + get { return m_allowDockDragAndDrop; } + set { m_allowDockDragAndDrop = value; } + } + + private IDisposable m_autoHidePane = null; + internal IDisposable AutoHidePane + { + get { return m_autoHidePane; } + set { m_autoHidePane = value; } + } + + private object m_autoHideTabs = null; + internal object AutoHideTabs + { + get { return m_autoHideTabs; } + set { m_autoHideTabs = value; } + } + + private object TabPageContextMenu + { + get + { + IDockContent content = ActiveContent; + + if (content == null) + return null; + + if (content.DockHandler.TabPageContextMenuStrip != null) + return content.DockHandler.TabPageContextMenuStrip; +#if NET35 || NET40 + else if (content.DockHandler.TabPageContextMenu != null) + return content.DockHandler.TabPageContextMenu; +#endif + else + return null; + } + } + + internal bool HasTabPageContextMenu + { + get { return TabPageContextMenu != null; } + } + + internal void ShowTabPageContextMenu(Control control, Point position) + { + object menu = TabPageContextMenu; + + if (menu == null) + return; + + ContextMenuStrip contextMenuStrip = menu as ContextMenuStrip; + if (contextMenuStrip != null) + { + contextMenuStrip.Show(control, position); + return; + } +#if NET35 || NET40 + ContextMenu contextMenu = menu as ContextMenu; + if (contextMenu != null) + contextMenu.Show(this, position); +#endif + } + + private Rectangle CaptionRectangle + { + get + { + if (!HasCaption) + return Rectangle.Empty; + + Rectangle rectWindow = DisplayingRectangle; + int x, y, width; + x = rectWindow.X; + y = rectWindow.Y; + width = rectWindow.Width; + int height = CaptionControl.MeasureHeight(); + + return new Rectangle(x, y, width, height); + } + } + + internal protected virtual Rectangle ContentRectangle + { + get + { + Rectangle rectWindow = DisplayingRectangle; + Rectangle rectCaption = CaptionRectangle; + Rectangle rectTabStrip = TabStripRectangle; + + int x = rectWindow.X; + + int y = rectWindow.Y + (rectCaption.IsEmpty ? 0 : rectCaption.Height); + if (DockState == DockState.Document && DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Top) + y += rectTabStrip.Height; + + int width = rectWindow.Width; + int height = rectWindow.Height - rectCaption.Height - rectTabStrip.Height; + + return new Rectangle(x, y, width, height); + } + } + + internal Rectangle TabStripRectangle + { + get + { + if (Appearance == AppearanceStyle.ToolWindow) + return TabStripRectangle_ToolWindow; + else + return TabStripRectangle_Document; + } + } + + private Rectangle TabStripRectangle_ToolWindow + { + get + { + if (DisplayingContents.Count <= 1 || IsAutoHide) + return Rectangle.Empty; + + Rectangle rectWindow = DisplayingRectangle; + + int width = rectWindow.Width; + int height = TabStripControl.MeasureHeight(); + int x = rectWindow.X; + int y = rectWindow.Bottom - height; + Rectangle rectCaption = CaptionRectangle; + if (rectCaption.Contains(x, y)) + y = rectCaption.Y + rectCaption.Height; + + return new Rectangle(x, y, width, height); + } + } + + private Rectangle TabStripRectangle_Document + { + get + { + if (DisplayingContents.Count == 0) + return Rectangle.Empty; + + if (DisplayingContents.Count == 1 && DockPanel.DocumentStyle == DocumentStyle.DockingSdi) + return Rectangle.Empty; + + Rectangle rectWindow = DisplayingRectangle; + int x = rectWindow.X; + int width = rectWindow.Width; + int height = TabStripControl.MeasureHeight(); + + int y = 0; + if (DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + y = rectWindow.Height - height; + else + y = rectWindow.Y; + + return new Rectangle(x, y, width, height); + } + } + + public virtual string CaptionText + { + get { return ActiveContent == null ? string.Empty : ActiveContent.DockHandler.TabText; } + } + + private DockContentCollection m_contents; + public DockContentCollection Contents + { + get { return m_contents; } + } + + private DockContentCollection m_displayingContents; + public DockContentCollection DisplayingContents + { + get { return m_displayingContents; } + } + + private DockPanel m_dockPanel; + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + private bool HasCaption + { + get + { + if (DockState == DockState.Document || + DockState == DockState.Hidden || + DockState == DockState.Unknown || + (DockState == DockState.Float && FloatWindow.VisibleNestedPanes.Count <= 1)) + return false; + else + return true; + } + } + + private bool m_isActivated = false; + public bool IsActivated + { + get { return m_isActivated; } + } + internal void SetIsActivated(bool value) + { + if (m_isActivated == value) + return; + + m_isActivated = value; + if (DockState != DockState.Document) + RefreshChanges(false); + OnIsActivatedChanged(EventArgs.Empty); + } + + private bool m_isActiveDocumentPane = false; + public bool IsActiveDocumentPane + { + get { return m_isActiveDocumentPane; } + } + + internal void SetIsActiveDocumentPane(bool value) + { + if (m_isActiveDocumentPane == value) + return; + + m_isActiveDocumentPane = value; + if (DockState == DockState.Document) + RefreshChanges(); + OnIsActiveDocumentPaneChanged(EventArgs.Empty); + } + + public bool IsActivePane + { + get { return this == DockPanel.ActivePane; } + } + + public bool IsDockStateValid(DockState dockState) + { + foreach (IDockContent content in Contents) + if (!content.DockHandler.IsDockStateValid(dockState)) + return false; + + return true; + } + + public bool IsAutoHide + { + get { return DockHelper.IsDockStateAutoHide(DockState); } + } + + public AppearanceStyle Appearance + { + get { return (DockState == DockState.Document) ? AppearanceStyle.Document : AppearanceStyle.ToolWindow; } + } + + public Rectangle DisplayingRectangle + { + get { return ClientRectangle; } + } + + public void Activate() + { + if (DockHelper.IsDockStateAutoHide(DockState) && DockPanel.ActiveAutoHideContent != ActiveContent) + DockPanel.ActiveAutoHideContent = ActiveContent; + else if (!IsActivated && ActiveContent != null) + ActiveContent.DockHandler.Activate(); + } + + internal void AddContent(IDockContent content) + { + if (Contents.Contains(content)) + return; + + Contents.Add(content); + } + + internal void Close() + { + Dispose(); + } + + public void CloseActiveContent() + { + CloseContent(ActiveContent); + } + + internal void CloseContent(IDockContent content) + { + if (content == null) + return; + + if (!content.DockHandler.CloseButton) + return; + + DockPanel dockPanel = DockPanel; + + dockPanel.SuspendLayout(true); + + try + { + if (content.DockHandler.HideOnClose) + { + content.DockHandler.Hide(); + NestedDockingStatus.NestedPanes.SwitchPaneWithFirstChild(this); + } + else + { + content.DockHandler.Close(); + // TODO: fix layout here for #519 + } + } + finally + { + dockPanel.ResumeLayout(true, true); + } + } + + private HitTestResult GetHitTest(Point ptMouse) + { + Point ptMouseClient = PointToClient(ptMouse); + + Rectangle rectCaption = CaptionRectangle; + if (rectCaption.Contains(ptMouseClient)) + return new HitTestResult(HitTestArea.Caption, -1); + + Rectangle rectContent = ContentRectangle; + if (rectContent.Contains(ptMouseClient)) + return new HitTestResult(HitTestArea.Content, -1); + + Rectangle rectTabStrip = TabStripRectangle; + if (rectTabStrip.Contains(ptMouseClient)) + return new HitTestResult(HitTestArea.TabStrip, TabStripControl.HitTest(TabStripControl.PointToClient(ptMouse))); + + return new HitTestResult(HitTestArea.None, -1); + } + + private bool m_isHidden = true; + public bool IsHidden + { + get { return m_isHidden; } + } + private void SetIsHidden(bool value) + { + if (m_isHidden == value) + return; + + m_isHidden = value; + if (DockHelper.IsDockStateAutoHide(DockState)) + { + DockPanel.RefreshAutoHideStrip(); + DockPanel.PerformLayout(); + } + else if (NestedPanesContainer != null) + ((Control)NestedPanesContainer).PerformLayout(); + } + + protected override void OnLayout(LayoutEventArgs e) + { + SetIsHidden(DisplayingContents.Count == 0); + if (!IsHidden) + { + CaptionControl.Bounds = CaptionRectangle; + TabStripControl.Bounds = TabStripRectangle; + + SetContentBounds(); + + foreach (IDockContent content in Contents) + { + 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 == DocumentStyle.DockingMdi) + rectContent = DockPanel.RectangleToMdiClient(RectangleToScreen(rectContent)); + + Rectangle rectInactive = new Rectangle(-rectContent.Width, rectContent.Y, rectContent.Width, rectContent.Height); + foreach (IDockContent content in Contents) + if (content.DockHandler.Pane == this) + { + if (content == ActiveContent) + content.DockHandler.Form.Bounds = rectContent; + else + content.DockHandler.Form.Bounds = rectInactive; + } + } + + internal void RefreshChanges() + { + RefreshChanges(true); + } + + private void RefreshChanges(bool performLayout) + { + if (IsDisposed) + return; + + CaptionControl.RefreshChanges(); + TabStripControl.RefreshChanges(); + if (DockState == DockState.Float && FloatWindow != null) + FloatWindow.RefreshChanges(); + if (DockHelper.IsDockStateAutoHide(DockState) && DockPanel != null) + { + DockPanel.RefreshAutoHideStrip(); + DockPanel.PerformLayout(); + } + + if (performLayout) + PerformLayout(); + } + + internal void RemoveContent(IDockContent content) + { + if (!Contents.Contains(content)) + return; + + Contents.Remove(content); + } + + public void SetContentIndex(IDockContent content, int index) + { + int oldIndex = Contents.IndexOf(content); + if (oldIndex == -1) + throw (new ArgumentException(Strings.DockPane_SetContentIndex_InvalidContent)); + + if (index < 0 || index > Contents.Count - 1) + if (index != -1) + throw (new ArgumentOutOfRangeException(Strings.DockPane_SetContentIndex_InvalidIndex)); + + if (oldIndex == index) + return; + if (oldIndex == Contents.Count - 1 && index == -1) + return; + + Contents.Remove(content); + if (index == -1) + Contents.Add(content); + else if (oldIndex < index) + Contents.AddAt(content, index - 1); + else + Contents.AddAt(content, index); + + RefreshChanges(); + } + + private void SetParent() + { + if (DockState == DockState.Unknown || DockState == DockState.Hidden) + { + SetParent(null); + Splitter.Parent = null; + } + else if (DockState == DockState.Float) + { + SetParent(FloatWindow); + Splitter.Parent = FloatWindow; + } + else if (DockHelper.IsDockStateAutoHide(DockState)) + { + SetParent(DockPanel.AutoHideControl); + Splitter.Parent = null; + } + else + { + SetParent(DockPanel.DockWindows[DockState]); + Splitter.Parent = Parent; + } + } + + private void SetParent(Control value) + { + if (Parent == value) + return; + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // Workaround of .Net Framework bug: + // Change the parent of a control with focus may result in the first + // MDI child form get activated. + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + IDockContent contentFocused = GetFocusedContent(); + if (contentFocused != null) + DockPanel.SaveFocus(); + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + Parent = value; + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // Workaround of .Net Framework bug: + // Change the parent of a control with focus may result in the first + // MDI child form get activated. + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if (contentFocused != null) + contentFocused.DockHandler.Activate(); + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + } + + public new void Show() + { + Activate(); + } + + internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline) + { + if (!dragSource.CanDockTo(this)) + return; + + Point ptMouse = Control.MousePosition; + + HitTestResult hitTestResult = GetHitTest(ptMouse); + if (hitTestResult.HitArea == HitTestArea.Caption) + dockOutline.Show(this, -1); + else if (hitTestResult.HitArea == HitTestArea.TabStrip && hitTestResult.Index != -1) + dockOutline.Show(this, hitTestResult.Index); + } + + internal void ValidateActiveContent() + { + if (ActiveContent == null) + { + if (DisplayingContents.Count != 0) + ActiveContent = DisplayingContents[0]; + return; + } + + if (DisplayingContents.IndexOf(ActiveContent) >= 0) + return; + + IDockContent prevVisible = null; + for (int i = Contents.IndexOf(ActiveContent) - 1; i >= 0; i--) + if (Contents[i].DockHandler.DockState == DockState) + { + 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 + ActiveContent = null; + } + + private static readonly object DockStateChangedEvent = new object(); + public event EventHandler DockStateChanged + { + add { Events.AddHandler(DockStateChangedEvent, value); } + remove { Events.RemoveHandler(DockStateChangedEvent, value); } + } + protected virtual void OnDockStateChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[DockStateChangedEvent]; + if (handler != null) + handler(this, e); + } + + private static readonly object IsActivatedChangedEvent = new object(); + public event EventHandler IsActivatedChanged + { + add { Events.AddHandler(IsActivatedChangedEvent, value); } + remove { Events.RemoveHandler(IsActivatedChangedEvent, value); } + } + protected virtual void OnIsActivatedChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[IsActivatedChangedEvent]; + if (handler != null) + handler(this, e); + } + + private static readonly object IsActiveDocumentPaneChangedEvent = new object(); + public event EventHandler IsActiveDocumentPaneChanged + { + add { Events.AddHandler(IsActiveDocumentPaneChangedEvent, value); } + remove { Events.RemoveHandler(IsActiveDocumentPaneChangedEvent, value); } + } + protected virtual void OnIsActiveDocumentPaneChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[IsActiveDocumentPaneChangedEvent]; + if (handler != null) + handler(this, e); + } + + public DockWindow DockWindow + { + get { return (m_nestedDockingStatus.NestedPanes == null) ? null : m_nestedDockingStatus.NestedPanes.Container as DockWindow; } + set + { + DockWindow oldValue = DockWindow; + if (oldValue == value) + return; + + DockTo(value); + } + } + + public FloatWindow FloatWindow + { + get { return (m_nestedDockingStatus.NestedPanes == null) ? null : m_nestedDockingStatus.NestedPanes.Container as FloatWindow; } + set + { + FloatWindow oldValue = FloatWindow; + if (oldValue == value) + return; + + DockTo(value); + } + } + + private NestedDockingStatus m_nestedDockingStatus; + public NestedDockingStatus NestedDockingStatus + { + get { return m_nestedDockingStatus; } + } + + private bool m_isFloat; + public bool IsFloat + { + get { return m_isFloat; } + } + + public INestedPanesContainer NestedPanesContainer + { + get + { + if (NestedDockingStatus.NestedPanes == null) + return null; + else + return NestedDockingStatus.NestedPanes.Container; + } + } + + private DockState m_dockState = DockState.Unknown; + public DockState DockState + { + get { return m_dockState; } + set + { + SetDockState(value); + } + } + + public DockPane SetDockState(DockState value) + { + if (value == DockState.Unknown || value == DockState.Hidden) + throw new InvalidOperationException(Strings.DockPane_SetDockState_InvalidState); + + if ((value == DockState.Float) == this.IsFloat) + { + InternalSetDockState(value); + return this; + } + + if (DisplayingContents.Count == 0) + return null; + + IDockContent firstContent = null; + for (int i = 0; i < DisplayingContents.Count; i++) + { + IDockContent content = DisplayingContents[i]; + if (content.DockHandler.IsDockStateValid(value)) + { + firstContent = content; + break; + } + } + if (firstContent == null) + return null; + + firstContent.DockHandler.DockState = value; + DockPane pane = firstContent.DockHandler.Pane; + DockPanel.SuspendLayout(true); + for (int i = 0; i < DisplayingContents.Count; i++) + { + IDockContent content = DisplayingContents[i]; + if (content.DockHandler.IsDockStateValid(value)) + content.DockHandler.Pane = pane; + } + DockPanel.ResumeLayout(true, true); + return pane; + } + + private void InternalSetDockState(DockState value) + { + if (m_dockState == value) + return; + + DockState oldDockState = m_dockState; + INestedPanesContainer oldContainer = NestedPanesContainer; + + m_dockState = value; + + SuspendRefreshStateChange(); + + IDockContent contentFocused = GetFocusedContent(); + if (contentFocused != null) + DockPanel.SaveFocus(); + + if (!IsFloat) + DockWindow = DockPanel.DockWindows[DockState]; + else if (FloatWindow == null) + FloatWindow = DockPanel.Theme.Extender.FloatWindowFactory.CreateFloatWindow(DockPanel, this); + + if (contentFocused != null) + { + if (!Win32Helper.IsRunningOnMono) + { + DockPanel.ContentFocusManager.Activate(contentFocused); + } + } + + ResumeRefreshStateChange(oldContainer, oldDockState); + } + + private int m_countRefreshStateChange = 0; + private void SuspendRefreshStateChange() + { + m_countRefreshStateChange++; + DockPanel.SuspendLayout(true); + } + + private void ResumeRefreshStateChange() + { + m_countRefreshStateChange--; + System.Diagnostics.Debug.Assert(m_countRefreshStateChange >= 0); + DockPanel.ResumeLayout(true, true); + } + + private bool IsRefreshStateChangeSuspended + { + get { return m_countRefreshStateChange != 0; } + } + + private void ResumeRefreshStateChange(INestedPanesContainer oldContainer, DockState oldDockState) + { + ResumeRefreshStateChange(); + RefreshStateChange(oldContainer, oldDockState); + } + + private void RefreshStateChange(INestedPanesContainer oldContainer, DockState oldDockState) + { + if (IsRefreshStateChangeSuspended) + return; + + SuspendRefreshStateChange(); + + DockPanel.SuspendLayout(true); + + IDockContent contentFocused = GetFocusedContent(); + if (contentFocused != null) + DockPanel.SaveFocus(); + SetParent(); + + if (ActiveContent != null) + ActiveContent.DockHandler.SetDockState(ActiveContent.DockHandler.IsHidden, DockState, ActiveContent.DockHandler.Pane); + foreach (IDockContent content in Contents) + { + if (content.DockHandler.Pane == this) + content.DockHandler.SetDockState(content.DockHandler.IsHidden, DockState, content.DockHandler.Pane); + } + + if (oldContainer != null) + { + Control oldContainerControl = (Control)oldContainer; + if (oldContainer.DockState == oldDockState && !oldContainerControl.IsDisposed) + oldContainerControl.PerformLayout(); + } + if (DockHelper.IsDockStateAutoHide(oldDockState)) + DockPanel.RefreshActiveAutoHideContent(); + + if (NestedPanesContainer.DockState == DockState) + ((Control)NestedPanesContainer).PerformLayout(); + if (DockHelper.IsDockStateAutoHide(DockState)) + DockPanel.RefreshActiveAutoHideContent(); + + if (DockHelper.IsDockStateAutoHide(oldDockState) || + DockHelper.IsDockStateAutoHide(DockState)) + { + DockPanel.RefreshAutoHideStrip(); + DockPanel.PerformLayout(); + } + + ResumeRefreshStateChange(); + + if (contentFocused != null) + contentFocused.DockHandler.Activate(); + + DockPanel.ResumeLayout(true, true); + + if (oldDockState != DockState) + OnDockStateChanged(EventArgs.Empty); + } + + private IDockContent GetFocusedContent() + { + IDockContent contentFocused = null; + foreach (IDockContent content in Contents) + { + if (content.DockHandler.Form.ContainsFocus) + { + contentFocused = content; + break; + } + } + + return contentFocused; + } + + public DockPane DockTo(INestedPanesContainer container) + { + if (container == null) + throw new InvalidOperationException(Strings.DockPane_DockTo_NullContainer); + + DockAlignment alignment; + if (container.DockState == DockState.DockLeft || container.DockState == DockState.DockRight) + alignment = DockAlignment.Bottom; + else + alignment = DockAlignment.Right; + + return DockTo(container, container.NestedPanes.GetDefaultPreviousPane(this), alignment, 0.5); + } + + public DockPane DockTo(INestedPanesContainer container, DockPane previousPane, DockAlignment alignment, double proportion) + { + if (container == null) + throw new InvalidOperationException(Strings.DockPane_DockTo_NullContainer); + + if (container.IsFloat == this.IsFloat) + { + InternalAddToDockList(container, previousPane, alignment, proportion); + return this; + } + + IDockContent firstContent = GetFirstContent(container.DockState); + if (firstContent == null) + return null; + + DockPane pane; + DockPanel.DummyContent.DockPanel = DockPanel; + if (container.IsFloat) + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(DockPanel.DummyContent, (FloatWindow)container, true); + else + pane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(DockPanel.DummyContent, container.DockState, true); + + pane.DockTo(container, previousPane, alignment, proportion); + SetVisibleContentsToPane(pane); + DockPanel.DummyContent.DockPanel = null; + + return pane; + } + + private void SetVisibleContentsToPane(DockPane pane) + { + SetVisibleContentsToPane(pane, ActiveContent); + } + + private void SetVisibleContentsToPane(DockPane pane, IDockContent activeContent) + { + for (int i = 0; i < DisplayingContents.Count; i++) + { + IDockContent content = DisplayingContents[i]; + if (content.DockHandler.IsDockStateValid(pane.DockState)) + { + content.DockHandler.Pane = pane; + i--; + } + } + + if (activeContent.DockHandler.Pane == pane) + pane.ActiveContent = activeContent; + } + + private void InternalAddToDockList(INestedPanesContainer container, DockPane prevPane, DockAlignment alignment, double proportion) + { + if ((container.DockState == DockState.Float) != IsFloat) + throw new InvalidOperationException(Strings.DockPane_DockTo_InvalidContainer); + + int count = container.NestedPanes.Count; + if (container.NestedPanes.Contains(this)) + count--; + if (prevPane == null && count > 0) + throw new InvalidOperationException(Strings.DockPane_DockTo_NullPrevPane); + + if (prevPane != null && !container.NestedPanes.Contains(prevPane)) + throw new InvalidOperationException(Strings.DockPane_DockTo_NoPrevPane); + + if (prevPane == this) + throw new InvalidOperationException(Strings.DockPane_DockTo_SelfPrevPane); + + INestedPanesContainer oldContainer = NestedPanesContainer; + DockState oldDockState = DockState; + container.NestedPanes.Add(this); + NestedDockingStatus.SetStatus(container.NestedPanes, prevPane, alignment, proportion); + + if (DockHelper.IsDockWindowState(DockState)) + m_dockState = container.DockState; + + RefreshStateChange(oldContainer, oldDockState); + } + + public void SetNestedDockingProportion(double proportion) + { + NestedDockingStatus.SetStatus(NestedDockingStatus.NestedPanes, NestedDockingStatus.PreviousPane, NestedDockingStatus.Alignment, proportion); + if (NestedPanesContainer != null) + ((Control)NestedPanesContainer).PerformLayout(); + } + + public DockPane Float() + { + DockPanel.SuspendLayout(true); + + IDockContent activeContent = ActiveContent; + + DockPane floatPane = GetFloatPaneFromContents(); + if (floatPane == null) + { + IDockContent firstContent = GetFirstContent(DockState.Float); + if (firstContent == null) + { + DockPanel.ResumeLayout(true, true); + return null; + } + + floatPane = DockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(firstContent, DockState.Float, true); + } + + SetVisibleContentsToPane(floatPane, activeContent); + if (PatchController.EnableFloatSplitterFix == true) + { + if (IsHidden) + { + NestedDockingStatus.NestedPanes.SwitchPaneWithFirstChild(this); + } + } + + DockPanel.ResumeLayout(true, true); + return floatPane; + } + + private DockPane GetFloatPaneFromContents() + { + DockPane floatPane = null; + for (int i = 0; i < DisplayingContents.Count; i++) + { + IDockContent content = DisplayingContents[i]; + if (!content.DockHandler.IsDockStateValid(DockState.Float)) + continue; + + if (floatPane != null && content.DockHandler.FloatPane != floatPane) + return null; + else + floatPane = content.DockHandler.FloatPane; + } + + return floatPane; + } + + private IDockContent GetFirstContent(DockState dockState) + { + for (int i = 0; i < DisplayingContents.Count; i++) + { + IDockContent content = DisplayingContents[i]; + if (content.DockHandler.IsDockStateValid(dockState)) + return content; + } + return null; + } + + public void RestoreToPanel() + { + DockPanel.SuspendLayout(true); + + IDockContent activeContent = DockPanel.ActiveContent; + + for (int i = DisplayingContents.Count - 1; i >= 0; i--) + { + IDockContent content = DisplayingContents[i]; + if (content.DockHandler.CheckDockState(false) != DockState.Unknown) + content.DockHandler.IsFloat = false; + } + + DockPanel.ResumeLayout(true, true); + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE) + Activate(); + + base.WndProc(ref m); + } + +#region IDockDragSource Members + +#region IDragSource Members + + Control IDragSource.DragControl + { + get { return this; } + } + + public IDockContent MouseOverTab { get; set; } + +#endregion + + bool IDockDragSource.IsDockStateValid(DockState dockState) + { + return IsDockStateValid(dockState); + } + + bool IDockDragSource.CanDockTo(DockPane pane) + { + if (!IsDockStateValid(pane.DockState)) + return false; + + if (pane == this) + return false; + + return true; + } + + Rectangle IDockDragSource.BeginDrag(Point ptMouse) + { + Point location = PointToScreen(new Point(0, 0)); + Size size; + + DockPane floatPane = ActiveContent.DockHandler.FloatPane; + if (DockState == DockState.Float || floatPane == null || floatPane.FloatWindow.NestedPanes.Count != 1) + size = DockPanel.DefaultFloatWindowSize; + else + size = floatPane.FloatWindow.Size; + + if (ptMouse.X > location.X + size.Width) + location.X += ptMouse.X - (location.X + size.Width) + DockPanel.Theme.Measures.SplitterSize; + + return new Rectangle(location, size); + } + + void IDockDragSource.EndDrag() + { + } + + public void FloatAt(Rectangle floatWindowBounds) + { + if (FloatWindow == null || FloatWindow.NestedPanes.Count != 1) + FloatWindow = DockPanel.Theme.Extender.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds); + else + FloatWindow.Bounds = floatWindowBounds; + + DockState = DockState.Float; + + NestedDockingStatus.NestedPanes.SwitchPaneWithFirstChild(this); + } + + public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex) + { + if (dockStyle == DockStyle.Fill) + { + IDockContent activeContent = ActiveContent; + for (int i = Contents.Count - 1; i >= 0; i--) + { + IDockContent c = Contents[i]; + if (c.DockHandler.DockState == DockState) + { + c.DockHandler.Pane = pane; + if (contentIndex != -1) + pane.SetContentIndex(c, contentIndex); + } + } + pane.ActiveContent = activeContent; + } + else + { + if (dockStyle == DockStyle.Left) + DockTo(pane.NestedPanesContainer, pane, DockAlignment.Left, 0.5); + else if (dockStyle == DockStyle.Right) + DockTo(pane.NestedPanesContainer, pane, DockAlignment.Right, 0.5); + else if (dockStyle == DockStyle.Top) + DockTo(pane.NestedPanesContainer, pane, DockAlignment.Top, 0.5); + else if (dockStyle == DockStyle.Bottom) + DockTo(pane.NestedPanesContainer, pane, DockAlignment.Bottom, 0.5); + + DockState = pane.DockState; + } + } + + public void DockTo(DockPanel panel, DockStyle dockStyle) + { + if (panel != DockPanel) + throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, nameof(panel)); + + if (dockStyle == DockStyle.Top) + DockState = DockState.DockTop; + else if (dockStyle == DockStyle.Bottom) + DockState = DockState.DockBottom; + else if (dockStyle == DockStyle.Left) + DockState = DockState.DockLeft; + else if (dockStyle == DockStyle.Right) + DockState = DockState.DockRight; + else if (dockStyle == DockStyle.Fill) + DockState = DockState.Document; + } + +#endregion + +#region cachedLayoutArgs leak workaround + + /// + /// There's a bug in the WinForms layout engine + /// that can result in a deferred layout to not + /// properly clear out the cached layout args after + /// the layout operation is performed. + /// Specifically, this bug is hit when the bounds of + /// the Pane change, initiating a layout on the parent + /// (DockWindow) which is where the bug hits. + /// To work around it, when a pane loses the DockWindow + /// as its parent, that parent DockWindow needs to + /// perform a layout to flush the cached args, if they exist. + /// + private DockWindow _lastParentWindow; + protected override void OnParentChanged(EventArgs e) + { + base.OnParentChanged(e); + var newParent = Parent as DockWindow; + if (newParent != _lastParentWindow) + { + if (_lastParentWindow != null) + _lastParentWindow.PerformLayout(); + _lastParentWindow = newParent; + } + } +#endregion + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPaneCaptionBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPaneCaptionBase.cs new file mode 100644 index 000000000..20d79f2fa --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPaneCaptionBase.cs @@ -0,0 +1,109 @@ +using System.Drawing; +using System.Security.Permissions; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public abstract class DockPaneCaptionBase : Control + { + protected internal DockPaneCaptionBase(DockPane pane) + { + m_dockPane = pane; + + SetStyle(ControlStyles.OptimizedDoubleBuffer | + ControlStyles.ResizeRedraw | + ControlStyles.UserPaint | + ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.Selectable, false); + } + + private DockPane m_dockPane; + public DockPane DockPane + { + get { return m_dockPane; } + } + + protected DockPane.AppearanceStyle Appearance + { + get { return DockPane.Appearance; } + } + + protected bool HasTabPageContextMenu + { + get { return DockPane.HasTabPageContextMenu; } + } + + protected void ShowTabPageContextMenu(Point position) + { + DockPane.ShowTabPageContextMenu(this, position); + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (e.Button == MouseButtons.Right) + ShowTabPageContextMenu(new Point(e.X, e.Y)); + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (e.Button == MouseButtons.Left && + DockPane.DockPanel.AllowEndUserDocking && + DockPane.AllowDockDragAndDrop && + DockPane.ActiveContent != null && + (!DockHelper.IsDockStateAutoHide(DockPane.DockState) || CanDragAutoHide)) + { + DockPane.DockPanel.BeginDrag(DockPane); + } + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK) + { + if (DockHelper.IsDockStateAutoHide(DockPane.DockState)) + { + DockPane.DockPanel.ActiveAutoHideContent = null; + return; + } + + if (DockPane.IsFloat) + DockPane.RestoreToPanel(); + else + DockPane.Float(); + } + base.WndProc(ref m); + } + + internal void RefreshChanges() + { + if (IsDisposed) + return; + + OnRefreshChanges(); + } + + protected virtual void OnRightToLeftLayoutChanged() + { + } + + protected virtual void OnRefreshChanges() + { + } + + protected internal abstract int MeasureHeight(); + + /// + /// Gets a value indicating whether dock panel can be dragged when in auto hide mode. + /// Default is false. + /// + protected virtual bool CanDragAutoHide + { + get { return false; } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPaneCollection.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPaneCollection.cs new file mode 100644 index 000000000..7d72553c7 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPaneCollection.cs @@ -0,0 +1,56 @@ +using System.Collections.ObjectModel; +using System.Collections.Generic; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class DockPaneCollection : ReadOnlyCollection + { + internal DockPaneCollection() + : base(new List()) + { + } + + internal int Add(DockPane pane) + { + if (Items.Contains(pane)) + return Items.IndexOf(pane); + + Items.Add(pane); + return Count - 1; + } + + internal void AddAt(DockPane pane, int index) + { + if (index < 0 || index > Items.Count - 1) + return; + + if (Contains(pane)) + return; + + Items.Insert(index, pane); + } + + internal void Dispose() + { + if (PatchController.EnableNestedDisposalFix == true) + { + List collection = new List(Items); + foreach (var dockPane in collection) + { + dockPane.Close(); + } + + collection.Clear(); + return; + } + + for (int i=Count - 1; i>=0; i--) + this[i].Close(); + } + + internal void Remove(DockPane pane) + { + Items.Remove(pane); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPaneStripBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPaneStripBase.cs new file mode 100644 index 000000000..e19b3417f --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPaneStripBase.cs @@ -0,0 +1,448 @@ +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Collections; +using System.Collections.Generic; +using System.Security.Permissions; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public abstract class DockPaneStripBase : Control + { + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + protected internal class Tab : IDisposable + { + private IDockContent m_content; + + public Tab(IDockContent content) + { + m_content = content; + } + + ~Tab() + { + Dispose(false); + } + + public IDockContent Content + { + get { return m_content; } + } + + public Form ContentForm + { + get { return m_content as Form; } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + } + + private Rectangle? _rect; + + public Rectangle? Rectangle + { + get + { + if (_rect != null) + { + return _rect; + } + + return _rect = System.Drawing.Rectangle.Empty; + } + + set + { + _rect = value; + } + } + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + protected sealed class TabCollection : IEnumerable + { + #region IEnumerable Members + IEnumerator IEnumerable.GetEnumerator() + { + for (int i = 0; i < Count; i++) + yield return this[i]; + } + + IEnumerator IEnumerable.GetEnumerator() + { + for (int i = 0; i < Count; i++) + yield return this[i]; + } + #endregion + + internal TabCollection(DockPane pane) + { + m_dockPane = pane; + } + + private DockPane m_dockPane; + public DockPane DockPane + { + get { return m_dockPane; } + } + + public int Count + { + get { return DockPane.DisplayingContents.Count; } + } + + public Tab this[int index] + { + get + { + IDockContent content = DockPane.DisplayingContents[index]; + if (content == null) + throw (new ArgumentOutOfRangeException(nameof(index))); + return content.DockHandler.GetTab(DockPane.TabStripControl); + } + } + + public bool Contains(Tab tab) + { + return (IndexOf(tab) != -1); + } + + public bool Contains(IDockContent content) + { + return (IndexOf(content) != -1); + } + + public int IndexOf(Tab tab) + { + if (tab == null) + return -1; + + return DockPane.DisplayingContents.IndexOf(tab.Content); + } + + public int IndexOf(IDockContent content) + { + return DockPane.DisplayingContents.IndexOf(content); + } + } + + protected DockPaneStripBase(DockPane pane) + { + m_dockPane = pane; + + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + SetStyle(ControlStyles.Selectable, false); + AllowDrop = true; + } + + private DockPane m_dockPane; + protected DockPane DockPane + { + get { return m_dockPane; } + } + + protected DockPane.AppearanceStyle Appearance + { + get { return DockPane.Appearance; } + } + + private TabCollection m_tabs; + + protected TabCollection Tabs + { + get + { + return m_tabs ?? (m_tabs = new TabCollection(DockPane)); + } + } + + internal void RefreshChanges() + { + if (IsDisposed) + return; + + OnRefreshChanges(); + } + + protected virtual void OnRefreshChanges() + { + } + + protected internal abstract int MeasureHeight(); + + protected internal abstract void EnsureTabVisible(IDockContent content); + + protected int HitTest() + { + return HitTest(PointToClient(Control.MousePosition)); + } + + protected internal abstract int HitTest(Point point); + + protected virtual bool MouseDownActivateTest(MouseEventArgs e) + { + return true; + } + + public abstract GraphicsPath GetOutline(int index); + + protected internal virtual Tab CreateTab(IDockContent content) + { + return new Tab(content); + } + + private Rectangle _dragBox = Rectangle.Empty; + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + int index = HitTest(); + if (index != -1) + { + if (e.Button == MouseButtons.Middle) + { + // Close the specified content. + TryCloseTab(index); + } + else + { + IDockContent content = Tabs[index].Content; + if (DockPane.ActiveContent != content) + { + // Test if the content should be active + if (MouseDownActivateTest(e)) + DockPane.ActiveContent = content; + } + + } + } + + if (e.Button == MouseButtons.Left) + { + var dragSize = SystemInformation.DragSize; + _dragBox = new Rectangle(new Point(e.X - (dragSize.Width / 2), + e.Y - (dragSize.Height / 2)), dragSize); + } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (e.Button != MouseButtons.Left || _dragBox.Contains(e.Location)) + return; + + if (DockPane.ActiveContent == null) + return; + + if (DockPane.DockPanel.AllowEndUserDocking && DockPane.AllowDockDragAndDrop && DockPane.ActiveContent.DockHandler.AllowEndUserDocking) + DockPane.DockPanel.BeginDrag(DockPane.ActiveContent.DockHandler); + } + + protected bool HasTabPageContextMenu + { + get { return DockPane.HasTabPageContextMenu; } + } + + protected void ShowTabPageContextMenu(Point position) + { + DockPane.ShowTabPageContextMenu(this, position); + } + + protected bool TryCloseTab(int index) + { + if (index >= 0 || index < Tabs.Count) + { + // Close the specified content. + IDockContent content = Tabs[index].Content; + DockPane.CloseContent(content); + if (PatchController.EnableSelectClosestOnClose == true) + SelectClosestPane(index); + + return true; + } + return false; + } + + private void SelectClosestPane(int index) + { + if (index > 0 && DockPane.DockPanel.DocumentStyle == DocumentStyle.DockingWindow) + { + index = index - 1; + + if (index >= 0 || index < Tabs.Count) + DockPane.ActiveContent = Tabs[index].Content; + } + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + if (e.Button == MouseButtons.Right) + ShowTabPageContextMenu(new Point(e.X, e.Y)); + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK) + { + base.WndProc(ref m); + + int index = HitTest(); + if (DockPane.DockPanel.AllowEndUserDocking && index != -1) + { + IDockContent content = Tabs[index].Content; + if (content.DockHandler.CheckDockState(!content.DockHandler.IsFloat) != DockState.Unknown) + content.DockHandler.IsFloat = !content.DockHandler.IsFloat; + } + + return; + } + + base.WndProc(ref m); + return; + } + + protected override void OnDragOver(DragEventArgs drgevent) + { + base.OnDragOver(drgevent); + + int index = HitTest(); + if (index != -1) + { + IDockContent content = Tabs[index].Content; + if (DockPane.ActiveContent != content) + DockPane.ActiveContent = content; + } + } + + protected void ContentClosed() + { + if (m_tabs.Count == 0) + { + DockPane.ClearLastActiveContent(); + } + } + + protected abstract Rectangle GetTabBounds(Tab tab); + + internal static Rectangle ToScreen(Rectangle rectangle, Control parent) + { + if (parent == null) + return rectangle; + + return new Rectangle(parent.PointToScreen(new Point(rectangle.Left, rectangle.Top)), new Size(rectangle.Width, rectangle.Height)); + } + + protected override AccessibleObject CreateAccessibilityInstance() + { + return new DockPaneStripAccessibleObject(this); + } + + public class DockPaneStripAccessibleObject : Control.ControlAccessibleObject + { + private DockPaneStripBase _strip; + + public DockPaneStripAccessibleObject(DockPaneStripBase strip) + : base(strip) + { + _strip = strip; + } + + public override AccessibleRole Role + { + get + { + return AccessibleRole.PageTabList; + } + } + + public override int GetChildCount() + { + return _strip.Tabs.Count; + } + + public override AccessibleObject GetChild(int index) + { + return new DockPaneStripTabAccessibleObject(_strip, _strip.Tabs[index], this); + } + + public override AccessibleObject HitTest(int x, int y) + { + Point point = new Point(x, y); + foreach (Tab tab in _strip.Tabs) + { + Rectangle rectangle = _strip.GetTabBounds(tab); + if (ToScreen(rectangle, _strip).Contains(point)) + return new DockPaneStripTabAccessibleObject(_strip, tab, this); + } + + return null; + } + } + + protected class DockPaneStripTabAccessibleObject : AccessibleObject + { + private DockPaneStripBase _strip; + private Tab _tab; + + private AccessibleObject _parent; + + internal DockPaneStripTabAccessibleObject(DockPaneStripBase strip, Tab tab, AccessibleObject parent) + { + _strip = strip; + _tab = tab; + + _parent = parent; + } + + public override AccessibleObject Parent + { + get + { + return _parent; + } + } + + public override AccessibleRole Role + { + get + { + return AccessibleRole.PageTab; + } + } + + public override Rectangle Bounds + { + get + { + Rectangle rectangle = _strip.GetTabBounds(_tab); + return ToScreen(rectangle, _strip); + } + } + + public override string Name + { + get + { + return _tab.Content.DockHandler.TabText; + } + set + { + //base.Name = value; + } + } + } + + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Appearance.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Appearance.cs new file mode 100644 index 000000000..9a935be71 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Appearance.cs @@ -0,0 +1,44 @@ +namespace WeifenLuo.WinFormsUI.Docking +{ + using System; + using System.ComponentModel; + + public partial class DockPanel + { + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DockPanelSkin")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Browsable(false)] + [Obsolete("Use Theme.Skin instead.")] + public DockPanelSkin Skin + { + get { return null; } + } + + private ThemeBase m_dockPanelTheme = new DefaultTheme(); + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DockPanelTheme")] + public ThemeBase Theme + { + get { return m_dockPanelTheme; } + set + { + if (value == null) + { + return; + } + + if (m_dockPanelTheme.GetType() == value.GetType()) + { + return; + } + + m_dockPanelTheme?.CleanUp(this); + m_dockPanelTheme = value; + m_dockPanelTheme.ApplyTo(this); + m_dockPanelTheme.PostApply(this); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs new file mode 100644 index 000000000..b9b673128 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs @@ -0,0 +1,575 @@ +using System; +using System.Windows.Forms; +using System.Drawing; +using System.ComponentModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPanel + { + [ToolboxItem(false)] + public class AutoHideWindowControl : Panel, ISplitterHost + { + protected class SplitterControl : SplitterBase + { + public SplitterControl(AutoHideWindowControl autoHideWindow) + { + m_autoHideWindow = autoHideWindow; + } + + private AutoHideWindowControl m_autoHideWindow; + private AutoHideWindowControl AutoHideWindow + { + get { return m_autoHideWindow; } + } + + protected override int SplitterSize + { + get { return AutoHideWindow.DockPanel.Theme.Measures.AutoHideSplitterSize; } + } + + protected override void StartDrag() + { + AutoHideWindow.DockPanel.BeginDrag(AutoHideWindow, AutoHideWindow.RectangleToScreen(Bounds)); + } + } + + #region consts + private const int ANIMATE_TIME = 100; // in mini-seconds + #endregion + + private Timer m_timerMouseTrack; + protected SplitterBase m_splitter { get; private set; } + + public AutoHideWindowControl(DockPanel dockPanel) + { + m_dockPanel = dockPanel; + + m_timerMouseTrack = new Timer(); + m_timerMouseTrack.Tick += new EventHandler(TimerMouseTrack_Tick); + + Visible = false; + m_splitter = DockPanel.Theme.Extender.WindowSplitterControlFactory.CreateSplitterControl(this); + Controls.Add(m_splitter); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + m_timerMouseTrack.Dispose(); + } + base.Dispose(disposing); + } + + public bool IsDockWindow + { + get { return false; } + } + + private DockPanel m_dockPanel = null; + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + private DockPane m_activePane = null; + public DockPane ActivePane + { + get { return m_activePane; } + } + + private void SetActivePane() + { + DockPane value = (ActiveContent == null ? null : ActiveContent.DockHandler.Pane); + + if (value == m_activePane) + return; + + m_activePane = value; + } + + private static readonly object AutoHideActiveContentChangedEvent = new object(); + public event EventHandler ActiveContentChanged + { + add { Events.AddHandler(AutoHideActiveContentChangedEvent, value); } + remove { Events.RemoveHandler(AutoHideActiveContentChangedEvent, value); } + } + + protected virtual void OnActiveContentChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[ActiveContentChangedEvent]; + if (handler != null) + handler(this, e); + } + + private IDockContent m_activeContent = null; + public IDockContent ActiveContent + { + get { return m_activeContent; } + set + { + if (value == m_activeContent) + return; + + if (value != null) + { + if (!DockHelper.IsDockStateAutoHide(value.DockHandler.DockState) || value.DockHandler.DockPanel != DockPanel) + throw (new InvalidOperationException(Strings.DockPanel_ActiveAutoHideContent_InvalidValue)); + } + + DockPanel.SuspendLayout(); + + if (m_activeContent != null) + { + if (m_activeContent.DockHandler.Form.ContainsFocus) + { + if (!Win32Helper.IsRunningOnMono) + { + DockPanel.ContentFocusManager.GiveUpFocus(m_activeContent); + } + } + + AnimateWindow(false); + } + + m_activeContent = value; + SetActivePane(); + if (ActivePane != null) + ActivePane.ActiveContent = m_activeContent; + + if (m_activeContent != null) + AnimateWindow(true); + + DockPanel.ResumeLayout(); + DockPanel.RefreshAutoHideStrip(); + + SetTimerMouseTrack(); + + OnActiveContentChanged(EventArgs.Empty); + } + } + + public DockState DockState + { + get { return ActiveContent == null ? DockState.Unknown : ActiveContent.DockHandler.DockState; } + } + + private bool m_flagAnimate = true; + private bool FlagAnimate + { + get { return m_flagAnimate; } + 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 && Visible != show) + { + Visible = show; + return; + } + + Parent.SuspendLayout(); + + Rectangle rectSource = GetRectangle(!show); + Rectangle rectTarget = GetRectangle(show); + int dxLoc, dyLoc; + int dWidth, dHeight; + dxLoc = dyLoc = dWidth = dHeight = 0; + if (DockState == DockState.DockTopAutoHide) + dHeight = show ? 1 : -1; + else if (DockState == DockState.DockLeftAutoHide) + dWidth = show ? 1 : -1; + else if (DockState == DockState.DockRightAutoHide) + { + dxLoc = show ? -1 : 1; + dWidth = show ? 1 : -1; + } + else if (DockState == DockState.DockBottomAutoHide) + { + dyLoc = (show ? -1 : 1); + dHeight = (show ? 1 : -1); + } + + if (show) + { + Bounds = DockPanel.GetAutoHideWindowBounds(new Rectangle(-rectTarget.Width, -rectTarget.Height, rectTarget.Width, rectTarget.Height)); + if (Visible == false) + Visible = true; + PerformLayout(); + } + + SuspendLayout(); + + LayoutAnimateWindow(rectSource); + if (Visible == false) + Visible = true; + + int speedFactor = 1; + int totalPixels = (rectSource.Width != rectTarget.Width) ? + Math.Abs(rectSource.Width - rectTarget.Width) : + Math.Abs(rectSource.Height - rectTarget.Height); + int remainPixels = totalPixels; + DateTime startingTime = DateTime.Now; + while (rectSource != rectTarget) + { + DateTime startPerMove = DateTime.Now; + + rectSource.X += dxLoc * speedFactor; + rectSource.Y += dyLoc * speedFactor; + rectSource.Width += dWidth * speedFactor; + rectSource.Height += dHeight * speedFactor; + if (Math.Sign(rectTarget.X - rectSource.X) != Math.Sign(dxLoc)) + rectSource.X = rectTarget.X; + if (Math.Sign(rectTarget.Y - rectSource.Y) != Math.Sign(dyLoc)) + rectSource.Y = rectTarget.Y; + if (Math.Sign(rectTarget.Width - rectSource.Width) != Math.Sign(dWidth)) + rectSource.Width = rectTarget.Width; + if (Math.Sign(rectTarget.Height - rectSource.Height) != Math.Sign(dHeight)) + rectSource.Height = rectTarget.Height; + + LayoutAnimateWindow(rectSource); + if (Parent != null) + Parent.Update(); + + remainPixels -= speedFactor; + + while (true) + { + TimeSpan time = new TimeSpan(0, 0, 0, 0, ANIMATE_TIME); + TimeSpan elapsedPerMove = DateTime.Now - startPerMove; + TimeSpan elapsedTime = DateTime.Now - startingTime; + if (((int)((time - elapsedTime).TotalMilliseconds)) <= 0) + { + speedFactor = remainPixels; + break; + } + else + speedFactor = remainPixels * (int)elapsedPerMove.TotalMilliseconds / (int)((time - elapsedTime).TotalMilliseconds); + if (speedFactor >= 1) + break; + } + } + ResumeLayout(); + Parent.ResumeLayout(); + } + + private void LayoutAnimateWindow(Rectangle rect) + { + Bounds = DockPanel.GetAutoHideWindowBounds(rect); + + Rectangle rectClient = ClientRectangle; + + if (DockState == DockState.DockLeftAutoHide) + ActivePane.Location = new Point(rectClient.Right - 2 - DockPanel.Theme.Measures.AutoHideSplitterSize - ActivePane.Width, ActivePane.Location.Y); + else if (DockState == DockState.DockTopAutoHide) + ActivePane.Location = new Point(ActivePane.Location.X, rectClient.Bottom - 2 - DockPanel.Theme.Measures.AutoHideSplitterSize - ActivePane.Height); + } + + private Rectangle GetRectangle(bool show) + { + if (DockState == DockState.Unknown) + return Rectangle.Empty; + + Rectangle rect = DockPanel.AutoHideWindowRectangle; + + if (show) + return rect; + + if (DockState == DockState.DockLeftAutoHide) + rect.Width = 0; + else if (DockState == DockState.DockRightAutoHide) + { + rect.X += rect.Width; + rect.Width = 0; + } + else if (DockState == DockState.DockTopAutoHide) + rect.Height = 0; + else + { + rect.Y += rect.Height; + rect.Height = 0; + } + + return rect; + } + + private void SetTimerMouseTrack() + { + if (ActivePane == null || ActivePane.IsActivated || FlagDragging) + { + m_timerMouseTrack.Enabled = false; + return; + } + + // start the timer + int hovertime = SystemInformation.MouseHoverTime ; + + // assign a default value 400 in case of setting Timer.Interval invalid value exception + if (hovertime <= 0) + hovertime = 400; + + m_timerMouseTrack.Interval = 2 * (int)hovertime; + m_timerMouseTrack.Enabled = true; + } + + protected virtual Rectangle DisplayingRectangle + { + get + { + Rectangle rect = ClientRectangle; + + // exclude the border and the splitter + if (DockState == DockState.DockBottomAutoHide) + { + rect.Y += 2 + DockPanel.Theme.Measures.AutoHideSplitterSize; + rect.Height -= 2 + DockPanel.Theme.Measures.AutoHideSplitterSize; + } + else if (DockState == DockState.DockRightAutoHide) + { + rect.X += 2 + DockPanel.Theme.Measures.AutoHideSplitterSize; + rect.Width -= 2 + DockPanel.Theme.Measures.AutoHideSplitterSize; + } + else if (DockState == DockState.DockTopAutoHide) + rect.Height -= 2 + DockPanel.Theme.Measures.AutoHideSplitterSize; + else if (DockState == DockState.DockLeftAutoHide) + rect.Width -= 2 + DockPanel.Theme.Measures.AutoHideSplitterSize; + + return rect; + } + } + + public void RefreshActiveContent() + { + if (ActiveContent == null) + return; + + if (!DockHelper.IsDockStateAutoHide(ActiveContent.DockHandler.DockState)) + { + FlagAnimate = false; + ActiveContent = null; + FlagAnimate = true; + } + } + + public void RefreshActivePane() + { + SetTimerMouseTrack(); + } + + private void TimerMouseTrack_Tick(object sender, EventArgs e) + { + if (IsDisposed) + return; + + if (ActivePane == null || ActivePane.IsActivated) + { + m_timerMouseTrack.Enabled = false; + return; + } + + DockPane pane = ActivePane; + Point ptMouseInAutoHideWindow = PointToClient(Control.MousePosition); + Point ptMouseInDockPanel = DockPanel.PointToClient(Control.MousePosition); + + Rectangle rectTabStrip = DockPanel.GetTabStripRectangle(pane.DockState); + + if (!ClientRectangle.Contains(ptMouseInAutoHideWindow) && !rectTabStrip.Contains(ptMouseInDockPanel)) + { + ActiveContent = null; + m_timerMouseTrack.Enabled = false; + } + } + + #region ISplitterDragSource Members + + void ISplitterDragSource.BeginDrag(Rectangle rectSplitter) + { + FlagDragging = true; + } + + void ISplitterDragSource.EndDrag() + { + FlagDragging = false; + } + + bool ISplitterDragSource.IsVertical + { + get { return (DockState == DockState.DockLeftAutoHide || DockState == DockState.DockRightAutoHide); } + } + + Rectangle ISplitterDragSource.DragLimitBounds + { + get + { + Rectangle rectLimit = DockPanel.DockArea; + + if ((this as ISplitterDragSource).IsVertical) + { + rectLimit.X += MeasurePane.MinSize; + rectLimit.Width -= 2 * MeasurePane.MinSize; + } + else + { + rectLimit.Y += MeasurePane.MinSize; + rectLimit.Height -= 2 * MeasurePane.MinSize; + } + + return DockPanel.RectangleToScreen(rectLimit); + } + } + + void ISplitterDragSource.MoveSplitter(int offset) + { + Rectangle rectDockArea = DockPanel.DockArea; + IDockContent content = ActiveContent; + if (DockState == DockState.DockLeftAutoHide && rectDockArea.Width > 0) + { + if (content.DockHandler.AutoHidePortion < 1) + content.DockHandler.AutoHidePortion += ((double)offset) / (double)rectDockArea.Width; + else + content.DockHandler.AutoHidePortion = Width + offset; + } + else if (DockState == DockState.DockRightAutoHide && rectDockArea.Width > 0) + { + if (content.DockHandler.AutoHidePortion < 1) + content.DockHandler.AutoHidePortion -= ((double)offset) / (double)rectDockArea.Width; + else + content.DockHandler.AutoHidePortion = Width - offset; + } + else if (DockState == DockState.DockBottomAutoHide && rectDockArea.Height > 0) + { + if (content.DockHandler.AutoHidePortion < 1) + content.DockHandler.AutoHidePortion -= ((double)offset) / (double)rectDockArea.Height; + else + content.DockHandler.AutoHidePortion = Height - offset; + } + else if (DockState == DockState.DockTopAutoHide && rectDockArea.Height > 0) + { + if (content.DockHandler.AutoHidePortion < 1) + content.DockHandler.AutoHidePortion += ((double)offset) / (double)rectDockArea.Height; + else + content.DockHandler.AutoHidePortion = Height + offset; + } + } + + #region IDragSource Members + + Control IDragSource.DragControl + { + get { return this; } + } + + #endregion + + #endregion + } + + private AutoHideWindowControl AutoHideWindow + { + get { return m_autoHideWindow; } + } + + internal Control AutoHideControl + { + get { return m_autoHideWindow; } + } + + internal void RefreshActiveAutoHideContent() + { + AutoHideWindow.RefreshActiveContent(); + } + + internal Rectangle AutoHideWindowRectangle + { + get + { + DockState state = AutoHideWindow.DockState; + Rectangle rectDockArea = DockArea; + if (ActiveAutoHideContent == null) + return Rectangle.Empty; + + if (Parent == null) + return Rectangle.Empty; + + Rectangle rect = Rectangle.Empty; + double autoHideSize = ActiveAutoHideContent.DockHandler.AutoHidePortion; + if (state == DockState.DockLeftAutoHide) + { + if (autoHideSize < 1) + autoHideSize = rectDockArea.Width * autoHideSize; + if (autoHideSize > rectDockArea.Width - MeasurePane.MinSize) + autoHideSize = rectDockArea.Width - MeasurePane.MinSize; + rect.X = rectDockArea.X - Theme.Measures.DockPadding; + rect.Y = rectDockArea.Y; + rect.Width = (int)autoHideSize; + rect.Height = rectDockArea.Height; + } + else if (state == DockState.DockRightAutoHide) + { + if (autoHideSize < 1) + autoHideSize = rectDockArea.Width * autoHideSize; + if (autoHideSize > rectDockArea.Width - MeasurePane.MinSize) + autoHideSize = rectDockArea.Width - MeasurePane.MinSize; + rect.X = rectDockArea.X + rectDockArea.Width - (int)autoHideSize + Theme.Measures.DockPadding; + rect.Y = rectDockArea.Y; + rect.Width = (int)autoHideSize; + rect.Height = rectDockArea.Height; + } + else if (state == DockState.DockTopAutoHide) + { + if (autoHideSize < 1) + autoHideSize = rectDockArea.Height * autoHideSize; + if (autoHideSize > rectDockArea.Height - MeasurePane.MinSize) + autoHideSize = rectDockArea.Height - MeasurePane.MinSize; + rect.X = rectDockArea.X; + rect.Y = rectDockArea.Y - Theme.Measures.DockPadding; + rect.Width = rectDockArea.Width; + rect.Height = (int)autoHideSize; + } + else if (state == DockState.DockBottomAutoHide) + { + if (autoHideSize < 1) + autoHideSize = rectDockArea.Height * autoHideSize; + if (autoHideSize > rectDockArea.Height - MeasurePane.MinSize) + autoHideSize = rectDockArea.Height - MeasurePane.MinSize; + rect.X = rectDockArea.X; + rect.Y = rectDockArea.Y + rectDockArea.Height - (int)autoHideSize + Theme.Measures.DockPadding; + rect.Width = rectDockArea.Width; + rect.Height = (int)autoHideSize; + } + + return rect; + } + } + + internal Rectangle GetAutoHideWindowBounds(Rectangle rectAutoHideWindow) + { + if (DocumentStyle == DocumentStyle.SystemMdi || + DocumentStyle == DocumentStyle.DockingMdi) + return (Parent == null) ? Rectangle.Empty : Parent.RectangleToClient(RectangleToScreen(rectAutoHideWindow)); + else + return rectAutoHideWindow; + } + + internal void RefreshAutoHideStrip() + { + AutoHideStripControl.RefreshChanges(); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DockDragHandler.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DockDragHandler.cs new file mode 100644 index 000000000..867501757 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DockDragHandler.cs @@ -0,0 +1,551 @@ +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Drawing2D; +//using Vanara.PInvoke; +using System.Diagnostics; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPanel + { + #region IHitTest + public interface IHitTest + { + DockStyle HitTest(Point pt); + DockStyle Status { get; set; } + } + + public interface IPaneIndicator : IHitTest + { + Point Location { get; set; } + bool Visible { get; set; } + int Left { get; } + int Top { get; } + int Right { get; } + int Bottom { get; } + Rectangle ClientRectangle { get; } + int Width { get; } + int Height { get; } + GraphicsPath DisplayingGraphicsPath { get; } + } + + public interface IPanelIndicator : IHitTest + { + Point Location { get; set; } + bool Visible { get; set; } + Rectangle Bounds { get; } + int Width { get; } + int Height { get; } + } + + public 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; } + } + } + + #endregion + + public sealed class DockDragHandler : DragHandler + { + public class DockIndicator : DragForm + { + #region consts + private int _PanelIndicatorMargin = 10; + #endregion + + private DockDragHandler m_dragHandler; + + public DockIndicator(DockDragHandler dragHandler) + { + m_dragHandler = dragHandler; + Controls.AddRange(new[] { + (Control)PaneDiamond, + (Control)PanelLeft, + (Control)PanelRight, + (Control)PanelTop, + (Control)PanelBottom, + (Control)PanelFill + }); + Region = new Region(Rectangle.Empty); + } + + private IPaneIndicator m_paneDiamond = null; + private IPaneIndicator PaneDiamond + { + get + { + if (m_paneDiamond == null) + m_paneDiamond = m_dragHandler.DockPanel.Theme.Extender.PaneIndicatorFactory.CreatePaneIndicator(m_dragHandler.DockPanel.Theme); + + return m_paneDiamond; + } + } + + private IPanelIndicator m_panelLeft = null; + private IPanelIndicator PanelLeft + { + get + { + if (m_panelLeft == null) + m_panelLeft = m_dragHandler.DockPanel.Theme.Extender.PanelIndicatorFactory.CreatePanelIndicator(DockStyle.Left, m_dragHandler.DockPanel.Theme); + + return m_panelLeft; + } + } + + private IPanelIndicator m_panelRight = null; + private IPanelIndicator PanelRight + { + get + { + if (m_panelRight == null) + m_panelRight = m_dragHandler.DockPanel.Theme.Extender.PanelIndicatorFactory.CreatePanelIndicator(DockStyle.Right, m_dragHandler.DockPanel.Theme); + + return m_panelRight; + } + } + + private IPanelIndicator m_panelTop = null; + private IPanelIndicator PanelTop + { + get + { + if (m_panelTop == null) + m_panelTop = m_dragHandler.DockPanel.Theme.Extender.PanelIndicatorFactory.CreatePanelIndicator(DockStyle.Top, m_dragHandler.DockPanel.Theme); + + return m_panelTop; + } + } + + private IPanelIndicator m_panelBottom = null; + private IPanelIndicator PanelBottom + { + get + { + if (m_panelBottom == null) + m_panelBottom = m_dragHandler.DockPanel.Theme.Extender.PanelIndicatorFactory.CreatePanelIndicator(DockStyle.Bottom, m_dragHandler.DockPanel.Theme); + + return m_panelBottom; + } + } + + private IPanelIndicator m_panelFill = null; + private IPanelIndicator PanelFill + { + get + { + if (m_panelFill == null) + m_panelFill = m_dragHandler.DockPanel.Theme.Extender.PanelIndicatorFactory.CreatePanelIndicator(DockStyle.Fill, m_dragHandler.DockPanel.Theme); + + 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(); + } + } + + public DockDragHandler DragHandler + { + get { return m_dragHandler; } + } + + public DockPanel DockPanel + { + get { return DragHandler.DockPanel; } + } + + private DockPane m_dockPane = null; + public DockPane DockPane + { + get { return m_dockPane; } + internal 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() + { + if (PatchController.EnablePerScreenDpi == true) + { + //SHCore.PROCESS_DPI_AWARENESS value; + //if (SHCore.GetProcessDpiAwareness(Process.GetCurrentProcess().Handle, out value) == HRESULT.S_OK) + //{ + // if (value == SHCore.PROCESS_DPI_AWARENESS.PROCESS_SYSTEM_DPI_AWARE) + // { + var allScreens = Screen.AllScreens; + var mousePos = Control.MousePosition; + foreach (var screen in allScreens) + { + if (screen.Bounds.Contains(mousePos)) + { + Bounds = screen.Bounds; + } + } + // } + //} + } + + Region region = new Region(Rectangle.Empty); + Rectangle rectDockArea = FullPanelEdge ? DockPanel.DockArea : DockPanel.DocumentWindowBounds; + + rectDockArea = RectangleToClient(DockPanel.RectangleToScreen(rectDockArea)); + 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 = RectangleToClient(DockPanel.RectangleToScreen(DockPanel.DocumentWindowBounds)); + 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 = RectangleToClient(DockPane.RectangleToScreen(DockPane.ClientRectangle)); + 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(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.DragSource.IsDockStateValid(dockState); + } + + private bool ShouldPaneDiamondVisible() + { + if (DockPane == null) + return false; + + if (!DockPanel.AllowEndUserNestedDocking) + return false; + + return DragHandler.DragSource.CanDockTo(DockPane); + } + + public override void Show(bool bActivate) + { + base.Show(bActivate); + if (PatchController.EnablePerScreenDpi != true) + { + Bounds = SystemInformation.VirtualScreen; + } + + 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 IPaneIndicator) + DragHandler.Outline.Show(DockPane, HitTestResult.Status); + else + DragHandler.Outline.Show(DockPanel, HitTestResult.Status, FullPanelEdge); + } + } + + private static DockStyle TestDrop(IHitTest hitTest, Point pt) + { + return hitTest.Status = hitTest.HitTest(pt); + } + } + + public DockDragHandler(DockPanel panel) + : base(panel) + { + } + + public new IDockDragSource DragSource + { + get { return base.DragSource as IDockDragSource; } + set { base.DragSource = value; } + } + + private DockOutlineBase m_outline; + public DockOutlineBase Outline + { + get { return m_outline; } + private set { m_outline = value; } + } + + private DockIndicator m_indicator; + private DockIndicator Indicator + { + get { return m_indicator; } + set { m_indicator = value; } + } + + private Rectangle m_floatOutlineBounds; + private Rectangle FloatOutlineBounds + { + get { return m_floatOutlineBounds; } + set { m_floatOutlineBounds = value; } + } + + public void BeginDrag(IDockDragSource dragSource) + { + DragSource = dragSource; + + if (!BeginDrag()) + { + DragSource = null; + return; + } + + Outline = DockPanel.Theme.Extender.DockOutlineFactory.CreateDockOutline(); + Indicator = DockPanel.Theme.Extender.DockIndicatorFactory.CreateDockIndicator(this); + Indicator.Show(false); + + FloatOutlineBounds = DragSource.BeginDrag(StartMousePosition); + } + + protected override void OnDragging() + { + TestDrop(); + } + + protected override void OnEndDrag(bool abort) + { + DockPanel.SuspendLayout(true); + + Outline.Close(); + Indicator.Close(); + + EndDrag(abort); + + // Queue a request to layout all children controls + DockPanel.PerformMdiClientLayout(); + + DockPanel.ResumeLayout(true, true); + + DragSource.EndDrag(); + + DragSource = null; + + // Fire notification + DockPanel.OnDocumentDragged(); + } + + private void TestDrop() + { + Outline.FlagTestDrop = false; + + Indicator.FullPanelEdge = ((Control.ModifierKeys & Keys.Shift) != 0); + + if ((Control.ModifierKeys & Keys.Control) == 0) + { + Indicator.TestDrop(); + + if (!Outline.FlagTestDrop) + { + DockPane pane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel); + if (pane != null && DragSource.IsDockStateValid(pane.DockState)) + pane.TestDrop(DragSource, Outline); + } + + if (!Outline.FlagTestDrop && DragSource.IsDockStateValid(DockState.Float)) + { + FloatWindow floatWindow = DockHelper.FloatWindowAtPoint(Control.MousePosition, DockPanel); + if (floatWindow != null) + floatWindow.TestDrop(DragSource, Outline); + } + } + else + Indicator.DockPane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel); + + if (!Outline.FlagTestDrop) + { + if (DragSource.IsDockStateValid(DockState.Float)) + { + Rectangle rect = FloatOutlineBounds; + rect.Offset(Control.MousePosition.X - StartMousePosition.X, Control.MousePosition.Y - StartMousePosition.Y); + Outline.Show(rect); + } + } + + if (!Outline.FlagTestDrop) + { + Cursor.Current = Cursors.No; + Outline.Show(); + } + else + Cursor.Current = DragControl.Cursor; + } + + private void EndDrag(bool abort) + { + if (abort) + return; + + if (!Outline.FloatWindowBounds.IsEmpty) + DragSource.FloatAt(Outline.FloatWindowBounds); + else if (Outline.DockTo is DockPane) + { + DockPane pane = Outline.DockTo as DockPane; + DragSource.DockTo(pane, Outline.Dock, Outline.ContentIndex); + } + else if (Outline.DockTo is DockPanel) + { + DockPanel panel = Outline.DockTo as DockPanel; + panel.UpdateDockWindowZOrder(Outline.Dock, Outline.FlagFullEdge); + DragSource.DockTo(panel, Outline.Dock); + } + } + } + + private DockDragHandler m_dockDragHandler = null; + private DockDragHandler GetDockDragHandler() + { + if (m_dockDragHandler == null) + m_dockDragHandler = new DockDragHandler(this); + return m_dockDragHandler; + } + + internal void BeginDrag(IDockDragSource dragSource) + { + GetDockDragHandler().BeginDrag(dragSource); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DragHandler.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DragHandler.cs new file mode 100644 index 000000000..08d1ce7fc --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.DragHandler.cs @@ -0,0 +1,163 @@ +using System.Windows.Forms; +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPanel + { + /// + /// DragHandlerBase is the base class for drag handlers. The derived class should: + /// 1. Define its public method BeginDrag. From within this public BeginDrag method, + /// DragHandlerBase.BeginDrag should be called to initialize the mouse capture + /// and message filtering. + /// 2. Override the OnDragging and OnEndDrag methods. + /// + public abstract class DragHandlerBase : NativeWindow, IMessageFilter + { + protected DragHandlerBase() + { + } + + protected abstract Control DragControl + { + get; + } + + private Point m_startMousePosition = Point.Empty; + protected Point StartMousePosition + { + get { return m_startMousePosition; } + private set { m_startMousePosition = value; } + } + + protected bool BeginDrag() + { + if (DragControl == null) + return false; + + StartMousePosition = Control.MousePosition; + + if (!Win32Helper.IsRunningOnMono) + { + if (!NativeMethods.DragDetect(DragControl.Handle, StartMousePosition)) + { + return false; + } + } + + DragControl.FindForm().Capture = true; + AssignHandle(DragControl.FindForm().Handle); + if (PatchController.EnableActiveXFix == false) + { + Application.AddMessageFilter(this); + } + + return true; + } + + protected abstract void OnDragging(); + + protected abstract void OnEndDrag(bool abort); + + private void EndDrag(bool abort) + { + ReleaseHandle(); + + if (PatchController.EnableActiveXFix == false) + { + Application.RemoveMessageFilter(this); + } + + DragControl.FindForm().Capture = false; + + OnEndDrag(abort); + } + + bool IMessageFilter.PreFilterMessage(ref Message m) + { + if (PatchController.EnableActiveXFix == false) + { + if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE) + OnDragging(); + else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONUP) + EndDrag(false); + else if (m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED) + EndDrag(!Win32Helper.IsRunningOnMono); + else if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN && (int)m.WParam == (int)Keys.Escape) + EndDrag(true); + } + + return OnPreFilterMessage(ref m); + } + + protected virtual bool OnPreFilterMessage(ref Message m) + { + if (PatchController.EnableActiveXFix == true) + { + if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE) + OnDragging(); + else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONUP) + EndDrag(false); + else if (m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED) + EndDrag(!Win32Helper.IsRunningOnMono); + else if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN && (int)m.WParam == (int)Keys.Escape) + EndDrag(true); + } + + return false; + } + + protected sealed override void WndProc(ref Message m) + { + if (PatchController.EnableActiveXFix == true) + { + //Manually pre-filter message, rather than using + //Application.AddMessageFilter(this). This fixes + //the docker control for ActiveX objects + this.OnPreFilterMessage(ref m); + } + + if (m.Msg == (int)Win32.Msgs.WM_CANCELMODE || m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED) + EndDrag(true); + + base.WndProc(ref m); + } + } + + public abstract class DragHandler : DragHandlerBase + { + private DockPanel m_dockPanel; + + protected DragHandler(DockPanel dockPanel) + { + m_dockPanel = dockPanel; + } + + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + private IDragSource m_dragSource; + protected IDragSource DragSource + { + get { return m_dragSource; } + set { m_dragSource = value; } + } + + protected sealed override Control DragControl + { + get { return DragSource == null ? null : DragSource.DragControl; } + } + + protected sealed override bool OnPreFilterMessage(ref Message m) + { + if ((m.Msg == (int)Win32.Msgs.WM_KEYDOWN || m.Msg == (int)Win32.Msgs.WM_KEYUP) && + ((int)m.WParam == (int)Keys.ControlKey || (int)m.WParam == (int)Keys.ShiftKey)) + OnDragging(); + + return base.OnPreFilterMessage(ref m); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.FocusManager.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.FocusManager.cs new file mode 100644 index 000000000..4509e1b6d --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.FocusManager.cs @@ -0,0 +1,632 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + internal interface IContentFocusManager + { + void Activate(IDockContent content); + void GiveUpFocus(IDockContent content); + void AddToList(IDockContent content); + void RemoveFromList(IDockContent content); + } + + partial class DockPanel + { + private interface IFocusManager + { + void SuspendFocusTracking(); + void ResumeFocusTracking(); + bool IsFocusTrackingSuspended { get; } + IDockContent ActiveContent { get; } + DockPane ActivePane { get; } + IDockContent ActiveDocument { get; } + DockPane ActiveDocumentPane { get; } + } + + private class FocusManagerImpl : Component, IContentFocusManager, IFocusManager + { + private class HookEventArgs : EventArgs + { + [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + public int HookCode; + [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + public IntPtr wParam; + public IntPtr lParam; + } + + private class LocalWindowsHook : IDisposable + { + // Internal properties + private IntPtr m_hHook = IntPtr.Zero; + private NativeMethods.HookProc m_filterFunc = null; + private Win32.HookType m_hookType; + + // Event delegate + public delegate void HookEventHandler(object sender, HookEventArgs e); + + // Event: HookInvoked + public event HookEventHandler HookInvoked; + protected void OnHookInvoked(HookEventArgs e) + { + if (HookInvoked != null) + HookInvoked(this, e); + } + + public LocalWindowsHook(Win32.HookType hook) + { + m_hookType = hook; + m_filterFunc = new NativeMethods.HookProc(this.CoreHookProc); + } + + // Default filter function + public IntPtr CoreHookProc(int code, IntPtr wParam, IntPtr lParam) + { + if (code < 0) + return NativeMethods.CallNextHookEx(m_hHook, code, wParam, lParam); + + // Let clients determine what to do + HookEventArgs e = new HookEventArgs(); + e.HookCode = code; + e.wParam = wParam; + e.lParam = lParam; + OnHookInvoked(e); + + // Yield to the next hook in the chain + return NativeMethods.CallNextHookEx(m_hHook, code, wParam, lParam); + } + + // Install the hook + public void Install() + { + if (m_hHook != IntPtr.Zero) + Uninstall(); + + int threadId = NativeMethods.GetCurrentThreadId(); + m_hHook = NativeMethods.SetWindowsHookEx(m_hookType, m_filterFunc, IntPtr.Zero, threadId); + } + + // Uninstall the hook + public void Uninstall() + { + if (m_hHook != IntPtr.Zero) + { + NativeMethods.UnhookWindowsHookEx(m_hHook); + m_hHook = IntPtr.Zero; + } + } + + ~LocalWindowsHook() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + Uninstall(); + } + } + + // Use a static instance of the windows hook to prevent stack overflows in the windows kernel. + [ThreadStatic] + private static LocalWindowsHook sm_localWindowsHook; + [ThreadStatic] + private static int _referenceCount = 0; + + private readonly LocalWindowsHook.HookEventHandler m_hookEventHandler; + + public FocusManagerImpl(DockPanel dockPanel) + { + m_dockPanel = dockPanel; + if (Win32Helper.IsRunningOnMono) + return; + m_hookEventHandler = new LocalWindowsHook.HookEventHandler(HookEventHandler); + + // Ensure the windows hook has been created for this thread + if (sm_localWindowsHook == null) + { + sm_localWindowsHook = new LocalWindowsHook(Win32.HookType.WH_CALLWNDPROCRET); + sm_localWindowsHook.Install(); + } + + sm_localWindowsHook.HookInvoked += m_hookEventHandler; + ++_referenceCount; + } + + private DockPanel m_dockPanel; + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + private bool m_disposed = false; + protected override void Dispose(bool disposing) + { + if (!m_disposed && disposing) + { + if (!Win32Helper.IsRunningOnMono) + { + sm_localWindowsHook.HookInvoked -= m_hookEventHandler; + } + + --_referenceCount; + + if (_referenceCount == 0 && sm_localWindowsHook != null) + { + sm_localWindowsHook.Dispose(); + sm_localWindowsHook = null; + } + + m_disposed = true; + } + + base.Dispose(disposing); + } + + private IDockContent m_contentActivating = null; + private IDockContent ContentActivating + { + get { return m_contentActivating; } + set { m_contentActivating = value; } + } + + public void Activate(IDockContent content) + { + if (IsFocusTrackingSuspended) + { + ContentActivating = content; + return; + } + + if (content == null) + return; + DockContentHandler handler = content.DockHandler; + if (handler.Form.IsDisposed) + return; // Should not reach here, but better than throwing an exception + if (ContentContains(content, handler.ActiveWindowHandle)) + { + if (!Win32Helper.IsRunningOnMono) + { + NativeMethods.SetFocus(handler.ActiveWindowHandle); + } + } + + if (handler.Form.ContainsFocus) + return; + + if (handler.Form.SelectNextControl(handler.Form.ActiveControl, true, true, true, true)) + return; + + if (Win32Helper.IsRunningOnMono) + return; + + // Since DockContent Form is not selectalbe, use Win32 SetFocus instead + NativeMethods.SetFocus(handler.Form.Handle); + } + + private List m_listContent = new List(); + private List ListContent + { + get { return m_listContent; } + } + public void AddToList(IDockContent content) + { + if (ListContent.Contains(content) || IsInActiveList(content)) + return; + + ListContent.Add(content); + } + + public void RemoveFromList(IDockContent content) + { + if (IsInActiveList(content)) + RemoveFromActiveList(content); + if (ListContent.Contains(content)) + ListContent.Remove(content); + } + + private IDockContent m_lastActiveContent = null; + private IDockContent LastActiveContent + { + get { return m_lastActiveContent; } + set { m_lastActiveContent = value; } + } + + private bool IsInActiveList(IDockContent content) + { + return !(content.DockHandler.NextActive == null && LastActiveContent != content); + } + + private void AddLastToActiveList(IDockContent content) + { + IDockContent last = LastActiveContent; + if (last == content) + return; + + DockContentHandler handler = content.DockHandler; + + if (IsInActiveList(content)) + RemoveFromActiveList(content); + + handler.PreviousActive = last; + handler.NextActive = null; + LastActiveContent = content; + if (last != null) + last.DockHandler.NextActive = LastActiveContent; + } + + private void RemoveFromActiveList(IDockContent content) + { + if (LastActiveContent == content) + LastActiveContent = content.DockHandler.PreviousActive; + + IDockContent prev = content.DockHandler.PreviousActive; + IDockContent next = content.DockHandler.NextActive; + if (prev != null) + prev.DockHandler.NextActive = next; + if (next != null) + next.DockHandler.PreviousActive = prev; + + content.DockHandler.PreviousActive = null; + content.DockHandler.NextActive = null; + } + + public void GiveUpFocus(IDockContent content) + { + DockContentHandler handler = content.DockHandler; + if (!handler.Form.ContainsFocus) + return; + + if (IsFocusTrackingSuspended) + DockPanel.DummyControl.Focus(); + + if (LastActiveContent == content) + { + IDockContent prev = handler.PreviousActive; + if (prev != null) + Activate(prev); + else if (ListContent.Count > 0) + Activate(ListContent[ListContent.Count - 1]); + } + else if (LastActiveContent != null) + Activate(LastActiveContent); + else if (ListContent.Count > 0) + Activate(ListContent[ListContent.Count - 1]); + } + + private static bool ContentContains(IDockContent content, IntPtr hWnd) + { + Control control = Control.FromChildHandle(hWnd); + for (Control parent = control; parent != null; parent = parent.Parent) + if (parent == content.DockHandler.Form) + return true; + + return false; + } + + private uint m_countSuspendFocusTracking = 0; + public void SuspendFocusTracking() + { + if (m_disposed) + return; + + if (m_countSuspendFocusTracking++ == 0) + { + if (!Win32Helper.IsRunningOnMono) + sm_localWindowsHook.HookInvoked -= m_hookEventHandler; + } + } + + public void ResumeFocusTracking() + { + if (m_disposed || m_countSuspendFocusTracking == 0) + return; + + if (--m_countSuspendFocusTracking == 0) + { + if (ContentActivating != null) + { + Activate(ContentActivating); + ContentActivating = null; + } + + if (!Win32Helper.IsRunningOnMono) + sm_localWindowsHook.HookInvoked += m_hookEventHandler; + + if (!InRefreshActiveWindow) + RefreshActiveWindow(); + } + } + + public bool IsFocusTrackingSuspended + { + get { return m_countSuspendFocusTracking != 0; } + } + + // Windows hook event handler + private void HookEventHandler(object sender, HookEventArgs e) + { + Win32.Msgs msg = (Win32.Msgs)Marshal.ReadInt32(e.lParam, IntPtr.Size * 3); + + if (msg == Win32.Msgs.WM_KILLFOCUS) + { + IntPtr wParam = Marshal.ReadIntPtr(e.lParam, IntPtr.Size * 2); + DockPane pane = GetPaneFromHandle(wParam); + if (pane == null) + RefreshActiveWindow(); + } + else if (msg == Win32.Msgs.WM_SETFOCUS || msg == Win32.Msgs.WM_MDIACTIVATE) + RefreshActiveWindow(); + } + + 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 == DockPanel) + return content.DockHandler.Pane; + + pane = control as DockPane; + if (pane != null && pane.DockPanel == DockPanel) + break; + } + + return pane; + } + + private bool m_inRefreshActiveWindow = false; + private bool InRefreshActiveWindow + { + get { return m_inRefreshActiveWindow; } + } + + private void RefreshActiveWindow() + { + if (DockPanel.Theme == null) + { + return; + } + + SuspendFocusTracking(); + m_inRefreshActiveWindow = true; + + DockPane oldActivePane = ActivePane; + IDockContent oldActiveContent = ActiveContent; + IDockContent oldActiveDocument = ActiveDocument; + + SetActivePane(); + SetActiveContent(); + SetActiveDocumentPane(); + SetActiveDocument(); + DockPanel.AutoHideWindow.RefreshActivePane(); + + ResumeFocusTracking(); + m_inRefreshActiveWindow = false; + + if (oldActiveContent != ActiveContent) + DockPanel.OnActiveContentChanged(EventArgs.Empty); + if (oldActiveDocument != ActiveDocument) + DockPanel.OnActiveDocumentChanged(EventArgs.Empty); + if (oldActivePane != ActivePane) + DockPanel.OnActivePaneChanged(EventArgs.Empty); + } + + private DockPane m_activePane = null; + public DockPane ActivePane + { + get { return m_activePane; } + } + + private void SetActivePane() + { + DockPane value = Win32Helper.IsRunningOnMono ? null : GetPaneFromHandle(NativeMethods.GetFocus()); + if (m_activePane == value) + return; + + if (m_activePane != null) + m_activePane.SetIsActivated(false); + + m_activePane = value; + + if (m_activePane != null) + m_activePane.SetIsActivated(true); + } + + private IDockContent m_activeContent = null; + public IDockContent ActiveContent + { + get { return m_activeContent; } + } + + internal void SetActiveContent() + { + IDockContent value = ActivePane == null ? null : ActivePane.ActiveContent; + + if (m_activeContent == value) + return; + + if (m_activeContent != null) + m_activeContent.DockHandler.IsActivated = false; + + m_activeContent = value; + + if (m_activeContent != null) + { + m_activeContent.DockHandler.IsActivated = true; + if (!DockHelper.IsDockStateAutoHide((m_activeContent.DockHandler.DockState))) + AddLastToActiveList(m_activeContent); + } + } + + private DockPane m_activeDocumentPane = null; + public DockPane ActiveDocumentPane + { + get { return m_activeDocumentPane; } + } + + private void SetActiveDocumentPane() + { + DockPane value = null; + + if (ActivePane != null && ActivePane.DockState == DockState.Document) + value = ActivePane; + + if (value == null && DockPanel.DockWindows != null) + { + if (ActiveDocumentPane == null) + value = DockPanel.DockWindows[DockState.Document].DefaultPane; + else if (ActiveDocumentPane.DockPanel != DockPanel || ActiveDocumentPane.DockState != DockState.Document) + value = DockPanel.DockWindows[DockState.Document].DefaultPane; + else + value = ActiveDocumentPane; + } + + if (m_activeDocumentPane == value) + return; + + if (m_activeDocumentPane != null) + m_activeDocumentPane.SetIsActiveDocumentPane(false); + + m_activeDocumentPane = value; + + if (m_activeDocumentPane != null) + m_activeDocumentPane.SetIsActiveDocumentPane(true); + } + + private IDockContent m_activeDocument = null; + public IDockContent ActiveDocument + { + get { return m_activeDocument; } + } + + private void SetActiveDocument() + { + IDockContent value = ActiveDocumentPane == null ? null : ActiveDocumentPane.ActiveContent; + + if (m_activeDocument == value) + return; + + m_activeDocument = value; + } + } + + private IFocusManager FocusManager + { + get { return m_focusManager; } + } + + internal IContentFocusManager ContentFocusManager + { + get { return m_focusManager; } + } + + internal void SaveFocus() + { + DummyControl.Focus(); + } + + [Browsable(false)] + public IDockContent ActiveContent + { + get { return FocusManager.ActiveContent; } + } + + [Browsable(false)] + public DockPane ActivePane + { + get { return FocusManager.ActivePane; } + } + + [Browsable(false)] + public IDockContent ActiveDocument + { + get { return FocusManager.ActiveDocument; } + } + + [Browsable(false)] + public DockPane ActiveDocumentPane + { + get { return FocusManager.ActiveDocumentPane; } + } + + private static readonly object ActiveDocumentChangedEvent = new object(); + [LocalizedCategory("Category_PropertyChanged")] + [LocalizedDescription("DockPanel_ActiveDocumentChanged_Description")] + public event EventHandler ActiveDocumentChanged + { + add { Events.AddHandler(ActiveDocumentChangedEvent, value); } + remove { Events.RemoveHandler(ActiveDocumentChangedEvent, value); } + } + protected virtual void OnActiveDocumentChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[ActiveDocumentChangedEvent]; + if (handler != null) + handler(this, e); + } + + private static readonly object ActiveContentChangedEvent = new object(); + [LocalizedCategory("Category_PropertyChanged")] + [LocalizedDescription("DockPanel_ActiveContentChanged_Description")] + public event EventHandler ActiveContentChanged + { + add { Events.AddHandler(ActiveContentChangedEvent, value); } + remove { Events.RemoveHandler(ActiveContentChangedEvent, value); } + } + + protected void OnActiveContentChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[ActiveContentChangedEvent]; + if (handler != null) + handler(this, e); + } + + private static readonly object DocumentDraggedEvent = new object(); + [LocalizedCategory("Category_PropertyChanged")] + [LocalizedDescription("DockPanel_ActiveContentChanged_Description")] + public event EventHandler DocumentDragged + { + add { Events.AddHandler(DocumentDraggedEvent, value); } + remove { Events.RemoveHandler(DocumentDraggedEvent, value); } + } + + internal void OnDocumentDragged() + { + EventHandler handler = (EventHandler)Events[DocumentDraggedEvent]; + if (handler != null) + handler(this, EventArgs.Empty); + } + + private static readonly object ActivePaneChangedEvent = new object(); + [LocalizedCategory("Category_PropertyChanged")] + [LocalizedDescription("DockPanel_ActivePaneChanged_Description")] + public event EventHandler ActivePaneChanged + { + add { Events.AddHandler(ActivePaneChangedEvent, value); } + remove { Events.RemoveHandler(ActivePaneChangedEvent, value); } + } + protected virtual void OnActivePaneChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[ActivePaneChangedEvent]; + if (handler != null) + handler(this, e); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.MdiClientController.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.MdiClientController.cs new file mode 100644 index 000000000..989fec129 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.MdiClientController.cs @@ -0,0 +1,441 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.ComponentModel; +using System.ComponentModel.Design; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPanel + { + // This class comes from Jacob Slusser's MdiClientController class: + // http://www.codeproject.com/cs/miscctrl/mdiclientcontroller.asp + private class MdiClientController : NativeWindow, IComponent, IDisposable + { + private bool m_autoScroll = true; + private BorderStyle m_borderStyle = BorderStyle.Fixed3D; + private MdiClient m_mdiClient = null; + private Form m_parentForm = null; + private ISite m_site = null; + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (Site != null && Site.Container != null) + Site.Container.Remove(this); + + Disposed?.Invoke(this, EventArgs.Empty); + } + } + + 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(); + } + } + + public BorderStyle 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 + + if (!Win32Helper.IsRunningOnMono) + { + // Get styles using Win32 calls + int style = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE); + int exStyle = NativeMethods.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 + NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE, style); + NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, exStyle); + } + + // Cause an update of the non-client area. + UpdateStyles(); + } + } + + public MdiClient MdiClient + { + get { return m_mdiClient; } + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + 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); + } + } + + 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; + } + } + } + + public void RenewMdiClient() + { + // Reinitialize the MdiClient and its properties. + InitializeMdiClient(); + RefreshProperties(); + } + + public event EventHandler Disposed; + + public event EventHandler HandleAssigned; + + public event EventHandler MdiChildActivate; + + 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); + } + + 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) + { + 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) + { + if (!Win32Helper.IsRunningOnMono) + { + NativeMethods.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 + BorderStyle = m_borderStyle; + AutoScroll = m_autoScroll; + } + + 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. + if (!Win32Helper.IsRunningOnMono) + NativeMethods.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); + } + } + + private MdiClientController m_mdiClientController = null; + private MdiClientController GetMdiClientController() + { + 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 ParentFormMdiChildActivate(object sender, EventArgs e) + { + if (GetMdiClientController().ParentForm == null) + return; + + IDockContent content = GetMdiClientController().ParentForm.ActiveMdiChild as IDockContent; + if (content == null) + return; + + if (content.DockHandler.DockPanel == this && content.DockHandler.Pane != null) + { + if (content.DockHandler.Pane.DisplayingContents.Contains(content)) + { + content.DockHandler.Pane.ActiveContent = content; + } + else if (PatchController.EnableActiveControlFix != true) + { + content.DockHandler.Pane.ActiveContent = content; + } + } + } + + private bool MdiClientExists + { + get { return GetMdiClientController().MdiClient != null; } + } + + private void SetMdiClientBounds(Rectangle bounds) + { + GetMdiClientController().MdiClient.Bounds = bounds; + } + + private void SuspendMdiClientLayout() + { + if (GetMdiClientController().MdiClient != null) + GetMdiClientController().MdiClient.SuspendLayout(); + } + + private void ResumeMdiClientLayout(bool perform) + { + if (GetMdiClientController().MdiClient != null) + GetMdiClientController().MdiClient.ResumeLayout(perform); + } + + private void PerformMdiClientLayout() + { + if (GetMdiClientController().MdiClient != null) + GetMdiClientController().MdiClient.PerformLayout(); + } + + // Called when: + // 1. DockPanel.DocumentStyle changed + // 2. DockPanel.Visible changed + // 3. MdiClientController.Handle assigned + private void SetMdiClient() + { + MdiClientController controller = GetMdiClientController(); + + if (this.DocumentStyle == DocumentStyle.DockingMdi) + { + controller.AutoScroll = false; + controller.BorderStyle = BorderStyle.None; + if (MdiClientExists) + controller.MdiClient.Dock = DockStyle.Fill; + } + else if (DocumentStyle == DocumentStyle.DockingSdi || DocumentStyle == DocumentStyle.DockingWindow) + { + controller.AutoScroll = true; + controller.BorderStyle = BorderStyle.Fixed3D; + if (MdiClientExists) + controller.MdiClient.Dock = DockStyle.Fill; + } + else if (this.DocumentStyle == DocumentStyle.SystemMdi) + { + controller.AutoScroll = true; + controller.BorderStyle = BorderStyle.Fixed3D; + if (controller.MdiClient != null) + { + controller.MdiClient.Dock = DockStyle.None; + controller.MdiClient.Bounds = SystemMdiClientBounds; + } + } + } + + internal Rectangle RectangleToMdiClient(Rectangle rect) + { + if (MdiClientExists) + return GetMdiClientController().MdiClient.RectangleToClient(rect); + else + return Rectangle.Empty; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Persistor.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Persistor.cs new file mode 100644 index 000000000..a7f583e55 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.Persistor.cs @@ -0,0 +1,816 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Xml; +using System.Globalization; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPanel + { + private static class Persistor + { + private const string ConfigFileVersion = "1.0"; + private static string[] CompatibleConfigFileVersions = { }; + + private class DummyContent : DockContent + { + } + + private struct DockPanelStruct + { + private double m_dockLeftPortion; + public double DockLeftPortion + { + get { return m_dockLeftPortion; } + set { m_dockLeftPortion = value; } + } + + private double m_dockRightPortion; + public double DockRightPortion + { + get { return m_dockRightPortion; } + set { m_dockRightPortion = value; } + } + + private double m_dockTopPortion; + public double DockTopPortion + { + get { return m_dockTopPortion; } + set { m_dockTopPortion = value; } + } + + private double m_dockBottomPortion; + public double DockBottomPortion + { + get { return m_dockBottomPortion; } + set { m_dockBottomPortion = value; } + } + + private int m_indexActiveDocumentPane; + public int IndexActiveDocumentPane + { + get { return m_indexActiveDocumentPane; } + set { m_indexActiveDocumentPane = value; } + } + + private int m_indexActivePane; + public int IndexActivePane + { + get { return m_indexActivePane; } + set { m_indexActivePane = value; } + } + } + + private struct ContentStruct + { + private string m_persistString; + public string PersistString + { + get { return m_persistString; } + set { m_persistString = value; } + } + + private double m_autoHidePortion; + public double AutoHidePortion + { + get { return m_autoHidePortion; } + set { m_autoHidePortion = value; } + } + + private bool m_isHidden; + public bool IsHidden + { + get { return m_isHidden; } + set { m_isHidden = value; } + } + + private bool m_isFloat; + public bool IsFloat + { + get { return m_isFloat; } + set { m_isFloat = value; } + } + } + + private struct PaneStruct + { + private DockState m_dockState; + public DockState DockState + { + get { return m_dockState; } + set { m_dockState = value; } + } + + private int m_indexActiveContent; + public int IndexActiveContent + { + get { return m_indexActiveContent; } + set { m_indexActiveContent = value; } + } + + private int[] m_indexContents; + public int[] IndexContents + { + get { return m_indexContents; } + set { m_indexContents = value; } + } + + private int m_zOrderIndex; + public int ZOrderIndex + { + get { return m_zOrderIndex; } + set { m_zOrderIndex = value; } + } + } + + private struct NestedPane + { + private int m_indexPane; + public int IndexPane + { + get { return m_indexPane; } + set { m_indexPane = value; } + } + + private int m_indexPrevPane; + public int IndexPrevPane + { + get { return m_indexPrevPane; } + set { m_indexPrevPane = value; } + } + + private DockAlignment m_alignment; + public DockAlignment Alignment + { + get { return m_alignment; } + set { m_alignment = value; } + } + + private double m_proportion; + public double Proportion + { + get { return m_proportion; } + set { m_proportion = value; } + } + } + + private struct DockWindowStruct + { + private DockState m_dockState; + public DockState DockState + { + get { return m_dockState; } + set { m_dockState = value; } + } + + private int m_zOrderIndex; + public int ZOrderIndex + { + get { return m_zOrderIndex; } + set { m_zOrderIndex = value; } + } + + private NestedPane[] m_nestedPanes; + public NestedPane[] NestedPanes + { + get { return m_nestedPanes; } + set { m_nestedPanes = value; } + } + } + + private struct FloatWindowStruct + { + private Rectangle m_bounds; + public Rectangle Bounds + { + get { return m_bounds; } + set { m_bounds = value; } + } + + private int m_zOrderIndex; + public int ZOrderIndex + { + get { return m_zOrderIndex; } + set { m_zOrderIndex = value; } + } + + private NestedPane[] m_nestedPanes; + public NestedPane[] NestedPanes + { + get { return m_nestedPanes; } + set { m_nestedPanes = value; } + } + } + + public static void SaveAsXml(DockPanel dockPanel, string fileName) + { + SaveAsXml(dockPanel, fileName, Encoding.Unicode); + } + + public static void SaveAsXml(DockPanel dockPanel, string fileName, Encoding encoding) + { + using (var fs = new FileStream(fileName, FileMode.Create)) + { + try + { + SaveAsXml(dockPanel, fs, encoding); + } + finally + { + fs.Close(); + } + } + } + + 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) + { + XmlWriter xmlOut = XmlWriter.Create(stream, new XmlWriterSettings() + { + Encoding = encoding, + Indent = true, + OmitXmlDeclaration = upstream + }); + + // Always begin file with identification and warning + xmlOut.WriteComment(Strings.DockPanel_Persistor_XmlFileComment1); + xmlOut.WriteComment(Strings.DockPanel_Persistor_XmlFileComment2); + + // Associate a version number with the root element so that future version of the code + // will be able to be backwards compatible or at least recognise out of date versions + xmlOut.WriteStartElement("DockPanel"); + xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion); + xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture)); + + if (!Win32Helper.IsRunningOnMono) + { + xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString(CultureInfo.InvariantCulture)); + } + + // Contents + xmlOut.WriteStartElement("Contents"); + xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString(CultureInfo.InvariantCulture)); + foreach (IDockContent content in dockPanel.Contents) + { + xmlOut.WriteStartElement("Content"); + xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("PersistString", content.DockHandler.PersistString); + xmlOut.WriteAttributeString("AutoHidePortion", content.DockHandler.AutoHidePortion.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("IsHidden", content.DockHandler.IsHidden.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("IsFloat", content.DockHandler.IsFloat.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); + + // Panes + xmlOut.WriteStartElement("Panes"); + xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString(CultureInfo.InvariantCulture)); + foreach (DockPane pane in dockPanel.Panes) + { + xmlOut.WriteStartElement("Pane"); + xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("DockState", pane.DockState.ToString()); + xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteStartElement("Contents"); + xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString(CultureInfo.InvariantCulture)); + foreach (IDockContent content in pane.Contents) + { + xmlOut.WriteStartElement("Content"); + xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); + + // DockWindows + xmlOut.WriteStartElement("DockWindows"); + int dockWindowId = 0; + foreach (DockWindow dw in dockPanel.DockWindows) + { + xmlOut.WriteStartElement("DockWindow"); + xmlOut.WriteAttributeString("ID", dockWindowId.ToString(CultureInfo.InvariantCulture)); + dockWindowId++; + xmlOut.WriteAttributeString("DockState", dw.DockState.ToString()); + xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteStartElement("NestedPanes"); + xmlOut.WriteAttributeString("Count", dw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture)); + foreach (DockPane pane in dw.NestedPanes) + { + xmlOut.WriteStartElement("Pane"); + xmlOut.WriteAttributeString("ID", dw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); + NestedDockingStatus status = pane.NestedDockingStatus; + xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); + xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); + + // FloatWindows + RectangleConverter rectConverter = new RectangleConverter(); + xmlOut.WriteStartElement("FloatWindows"); + xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString(CultureInfo.InvariantCulture)); + foreach (FloatWindow fw in dockPanel.FloatWindows) + { + xmlOut.WriteStartElement("FloatWindow"); + xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds)); + xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteStartElement("NestedPanes"); + xmlOut.WriteAttributeString("Count", fw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture)); + foreach (DockPane pane in fw.NestedPanes) + { + xmlOut.WriteStartElement("Pane"); + xmlOut.WriteAttributeString("ID", fw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture)); + NestedDockingStatus status = pane.NestedDockingStatus; + xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); + xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); + xmlOut.WriteEndElement(); + } + xmlOut.WriteEndElement(); // + + xmlOut.WriteEndElement(); + + if (!upstream) + { + xmlOut.WriteEndDocument(); + xmlOut.Close(); + } + else + xmlOut.Flush(); + } + + public static void LoadFromXml(DockPanel dockPanel, string fileName, DeserializeDockContent deserializeContent) + { + using (var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) + { + try + { + LoadFromXml(dockPanel, fs, deserializeContent, true); + } + finally + { + fs.Close(); + } + } + } + + private static ContentStruct[] LoadContents(XmlTextReader xmlIn) + { + int countOfContents = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture); + ContentStruct[] contents = new ContentStruct[countOfContents]; + MoveToNextElement(xmlIn); + for (int i = 0; i < countOfContents; i++) + { + int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "Content" || id != i) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + + contents[i].PersistString = xmlIn.GetAttribute("PersistString"); + contents[i].AutoHidePortion = Convert.ToDouble(xmlIn.GetAttribute("AutoHidePortion"), CultureInfo.InvariantCulture); + contents[i].IsHidden = Convert.ToBoolean(xmlIn.GetAttribute("IsHidden"), CultureInfo.InvariantCulture); + contents[i].IsFloat = Convert.ToBoolean(xmlIn.GetAttribute("IsFloat"), CultureInfo.InvariantCulture); + MoveToNextElement(xmlIn); + } + + return contents; + } + + private static PaneStruct[] LoadPanes(XmlTextReader xmlIn) + { + EnumConverter dockStateConverter = new EnumConverter(typeof(DockState)); + int countOfPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture); + PaneStruct[] panes = new PaneStruct[countOfPanes]; + MoveToNextElement(xmlIn); + for (int i = 0; i < countOfPanes; i++) + { + int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "Pane" || id != i) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + + panes[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState")); + panes[i].IndexActiveContent = Convert.ToInt32(xmlIn.GetAttribute("ActiveContent"), CultureInfo.InvariantCulture); + panes[i].ZOrderIndex = -1; + + MoveToNextElement(xmlIn); + if (xmlIn.Name != "Contents") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + int countOfPaneContents = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture); + panes[i].IndexContents = new int[countOfPaneContents]; + MoveToNextElement(xmlIn); + for (int j = 0; j < countOfPaneContents; j++) + { + int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "Content" || id2 != j) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + + panes[i].IndexContents[j] = Convert.ToInt32(xmlIn.GetAttribute("RefID"), CultureInfo.InvariantCulture); + MoveToNextElement(xmlIn); + } + } + + return panes; + } + + private static DockWindowStruct[] LoadDockWindows(XmlTextReader xmlIn, DockPanel dockPanel) + { + EnumConverter dockStateConverter = new EnumConverter(typeof(DockState)); + EnumConverter dockAlignmentConverter = new EnumConverter(typeof(DockAlignment)); + int countOfDockWindows = dockPanel.DockWindows.Count; + DockWindowStruct[] dockWindows = new DockWindowStruct[countOfDockWindows]; + MoveToNextElement(xmlIn); + for (int i = 0; i < countOfDockWindows; i++) + { + int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "DockWindow" || id != i) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + + dockWindows[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState")); + dockWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex"), CultureInfo.InvariantCulture); + MoveToNextElement(xmlIn); + if (xmlIn.Name != "DockList" && xmlIn.Name != "NestedPanes") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + int countOfNestedPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture); + dockWindows[i].NestedPanes = new NestedPane[countOfNestedPanes]; + MoveToNextElement(xmlIn); + for (int j = 0; j < countOfNestedPanes; j++) + { + int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "Pane" || id2 != j) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + dockWindows[i].NestedPanes[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID"), CultureInfo.InvariantCulture); + dockWindows[i].NestedPanes[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane"), CultureInfo.InvariantCulture); + dockWindows[i].NestedPanes[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment")); + dockWindows[i].NestedPanes[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture); + MoveToNextElement(xmlIn); + } + } + + return dockWindows; + } + + private static FloatWindowStruct[] LoadFloatWindows(XmlTextReader xmlIn) + { + EnumConverter dockAlignmentConverter = new EnumConverter(typeof(DockAlignment)); + RectangleConverter rectConverter = new RectangleConverter(); + int countOfFloatWindows = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture); + FloatWindowStruct[] floatWindows = new FloatWindowStruct[countOfFloatWindows]; + MoveToNextElement(xmlIn); + for (int i = 0; i < countOfFloatWindows; i++) + { + int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "FloatWindow" || id != i) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + + floatWindows[i].Bounds = (Rectangle)rectConverter.ConvertFromInvariantString(xmlIn.GetAttribute("Bounds")); + floatWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex"), CultureInfo.InvariantCulture); + MoveToNextElement(xmlIn); + if (xmlIn.Name != "DockList" && xmlIn.Name != "NestedPanes") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + int countOfNestedPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture); + floatWindows[i].NestedPanes = new NestedPane[countOfNestedPanes]; + MoveToNextElement(xmlIn); + for (int j = 0; j < countOfNestedPanes; j++) + { + int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture); + if (xmlIn.Name != "Pane" || id2 != j) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + floatWindows[i].NestedPanes[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID"), CultureInfo.InvariantCulture); + floatWindows[i].NestedPanes[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane"), CultureInfo.InvariantCulture); + floatWindows[i].NestedPanes[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment")); + floatWindows[i].NestedPanes[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture); + MoveToNextElement(xmlIn); + } + } + + return floatWindows; + } + + public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent, bool closeStream) + { + if (dockPanel.Contents.Count != 0) + throw new InvalidOperationException(Strings.DockPanel_LoadFromXml_AlreadyInitialized); + + DockPanelStruct dockPanelStruct; + ContentStruct[] contents; + PaneStruct[] panes; + DockWindowStruct[] dockWindows; + FloatWindowStruct[] floatWindows; + using (var xmlIn = new XmlTextReader(stream) { WhitespaceHandling = WhitespaceHandling.None }) + { + xmlIn.MoveToContent(); + + while (!xmlIn.Name.Equals("DockPanel")) + { + if (!MoveToNextElement(xmlIn)) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + } + + string formatVersion = xmlIn.GetAttribute("FormatVersion"); + if (!IsFormatVersionValid(formatVersion)) + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidFormatVersion); + + dockPanelStruct = new DockPanelStruct(); + dockPanelStruct.DockLeftPortion = Convert.ToDouble(xmlIn.GetAttribute("DockLeftPortion"), CultureInfo.InvariantCulture); + dockPanelStruct.DockRightPortion = Convert.ToDouble(xmlIn.GetAttribute("DockRightPortion"), CultureInfo.InvariantCulture); + dockPanelStruct.DockTopPortion = Convert.ToDouble(xmlIn.GetAttribute("DockTopPortion"), CultureInfo.InvariantCulture); + dockPanelStruct.DockBottomPortion = Convert.ToDouble(xmlIn.GetAttribute("DockBottomPortion"), CultureInfo.InvariantCulture); + dockPanelStruct.IndexActiveDocumentPane = Convert.ToInt32(xmlIn.GetAttribute("ActiveDocumentPane"), CultureInfo.InvariantCulture); + dockPanelStruct.IndexActivePane = Convert.ToInt32(xmlIn.GetAttribute("ActivePane"), CultureInfo.InvariantCulture); + + // Load Contents + MoveToNextElement(xmlIn); + if (xmlIn.Name != "Contents") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + contents = LoadContents(xmlIn); + + // Load Panes + if (xmlIn.Name != "Panes") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + panes = LoadPanes(xmlIn); + + // Load DockWindows + if (xmlIn.Name != "DockWindows") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + dockWindows = LoadDockWindows(xmlIn, dockPanel); + + // Load FloatWindows + if (xmlIn.Name != "FloatWindows") + throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat); + floatWindows = LoadFloatWindows(xmlIn); + + if (closeStream) + xmlIn.Close(); + } + + dockPanel.SuspendLayout(true); + + 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++) + { + IDockContent content = deserializeContent(contents[i].PersistString); + if (content == null) + content = new DummyContent(); + content.DockHandler.DockPanel = dockPanel; + content.DockHandler.AutoHidePortion = contents[i].AutoHidePortion; + content.DockHandler.IsHidden = true; + content.DockHandler.IsFloat = contents[i].IsFloat; + } + + // Create panes + for (int i = 0; i < panes.Length; i++) + { + DockPane pane = null; + for (int j = 0; j < panes[i].IndexContents.Length; j++) + { + IDockContent content = dockPanel.Contents[panes[i].IndexContents[j]]; + if (j == 0) + pane = dockPanel.Theme.Extender.DockPaneFactory.CreateDockPane(content, panes[i].DockState, false); + else if (panes[i].DockState == DockState.Float) + content.DockHandler.FloatPane = pane; + else + content.DockHandler.PanelPane = pane; + } + } + + // Assign Panes to DockWindows + for (int i = 0; i < dockWindows.Length; i++) + { + for (int j = 0; j < dockWindows[i].NestedPanes.Length; j++) + { + DockWindow dw = dockPanel.DockWindows[dockWindows[i].DockState]; + int indexPane = dockWindows[i].NestedPanes[j].IndexPane; + DockPane pane = dockPanel.Panes[indexPane]; + int indexPrevPane = dockWindows[i].NestedPanes[j].IndexPrevPane; + DockPane prevPane = (indexPrevPane == -1) ? dw.NestedPanes.GetDefaultPreviousPane(pane) : dockPanel.Panes[indexPrevPane]; + DockAlignment alignment = dockWindows[i].NestedPanes[j].Alignment; + double proportion = dockWindows[i].NestedPanes[j].Proportion; + pane.DockTo(dw, prevPane, alignment, proportion); + if (panes[indexPane].DockState == dw.DockState) + panes[indexPane].ZOrderIndex = dockWindows[i].ZOrderIndex; + } + } + + // Create float windows + for (int i = 0; i < floatWindows.Length; i++) + { + FloatWindow fw = null; + for (int j = 0; j < floatWindows[i].NestedPanes.Length; j++) + { + int indexPane = floatWindows[i].NestedPanes[j].IndexPane; + DockPane pane = dockPanel.Panes[indexPane]; + if (j == 0) + fw = dockPanel.Theme.Extender.FloatWindowFactory.CreateFloatWindow(dockPanel, pane, floatWindows[i].Bounds); + else + { + int indexPrevPane = floatWindows[i].NestedPanes[j].IndexPrevPane; + DockPane prevPane = indexPrevPane == -1 ? null : dockPanel.Panes[indexPrevPane]; + DockAlignment alignment = floatWindows[i].NestedPanes[j].Alignment; + double proportion = floatWindows[i].NestedPanes[j].Proportion; + pane.DockTo(fw, prevPane, alignment, proportion); + } + + if (panes[indexPane].DockState == fw.DockState) + panes[indexPane].ZOrderIndex = floatWindows[i].ZOrderIndex; + } + } + + // sort IDockContent by its Pane's ZOrder + int[] sortedContents = null; + if (contents.Length > 0) + { + sortedContents = new int[contents.Length]; + for (int i = 0; i < contents.Length; i++) + sortedContents[i] = i; + + int lastDocument = contents.Length; + for (int i = 0; i < contents.Length - 1; i++) + { + for (int j = i + 1; j < contents.Length; j++) + { + 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]].DockHandler.Pane; + int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex; + if (ZOrderIndex1 > ZOrderIndex2) + { + int temp = sortedContents[i]; + sortedContents[i] = sortedContents[j]; + sortedContents[j] = temp; + } + } + } + } + + // show non-document IDockContent first to avoid screen flickers + for (int i = 0; i < contents.Length; i++) + { + IDockContent content = dockPanel.Contents[sortedContents[i]]; + if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState != DockState.Document) + { + content.DockHandler.SuspendAutoHidePortionUpdates = true; + content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden; + content.DockHandler.SuspendAutoHidePortionUpdates = false; + } + } + + // after all non-document IDockContent, show document IDockContent + for (int i = 0; i < contents.Length; i++) + { + IDockContent content = dockPanel.Contents[sortedContents[i]]; + if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState == DockState.Document) + { + content.DockHandler.SuspendAutoHidePortionUpdates = true; + content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden; + content.DockHandler.SuspendAutoHidePortionUpdates = false; + } + } + + for (int i = 0; i < panes.Length; i++) + dockPanel.Panes[i].ActiveContent = panes[i].IndexActiveContent == -1 ? null : dockPanel.Contents[panes[i].IndexActiveContent]; + + if (dockPanelStruct.IndexActiveDocumentPane >= 0 && dockPanel.Panes.Count > dockPanelStruct.IndexActiveDocumentPane) + dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate(); + + if (dockPanelStruct.IndexActivePane >= 0 && dockPanel.Panes.Count > dockPanelStruct.IndexActivePane) + dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate(); + + for (int i = dockPanel.Contents.Count - 1; i >= 0; i--) + if (dockPanel.Contents[i] is DummyContent) + dockPanel.Contents[i].DockHandler.Form.Close(); + + dockPanel.ResumeLayout(true, true); + } + + private static bool MoveToNextElement(XmlTextReader xmlIn) + { + if (!xmlIn.Read()) + return false; + + while (xmlIn.NodeType == XmlNodeType.EndElement) + { + 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; + } + } + + public void SaveAsXml(string fileName) + { + Persistor.SaveAsXml(this, fileName); + } + + public void SaveAsXml(string fileName, Encoding encoding) + { + Persistor.SaveAsXml(this, fileName, encoding); + } + + public void SaveAsXml(Stream stream, Encoding encoding) + { + Persistor.SaveAsXml(this, stream, encoding); + } + + public void SaveAsXml(Stream stream, Encoding encoding, bool upstream) + { + Persistor.SaveAsXml(this, stream, encoding, upstream); + } + + /// + /// Loads layout from XML file. + /// + /// The file name. + /// Deserialization handler. + /// Deserialization might throw exceptions. + public void LoadFromXml(string fileName, DeserializeDockContent deserializeContent) + { + Persistor.LoadFromXml(this, fileName, deserializeContent); + } + + /// + /// Loads layout from a stream. + /// + /// The stream. + /// Deserialization handler. + /// Deserialization might throw exceptions. + /// + /// The stream is closed after deserialization. + /// + public void LoadFromXml(Stream stream, DeserializeDockContent deserializeContent) + { + Persistor.LoadFromXml(this, stream, deserializeContent, true); + } + + /// + /// Loads layout from a stream. + /// + /// The stream. + /// Deserialization handler. + /// The flag to close the stream after deserialization. + /// Deserialization might throw exceptions. + public void LoadFromXml(Stream stream, DeserializeDockContent deserializeContent, bool closeStream) + { + Persistor.LoadFromXml(this, stream, deserializeContent, closeStream); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs new file mode 100644 index 000000000..e96a8a441 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs @@ -0,0 +1,161 @@ +using System.Windows.Forms; +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + partial class DockPanel + { + private sealed class SplitterDragHandler : DragHandler + { + private 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.Bounds = Rectangle.Empty; + 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; + } + } + + public SplitterDragHandler(DockPanel dockPanel) + : base(dockPanel) + { + } + + public new ISplitterDragSource DragSource + { + get { return base.DragSource as ISplitterDragSource; } + private set { base.DragSource = value; } + } + + private SplitterOutline m_outline; + private SplitterOutline Outline + { + get { return m_outline; } + set { m_outline = value; } + } + + private Rectangle m_rectSplitter; + private Rectangle RectSplitter + { + get { return m_rectSplitter; } + set { m_rectSplitter = value; } + } + + public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter) + { + DragSource = dragSource; + RectSplitter = rectSplitter; + + if (!BeginDrag()) + { + DragSource = null; + return; + } + + Outline = new SplitterOutline(); + Outline.Show(rectSplitter); + DragSource.BeginDrag(rectSplitter); + } + + protected override void OnDragging() + { + Outline.Show(GetSplitterOutlineBounds(Control.MousePosition)); + } + + protected override void OnEndDrag(bool abort) + { + DockPanel.SuspendLayout(true); + + Outline.Close(); + + if (!abort) + DragSource.MoveSplitter(GetMovingOffset(Control.MousePosition)); + + DragSource.EndDrag(); + DockPanel.ResumeLayout(true, true); + } + + private int GetMovingOffset(Point ptMouse) + { + Rectangle rect = GetSplitterOutlineBounds(ptMouse); + if (DragSource.IsVertical) + return rect.X - RectSplitter.X; + else + return rect.Y - RectSplitter.Y; + } + + private Rectangle GetSplitterOutlineBounds(Point ptMouse) + { + Rectangle rectLimit = DragSource.DragLimitBounds; + + Rectangle rect = RectSplitter; + if (rectLimit.Width <= 0 || rectLimit.Height <= 0) + return rect; + + if (DragSource.IsVertical) + { + rect.X += ptMouse.X - StartMousePosition.X; + rect.Height = rectLimit.Height; + } + else + { + rect.Y += ptMouse.Y - StartMousePosition.Y; + rect.Width = rectLimit.Width; + } + + if (rect.Left < rectLimit.Left) + rect.X = rectLimit.X; + if (rect.Top < rectLimit.Top) + rect.Y = rectLimit.Y; + if (rect.Right > rectLimit.Right) + rect.X -= rect.Right - rectLimit.Right; + if (rect.Bottom > rectLimit.Bottom) + rect.Y -= rect.Bottom - rectLimit.Bottom; + + return rect; + } + } + + private SplitterDragHandler m_splitterDragHandler = null; + private SplitterDragHandler GetSplitterDragHandler() + { + if (m_splitterDragHandler == null) + m_splitterDragHandler = new SplitterDragHandler(this); + return m_splitterDragHandler; + } + + public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter) + { + GetSplitterDragHandler().BeginDrag(dragSource, rectSplitter); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.bmp b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.bmp new file mode 100644 index 0000000000000000000000000000000000000000..10d6858f9490df8c44bc54bb02ab98d05d052484 GIT binary patch literal 822 zcmbV_(G7qg3~$x7}%dq7e+dr!<0rf4+`axo8$wKBceVOu6aY@k6LOI;(>ATU_|AQ5wMj X8lVvjpaB}em)YQocLrtG_;(y0(ZY@L literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.cs new file mode 100644 index 000000000..da19d8d32 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanel.cs @@ -0,0 +1,1176 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Collections.Generic; + +// To simplify the process of finding the toolbox bitmap resource: +// #1 Create an internal class called "resfinder" outside of the root namespace. +// #2 Use "resfinder" in the toolbox bitmap attribute instead of the control name. +// #3 use the "." string to locate the resource. +// See: http://www.bobpowell.net/toolboxbitmap.htm +internal class resfinder +{ +} + +namespace WeifenLuo.WinFormsUI.Docking +{ + /// + /// Deserialization handler of layout file/stream. + /// + /// Strings stored in layout file/stream. + /// Dock content deserialized from layout/stream. + /// + /// The deserialization handler method should handle all possible exceptions. + /// + /// If any exception happens during deserialization and is not handled, the program might crash or experience other issues. + /// + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "0#")] + public delegate IDockContent DeserializeDockContent(string persistString); + + [LocalizedDescription("DockPanel_Description")] + [Designer("System.Windows.Forms.Design.ControlDesigner, System.Design")] + [ToolboxBitmap(typeof(resfinder), "WeifenLuo.WinFormsUI.Docking.DockPanel.bmp")] + [DefaultProperty("DocumentStyle")] + [DefaultEvent("ActiveContentChanged")] + public partial class DockPanel : Panel + { + private readonly FocusManagerImpl m_focusManager; + private readonly DockPaneCollection m_panes; + private readonly FloatWindowCollection m_floatWindows; + private AutoHideWindowControl m_autoHideWindow; + private DockWindowCollection m_dockWindows; + private readonly DockContent m_dummyContent; + private readonly Control m_dummyControl; + + public DockPanel() + { + ShowAutoHideContentOnHover = true; + + m_focusManager = new FocusManagerImpl(this); + m_panes = new DockPaneCollection(); + m_floatWindows = new FloatWindowCollection(); + + SuspendLayout(); + + m_dummyControl = new DummyControl(); + m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1); + Controls.Add(m_dummyControl); + + Theme.ApplyTo(this); + + m_autoHideWindow = Theme.Extender.AutoHideWindowFactory.CreateAutoHideWindow(this); + m_autoHideWindow.Visible = false; + m_autoHideWindow.ActiveContentChanged += m_autoHideWindow_ActiveContentChanged; + SetAutoHideWindowParent(); + + LoadDockWindows(); + + m_dummyContent = new DockContent(); + ResumeLayout(); + } + + internal void ResetDummy() + { + DummyControl.ResetBackColor(); + } + + internal void SetDummy() + { + DummyControl.BackColor = DockBackColor; + } + + private Color m_BackColor; + + /// + /// Determines the color with which the client rectangle will be drawn. + /// If this property is used instead of the BackColor it will not have any influence on the borders to the surrounding controls (DockPane). + /// The BackColor property changes the borders of surrounding controls (DockPane). + /// Alternatively both properties may be used (BackColor to draw and define the color of the borders and DockBackColor to define the color of the client rectangle). + /// For Backgroundimages: Set your prefered Image, then set the DockBackColor and the BackColor to the same Color (Control) + /// + [Description("Determines the color with which the client rectangle will be drawn.\r\n" + + "If this property is used instead of the BackColor it will not have any influence on the borders to the surrounding controls (DockPane).\r\n" + + "The BackColor property changes the borders of surrounding controls (DockPane).\r\n" + + "Alternatively both properties may be used (BackColor to draw and define the color of the borders and DockBackColor to define the color of the client rectangle).\r\n" + + "For Backgroundimages: Set your prefered Image, then set the DockBackColor and the BackColor to the same Color (Control).")] + public Color DockBackColor + { + get + { + return !m_BackColor.IsEmpty ? m_BackColor : base.BackColor; + } + + set + { + if (m_BackColor != value) + { + m_BackColor = value; + Refresh(); + } + } + } + + private bool ShouldSerializeDockBackColor() + { + return !m_BackColor.IsEmpty; + } + + private AutoHideStripBase m_autoHideStripControl; + + internal AutoHideStripBase AutoHideStripControl + { + get + { + if (m_autoHideStripControl == null) + { + m_autoHideStripControl = Theme.Extender.AutoHideStripFactory.CreateAutoHideStrip(this); + Controls.Add(m_autoHideStripControl); + } + + return m_autoHideStripControl; + } + } + + internal void ResetAutoHideStripControl() + { + if (m_autoHideStripControl != null) + m_autoHideStripControl.Dispose(); + + m_autoHideStripControl = null; + } + + private void MdiClientHandleAssigned(object sender, EventArgs e) + { + SetMdiClient(); + PerformLayout(); + } + + private void MdiClient_Layout(object sender, LayoutEventArgs e) + { + if (DocumentStyle != DocumentStyle.DockingMdi) + return; + + foreach (DockPane pane in Panes) + if (pane.DockState == DockState.Document) + pane.SetContentBounds(); + + InvalidateWindowRegion(); + } + + private bool m_disposed; + + protected override void Dispose(bool disposing) + { + if (!m_disposed && disposing) + { + m_focusManager.Dispose(); + if (m_mdiClientController != null) + { + m_mdiClientController.HandleAssigned -= new EventHandler(MdiClientHandleAssigned); + m_mdiClientController.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate); + m_mdiClientController.Layout -= new LayoutEventHandler(MdiClient_Layout); + m_mdiClientController.Dispose(); + } + FloatWindows.Dispose(); + Panes.Dispose(); + DummyContent.Dispose(); + + m_disposed = true; + } + + base.Dispose(disposing); + } + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public IDockContent ActiveAutoHideContent + { + get { return AutoHideWindow.ActiveContent; } + set { AutoHideWindow.ActiveContent = value; } + } + + private bool m_allowEndUserDocking = !Win32Helper.IsRunningOnMono; + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_AllowEndUserDocking_Description")] + [DefaultValue(true)] + public bool AllowEndUserDocking + { + get + { + if (Win32Helper.IsRunningOnMono && m_allowEndUserDocking) + m_allowEndUserDocking = false; + + return m_allowEndUserDocking; + } + + set + { + if (Win32Helper.IsRunningOnMono && value) + throw new InvalidOperationException("AllowEndUserDocking can only be false if running on Mono"); + + m_allowEndUserDocking = value; + } + } + + private bool m_allowEndUserNestedDocking = !Win32Helper.IsRunningOnMono; + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_AllowEndUserNestedDocking_Description")] + [DefaultValue(true)] + public bool AllowEndUserNestedDocking + { + get + { + if (Win32Helper.IsRunningOnMono && m_allowEndUserDocking) + m_allowEndUserDocking = false; + return m_allowEndUserNestedDocking; + } + + set + { + if (Win32Helper.IsRunningOnMono && value) + throw new InvalidOperationException("AllowEndUserNestedDocking can only be false if running on Mono"); + + m_allowEndUserNestedDocking = value; + } + } + + private DockContentCollection m_contents = new DockContentCollection(); + [Browsable(false)] + public DockContentCollection Contents + { + get { return m_contents; } + } + + internal DockContent DummyContent + { + get { return m_dummyContent; } + } + + private bool m_rightToLeftLayout = false; + [DefaultValue(false)] + [LocalizedCategory("Appearance")] + [LocalizedDescription("DockPanel_RightToLeftLayout_Description")] + public bool RightToLeftLayout + { + get + { + return m_rightToLeftLayout; + } + + set + { + if (m_rightToLeftLayout == value) + return; + + m_rightToLeftLayout = value; + foreach (FloatWindow floatWindow in FloatWindows) + floatWindow.RightToLeftLayout = value; + } + } + + protected override void OnRightToLeftChanged(EventArgs e) + { + base.OnRightToLeftChanged(e); + foreach (FloatWindow floatWindow in FloatWindows) + floatWindow.RightToLeft = RightToLeft; + } + + private bool m_showDocumentIcon = false; + [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(); + } + } + + [DefaultValue(DocumentTabStripLocation.Top)] + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DocumentTabStripLocation")] + public DocumentTabStripLocation DocumentTabStripLocation { get; set; } = DocumentTabStripLocation.Top; + + [Browsable(false)] + [Obsolete("Use Theme.Extender instead.")] + public DockPanelExtender Extender + { + get { return null; } + } + + [Browsable(false)] + [Obsolete("Use Theme.Extender instead.")] + public DockPanelExtender.IDockPaneFactory DockPaneFactory + { + get { return null; } + } + + [Browsable(false)] + [Obsolete("Use Theme.Extender instead.")] + public DockPanelExtender.IFloatWindowFactory FloatWindowFactory + { + get { return null; } + } + + [Browsable(false)] + [Obsolete("Use Theme.Extender instead.")] + public DockPanelExtender.IDockWindowFactory DockWindowFactory + { + get { return null; } + } + + [Browsable(false)] + public DockPaneCollection Panes + { + get { return m_panes; } + } + + /// + /// Dock area. + /// + /// + /// This is the center rectangle of control. + /// + /// Excluded spaces are for the following visual elements, + /// * Auto hide strips on four sides. + /// * Necessary paddings defined in themes. + /// + /// Therefore, all dock contents mainly fall into this area (except auto hide window, which might slightly move beyond this area). + /// + public Rectangle DockArea + { + get + { + return new Rectangle(DockPadding.Left, DockPadding.Top, + ClientRectangle.Width - DockPadding.Left - DockPadding.Right, + ClientRectangle.Height - DockPadding.Top - DockPadding.Bottom); + } + } + + private double m_dockBottomPortion = 0.25; + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DockBottomPortion_Description")] + [DefaultValue(0.25)] + public double DockBottomPortion + { + get + { + return m_dockBottomPortion; + } + + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException(nameof(value)); + + if (Math.Abs(value - m_dockBottomPortion) < double.Epsilon) + return; + + m_dockBottomPortion = value; + + if (m_dockBottomPortion < 1 && m_dockTopPortion < 1) + { + if (m_dockTopPortion + m_dockBottomPortion > 1) + m_dockTopPortion = 1 - m_dockBottomPortion; + } + + PerformLayout(); + } + } + + private double m_dockLeftPortion = 0.25; + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DockLeftPortion_Description")] + [DefaultValue(0.25)] + public double DockLeftPortion + { + get + { + return m_dockLeftPortion; + } + + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException(nameof(value)); + + if (Math.Abs(value - m_dockLeftPortion) < double.Epsilon) + return; + + m_dockLeftPortion = value; + + if (m_dockLeftPortion < 1 && m_dockRightPortion < 1) + { + if (m_dockLeftPortion + m_dockRightPortion > 1) + m_dockRightPortion = 1 - m_dockLeftPortion; + } + PerformLayout(); + } + } + + private double m_dockRightPortion = 0.25; + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DockRightPortion_Description")] + [DefaultValue(0.25)] + public double DockRightPortion + { + get + { + return m_dockRightPortion; + } + + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException(nameof(value)); + + if (Math.Abs(value - m_dockRightPortion) < double.Epsilon) + return; + + m_dockRightPortion = value; + + if (m_dockLeftPortion < 1 && m_dockRightPortion < 1) + { + if (m_dockLeftPortion + m_dockRightPortion > 1) + m_dockLeftPortion = 1 - m_dockRightPortion; + } + + PerformLayout(); + } + } + + private double m_dockTopPortion = 0.25; + + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DockTopPortion_Description")] + [DefaultValue(0.25)] + public double DockTopPortion + { + get + { + return m_dockTopPortion; + } + + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException(nameof(value)); + + if (Math.Abs(value - m_dockTopPortion) < double.Epsilon) + return; + + m_dockTopPortion = value; + + if (m_dockTopPortion < 1 && m_dockBottomPortion < 1) + { + if (m_dockTopPortion + m_dockBottomPortion > 1) + m_dockBottomPortion = 1 - m_dockTopPortion; + } + PerformLayout(); + } + } + + [Browsable(false)] + public DockWindowCollection DockWindows + { + get { return m_dockWindows; } + } + + public void UpdateDockWindowZOrder(DockStyle dockStyle, bool fullPanelEdge) + { + if (dockStyle == DockStyle.Left) + { + if (fullPanelEdge) + DockWindows[DockState.DockLeft].SendToBack(); + else + DockWindows[DockState.DockLeft].BringToFront(); + } + else if (dockStyle == DockStyle.Right) + { + if (fullPanelEdge) + DockWindows[DockState.DockRight].SendToBack(); + else + DockWindows[DockState.DockRight].BringToFront(); + } + else if (dockStyle == DockStyle.Top) + { + if (fullPanelEdge) + DockWindows[DockState.DockTop].SendToBack(); + else + DockWindows[DockState.DockTop].BringToFront(); + } + else if (dockStyle == DockStyle.Bottom) + { + if (fullPanelEdge) + DockWindows[DockState.DockBottom].SendToBack(); + else + DockWindows[DockState.DockBottom].BringToFront(); + } + } + + [Browsable(false)] + public int DocumentsCount + { + get + { + int count = 0; + foreach (IDockContent content in Documents) + count++; + + return count; + } + } + + public IDockContent[] DocumentsToArray() + { + int count = DocumentsCount; + IDockContent[] documents = new IDockContent[count]; + int i = 0; + foreach (IDockContent content in Documents) + { + documents[i] = content; + i++; + } + + return documents; + } + + [Browsable(false)] + public IEnumerable Documents + { + get + { + foreach (IDockContent content in Contents) + { + if (content.DockHandler.DockState == DockState.Document) + yield return content; + } + } + } + + private Control DummyControl + { + get { return m_dummyControl; } + } + + [Browsable(false)] + public FloatWindowCollection FloatWindows + { + get { return m_floatWindows; } + } + + [Category("Layout")] + [LocalizedDescription("DockPanel_DefaultFloatWindowSize_Description")] + public Size DefaultFloatWindowSize { get; set; } = new Size(300, 300); + + private bool ShouldSerializeDefaultFloatWindowSize() + { + return DefaultFloatWindowSize != new Size(300, 300); + } + + private void ResetDefaultFloatWindowSize() + { + DefaultFloatWindowSize = new Size(300, 300); + } + + private DocumentStyle m_documentStyle = DocumentStyle.DockingWindow; + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_DocumentStyle_Description")] + [DefaultValue(DocumentStyle.DockingWindow)] + public DocumentStyle DocumentStyle + { + get { return m_documentStyle; } + set + { + if (value == m_documentStyle) + return; + + if (!Enum.IsDefined(typeof(DocumentStyle), value)) + throw new InvalidEnumArgumentException(); + + if (value == DocumentStyle.SystemMdi && DockWindows[DockState.Document].VisibleNestedPanes.Count > 0) + throw new InvalidEnumArgumentException(); + + m_documentStyle = value; + + SuspendLayout(true); + + SetAutoHideWindowParent(); + SetMdiClient(); + InvalidateWindowRegion(); + + foreach (IDockContent content in Contents) + { + if (content.DockHandler.DockState == DockState.Document) + content.DockHandler.SetPaneAndVisible(content.DockHandler.Pane); + } + + PerformMdiClientLayout(); + + ResumeLayout(true, true); + } + } + + [LocalizedCategory("Category_Performance")] + [LocalizedDescription("DockPanel_SupportDeeplyNestedContent_Description")] + [DefaultValue(false)] + public bool SupportDeeplyNestedContent { get; set; } + + /// + /// Flag to show autohide content on mouse hover. Default value is true. + /// + /// + /// This flag is ignored in VS2012/2013 themes. Such themes assume it is always false. + /// + [LocalizedCategory("Category_Docking")] + [LocalizedDescription("DockPanel_ShowAutoHideContentOnHover_Description")] + [DefaultValue(true)] + public bool ShowAutoHideContentOnHover { get; set; } + + public int GetDockWindowSize(DockState dockState) + { + if (dockState == DockState.DockLeft || dockState == DockState.DockRight) + { + int width = ClientRectangle.Width - DockPadding.Left - DockPadding.Right; + int dockLeftSize = m_dockLeftPortion >= 1 ? (int)m_dockLeftPortion : (int)(width * m_dockLeftPortion); + int dockRightSize = m_dockRightPortion >= 1 ? (int)m_dockRightPortion : (int)(width * m_dockRightPortion); + + if (dockLeftSize < MeasurePane.MinSize) + dockLeftSize = MeasurePane.MinSize; + if (dockRightSize < MeasurePane.MinSize) + dockRightSize = MeasurePane.MinSize; + + if (dockLeftSize + dockRightSize > width - MeasurePane.MinSize) + { + int adjust = (dockLeftSize + dockRightSize) - (width - MeasurePane.MinSize); + dockLeftSize -= adjust / 2; + dockRightSize -= adjust / 2; + } + + return dockState == DockState.DockLeft ? dockLeftSize : dockRightSize; + } + + if (dockState == DockState.DockTop || dockState == DockState.DockBottom) + { + int height = ClientRectangle.Height - DockPadding.Top - DockPadding.Bottom; + int dockTopSize = m_dockTopPortion >= 1 ? (int)m_dockTopPortion : (int)(height * m_dockTopPortion); + int dockBottomSize = m_dockBottomPortion >= 1 ? (int)m_dockBottomPortion : (int)(height * m_dockBottomPortion); + + if (dockTopSize < MeasurePane.MinSize) + dockTopSize = MeasurePane.MinSize; + if (dockBottomSize < MeasurePane.MinSize) + dockBottomSize = MeasurePane.MinSize; + + if (dockTopSize + dockBottomSize > height - MeasurePane.MinSize) + { + int adjust = (dockTopSize + dockBottomSize) - (height - MeasurePane.MinSize); + dockTopSize -= adjust / 2; + dockBottomSize -= adjust / 2; + } + + return dockState == DockState.DockTop ? dockTopSize : dockBottomSize; + } + + return 0; + } + + protected override void OnLayout(LayoutEventArgs levent) + { + SuspendLayout(true); + + AutoHideStripControl.Bounds = ClientRectangle; + + CalculateDockPadding(); + + DockWindows[DockState.DockLeft].Width = GetDockWindowSize(DockState.DockLeft); + DockWindows[DockState.DockRight].Width = GetDockWindowSize(DockState.DockRight); + DockWindows[DockState.DockTop].Height = GetDockWindowSize(DockState.DockTop); + DockWindows[DockState.DockBottom].Height = GetDockWindowSize(DockState.DockBottom); + + AutoHideWindow.Bounds = GetAutoHideWindowBounds(AutoHideWindowRectangle); + + DockWindow documentDockWindow = DockWindows[DockState.Document]; + + if (ReferenceEquals(documentDockWindow.Parent, AutoHideWindow.Parent)) + { + AutoHideWindow.Parent.Controls.SetChildIndex(AutoHideWindow, 0); + documentDockWindow.Parent.Controls.SetChildIndex(documentDockWindow, 1); + } + else + { + documentDockWindow.BringToFront(); + AutoHideWindow.BringToFront(); + } + + base.OnLayout(levent); + + if (DocumentStyle == DocumentStyle.SystemMdi && MdiClientExists) + { + SetMdiClientBounds(SystemMdiClientBounds); + InvalidateWindowRegion(); + } + else if (DocumentStyle == DocumentStyle.DockingMdi) + { + InvalidateWindowRegion(); + } + + ResumeLayout(true, true); + } + + internal Rectangle GetTabStripRectangle(DockState dockState) + { + return AutoHideStripControl.GetTabStripRectangle(dockState); + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + if (DockBackColor.ToArgb() == BackColor.ToArgb()) + return; + + Graphics g = e.Graphics; + SolidBrush bgBrush = new SolidBrush(DockBackColor); + g.FillRectangle(bgBrush, ClientRectangle); + } + + internal void AddContent(IDockContent content) + { + if (content == null) + throw(new ArgumentNullException()); + + if (!Contents.Contains(content)) + { + Contents.Add(content); + OnContentAdded(new DockContentEventArgs(content)); + } + } + + internal void AddPane(DockPane pane) + { + if (Panes.Contains(pane)) + return; + + Panes.Add(pane); + } + + internal void AddFloatWindow(FloatWindow floatWindow) + { + if (FloatWindows.Contains(floatWindow)) + return; + + FloatWindows.Add(floatWindow); + } + + private void CalculateDockPadding() + { + DockPadding.All = Theme.Measures.DockPadding; + int standard = AutoHideStripControl.MeasureHeight(); + if (AutoHideStripControl.GetNumberOfPanes(DockState.DockLeftAutoHide) > 0) + DockPadding.Left = standard; + if (AutoHideStripControl.GetNumberOfPanes(DockState.DockRightAutoHide) > 0) + DockPadding.Right = standard; + if (AutoHideStripControl.GetNumberOfPanes(DockState.DockTopAutoHide) > 0) + DockPadding.Top = standard; + if (AutoHideStripControl.GetNumberOfPanes(DockState.DockBottomAutoHide) > 0) + DockPadding.Bottom = standard; + } + + internal void RemoveContent(IDockContent content) + { + if (content == null) + throw(new ArgumentNullException()); + + if (Contents.Contains(content)) + { + Contents.Remove(content); + OnContentRemoved(new DockContentEventArgs(content)); + } + } + + internal void RemovePane(DockPane pane) + { + if (!Panes.Contains(pane)) + return; + + Panes.Remove(pane); + } + + internal void RemoveFloatWindow(FloatWindow floatWindow) + { + if (!FloatWindows.Contains(floatWindow)) + return; + + FloatWindows.Remove(floatWindow); + if (FloatWindows.Count != 0) + return; + + if (ParentForm == null) + return; + + ParentForm.Focus(); + } + + public void SetPaneIndex(DockPane pane, int index) + { + int oldIndex = Panes.IndexOf(pane); + if (oldIndex == -1) + throw(new ArgumentException(Strings.DockPanel_SetPaneIndex_InvalidPane)); + + if (index < 0 || index > Panes.Count - 1) + if (index != -1) + throw(new ArgumentOutOfRangeException(Strings.DockPanel_SetPaneIndex_InvalidIndex)); + + if (oldIndex == index) + return; + if (oldIndex == Panes.Count - 1 && index == -1) + return; + + Panes.Remove(pane); + if (index == -1) + Panes.Add(pane); + else if (oldIndex < index) + Panes.AddAt(pane, index - 1); + else + Panes.AddAt(pane, index); + } + + public void SuspendLayout(bool allWindows) + { + FocusManager.SuspendFocusTracking(); + SuspendLayout(); + if (allWindows) + SuspendMdiClientLayout(); + } + + public void ResumeLayout(bool performLayout, bool allWindows) + { + FocusManager.ResumeFocusTracking(); + ResumeLayout(performLayout); + if (allWindows) + ResumeMdiClientLayout(performLayout); + } + + internal Form ParentForm + { + get + { + if (!IsParentFormValid()) + throw new InvalidOperationException(Strings.DockPanel_ParentForm_Invalid); + + return GetMdiClientController().ParentForm; + } + } + + private bool IsParentFormValid() + { + if (DocumentStyle == DocumentStyle.DockingSdi || DocumentStyle == DocumentStyle.DockingWindow) + return true; + + if (!MdiClientExists) + GetMdiClientController().RenewMdiClient(); + + return (MdiClientExists); + } + + protected override void OnParentChanged(EventArgs e) + { + SetAutoHideWindowParent(); + GetMdiClientController().ParentForm = (this.Parent as Form); + base.OnParentChanged (e); + } + + private void SetAutoHideWindowParent() + { + Control parent; + if (DocumentStyle == DocumentStyle.DockingMdi || + DocumentStyle == DocumentStyle.SystemMdi) + parent = this.Parent; + else + parent = this; + if (AutoHideWindow.Parent != parent) + { + AutoHideWindow.Parent = parent; + AutoHideWindow.BringToFront(); + } + } + + protected override void OnVisibleChanged(EventArgs e) + { + base.OnVisibleChanged (e); + + if (Visible) + SetMdiClient(); + } + + private Rectangle SystemMdiClientBounds + { + get + { + if (!IsParentFormValid() || !Visible) + return Rectangle.Empty; + + Rectangle rect = ParentForm.RectangleToClient(RectangleToScreen(DocumentWindowBounds)); + return rect; + } + } + + public 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 PaintEventHandler m_dummyControlPaintEventHandler = null; + private void InvalidateWindowRegion() + { + if (DesignMode) + return; + + if (m_dummyControlPaintEventHandler == null) + m_dummyControlPaintEventHandler = new PaintEventHandler(DummyControl_Paint); + + DummyControl.Paint += m_dummyControlPaintEventHandler; + DummyControl.Invalidate(); + } + + void DummyControl_Paint(object sender, PaintEventArgs e) + { + DummyControl.Paint -= m_dummyControlPaintEventHandler; + UpdateWindowRegion(); + } + + private void UpdateWindowRegion() + { + if (this.DocumentStyle == DocumentStyle.DockingMdi) + UpdateWindowRegion_ClipContent(); + else if (this.DocumentStyle == DocumentStyle.DockingSdi || + this.DocumentStyle == DocumentStyle.DockingWindow) + UpdateWindowRegion_FullDocumentArea(); + else if (this.DocumentStyle == DocumentStyle.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.Visible || pane.DockState != DockState.Document) + continue; + + count ++; + } + + if (count == 0) + { + SetRegion(null); + return; + } + + Rectangle[] rects = new Rectangle[count]; + int i = 0; + foreach (DockPane pane in this.Panes) + { + if (!pane.Visible || pane.DockState != DockState.Document) + continue; + + rects[i] = RectangleToClient(pane.RectangleToScreen(pane.ContentRectangle)); + 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); + if (Region != null) + { + Region.Dispose(); + } + + 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; + } + + private static readonly object ActiveAutoHideContentChangedEvent = new object(); + [LocalizedCategory("Category_DockingNotification")] + [LocalizedDescription("DockPanel_ActiveAutoHideContentChanged_Description")] + public event EventHandler ActiveAutoHideContentChanged + { + add { Events.AddHandler(ActiveAutoHideContentChangedEvent, value); } + remove { Events.RemoveHandler(ActiveAutoHideContentChangedEvent, value); } + } + protected virtual void OnActiveAutoHideContentChanged(EventArgs e) + { + EventHandler handler = (EventHandler)Events[ActiveAutoHideContentChangedEvent]; + if (handler != null) + handler(this, e); + } + private void m_autoHideWindow_ActiveContentChanged(object sender, EventArgs e) + { + OnActiveAutoHideContentChanged(e); + } + + + private static readonly object ContentAddedEvent = new object(); + [LocalizedCategory("Category_DockingNotification")] + [LocalizedDescription("DockPanel_ContentAdded_Description")] + public event EventHandler ContentAdded + { + add { Events.AddHandler(ContentAddedEvent, value); } + remove { Events.RemoveHandler(ContentAddedEvent, value); } + } + protected virtual void OnContentAdded(DockContentEventArgs e) + { + EventHandler handler = (EventHandler)Events[ContentAddedEvent]; + if (handler != null) + handler(this, e); + } + + private static readonly object ContentRemovedEvent = new object(); + [LocalizedCategory("Category_DockingNotification")] + [LocalizedDescription("DockPanel_ContentRemoved_Description")] + public event EventHandler ContentRemoved + { + add { Events.AddHandler(ContentRemovedEvent, value); } + remove { Events.RemoveHandler(ContentRemovedEvent, value); } + } + protected virtual void OnContentRemoved(DockContentEventArgs e) + { + EventHandler handler = (EventHandler)Events[ContentRemovedEvent]; + if (handler != null) + handler(this, e); + } + + internal void ResetDockWindows() + { + if (m_autoHideWindow == null) + { + return; + } + + var old = m_dockWindows; + LoadDockWindows(); + foreach (var dockWindow in old) + { + Controls.Remove(dockWindow); + dockWindow.Dispose(); + } + } + + internal void LoadDockWindows() + { + m_dockWindows = new DockWindowCollection(this); + foreach (var dockWindow in DockWindows) + { + Controls.Add(dockWindow); + } + } + + public void ResetAutoHideStripWindow() + { + var old = m_autoHideWindow; + m_autoHideWindow = Theme.Extender.AutoHideWindowFactory.CreateAutoHideWindow(this); + m_autoHideWindow.Visible = false; + SetAutoHideWindowParent(); + + old.Visible = false; + old.Parent = null; + old.Dispose(); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanelColorPalette.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanelColorPalette.cs new file mode 100644 index 000000000..35a85d0b5 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanelColorPalette.cs @@ -0,0 +1,230 @@ +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class DockPanelColorPalette + { + public DockPanelColorPalette(IPaletteFactory factory) + { + factory.Initialize(this); + } + + public AutoHideStripPalette AutoHideStripDefault { get; } = new AutoHideStripPalette(); + public AutoHideStripPalette AutoHideStripHovered { get; } = new AutoHideStripPalette(); + public ButtonPalette OverflowButtonDefault { get; } = new ButtonPalette(); + public HoveredButtonPalette OverflowButtonHovered { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette OverflowButtonPressed { get; } = new HoveredButtonPalette(); + public TabPalette TabSelectedActive { get; } = new TabPalette(); + public TabPalette TabSelectedInactive { get; } = new TabPalette(); + public UnselectedTabPalette TabUnselected { get; } = new UnselectedTabPalette(); + public TabPalette TabUnselectedHovered { get; } = new TabPalette(); + public HoveredButtonPalette TabButtonSelectedActiveHovered { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette TabButtonSelectedActivePressed { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette TabButtonSelectedInactiveHovered { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette TabButtonSelectedInactivePressed { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette TabButtonUnselectedTabHoveredButtonHovered { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette TabButtonUnselectedTabHoveredButtonPressed { get; } = new HoveredButtonPalette(); + public MainWindowPalette MainWindowActive { get; } = new MainWindowPalette(); + public MainWindowStatusBarPalette MainWindowStatusBarDefault { get; } = new MainWindowStatusBarPalette(); + public ToolWindowCaptionPalette ToolWindowCaptionActive { get; } = new ToolWindowCaptionPalette(); + public ToolWindowCaptionPalette ToolWindowCaptionInactive { get; } = new ToolWindowCaptionPalette(); + public HoveredButtonPalette ToolWindowCaptionButtonActiveHovered { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette ToolWindowCaptionButtonPressed { get; } = new HoveredButtonPalette(); + public HoveredButtonPalette ToolWindowCaptionButtonInactiveHovered { get; } = new HoveredButtonPalette(); + public ToolWindowTabPalette ToolWindowTabSelectedActive { get; } = new ToolWindowTabPalette(); + public ToolWindowTabPalette ToolWindowTabSelectedInactive { get; } = new ToolWindowTabPalette(); + public ToolWindowUnselectedTabPalette ToolWindowTabUnselected { get; } = new ToolWindowUnselectedTabPalette(); + public ToolWindowTabPalette ToolWindowTabUnselectedHovered { get; } = new ToolWindowTabPalette(); + public Color ToolWindowBorder { get; set; } + public Color ToolWindowSeparator { get; set; } + public DockTargetPalette DockTarget { get; } = new DockTargetPalette(); + public CommandBarMenuPalette CommandBarMenuDefault { get; } = new CommandBarMenuPalette(); + public CommandBarMenuPopupPalette CommandBarMenuPopupDefault { get; } = new CommandBarMenuPopupPalette(); + public CommandBarMenuPopupDisabledPalette CommandBarMenuPopupDisabled { get; } = new CommandBarMenuPopupDisabledPalette(); + public CommandBarMenuPopupHoveredPalette CommandBarMenuPopupHovered { get; } = new CommandBarMenuPopupHoveredPalette(); + public CommandBarMenuTopLevelHeaderPalette CommandBarMenuTopLevelHeaderHovered { get; } = new CommandBarMenuTopLevelHeaderPalette(); + public CommandBarToolbarPalette CommandBarToolbarDefault { get; } = new CommandBarToolbarPalette(); + public CommandBarToolbarButtonCheckedPalette CommandBarToolbarButtonChecked { get; } = new CommandBarToolbarButtonCheckedPalette(); + public CommandBarToolbarButtonCheckedHoveredPalette CommandBarToolbarButtonCheckedHovered { get; } = new CommandBarToolbarButtonCheckedHoveredPalette(); + public CommandBarToolbarButtonPalette CommandBarToolbarButtonDefault { get; } = new CommandBarToolbarButtonPalette(); + public CommandBarToolbarButtonHoveredPalette CommandBarToolbarButtonHovered { get; } = new CommandBarToolbarButtonHoveredPalette(); + public CommandBarToolbarButtonPressedPalette CommandBarToolbarButtonPressed { get; } = new CommandBarToolbarButtonPressedPalette(); + public CommandBarToolbarOverflowButtonPalette CommandBarToolbarOverflowHovered { get; } = new CommandBarToolbarOverflowButtonPalette(); + public CommandBarToolbarOverflowButtonPalette CommandBarToolbarOverflowPressed { get; } = new CommandBarToolbarOverflowButtonPalette(); + + public VisualStudioColorTable ColorTable { get; } + } + + public class CommandBarToolbarOverflowButtonPalette + { + public Color Background { get; set; } + public Color Glyph { get; set; } + } + + public class CommandBarToolbarButtonPressedPalette + { + public Color Arrow { get; set; } + public Color Background { get; set; } + public Color Text { get; set; } + } + + public class CommandBarToolbarButtonHoveredPalette + { + public Color Arrow { get; set; } + public Color Separator { get; set; } + } + + public class CommandBarToolbarButtonPalette + { + public Color Arrow { get; set; } + } + + public class CommandBarToolbarButtonCheckedHoveredPalette + { + public Color Border { get; set; } + public Color Text { get; set; } + } + + public class CommandBarToolbarButtonCheckedPalette + { + public Color Background { get; set; } + public Color Border { get; set; } + public Color Text { get; set; } + } + + public class CommandBarToolbarPalette + { + public Color Background { get; set; } + public Color Border { get; set; } + public Color Grip { get; set; } + public Color OverflowButtonBackground { get; set; } + public Color OverflowButtonGlyph { get; set; } + public Color Separator { get; set; } + public Color SeparatorAccent { get; set; } + public Color Tray { get; set; } + } + + public class CommandBarMenuTopLevelHeaderPalette + { + public Color Background { get; set; } + public Color Border { get; set; } + public Color Text { get; set; } + } + + public class CommandBarMenuPopupHoveredPalette + { + public Color Arrow { get; set; } + public Color Checkmark { get; set; } + public Color CheckmarkBackground { get; set; } + public Color ItemBackground { get; set; } + public Color Text { get; set; } + } + + public class CommandBarMenuPopupDisabledPalette + { + public Color Checkmark { get; set; } + public Color CheckmarkBackground { get; set; } + public Color Text { get; set; } + } + + public class CommandBarMenuPopupPalette + { + public Color Arrow { get; set; } + public Color BackgroundBottom { get; set; } + public Color BackgroundTop { get; set; } + public Color Border { get; set; } + public Color Checkmark { get; set; } + public Color CheckmarkBackground { get; set; } + public Color IconBackground { get; set; } + public Color Separator { get; set; } + } + + public class CommandBarMenuPalette + { + public Color Background { get; set; } + public Color Text { get; set; } + } + + public interface IPaletteFactory + { + void Initialize(DockPanelColorPalette palette); + } + + public class DockTargetPalette + { + public Color Background { get; set; } + public Color Border { get; set; } + public Color ButtonBackground { get; set; } + public Color ButtonBorder { get; set; } + public Color GlyphBackground { get; set; } + public Color GlyphArrow { get; set; } + public Color GlyphBorder { get; set; } + } + + public class HoveredButtonPalette + { + public Color Background { get; set; } + public Color Border { get; set; } + public Color Glyph { get; set; } + } + + public class ButtonPalette + { + public Color Glyph { get; set; } + } + + public class MainWindowPalette + { + public Color Background { get; set; } + } + + public class MainWindowStatusBarPalette + { + public Color Background { get; set; } + public Color Highlight { get; set; } + public Color HighlightText { get; set; } + public Color ResizeGrip { get; set; } + public Color ResizeGripAccent { get; set; } + public Color Text { get; set; } + } + + public class ToolWindowTabPalette + { + public Color Background { get; set; } + public Color Text { get; set; } + } + + public class ToolWindowUnselectedTabPalette + { + public Color Background { get; set; } // VS2013 + public Color Text { get; set; } + } + + public class ToolWindowCaptionPalette + { + public Color Background { get; set; } + public Color Button { get; set; } + public Color Grip { get; set; } + public Color Text { get; set; } + } + + public class TabPalette + { + public Color Background { get; set; } + public Color Button { get; set; } + public Color Text { get; set; } + } + + public class UnselectedTabPalette + { + public Color Background { get; set; } // VS2013 only + public Color Text { get; set; } + } + + public class AutoHideStripPalette + { + public Color Background { get; set; } + public Color Border { get; set; } + public Color Text { get; set; } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanelExtender.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanelExtender.cs new file mode 100644 index 000000000..774233cc0 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanelExtender.cs @@ -0,0 +1,227 @@ +using System.Drawing; +using System.Diagnostics.CodeAnalysis; +using System.Windows.Forms; +using static WeifenLuo.WinFormsUI.Docking.DockPanel; +using static WeifenLuo.WinFormsUI.Docking.DockPanel.DockDragHandler; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public sealed class DockPanelExtender + { + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public interface IDockPaneFactory + { + DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show); + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")] + DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show); + + DockPane CreateDockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, + double proportion, bool show); + + [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")] + DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show); + } + + public interface IDockPaneSplitterControlFactory + { + DockPane.SplitterControlBase CreateSplitterControl(DockPane pane); + } + + public interface IWindowSplitterControlFactory + { + SplitterBase CreateSplitterControl(ISplitterHost host); + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public interface IFloatWindowFactory + { + FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane); + FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds); + } + + public interface IDockWindowFactory + { + DockWindow CreateDockWindow(DockPanel dockPanel, DockState dockState); + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public interface IDockPaneCaptionFactory + { + DockPaneCaptionBase CreateDockPaneCaption(DockPane pane); + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public interface IDockPaneStripFactory + { + DockPaneStripBase CreateDockPaneStrip(DockPane pane); + } + + [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public interface IAutoHideStripFactory + { + AutoHideStripBase CreateAutoHideStrip(DockPanel panel); + } + + public interface IAutoHideWindowFactory + { + AutoHideWindowControl CreateAutoHideWindow(DockPanel panel); + } + + public interface IPaneIndicatorFactory + { + IPaneIndicator CreatePaneIndicator(ThemeBase theme); + } + + public interface IPanelIndicatorFactory + { + IPanelIndicator CreatePanelIndicator(DockStyle style, ThemeBase theme); + } + + public interface IDockOutlineFactory + { + DockOutlineBase CreateDockOutline(); + } + + public interface IDockIndicatorFactory + { + DockIndicator CreateDockIndicator(DockDragHandler dockDragHandler); + } + + #region DefaultDockPaneFactory + + private class DefaultDockPaneFactory : IDockPaneFactory + { + public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show) + { + return new DockPane(content, visibleState, show); + } + + public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show) + { + return new DockPane(content, floatWindow, 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(IDockContent content, Rectangle floatWindowBounds, bool show) + { + return new DockPane(content, floatWindowBounds, show); + } + } + + #endregion + + #region DefaultFloatWindowFactory + + private class DefaultFloatWindowFactory : IFloatWindowFactory + { + public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane) + { + return new FloatWindow(dockPanel, pane); + } + + public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds) + { + return new FloatWindow(dockPanel, pane, bounds); + } + } + + #endregion + + private IDockPaneFactory m_dockPaneFactory = null; + + public IDockPaneFactory DockPaneFactory + { + get + { + if (m_dockPaneFactory == null) + { + m_dockPaneFactory = new DefaultDockPaneFactory(); + } + + return m_dockPaneFactory; + } + set + { + m_dockPaneFactory = value; + } + } + + public IDockPaneSplitterControlFactory DockPaneSplitterControlFactory { get; set; } + + public IWindowSplitterControlFactory WindowSplitterControlFactory { get; set; } + + private IFloatWindowFactory m_floatWindowFactory = null; + + public IFloatWindowFactory FloatWindowFactory + { + get + { + if (m_floatWindowFactory == null) + { + m_floatWindowFactory = new DefaultFloatWindowFactory(); + } + + return m_floatWindowFactory; + } + set + { + m_floatWindowFactory = value; + } + } + + public IDockWindowFactory DockWindowFactory { get; set; } + + public IDockPaneCaptionFactory DockPaneCaptionFactory { get; set; } + + public IDockPaneStripFactory DockPaneStripFactory { get; set; } + + private IAutoHideStripFactory m_autoHideStripFactory = null; + + public IAutoHideStripFactory AutoHideStripFactory + { + get + { + return m_autoHideStripFactory; + } + set + { + if (m_autoHideStripFactory == value) + { + return; + } + + m_autoHideStripFactory = value; + } + } + + private IAutoHideWindowFactory m_autoHideWindowFactory; + + public IAutoHideWindowFactory AutoHideWindowFactory + { + get { return m_autoHideWindowFactory; } + set + { + if (m_autoHideWindowFactory == value) + { + return; + } + + m_autoHideWindowFactory = value; + } + } + + public IPaneIndicatorFactory PaneIndicatorFactory { get; set; } + + public IPanelIndicatorFactory PanelIndicatorFactory { get; set; } + + public IDockOutlineFactory DockOutlineFactory { get; set; } + + public IDockIndicatorFactory DockIndicatorFactory { get; set; } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockPanelSkin.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockPanelSkin.cs new file mode 100644 index 000000000..23b075018 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockPanelSkin.cs @@ -0,0 +1,418 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace WeifenLuo.WinFormsUI.Docking +{ + #region DockPanelSkin classes + /// + /// The skin to use when displaying the DockPanel. + /// The skin allows custom gradient color schemes to be used when drawing the + /// DockStrips and Tabs. + /// + [TypeConverter(typeof(DockPanelSkinConverter))] + public class DockPanelSkin + { + private AutoHideStripSkin m_autoHideStripSkin = new AutoHideStripSkin(); + private DockPaneStripSkin m_dockPaneStripSkin = new DockPaneStripSkin(); + + /// + /// The skin used to display the auto hide strips and tabs. + /// + public AutoHideStripSkin AutoHideStripSkin + { + get { return m_autoHideStripSkin; } + set { m_autoHideStripSkin = value; } + } + + /// + /// The skin used to display the Document and ToolWindow style DockStrips and Tabs. + /// + public DockPaneStripSkin DockPaneStripSkin + { + get { return m_dockPaneStripSkin; } + set { m_dockPaneStripSkin = value; } + } + } + + /// + /// The skin used to display the auto hide strip and tabs. + /// + [TypeConverter(typeof(AutoHideStripConverter))] + public class AutoHideStripSkin + { + private DockPanelGradient m_dockStripGradient = new DockPanelGradient(); + private TabGradient m_TabGradient = new TabGradient(); + private DockStripBackground m_DockStripBackground = new DockStripBackground(); + + private Font m_textFont = SystemFonts.MenuFont; + + /// + /// The gradient color skin for the DockStrips. + /// + public DockPanelGradient DockStripGradient + { + get { return m_dockStripGradient; } + set { m_dockStripGradient = value; } + } + + /// + /// The gradient color skin for the Tabs. + /// + public TabGradient TabGradient + { + get { return m_TabGradient; } + set { m_TabGradient = value; } + } + + /// + /// The gradient color skin for the Tabs. + /// + public DockStripBackground DockStripBackground + { + get { return m_DockStripBackground; } + set { m_DockStripBackground = value; } + } + + /// + /// Font used in AutoHideStrip elements. + /// + [DefaultValue(typeof(SystemFonts), "MenuFont")] + public Font TextFont + { + get { return m_textFont; } + set { m_textFont = value; } + } + } + + /// + /// The skin used to display the document and tool strips and tabs. + /// + [TypeConverter(typeof(DockPaneStripConverter))] + public class DockPaneStripSkin + { + private DockPaneStripGradient m_DocumentGradient = new DockPaneStripGradient(); + private DockPaneStripToolWindowGradient m_ToolWindowGradient = new DockPaneStripToolWindowGradient(); + private Font m_textFont = SystemFonts.MenuFont; + + /// + /// The skin used to display the Document style DockPane strip and tab. + /// + public DockPaneStripGradient DocumentGradient + { + get { return m_DocumentGradient; } + set { m_DocumentGradient = value; } + } + + /// + /// The skin used to display the ToolWindow style DockPane strip and tab. + /// + public DockPaneStripToolWindowGradient ToolWindowGradient + { + get { return m_ToolWindowGradient; } + set { m_ToolWindowGradient = value; } + } + + /// + /// Font used in DockPaneStrip elements. + /// + [DefaultValue(typeof(SystemFonts), "MenuFont")] + public Font TextFont + { + get { return m_textFont; } + set { m_textFont = value; } + } + } + + /// + /// The skin used to display the DockPane ToolWindow strip and tab. + /// + [TypeConverter(typeof(DockPaneStripGradientConverter))] + public class DockPaneStripToolWindowGradient : DockPaneStripGradient + { + private TabGradient m_activeCaptionGradient = new TabGradient(); + private TabGradient m_inactiveCaptionGradient = new TabGradient(); + + /// + /// The skin used to display the active ToolWindow caption. + /// + public TabGradient ActiveCaptionGradient + { + get { return m_activeCaptionGradient; } + set { m_activeCaptionGradient = value; } + } + + /// + /// The skin used to display the inactive ToolWindow caption. + /// + public TabGradient InactiveCaptionGradient + { + get { return m_inactiveCaptionGradient; } + set { m_inactiveCaptionGradient = value; } + } + } + + /// + /// The skin used to display the DockPane strip and tab. + /// + [TypeConverter(typeof(DockPaneStripGradientConverter))] + public class DockPaneStripGradient + { + private DockPanelGradient m_dockStripGradient = new DockPanelGradient(); + private TabGradient m_activeTabGradient = new TabGradient(); + private TabGradient m_inactiveTabGradient = new TabGradient(); + private TabGradient m_hoverTabGradient = new TabGradient(); + + + /// + /// The gradient color skin for the DockStrip. + /// + public DockPanelGradient DockStripGradient + { + get { return m_dockStripGradient; } + set { m_dockStripGradient = value; } + } + + /// + /// The skin used to display the active DockPane tabs. + /// + public TabGradient ActiveTabGradient + { + get { return m_activeTabGradient; } + set { m_activeTabGradient = value; } + } + + public TabGradient HoverTabGradient + { + get { return m_hoverTabGradient; } + set { m_hoverTabGradient = value; } + } + + /// + /// The skin used to display the inactive DockPane tabs. + /// + public TabGradient InactiveTabGradient + { + get { return m_inactiveTabGradient; } + set { m_inactiveTabGradient = value; } + } + } + + /// + /// The skin used to display the dock pane tab + /// + [TypeConverter(typeof(DockPaneTabGradientConverter))] + public class TabGradient : DockPanelGradient + { + private Color m_textColor = SystemColors.ControlText; + + /// + /// The text color. + /// + [DefaultValue(typeof(SystemColors), "ControlText")] + public Color TextColor + { + get { return m_textColor; } + set { m_textColor = value; } + } + } + + /// + /// The skin used to display the dock pane tab + /// + [TypeConverter(typeof(DockPaneTabGradientConverter))] + public class DockStripBackground + { + private Color m_startColor = SystemColors.Control; + private Color m_endColor = SystemColors.Control; + //private LinearGradientMode m_linearGradientMode = LinearGradientMode.Horizontal; + + /// + /// The beginning gradient color. + /// + [DefaultValue(typeof(SystemColors), "Control")] + public Color StartColor + { + get { return m_startColor; } + set { m_startColor = value; } + } + + /// + /// The ending gradient color. + /// + [DefaultValue(typeof(SystemColors), "Control")] + public Color EndColor + { + get { return m_endColor; } + set { m_endColor = value; } + } + } + + + /// + /// The gradient color skin. + /// + [TypeConverter(typeof(DockPanelGradientConverter))] + public class DockPanelGradient + { + private Color m_startColor = SystemColors.Control; + private Color m_endColor = SystemColors.Control; + private LinearGradientMode m_linearGradientMode = LinearGradientMode.Horizontal; + + /// + /// The beginning gradient color. + /// + [DefaultValue(typeof(SystemColors), "Control")] + public Color StartColor + { + get { return m_startColor; } + set { m_startColor = value; } + } + + /// + /// The ending gradient color. + /// + [DefaultValue(typeof(SystemColors), "Control")] + public Color EndColor + { + get { return m_endColor; } + set { m_endColor = value; } + } + + /// + /// The gradient mode to display the colors. + /// + [DefaultValue(LinearGradientMode.Horizontal)] + public LinearGradientMode LinearGradientMode + { + get { return m_linearGradientMode; } + set { m_linearGradientMode = value; } + } + } + + #endregion + + #region Converters + public class DockPanelSkinConverter : ExpandableObjectConverter + { + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(DockPanelSkin)) + return true; + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(String) && value is DockPanelSkin) + { + return "DockPanelSkin"; + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + + public class DockPanelGradientConverter : ExpandableObjectConverter + { + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(DockPanelGradient)) + return true; + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(String) && value is DockPanelGradient) + { + return "DockPanelGradient"; + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + + public class AutoHideStripConverter : ExpandableObjectConverter + { + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(AutoHideStripSkin)) + return true; + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(String) && value is AutoHideStripSkin) + { + return "AutoHideStripSkin"; + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + + public class DockPaneStripConverter : ExpandableObjectConverter + { + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(DockPaneStripSkin)) + return true; + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(String) && value is DockPaneStripSkin) + { + return "DockPaneStripSkin"; + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + + public class DockPaneStripGradientConverter : ExpandableObjectConverter + { + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(DockPaneStripGradient)) + return true; + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) + { + if (destinationType == typeof(String) && value is DockPaneStripGradient) + { + return "DockPaneStripGradient"; + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + + public class DockPaneTabGradientConverter : ExpandableObjectConverter + { + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + { + if (destinationType == typeof(TabGradient)) + return true; + + return base.CanConvertTo(context, destinationType); + } + + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) + { + TabGradient val = value as TabGradient; + if (destinationType == typeof(String) && val != null) + { + return "DockPaneTabGradient"; + } + return base.ConvertTo(context, culture, value, destinationType); + } + } + #endregion +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockWindow.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockWindow.cs new file mode 100644 index 000000000..05b366923 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockWindow.cs @@ -0,0 +1,240 @@ +using System.Windows.Forms; +using System.Drawing; +using System.ComponentModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + /// + /// Dock window base class. + /// + [ToolboxItem(false)] + public partial class DockWindow : Panel, INestedPanesContainer, ISplitterHost + { + private DockPanel m_dockPanel; + private DockState m_dockState; + private SplitterBase m_splitter; + private NestedPaneCollection m_nestedPanes; + + protected internal DockWindow(DockPanel dockPanel, DockState dockState) + { + m_nestedPanes = new NestedPaneCollection(this); + m_dockPanel = dockPanel; + m_dockState = dockState; + Visible = false; + + SuspendLayout(); + + if (DockState == DockState.DockLeft || DockState == DockState.DockRight || + DockState == DockState.DockTop || DockState == DockState.DockBottom) + { + m_splitter = DockPanel.Theme.Extender.WindowSplitterControlFactory.CreateSplitterControl(this); + Controls.Add(m_splitter); + } + + if (DockState == DockState.DockLeft) + { + Dock = DockStyle.Left; + m_splitter.Dock = DockStyle.Right; + } + else if (DockState == DockState.DockRight) + { + Dock = DockStyle.Right; + m_splitter.Dock = DockStyle.Left; + } + else if (DockState == DockState.DockTop) + { + Dock = DockStyle.Top; + m_splitter.Dock = DockStyle.Bottom; + } + else if (DockState == DockState.DockBottom) + { + Dock = DockStyle.Bottom; + m_splitter.Dock = DockStyle.Top; + } + else if (DockState == DockState.Document) + { + Dock = DockStyle.Fill; + } + + ResumeLayout(); + } + + public bool IsDockWindow + { + get { return true; } + } + + public VisibleNestedPaneCollection VisibleNestedPanes + { + get { return NestedPanes.VisibleNestedPanes; } + } + + public NestedPaneCollection NestedPanes + { + get { return m_nestedPanes; } + } + + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + public DockState DockState + { + get { return m_dockState; } + } + + public bool IsFloat + { + get { return DockState == DockState.Float; } + } + + internal DockPane DefaultPane + { + get { return VisibleNestedPanes.Count == 0 ? null : VisibleNestedPanes[0]; } + } + + public virtual Rectangle DisplayingRectangle + { + get + { + Rectangle rect = ClientRectangle; + // if DockWindow is document, exclude the border + if (DockState == DockState.Document) + { + rect.X += 1; + rect.Y += 1; + rect.Width -= 2; + rect.Height -= 2; + } + // exclude the splitter + else if (DockState == DockState.DockLeft) + rect.Width -= DockPanel.Theme.Measures.SplitterSize; + else if (DockState == DockState.DockRight) + { + rect.X += DockPanel.Theme.Measures.SplitterSize; + rect.Width -= DockPanel.Theme.Measures.SplitterSize; + } + else if (DockState == DockState.DockTop) + rect.Height -= DockPanel.Theme.Measures.SplitterSize; + else if (DockState == DockState.DockBottom) + { + rect.Y += DockPanel.Theme.Measures.SplitterSize; + rect.Height -= DockPanel.Theme.Measures.SplitterSize; + } + + return rect; + } + } + + protected override void OnLayout(LayoutEventArgs levent) + { + VisibleNestedPanes.Refresh(); + if (VisibleNestedPanes.Count == 0) + { + if (Visible) + Visible = false; + } + else if (!Visible) + { + Visible = true; + VisibleNestedPanes.Refresh(); + } + + base.OnLayout (levent); + } + + #region ISplitterDragSource Members + + void ISplitterDragSource.BeginDrag(Rectangle rectSplitter) + { + } + + void ISplitterDragSource.EndDrag() + { + } + + bool ISplitterDragSource.IsVertical + { + get { return (DockState == DockState.DockLeft || DockState == DockState.DockRight); } + } + + Rectangle ISplitterDragSource.DragLimitBounds + { + get + { + Rectangle rectLimit = DockPanel.DockArea; + Point location; + if ((Control.ModifierKeys & Keys.Shift) == 0) + location = Location; + else + location = DockPanel.DockArea.Location; + + if (((ISplitterDragSource)this).IsVertical) + { + rectLimit.X += MeasurePane.MinSize; + rectLimit.Width -= 2 * MeasurePane.MinSize; + rectLimit.Y = location.Y; + if ((Control.ModifierKeys & Keys.Shift) == 0) + rectLimit.Height = Height; + } + else + { + rectLimit.Y += MeasurePane.MinSize; + rectLimit.Height -= 2 * MeasurePane.MinSize; + rectLimit.X = location.X; + if ((Control.ModifierKeys & Keys.Shift) == 0) + rectLimit.Width = Width; + } + + return DockPanel.RectangleToScreen(rectLimit); + } + } + + void ISplitterDragSource.MoveSplitter(int offset) + { + if ((Control.ModifierKeys & Keys.Shift) != 0) + SendToBack(); + + Rectangle rectDockArea = DockPanel.DockArea; + if (DockState == DockState.DockLeft && rectDockArea.Width > 0) + { + if (DockPanel.DockLeftPortion > 1) + DockPanel.DockLeftPortion = Width + offset; + else + DockPanel.DockLeftPortion += ((double)offset) / (double)rectDockArea.Width; + } + else if (DockState == DockState.DockRight && rectDockArea.Width > 0) + { + if (DockPanel.DockRightPortion > 1) + DockPanel.DockRightPortion = Width - offset; + else + DockPanel.DockRightPortion -= ((double)offset) / (double)rectDockArea.Width; + } + else if (DockState == DockState.DockBottom && rectDockArea.Height > 0) + { + if (DockPanel.DockBottomPortion > 1) + DockPanel.DockBottomPortion = Height - offset; + else + DockPanel.DockBottomPortion -= ((double)offset) / (double)rectDockArea.Height; + } + else if (DockState == DockState.DockTop && rectDockArea.Height > 0) + { + if (DockPanel.DockTopPortion > 1) + DockPanel.DockTopPortion = Height + offset; + else + DockPanel.DockTopPortion += ((double)offset) / (double)rectDockArea.Height; + } + } + + #region IDragSource Members + + Control IDragSource.DragControl + { + get { return this; } + } + + #endregion + #endregion + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DockWindowCollection.cs b/WeifenLuoLinux/WinFormsUI/Docking/DockWindowCollection.cs new file mode 100644 index 000000000..7d555b0b3 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DockWindowCollection.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class DockWindowCollection : ReadOnlyCollection + { + internal DockWindowCollection(DockPanel dockPanel) + : base(new List()) + { + Items.Add(dockPanel.Theme.Extender.DockWindowFactory.CreateDockWindow(dockPanel, DockState.Document)); + Items.Add(dockPanel.Theme.Extender.DockWindowFactory.CreateDockWindow(dockPanel, DockState.DockLeft)); + Items.Add(dockPanel.Theme.Extender.DockWindowFactory.CreateDockWindow(dockPanel, DockState.DockRight)); + Items.Add(dockPanel.Theme.Extender.DockWindowFactory.CreateDockWindow(dockPanel, DockState.DockTop)); + Items.Add(dockPanel.Theme.Extender.DockWindowFactory.CreateDockWindow(dockPanel, DockState.DockBottom)); + } + + public DockWindow this [DockState dockState] + { + get + { + if (dockState == DockState.Document) + return Items[0]; + else if (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide) + return Items[1]; + else if (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide) + return Items[2]; + else if (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide) + return Items[3]; + else if (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide) + return Items[4]; + + throw (new ArgumentOutOfRangeException()); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DragForm.cs b/WeifenLuoLinux/WinFormsUI/Docking/DragForm.cs new file mode 100644 index 000000000..06a5d926c --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DragForm.cs @@ -0,0 +1,99 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + // 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 + // (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 + public class DragForm : Form + { + public DragForm() + { + FormBorderStyle = FormBorderStyle.None; + ShowInTaskbar = false; + SetStyle(ControlStyles.Selectable, false); + Enabled = false; + TopMost = true; + SizeChanged += (sender, args) => + { + if (BackgroundColor != null) + { + Invalidate(); + } + }; + } + + public Color? BackgroundColor { get; set; } + + protected override CreateParams CreateParams + { + get + { + CreateParams createParams = base.CreateParams; + createParams.ExStyle |= (int)(Win32.WindowExStyles.WS_EX_NOACTIVATE | 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); + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + if (BackgroundColor == null) + { + return; + } + + var all = ClientRectangle; + if (all.Width > 10 && all.Height > 10) + { + var newLocation = new Point(all.Location.X + 5, all.Location.Y + 5); + var newSize = new Size(all.Width - 10, all.Height - 10); + var center = new Rectangle(newLocation, newSize); + e.Graphics.FillRectangle(new SolidBrush(BackgroundColor.Value), center); + } + } + + //The form can be still activated by explicity calling Activate + protected override bool ShowWithoutActivation + { + get { return true; } + } + + public virtual void Show(bool bActivate) + { + Show(); + + if (bActivate) + Activate(); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DrawingRoutines.cs b/WeifenLuoLinux/WinFormsUI/Docking/DrawingRoutines.cs new file mode 100644 index 000000000..e3f478176 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DrawingRoutines.cs @@ -0,0 +1,35 @@ +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace WeifenLuo.WinFormsUI.Docking { + public static class DrawingRoutines { + public static void SafelyDrawLinearGradient(this Rectangle rectangle, Color startColor, Color endColor, + LinearGradientMode mode, Graphics graphics, Blend blend = null) + { + if (rectangle.Width > 0 && rectangle.Height > 0) + { + using (LinearGradientBrush brush = new LinearGradientBrush(rectangle, startColor, endColor, mode)) + { + if (blend != null) + { + brush.Blend = blend; + } + + graphics.FillRectangle(brush, rectangle); + } + } + } + + public static void SafelyDrawLinearGradientF(this RectangleF rectangle, Color startColor, Color endColor, + LinearGradientMode mode, Graphics graphics) + { + if (rectangle.Width > 0 && rectangle.Height > 0) + { + using (LinearGradientBrush brush = new LinearGradientBrush(rectangle, startColor, endColor, mode)) + { + graphics.FillRectangle(brush, rectangle); + } + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/DummyControl.cs b/WeifenLuoLinux/WinFormsUI/Docking/DummyControl.cs new file mode 100644 index 000000000..98b7db5e2 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/DummyControl.cs @@ -0,0 +1,21 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ToolboxItem(false)] + internal sealed class DummyControl : Control + { + public DummyControl() + { + SetStyle(ControlStyles.Selectable, false); + ResetBackColor(); + } + + public override void ResetBackColor() + { + BackColor = SystemColors.ControlLight; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Enums.cs b/WeifenLuoLinux/WinFormsUI/Docking/Enums.cs new file mode 100644 index 000000000..a1d1fdbf2 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Enums.cs @@ -0,0 +1,59 @@ +using System; +using System.ComponentModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [Flags] + [Serializable] + [Editor(typeof(DockAreasEditor), typeof(System.Drawing.Design.UITypeEditor))] + public enum DockAreas + { + Float = 1, + DockLeft = 2, + DockRight = 4, + DockTop = 8, + DockBottom = 16, + Document = 32 + } + + public enum DockState + { + Unknown = 0, + Float = 1, + DockTopAutoHide = 2, + DockLeftAutoHide = 3, + DockBottomAutoHide = 4, + DockRightAutoHide = 5, + Document = 6, + DockTop = 7, + DockLeft = 8, + DockBottom = 9, + DockRight = 10, + Hidden = 11 + } + + public enum DockAlignment + { + Left, + Right, + Top, + Bottom + } + + public enum DocumentStyle + { + DockingMdi, + DockingWindow, + DockingSdi, + SystemMdi, + } + + /// + /// The location to draw the DockPaneStrip for Document style windows. + /// + public enum DocumentTabStripLocation + { + Top, + Bottom + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/FloatWindow.cs b/WeifenLuoLinux/WinFormsUI/Docking/FloatWindow.cs new file mode 100644 index 000000000..c801206b7 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/FloatWindow.cs @@ -0,0 +1,485 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Security.Permissions; +using System.Diagnostics.CodeAnalysis; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class FloatWindow : Form, INestedPanesContainer, IDockDragSource + { + private NestedPaneCollection m_nestedPanes; + internal const int WM_CHECKDISPOSE = (int)(Win32.Msgs.WM_USER + 1); + + internal protected FloatWindow(DockPanel dockPanel, DockPane pane) + { + InternalConstruct(dockPanel, pane, false, Rectangle.Empty); + } + + internal protected FloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds) + { + InternalConstruct(dockPanel, pane, true, bounds); + } + + private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds) + { + if (dockPanel == null) + throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel)); + + m_nestedPanes = new NestedPaneCollection(this); + + FormBorderStyle = FormBorderStyle.SizableToolWindow; + ShowInTaskbar = false; + if (dockPanel.RightToLeft != RightToLeft) + RightToLeft = dockPanel.RightToLeft; + if (RightToLeftLayout != dockPanel.RightToLeftLayout) + RightToLeftLayout = dockPanel.RightToLeftLayout; + + SuspendLayout(); + if (boundsSpecified) + { + Bounds = bounds; + StartPosition = FormStartPosition.Manual; + } + else + { + StartPosition = FormStartPosition.WindowsDefaultLocation; + Size = dockPanel.DefaultFloatWindowSize; + } + + m_dockPanel = dockPanel; + Owner = DockPanel.FindForm(); + DockPanel.AddFloatWindow(this); + if (pane != null) + pane.FloatWindow = this; + + if (PatchController.EnableFontInheritanceFix == true) + { + Font = dockPanel.Font; + } + + ResumeLayout(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (DockPanel != null) + DockPanel.RemoveFloatWindow(this); + m_dockPanel = null; + } + base.Dispose(disposing); + } + + private bool m_allowEndUserDocking = true; + public bool AllowEndUserDocking + { + get { return m_allowEndUserDocking; } + set { m_allowEndUserDocking = value; } + } + + private bool m_doubleClickTitleBarToDock = true; + public bool DoubleClickTitleBarToDock + { + get { return m_doubleClickTitleBarToDock; } + set { m_doubleClickTitleBarToDock = value; } + } + + public NestedPaneCollection NestedPanes + { + get { return m_nestedPanes; } + } + + public VisibleNestedPaneCollection VisibleNestedPanes + { + get { return NestedPanes.VisibleNestedPanes; } + } + + private DockPanel m_dockPanel; + public DockPanel DockPanel + { + get { return m_dockPanel; } + } + + public DockState DockState + { + get { return DockState.Float; } + } + + public bool IsFloat + { + get { return DockState == DockState.Float; } + } + + internal bool IsDockStateValid(DockState dockState) + { + foreach (DockPane pane in NestedPanes) + foreach (IDockContent content in pane.Contents) + if (!DockHelper.IsDockStateValid(dockState, content.DockHandler.DockAreas)) + return false; + + return true; + } + + protected override void OnActivated(EventArgs e) + { + DockPanel.FloatWindows.BringWindowToFront(this); + base.OnActivated (e); + // Propagate the Activated event to the visible panes content objects + foreach (DockPane pane in VisibleNestedPanes) + foreach (IDockContent content in pane.Contents) + content.OnActivated(e); + } + + protected override void OnDeactivate(EventArgs e) + { + base.OnDeactivate(e); + // Propagate the Deactivate event to the visible panes content objects + foreach (DockPane pane in VisibleNestedPanes) + foreach (IDockContent content in pane.Contents) + content.OnDeactivate(e); + } + + protected override void OnLayout(LayoutEventArgs levent) + { + VisibleNestedPanes.Refresh(); + RefreshChanges(); + Visible = (VisibleNestedPanes.Count > 0); + SetText(); + + base.OnLayout(levent); + } + + + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)")] + internal void SetText() + { + DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null; + + if (theOnlyPane == null || theOnlyPane.ActiveContent == null) + { + Text = " "; // use " " instead of string.Empty because the whole title bar will disappear when ControlBox is set to false. + Icon = null; + } + else + { + Text = theOnlyPane.ActiveContent.DockHandler.TabText; + Icon = theOnlyPane.ActiveContent.DockHandler.Icon; + } + } + + protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) + { + Rectangle rectWorkArea = SystemInformation.VirtualScreen; + + if (y + height > rectWorkArea.Bottom) + y -= (y + height) - rectWorkArea.Bottom; + + if (y < rectWorkArea.Top) + y += rectWorkArea.Top - y; + + base.SetBoundsCore (x, y, width, height, specified); + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + switch (m.Msg) + { + case (int)Win32.Msgs.WM_NCLBUTTONDOWN: + { + if (IsDisposed) + return; + + uint result = Win32Helper.IsRunningOnMono ? 0 : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam); + if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking) // HITTEST_CAPTION + { + Activate(); + m_dockPanel.BeginDrag(this); + } + else + base.WndProc(ref m); + + return; + } + case (int)Win32.Msgs.WM_NCRBUTTONDOWN: + { + uint result = Win32Helper.IsRunningOnMono ? Win32Helper.HitTestCaption(this) : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam); + if (result == 2) // HITTEST_CAPTION + { + DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null; + if (theOnlyPane != null && theOnlyPane.ActiveContent != null) + { + theOnlyPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition)); + return; + } + } + + base.WndProc(ref m); + return; + } + case (int)Win32.Msgs.WM_CLOSE: + if (NestedPanes.Count == 0) + { + base.WndProc(ref m); + return; + } + for (int i = NestedPanes.Count - 1; i >= 0; i--) + { + DockContentCollection contents = NestedPanes[i].Contents; + for (int j = contents.Count - 1; j >= 0; j--) + { + IDockContent content = contents[j]; + if (content.DockHandler.DockState != DockState.Float) + continue; + + if (!content.DockHandler.CloseButton) + continue; + + if (content.DockHandler.HideOnClose) + content.DockHandler.Hide(); + else + content.DockHandler.Close(); + } + } + return; + case (int)Win32.Msgs.WM_NCLBUTTONDBLCLK: + { + uint result = !DoubleClickTitleBarToDock || Win32Helper.IsRunningOnMono + ? Win32Helper.HitTestCaption(this) + : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam); + + if (result != 2) // HITTEST_CAPTION + { + base.WndProc(ref m); + return; + } + + DockPanel.SuspendLayout(true); + + // Restore to panel + foreach (DockPane pane in NestedPanes) + { + if (pane.DockState != DockState.Float) + continue; + pane.RestoreToPanel(); + } + + + DockPanel.ResumeLayout(true, true); + return; + } + case WM_CHECKDISPOSE: + if (NestedPanes.Count == 0) + Dispose(); + return; + } + + base.WndProc(ref m); + } + + internal void RefreshChanges() + { + if (IsDisposed) + return; + + if (VisibleNestedPanes.Count == 0) + { + ControlBox = true; + return; + } + + for (int i=VisibleNestedPanes.Count - 1; i>=0; i--) + { + DockContentCollection contents = VisibleNestedPanes[i].Contents; + for (int j=contents.Count - 1; j>=0; j--) + { + IDockContent content = contents[j]; + if (content.DockHandler.DockState != DockState.Float) + continue; + + if (content.DockHandler.CloseButton && content.DockHandler.CloseButtonVisible) + { + ControlBox = true; + return; + } + } + } + //Only if there is a ControlBox do we turn it off + //old code caused a flash of the window. + if (ControlBox) + ControlBox = false; + } + + public virtual Rectangle DisplayingRectangle + { + get { return ClientRectangle; } + } + + internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline) + { + if (VisibleNestedPanes.Count == 1) + { + DockPane pane = VisibleNestedPanes[0]; + if (!dragSource.CanDockTo(pane)) + return; + + Point ptMouse = Control.MousePosition; + uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y); + if (!Win32Helper.IsRunningOnMono) + { + if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION) + { + dockOutline.Show(VisibleNestedPanes[0], -1); + } + } + } + } + + #region IDockDragSource Members + + #region IDragSource Members + + Control IDragSource.DragControl + { + get { return this; } + } + + #endregion + + bool IDockDragSource.IsDockStateValid(DockState dockState) + { + return IsDockStateValid(dockState); + } + + bool IDockDragSource.CanDockTo(DockPane pane) + { + if (!IsDockStateValid(pane.DockState)) + return false; + + if (pane.FloatWindow == this) + return false; + + return true; + } + + private int m_preDragExStyle; + + Rectangle IDockDragSource.BeginDrag(Point ptMouse) + { + m_preDragExStyle = NativeMethods.GetWindowLong(this.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE); + NativeMethods.SetWindowLong(this.Handle, + (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, + m_preDragExStyle | (int)(Win32.WindowExStyles.WS_EX_TRANSPARENT | Win32.WindowExStyles.WS_EX_LAYERED) ); + return Bounds; + } + + void IDockDragSource.EndDrag() + { + NativeMethods.SetWindowLong(this.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, m_preDragExStyle); + + Invalidate(true); + NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCPAINT, 1, 0); + } + + public void FloatAt(Rectangle floatWindowBounds) + { + Bounds = floatWindowBounds; + } + + public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex) + { + if (dockStyle == DockStyle.Fill) + { + for (int i = NestedPanes.Count - 1; i >= 0; i--) + { + DockPane paneFrom = NestedPanes[i]; + for (int j = paneFrom.Contents.Count - 1; j >= 0; j--) + { + IDockContent c = paneFrom.Contents[j]; + c.DockHandler.Pane = pane; + if (contentIndex != -1) + pane.SetContentIndex(c, contentIndex); + c.DockHandler.Activate(); + } + } + } + else + { + DockAlignment alignment = DockAlignment.Left; + if (dockStyle == DockStyle.Left) + alignment = DockAlignment.Left; + else if (dockStyle == DockStyle.Right) + alignment = DockAlignment.Right; + else if (dockStyle == DockStyle.Top) + alignment = DockAlignment.Top; + else if (dockStyle == DockStyle.Bottom) + alignment = DockAlignment.Bottom; + + MergeNestedPanes(VisibleNestedPanes, pane.NestedPanesContainer.NestedPanes, pane, alignment, 0.5); + } + } + + public void DockTo(DockPanel panel, DockStyle dockStyle) + { + if (panel != DockPanel) + throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel"); + + NestedPaneCollection nestedPanesTo = null; + + if (dockStyle == DockStyle.Top) + nestedPanesTo = DockPanel.DockWindows[DockState.DockTop].NestedPanes; + else if (dockStyle == DockStyle.Bottom) + nestedPanesTo = DockPanel.DockWindows[DockState.DockBottom].NestedPanes; + else if (dockStyle == DockStyle.Left) + nestedPanesTo = DockPanel.DockWindows[DockState.DockLeft].NestedPanes; + else if (dockStyle == DockStyle.Right) + nestedPanesTo = DockPanel.DockWindows[DockState.DockRight].NestedPanes; + else if (dockStyle == DockStyle.Fill) + nestedPanesTo = DockPanel.DockWindows[DockState.Document].NestedPanes; + + DockPane prevPane = null; + for (int i = nestedPanesTo.Count - 1; i >= 0; i--) + if (nestedPanesTo[i] != VisibleNestedPanes[0]) + prevPane = nestedPanesTo[i]; + MergeNestedPanes(VisibleNestedPanes, nestedPanesTo, prevPane, DockAlignment.Left, 0.5); + } + + private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion) + { + if (nestedPanesFrom.Count == 0) + return; + + int count = nestedPanesFrom.Count; + DockPane[] panes = new DockPane[count]; + DockPane[] prevPanes = new DockPane[count]; + DockAlignment[] alignments = new DockAlignment[count]; + double[] proportions = new double[count]; + + for (int i = 0; i < count; i++) + { + panes[i] = nestedPanesFrom[i]; + prevPanes[i] = nestedPanesFrom[i].NestedDockingStatus.PreviousPane; + alignments[i] = nestedPanesFrom[i].NestedDockingStatus.Alignment; + proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion; + } + + DockPane pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion); + panes[0].DockState = nestedPanesTo.DockState; + + for (int i = 1; i < count; i++) + { + for (int j = i; j < count; j++) + { + if (prevPanes[j] == panes[i - 1]) + prevPanes[j] = pane; + } + pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]); + panes[i].DockState = nestedPanesTo.DockState; + } + } + + #endregion + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/FloatWindowCollection.cs b/WeifenLuoLinux/WinFormsUI/Docking/FloatWindowCollection.cs new file mode 100644 index 000000000..beb9c14a7 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/FloatWindowCollection.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class FloatWindowCollection : ReadOnlyCollection + { + internal FloatWindowCollection() + : base(new List()) + { + } + + internal int Add(FloatWindow fw) + { + if (Items.Contains(fw)) + return Items.IndexOf(fw); + + Items.Add(fw); + return Count - 1; + } + + internal void Dispose() + { + for (int i=Count - 1; i>=0; i--) + this[i].Close(); + } + + internal void Remove(FloatWindow fw) + { + Items.Remove(fw); + } + + internal void BringWindowToFront(FloatWindow fw) + { + Items.Remove(fw); + Items.Add(fw); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Helpers/DockHelper.cs b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/DockHelper.cs new file mode 100644 index 000000000..cf2b8637d --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/DockHelper.cs @@ -0,0 +1,104 @@ +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public static 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 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 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; + } + + public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel) + { + if (!Win32Helper.IsRunningOnMono) + 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 pane; + } + + return null; + } + + public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel) + { + if (!Win32Helper.IsRunningOnMono) + for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent) + { + FloatWindow floatWindow = control as FloatWindow; + if (floatWindow != null && floatWindow.DockPanel == dockPanel) + return floatWindow; + } + + return null; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Helpers/DrawHelper.cs b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/DrawHelper.cs new file mode 100644 index 000000000..8441b7b1b --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/DrawHelper.cs @@ -0,0 +1,101 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public static class DrawHelper + { + public static Point RtlTransform(Control control, Point point) + { + if (control.RightToLeft != RightToLeft.Yes) + return point; + else + return new Point(control.Right - point.X, point.Y); + } + + public static Rectangle RtlTransform(Control control, Rectangle rectangle) + { + if (control.RightToLeft != RightToLeft.Yes) + return rectangle; + else + return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height); + } + + public static GraphicsPath GetRoundedCornerTab(GraphicsPath graphicsPath, Rectangle rect, bool upCorner) + { + if (graphicsPath == null) + graphicsPath = new GraphicsPath(); + else + graphicsPath.Reset(); + + int curveSize = 6; + if (upCorner) + { + graphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left, rect.Top + curveSize / 2); + graphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90); + graphicsPath.AddLine(rect.Left + curveSize / 2, rect.Top, rect.Right - curveSize / 2, rect.Top); + graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Top, curveSize, curveSize), -90, 90); + graphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Bottom); + } + else + { + graphicsPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Bottom - curveSize / 2); + graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize), 0, 90); + graphicsPath.AddLine(rect.Right - curveSize / 2, rect.Bottom, rect.Left + curveSize / 2, rect.Bottom); + graphicsPath.AddArc(new Rectangle(rect.Left, rect.Bottom - curveSize, curveSize, curveSize), 90, 90); + graphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Top); + } + + return graphicsPath; + } + + public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap) + { + return CalculateGraphicsPathFromBitmap(bitmap, Color.Empty); + } + + // From http://edu.cnzz.cn/show_3281.html + public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap, Color colorTransparent) + { + GraphicsPath graphicsPath = new GraphicsPath(); + if (colorTransparent == Color.Empty) + colorTransparent = bitmap.GetPixel(0, 0); + + for(int row = 0; row < bitmap.Height; row ++) + { + int colOpaquePixel = 0; + for(int col = 0; col < bitmap.Width; col ++) + { + if(bitmap.GetPixel(col, row) != colorTransparent) + { + colOpaquePixel = col; + int colNext = col; + for(colNext = colOpaquePixel; colNext < bitmap.Width; colNext ++) + if(bitmap.GetPixel(colNext, row) == colorTransparent) + break; + + graphicsPath.AddRectangle(new Rectangle(colOpaquePixel, row, colNext - colOpaquePixel, 1)); + col = colNext; + } + } + } + return graphicsPath; + } + + public static int Balance(int length, int margin, int input, int lower, int upper) + { + return Max(Min(input, upper - length - margin), lower + margin); + } + + private static int Min(int one, int other) + { + return one > other ? other : one; + } + + private static int Max(int one, int other) + { + return one < other ? other : one; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Helpers/ResourceHelper.cs b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/ResourceHelper.cs new file mode 100644 index 000000000..dadfdef54 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/ResourceHelper.cs @@ -0,0 +1,25 @@ +using System.Resources; + +namespace WeifenLuo.WinFormsUI.Docking +{ + internal static class ResourceHelper + { + private static ResourceManager _resourceManager = null; + + private static ResourceManager ResourceManager + { + get + { + if (_resourceManager == null) + _resourceManager = new ResourceManager("WeifenLuo.WinFormsUI.Docking.Strings", typeof(ResourceHelper).Assembly); + return _resourceManager; + } + + } + + public static string GetString(string name) + { + return ResourceManager.GetString(name); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Helpers/Win32Helper.cs b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/Win32Helper.cs new file mode 100644 index 000000000..21086c77d --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Helpers/Win32Helper.cs @@ -0,0 +1,29 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public static class Win32Helper + { + private static readonly bool _isRunningOnMono = Type.GetType("Mono.Runtime") != null; + + public static bool IsRunningOnMono { get { return _isRunningOnMono; } } + + internal static Control ControlAtPoint(Point pt) + { + return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt)); + } + + internal static uint MakeLong(int low, int high) + { + return (uint)((high << 16) + low); + } + + internal static uint HitTestCaption(Control control) + { + var captionRectangle = new Rectangle(0, 0, control.Width, control.ClientRectangle.Top - control.PointToClient(control.Location).X); + return captionRectangle.Contains(Control.MousePosition) ? (uint)2 : 0; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/IImageService.cs b/WeifenLuoLinux/WinFormsUI/Docking/IImageService.cs new file mode 100644 index 000000000..30e400288 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/IImageService.cs @@ -0,0 +1,312 @@ +using System.Drawing; +using System.Drawing.Imaging; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public interface IImageService + { + Bitmap Dockindicator_PaneDiamond { get; } + Bitmap Dockindicator_PaneDiamond_Fill { get; } + Bitmap Dockindicator_PaneDiamond_Hotspot { get; } + Bitmap DockIndicator_PaneDiamond_HotspotIndex { get; } + Image DockIndicator_PanelBottom { get; } + Image DockIndicator_PanelFill { get; } + Image DockIndicator_PanelLeft { get; } + Image DockIndicator_PanelRight { get; } + Image DockIndicator_PanelTop { get; } + Bitmap DockPane_Close { get; } + Bitmap DockPane_List { get; } + Bitmap DockPane_Dock { get; } + Bitmap DockPaneActive_AutoHide { get; } + Bitmap DockPane_Option { get; } + Bitmap DockPane_OptionOverflow { get; } + Bitmap DockPaneActive_Close { get; } + Bitmap DockPaneActive_Dock { get; } + Bitmap DockPaneActive_Option { get; } + Bitmap DockPaneHover_Close { get; } + Bitmap DockPaneHover_List { get; } + Bitmap DockPaneHover_Dock { get; } + Bitmap DockPaneActiveHover_AutoHide { get; } + Bitmap DockPaneHover_Option { get; } + Bitmap DockPaneHover_OptionOverflow { get; } + Bitmap DockPanePress_Close { get; } + Bitmap DockPanePress_List { get; } + Bitmap DockPanePress_Dock { get; } + Bitmap DockPanePress_AutoHide { get; } + Bitmap DockPanePress_Option { get; } + Bitmap DockPanePress_OptionOverflow { get; } + Bitmap DockPaneActiveHover_Close { get; } + Bitmap DockPaneActiveHover_Dock { get; } + Bitmap DockPaneActiveHover_Option { get; } + Image TabActive_Close { get; } + Image TabInactive_Close { get; } + Image TabLostFocus_Close { get; } + Image TabHoverActive_Close { get; } + Image TabHoverInactive_Close { get; } + Image TabHoverLostFocus_Close { get; } + Image TabPressActive_Close { get; } + Image TabPressInactive_Close { get; } + Image TabPressLostFocus_Close { get; } + } + + public static class ImageServiceHelper + { + /// + /// Gets images for tabs and captions. + /// + /// + /// + /// + /// + /// + public static Bitmap GetImage(Bitmap mask, Color glyph, Color background, Color? border = null) + { + var width = mask.Width; + var height = mask.Height; + Bitmap input = new Bitmap(width, height); + using (Graphics gfx = Graphics.FromImage(input)) + { + SolidBrush brush = new SolidBrush(glyph); + gfx.FillRectangle(brush, 0, 0, width, height); + } + + Bitmap output = new Bitmap(input.Width, input.Height, PixelFormat.Format32bppArgb); + var rect = new Rectangle(0, 0, input.Width, input.Height); + var bitsMask = mask.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + var bitsInput = input.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + var bitsOutput = output.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); + unsafe + { + for (int y = 0; y < input.Height; y++) + { + byte* ptrMask = (byte*)bitsMask.Scan0 + y * bitsMask.Stride; + byte* ptrInput = (byte*)bitsInput.Scan0 + y * bitsInput.Stride; + byte* ptrOutput = (byte*)bitsOutput.Scan0 + y * bitsOutput.Stride; + for (int x = 0; x < input.Width; x++) + { + ptrOutput[4 * x] = ptrInput[4 * x]; // blue + ptrOutput[4 * x + 1] = ptrInput[4 * x + 1]; // green + ptrOutput[4 * x + 2] = ptrInput[4 * x + 2]; // red + ptrOutput[4 * x + 3] = ptrMask[4 * x]; // alpha + } + } + } + + mask.UnlockBits(bitsMask); + input.UnlockBits(bitsInput); + output.UnlockBits(bitsOutput); + input.Dispose(); + + if (border == null) + { + border = background; + } + + Bitmap back = new Bitmap(width, height); + using (Graphics gfx = Graphics.FromImage(back)) + { + SolidBrush brush = new SolidBrush(background); + SolidBrush brush2 = new SolidBrush(border.Value); + gfx.FillRectangle(brush2, 0, 0, width, height); + if (background != border.Value) + { + gfx.FillRectangle(brush, 1, 1, width - 2, height - 2); + } + + gfx.DrawImageUnscaled(output, 0, 0); + } + + output.Dispose(); + return back; + } + + public static Bitmap GetBackground(Color innerBorder, Color outerBorder, int width, IPaintingService painting) + { + Bitmap back = new Bitmap(width, width); + using (Graphics gfx = Graphics.FromImage(back)) + { + SolidBrush brush = painting.GetBrush(innerBorder); + SolidBrush brush2 = painting.GetBrush(outerBorder); + gfx.FillRectangle(brush2, 0, 0, width, width); + gfx.FillRectangle(brush, 1, 1, width - 2, width - 2); + } + + return back; + } + + public static Bitmap GetLayerImage(Color color, int width, IPaintingService painting) + { + Bitmap back = new Bitmap(width, width); + using (Graphics gfx = Graphics.FromImage(back)) + { + SolidBrush brush = painting.GetBrush(color); + gfx.FillRectangle(brush, 0, 0, width, width); + } + + return back; + } + + /// + /// Gets images for docking indicators. + /// + /// + public static Bitmap GetDockIcon(Bitmap maskArrow, Bitmap layerArrow, Bitmap maskWindow, Bitmap layerWindow, Bitmap maskBack, Color background, IPaintingService painting, Bitmap maskCore = null, Bitmap layerCore = null, Color? separator = null) + { + var width = maskBack.Width; + var height = maskBack.Height; + var rect = new Rectangle(0, 0, width, height); + Bitmap arrowOut = null; + + if (maskArrow != null) + { + Bitmap input = layerArrow; + arrowOut = MaskImages(input, maskArrow); + } + + Bitmap windowIn = layerWindow; + Bitmap windowOut = MaskImages(windowIn, maskWindow); + + Bitmap coreOut = null; + if (layerCore != null) + { + var coreIn = layerCore; + coreOut = MaskImages(coreIn, maskCore); + } + + Bitmap backIn = new Bitmap(width, height); + using (Graphics gfx = Graphics.FromImage(backIn)) + { + SolidBrush brush = painting.GetBrush(background); + gfx.FillRectangle(brush, 0, 0, width, height); + gfx.DrawImageUnscaled(windowOut, 0, 0); + windowOut.Dispose(); + if (layerCore != null) + { + gfx.DrawImageUnscaled(coreOut, 0, 0); + coreOut.Dispose(); + } + + if (separator != null) + { + Pen sep = painting.GetPen(separator.Value); + gfx.DrawRectangle(sep, 0, 0, width - 1, height - 1); + } + } + + Bitmap backOut = MaskImages(backIn, maskBack); + backIn.Dispose(); + + using (Graphics gfx = Graphics.FromImage(backOut)) + { + if (arrowOut != null) + { + gfx.DrawImageUnscaled(arrowOut, 0, 0); + arrowOut.Dispose(); + } + } + + return backOut; + } + + public static Bitmap MaskImages(Bitmap input, Bitmap maskArrow) + { + var width = input.Width; + var height = input.Height; + var rect = new Rectangle(0, 0, width, height); + var arrowOut = new Bitmap(width, height, PixelFormat.Format32bppArgb); + var bitsMask = maskArrow.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + var bitsInput = input.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + var bitsOutput = arrowOut.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); + unsafe + { + for (int y = 0; y < height; y++) + { + byte* ptrMask = (byte*)bitsMask.Scan0 + y * bitsMask.Stride; + byte* ptrInput = (byte*)bitsInput.Scan0 + y * bitsInput.Stride; + byte* ptrOutput = (byte*)bitsOutput.Scan0 + y * bitsOutput.Stride; + for (int x = 0; x < width; x++) + { + ptrOutput[4 * x] = ptrInput[4 * x]; // blue + ptrOutput[4 * x + 1] = ptrInput[4 * x + 1]; // green + ptrOutput[4 * x + 2] = ptrInput[4 * x + 2]; // red + ptrOutput[4 * x + 3] = ptrMask[4 * x]; // alpha + } + } + } + + maskArrow.UnlockBits(bitsMask); + input.UnlockBits(bitsInput); + arrowOut.UnlockBits(bitsOutput); + return arrowOut; + } + + public static Bitmap GetDockImage(Bitmap icon, Bitmap background) + { + var result = new Bitmap(background); + var offset = (background.Width - icon.Width) / 2; + using (var gfx = Graphics.FromImage(result)) + { + gfx.DrawImage(icon, offset, offset); + } + + return result; + } + + public static Bitmap CombineFive(Bitmap five, Bitmap bottom, Bitmap center, Bitmap left, Bitmap right, Bitmap top) + { + var result = new Bitmap(five); + var cell = (result.Width - bottom.Width) / 2; + var offset = (cell - bottom.Width) / 2; + using (var gfx = Graphics.FromImage(result)) + { + gfx.DrawImageUnscaled(top, cell, offset); + gfx.DrawImageUnscaled(center, cell, cell); + gfx.DrawImageUnscaled(bottom, cell, 2 * cell - offset); + gfx.DrawImageUnscaled(left, offset, cell); + gfx.DrawImageUnscaled(right, 2 * cell - offset, cell); + } + + return result; + } + + public static Bitmap GetFiveBackground(Bitmap mask, Color innerBorder, Color outerBorder, IPaintingService painting) + { + // TODO: calculate points using functions. + using (var input = GetLayerImage(innerBorder, mask.Width, painting)) + { + using (var gfx = Graphics.FromImage(input)) + { + var pen = painting.GetPen(outerBorder); + gfx.DrawLines(pen, new[] + { + new Point(36, 25),new Point(36, 0), + new Point(75, 0), new Point(75, 25) + }); + gfx.DrawLines(pen, new[] + { + new Point(86, 36), new Point(111, 36), + new Point(111, 75), new Point(86, 75) + }); + gfx.DrawLines(pen, new[] + { + new Point(75, 86), new Point(75, 111), + new Point(36, 111), new Point(36, 86) + }); + gfx.DrawLines(pen, new[] + { + new Point(25, 75), new Point(0, 75), + new Point(0, 36), new Point(25, 36) + }); + var pen2 = painting.GetPen(outerBorder, 2); + gfx.DrawLine(pen2, new Point(36, 25), new Point(25, 36)); + gfx.DrawLine(pen2, new Point(75, 25), new Point(86, 36)); + gfx.DrawLine(pen2, new Point(86, 75), new Point(75, 86)); + gfx.DrawLine(pen2, new Point(36, 86), new Point(25, 75)); + } + + return MaskImages(input, mask); + } + } + } + +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/Docking/IPaintingService.cs b/WeifenLuoLinux/WinFormsUI/Docking/IPaintingService.cs new file mode 100644 index 000000000..43b81ff99 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/IPaintingService.cs @@ -0,0 +1,11 @@ +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public interface IPaintingService + { + Pen GetPen(Color color, int thickness = 1); + SolidBrush GetBrush(Color color); + void CleanUp(); + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/InertButtonBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/InertButtonBase.cs new file mode 100644 index 000000000..d1f1db629 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/InertButtonBase.cs @@ -0,0 +1,165 @@ +using System; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Imaging; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public abstract class InertButtonBase : Control + { + protected InertButtonBase() + { + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + BackColor = Color.Transparent; + } + + public abstract Bitmap HoverImage { get; } + + public abstract Bitmap PressImage { get; } + + public abstract Bitmap Image { get; } + + private bool m_isMouseOver = false; + protected bool IsMouseOver + { + get { return m_isMouseOver; } + private set + { + if (m_isMouseOver == value) + return; + + m_isMouseOver = value; + Invalidate(); + } + } + + private bool m_isMouseDown = false; + protected bool IsMouseDown + { + get { return m_isMouseDown; } + private set + { + if (m_isMouseDown == value) + return; + + m_isMouseDown = value; + Invalidate(); + } + } + + protected override Size DefaultSize + { + get { return new Size(16, 15); } + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + bool over = ClientRectangle.Contains(e.X, e.Y); + if (IsMouseOver != over) + IsMouseOver = over; + } + + protected override void OnMouseEnter(EventArgs e) + { + base.OnMouseEnter(e); + if (!IsMouseOver) + IsMouseOver = true; + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + if (IsMouseOver) + IsMouseOver = false; + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseLeave(e); + if (!IsMouseDown) + IsMouseDown = true; + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseLeave(e); + if (IsMouseDown) + IsMouseDown = false; + } + + protected override void OnPaint(PaintEventArgs e) + { + if (HoverImage != null) + { + if (IsMouseOver && Enabled) + { + e.Graphics.DrawImage( + IsMouseDown ? PressImage : HoverImage, + PatchController.EnableHighDpi == true + ? ClientRectangle + : new Rectangle(0, 0, Image.Width, Image.Height)); + } + else + { + e.Graphics.DrawImage( + Image, + PatchController.EnableHighDpi == true + ? ClientRectangle + : new Rectangle(0, 0, Image.Width, Image.Height)); + } + + base.OnPaint(e); + return; + } + + if (IsMouseOver && Enabled) + { + using (Pen pen = new Pen(ForeColor)) + { + e.Graphics.DrawRectangle(pen, Rectangle.Inflate(ClientRectangle, -1, -1)); + } + } + + using (ImageAttributes imageAttributes = new ImageAttributes()) + { + ColorMap[] colorMap = new ColorMap[2]; + colorMap[0] = new ColorMap(); + colorMap[0].OldColor = Color.FromArgb(0, 0, 0); + colorMap[0].NewColor = ForeColor; + colorMap[1] = new ColorMap(); + colorMap[1].OldColor = Image.GetPixel(0, 0); + colorMap[1].NewColor = Color.Transparent; + + imageAttributes.SetRemapTable(colorMap); + + e.Graphics.DrawImage( + Image, + new Rectangle(0, 0, Image.Width, Image.Height), + 0, 0, + Image.Width, + Image.Height, + GraphicsUnit.Pixel, + imageAttributes); + } + + base.OnPaint(e); + } + + public void RefreshChanges() + { + if (IsDisposed) + return; + + bool mouseOver = ClientRectangle.Contains(PointToClient(Control.MousePosition)); + if (mouseOver != IsMouseOver) + IsMouseOver = mouseOver; + + OnRefreshChanges(); + } + + protected virtual void OnRefreshChanges() + { + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Interfaces.cs b/WeifenLuoLinux/WinFormsUI/Docking/Interfaces.cs new file mode 100644 index 000000000..6054cf99a --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Interfaces.cs @@ -0,0 +1,59 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public interface IDockContent : IContextMenuStripHost + { + DockContentHandler DockHandler { get; } + void OnActivated(EventArgs e); + void OnDeactivate(EventArgs e); + } + + public interface IContextMenuStripHost + { + void ApplyTheme(); + } + + public interface INestedPanesContainer + { + DockState DockState { get; } + Rectangle DisplayingRectangle { get; } + NestedPaneCollection NestedPanes { get; } + VisibleNestedPaneCollection VisibleNestedPanes { get; } + bool IsFloat { get; } + } + + public interface IDragSource + { + Control DragControl { get; } + } + + public interface IDockDragSource : IDragSource + { + Rectangle BeginDrag(Point ptMouse); + void EndDrag(); + bool IsDockStateValid(DockState dockState); + bool CanDockTo(DockPane pane); + void FloatAt(Rectangle floatWindowBounds); + void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex); + void DockTo(DockPanel panel, DockStyle dockStyle); + } + + public interface ISplitterDragSource : IDragSource + { + void BeginDrag(Rectangle rectSplitter); + void EndDrag(); + bool IsVertical { get; } + Rectangle DragLimitBounds { get; } + void MoveSplitter(int offset); + } + + public interface ISplitterHost : ISplitterDragSource + { + DockPanel DockPanel { get; } + DockState DockState { get; } + bool IsDockWindow { get; } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/LayoutUtils.cs b/WeifenLuoLinux/WinFormsUI/Docking/LayoutUtils.cs new file mode 100644 index 000000000..2c161b008 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/LayoutUtils.cs @@ -0,0 +1,12 @@ +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public static class LayoutUtils + { + public static bool IsZeroWidthOrHeight(Rectangle rectangle) + { + return (rectangle.Width == 0 || rectangle.Height == 0); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Localization.cs b/WeifenLuoLinux/WinFormsUI/Docking/Localization.cs new file mode 100644 index 000000000..962497dd7 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Localization.cs @@ -0,0 +1,46 @@ +using System; +using System.ComponentModel; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [AttributeUsage(AttributeTargets.All)] + internal sealed class LocalizedDescriptionAttribute : DescriptionAttribute + { + private bool m_initialized = false; + + public LocalizedDescriptionAttribute(string key) : base(key) + { + } + + public override string Description + { + get + { + if (!m_initialized) + { + string key = base.Description; + DescriptionValue = ResourceHelper.GetString(key); + if (DescriptionValue == null) + DescriptionValue = String.Empty; + + m_initialized = true; + } + + return DescriptionValue; + } + } + } + + [AttributeUsage(AttributeTargets.All)] + internal sealed class LocalizedCategoryAttribute : CategoryAttribute + { + public LocalizedCategoryAttribute(string key) : base(key) + { + } + + protected override string GetLocalizedString(string value) + { + return ResourceHelper.GetString(value); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Measures.cs b/WeifenLuoLinux/WinFormsUI/Docking/Measures.cs new file mode 100644 index 000000000..af2c474b4 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Measures.cs @@ -0,0 +1,15 @@ +namespace WeifenLuo.WinFormsUI.Docking +{ + public class Measures + { + public int SplitterSize = 4; + public int AutoHideSplitterSize = 4; + public int AutoHideTabLineWidth = 6; + public int DockPadding { get; set; } + } + + internal static class MeasurePane + { + public const int MinSize = 24; + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/NestedDockingStatus.cs b/WeifenLuoLinux/WinFormsUI/Docking/NestedDockingStatus.cs new file mode 100644 index 000000000..db783da45 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/NestedDockingStatus.cs @@ -0,0 +1,107 @@ +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public sealed class NestedDockingStatus + { + internal NestedDockingStatus(DockPane pane) + { + m_dockPane = pane; + } + + private DockPane m_dockPane = null; + public DockPane DockPane + { + get { return m_dockPane; } + } + + private NestedPaneCollection m_nestedPanes = null; + public NestedPaneCollection NestedPanes + { + get { return m_nestedPanes; } + } + + private DockPane m_previousPane = null; + public DockPane PreviousPane + { + get { return m_previousPane; } + } + + private DockAlignment m_alignment = DockAlignment.Left; + public DockAlignment Alignment + { + get { return m_alignment; } + } + + private double m_proportion = 0.5; + public double Proportion + { + get { return m_proportion; } + } + + private bool m_isDisplaying = false; + public bool IsDisplaying + { + get { return m_isDisplaying; } + } + + private DockPane m_displayingPreviousPane = null; + public DockPane DisplayingPreviousPane + { + get { return m_displayingPreviousPane; } + } + + private DockAlignment m_displayingAlignment = DockAlignment.Left; + public DockAlignment DisplayingAlignment + { + get { return m_displayingAlignment; } + } + + private double m_displayingProportion = 0.5; + public double DisplayingProportion + { + get { return m_displayingProportion; } + } + + private Rectangle m_logicalBounds = Rectangle.Empty; + public Rectangle LogicalBounds + { + get { return m_logicalBounds; } + } + + private Rectangle m_paneBounds = Rectangle.Empty; + public Rectangle PaneBounds + { + get { return m_paneBounds; } + } + + private Rectangle m_splitterBounds = Rectangle.Empty; + public Rectangle SplitterBounds + { + get { return m_splitterBounds; } + } + + internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion) + { + m_nestedPanes = nestedPanes; + m_previousPane = previousPane; + m_alignment = alignment; + m_proportion = proportion; + } + + internal void SetDisplayingStatus(bool isDisplaying, DockPane displayingPreviousPane, DockAlignment displayingAlignment, double displayingProportion) + { + m_isDisplaying = isDisplaying; + m_displayingPreviousPane = displayingPreviousPane; + m_displayingAlignment = displayingAlignment; + m_displayingProportion = displayingProportion; + } + + internal void SetDisplayingBounds(Rectangle logicalBounds, Rectangle paneBounds, Rectangle splitterBounds) + { + m_logicalBounds = logicalBounds; + m_paneBounds = paneBounds; + m_splitterBounds = splitterBounds; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/NestedPaneCollection.cs b/WeifenLuoLinux/WinFormsUI/Docking/NestedPaneCollection.cs new file mode 100644 index 000000000..18a9a46b7 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/NestedPaneCollection.cs @@ -0,0 +1,170 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public sealed class NestedPaneCollection : ReadOnlyCollection + { + private INestedPanesContainer m_container; + private VisibleNestedPaneCollection m_visibleNestedPanes; + + internal NestedPaneCollection(INestedPanesContainer container) + : base(new List()) + { + m_container = container; + m_visibleNestedPanes = new VisibleNestedPaneCollection(this); + } + + public INestedPanesContainer Container + { + get { return m_container; } + } + + public VisibleNestedPaneCollection VisibleNestedPanes + { + get { return m_visibleNestedPanes; } + } + + public DockState DockState + { + get { return Container.DockState; } + } + + public bool IsFloat + { + get { return DockState == DockState.Float; } + } + + internal void Add(DockPane pane) + { + if (pane == null) + return; + + NestedPaneCollection oldNestedPanes = (pane.NestedPanesContainer == null) ? null : pane.NestedPanesContainer.NestedPanes; + if (oldNestedPanes != null) + oldNestedPanes.InternalRemove(pane); + Items.Add(pane); + if (oldNestedPanes != null) + oldNestedPanes.CheckFloatWindowDispose(); + } + + private void CheckFloatWindowDispose() + { + if (Count != 0 || Container.DockState != DockState.Float) + return; + + FloatWindow floatWindow = (FloatWindow)Container; + if (floatWindow.Disposing || floatWindow.IsDisposed) + return; + + if (Win32Helper.IsRunningOnMono) + return; + + NativeMethods.PostMessage(((FloatWindow)Container).Handle, FloatWindow.WM_CHECKDISPOSE, 0, 0); + } + + /// + /// Switches a pane with its first child in the pane hierarchy. (The actual hiding happens elsewhere.) + /// + /// Pane to switch + public void SwitchPaneWithFirstChild(DockPane pane) + { + if (!Contains(pane)) + return; + + NestedDockingStatus statusPane = pane.NestedDockingStatus; + DockPane lastNestedPane = null; + for (int i = Count - 1; i > IndexOf(pane); i--) + { + if (this[i].NestedDockingStatus.PreviousPane == pane) + { + lastNestedPane = this[i]; + break; + } + } + + if (lastNestedPane != null) + { + int indexLastNestedPane = IndexOf(lastNestedPane); + Items[IndexOf(pane)] = lastNestedPane; + Items[indexLastNestedPane] = pane; + NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; + + DockAlignment newAlignment; + if (lastNestedDock.Alignment == DockAlignment.Left) + newAlignment = DockAlignment.Right; + else if (lastNestedDock.Alignment == DockAlignment.Right) + newAlignment = DockAlignment.Left; + else if (lastNestedDock.Alignment == DockAlignment.Top) + newAlignment = DockAlignment.Bottom; + else + newAlignment = DockAlignment.Top; + double newProportion = 1 - lastNestedDock.Proportion; + + lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion); + for (int i = indexLastNestedPane - 1; i > IndexOf(lastNestedPane); i--) + { + NestedDockingStatus status = this[i].NestedDockingStatus; + if (status.PreviousPane == pane) + status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion); + } + + statusPane.SetStatus(this, lastNestedPane, newAlignment, newProportion); + } + } + + internal void Remove(DockPane pane) + { + InternalRemove(pane); + CheckFloatWindowDispose(); + } + + private void InternalRemove(DockPane pane) + { + if (!Contains(pane)) + return; + + NestedDockingStatus statusPane = pane.NestedDockingStatus; + DockPane lastNestedPane = null; + for (int i=Count - 1; i> IndexOf(pane); i--) + { + if (this[i].NestedDockingStatus.PreviousPane == pane) + { + lastNestedPane = this[i]; + break; + } + } + + if (lastNestedPane != null) + { + int indexLastNestedPane = IndexOf(lastNestedPane); + Items.Remove(lastNestedPane); + Items[IndexOf(pane)] = lastNestedPane; + NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; + lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion); + for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) + { + NestedDockingStatus status = this[i].NestedDockingStatus; + if (status.PreviousPane == pane) + status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion); + } + } + else + Items.Remove(pane); + + statusPane.SetStatus(null, null, DockAlignment.Left, 0.5); + statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); + statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty); + } + + public DockPane GetDefaultPreviousPane(DockPane pane) + { + for (int i=Count-1; i>=0; i--) + if (this[i] != pane) + return this[i]; + + return null; + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/PatchController.cs b/WeifenLuoLinux/WinFormsUI/Docking/PatchController.cs new file mode 100644 index 000000000..9c0b87c5b --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/PatchController.cs @@ -0,0 +1,1039 @@ +using Microsoft.Win32; +using System; +using System.Configuration; +using WeifenLuo.WinFormsUI.Docking.Configuration; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public static class PatchController + { + public static bool? EnableAll { private get; set; } + + public static void Reset() + { + EnableAll = _highDpi = _memoryLeakFix + = _nestedDisposalFix = _focusLostFix = _contentOrderFix + = _fontInheritanceFix = _activeXFix = _displayingPaneFix + = _activeControlFix = _floatSplitterFix = _activateOnDockFix + = _selectClosestOnClose = _perScreenDpi = null; + } + +#region Copy this section to create new option, and then comment it to show what needs to be modified. + //* + private static bool? _highDpi; + + public static bool? EnableHighDpi + { + get + { + if (_highDpi != null) + { + return _highDpi; + } + + if (EnableAll != null) + { + return _highDpi = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _highDpi = section.EnableAll; + } + + return _highDpi = section.EnableHighDpi; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableHighDpi"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _highDpi = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableHighDpi"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _highDpi = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableHighDpi"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _highDpi = enable; + } + } + } + } + + return _highDpi = true; + } + + set + { + _highDpi = value; + } + } + // */ +#endregion + + private static bool? _memoryLeakFix; + + public static bool? EnableMemoryLeakFix + { + get + { + if (_memoryLeakFix != null) + { + return _memoryLeakFix; + } + + if (EnableAll != null) + { + return _memoryLeakFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _memoryLeakFix = section.EnableAll; + } + + return _memoryLeakFix = section.EnableMemoryLeakFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableMemoryLeakFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _memoryLeakFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableMemoryLeakFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _memoryLeakFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableMemoryLeakFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _memoryLeakFix = enable; + } + } + } + } + + return _memoryLeakFix = true; + } + + set + { + _memoryLeakFix = value; + } + } + + private static bool? _focusLostFix; + + public static bool? EnableMainWindowFocusLostFix + { + get + { + if (_focusLostFix != null) + { + return _focusLostFix; + } + + if (EnableAll != null) + { + return _focusLostFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _focusLostFix = section.EnableAll; + } + + return _focusLostFix = section.EnableMainWindowFocusLostFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableMainWindowFocusLostFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _focusLostFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableMainWindowFocusLostFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _focusLostFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableMainWindowFocusLostFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _focusLostFix = enable; + } + } + } + } + + return _focusLostFix = true; + } + + set + { + _focusLostFix = value; + } + } + + private static bool? _nestedDisposalFix; + + public static bool? EnableNestedDisposalFix + { + get + { + if (_nestedDisposalFix != null) + { + return _nestedDisposalFix; + } + + if (EnableAll != null) + { + return _nestedDisposalFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _nestedDisposalFix = section.EnableAll; + } + + return _nestedDisposalFix = section.EnableNestedDisposalFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableNestedDisposalFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _nestedDisposalFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableNestedDisposalFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _nestedDisposalFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableNestedDisposalFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _nestedDisposalFix = enable; + } + } + } + } + + return _nestedDisposalFix = true; + } + + set + { + _focusLostFix = value; + } + } + + private static bool? _fontInheritanceFix; + + public static bool? EnableFontInheritanceFix + { + get + { + if (_fontInheritanceFix != null) + { + return _fontInheritanceFix; + } + + if (EnableAll != null) + { + return _fontInheritanceFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _fontInheritanceFix = section.EnableAll; + } + + return _fontInheritanceFix = section.EnableFontInheritanceFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableFontInheritanceFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _fontInheritanceFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableFontInheritanceFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _fontInheritanceFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableFontInheritanceFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _fontInheritanceFix = enable; + } + } + } + } + + return _fontInheritanceFix = true; + } + + set + { + _fontInheritanceFix = value; + } + } + + private static bool? _contentOrderFix; + + public static bool? EnableContentOrderFix + { + get + { + if (_contentOrderFix != null) + { + return _contentOrderFix; + } + + if (EnableAll != null) + { + return _contentOrderFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _contentOrderFix = section.EnableAll; + } + + return _contentOrderFix = section.EnableContentOrderFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableContentOrderFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _contentOrderFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableContentOrderFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _contentOrderFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableContentOrderFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _contentOrderFix = enable; + } + } + } + } + + return _contentOrderFix = true; + } + + set + { + _contentOrderFix = value; + } + } + + private static bool? _activeXFix; + + public static bool? EnableActiveXFix + { + get + { + if (_activeXFix != null) + { + return _activeXFix; + } + + if (EnableAll != null) + { + return _activeXFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _activeXFix = section.EnableAll; + } + + return _activeXFix = section.EnableActiveXFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableActiveXFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _activeXFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableActiveXFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _activeXFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableActiveXFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _activeXFix = enable; + } + } + } + } + + return _activeXFix = false; // not enabled by default as it has side effect. + } + + set + { + _activeXFix = value; + } + } + + private static bool? _displayingPaneFix; + + public static bool? EnableDisplayingPaneFix + { + get + { + if (_displayingPaneFix != null) + { + return _displayingPaneFix; + } + + if (EnableAll != null) + { + return _displayingPaneFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _displayingPaneFix = section.EnableAll; + } + + return _displayingPaneFix = section.EnableDisplayingPaneFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableDisplayingPaneFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _displayingPaneFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableDisplayingPaneFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _displayingPaneFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableDisplayingPaneFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _displayingPaneFix = enable; + } + } + } + } + + return _displayingPaneFix = true; + } + + set + { + _displayingPaneFix = value; + } + } + + private static bool? _activeControlFix; + + public static bool? EnableActiveControlFix + { + get + { + if (_activeControlFix != null) + { + return _activeControlFix; + } + + if (EnableAll != null) + { + return _activeControlFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _activeControlFix = section.EnableAll; + } + + return _activeControlFix = section.EnableActiveControlFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableActiveControlFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _activeControlFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableActiveControlFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _activeControlFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableActiveControlFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _activeControlFix = enable; + } + } + } + } + + return _activeControlFix = true; + } + + set + { + _activeControlFix = value; + } + } + + private static bool? _floatSplitterFix; + + public static bool? EnableFloatSplitterFix + { + get + { + if (_floatSplitterFix != null) + { + return _floatSplitterFix; + } + + if (EnableAll != null) + { + return _floatSplitterFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _floatSplitterFix = section.EnableAll; + } + + return _floatSplitterFix = section.EnableFloatSplitterFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableFloatSplitterFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _floatSplitterFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableFloatSplitterFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _floatSplitterFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableFloatSplitterFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _floatSplitterFix = enable; + } + } + } + } + + return _floatSplitterFix = true; + } + + set + { + _floatSplitterFix = value; + } + } + + private static bool? _activateOnDockFix; + + public static bool? EnableActivateOnDockFix + { + get + { + if (_activateOnDockFix != null) + { + return _activateOnDockFix; + } + + if (EnableAll != null) + { + return _activateOnDockFix = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _activateOnDockFix = section.EnableAll; + } + + return _activateOnDockFix = section.EnableActivateOnDockFix; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableActivateOnDockFix"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _activateOnDockFix = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableActivateOnDockFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _activateOnDockFix = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableActivateOnDockFix"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _activateOnDockFix = enable; + } + } + } + } + + return _activateOnDockFix = true; + } + + set + { + _activateOnDockFix = value; + } + } + + private static bool? _selectClosestOnClose; + + public static bool? EnableSelectClosestOnClose + { + get + { + if (_selectClosestOnClose != null) + { + return _selectClosestOnClose; + } + + if (EnableAll != null) + { + return _selectClosestOnClose = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _selectClosestOnClose = section.EnableAll; + } + + return _selectClosestOnClose = section.EnableSelectClosestOnClose; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnableSelectClosestOnClose"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _selectClosestOnClose = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableSelectClosestOnClose"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _selectClosestOnClose = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnableSelectClosestOnClose"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _selectClosestOnClose = enable; + } + } + } + } + + return _selectClosestOnClose = true; + } + + set + { + _selectClosestOnClose = value; + } + } + + private static bool? _perScreenDpi; + + public static bool? EnablePerScreenDpi + { + get + { + if (_perScreenDpi != null) + { + return _perScreenDpi; + } + + if (EnableAll != null) + { + return _perScreenDpi = EnableAll; + } +#if NET35 || NET40 + var section = ConfigurationManager.GetSection("dockPanelSuite") as PatchSection; + if (section != null) + { + if (section.EnableAll != null) + { + return _perScreenDpi = section.EnableAll; + } + + return _perScreenDpi = section.EnablePerScreenDpi; + } +#endif + var environment = Environment.GetEnvironmentVariable("DPS_EnablePerScreenDpi"); + if (!string.IsNullOrEmpty(environment)) + { + var enable = false; + if (bool.TryParse(environment, out enable)) + { + return _perScreenDpi = enable; + } + } + + { + var key = Registry.CurrentUser.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnablePerScreenDpi"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _perScreenDpi = enable; + } + } + } + } + + { + var key = Registry.LocalMachine.OpenSubKey(@"Software\DockPanelSuite"); + if (key != null) + { + var pair = key.GetValue("EnablePerScreenDpi"); + if (pair != null) + { + var enable = false; + if (bool.TryParse(pair.ToString(), out enable)) + { + return _perScreenDpi = enable; + } + } + } + } + + return _perScreenDpi = false; + } + + set + { + _perScreenDpi = value; + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/SplitterBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/SplitterBase.cs new file mode 100644 index 000000000..b3a771fdb --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/SplitterBase.cs @@ -0,0 +1,69 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ToolboxItem(false)] + public class SplitterBase : Control + { + public SplitterBase() + { + SetStyle(ControlStyles.Selectable, false); + } + + public override DockStyle Dock + { + get { return base.Dock; } + set + { + SuspendLayout(); + base.Dock = value; + + if (Dock == DockStyle.Left || Dock == DockStyle.Right) + Width = SplitterSize; + else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom) + Height = SplitterSize; + else + Bounds = Rectangle.Empty; + + if (Dock == DockStyle.Left || Dock == DockStyle.Right) + Cursor = Cursors.VSplit; + else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom) + Cursor = Cursors.HSplit; + else + Cursor = Cursors.Default; + + ResumeLayout(); + } + } + + protected virtual int SplitterSize + { + get { return 0; } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (e.Button != MouseButtons.Left) + return; + + StartDrag(); + } + + protected virtual void StartDrag() + { + } + + protected override void WndProc(ref Message m) + { + // eat the WM_MOUSEACTIVATE message + if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE) + return; + + base.WndProc(ref m); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Strings.Designer.cs b/WeifenLuoLinux/WinFormsUI/Docking/Strings.Designer.cs new file mode 100644 index 000000000..e99df7695 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Strings.Designer.cs @@ -0,0 +1,783 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WeifenLuo.WinFormsUI.Docking { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WeifenLuo.WinFormsUI.Docking.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Docking. + /// + internal static string Category_Docking { + get { + return ResourceManager.GetString("Category_Docking", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Docking Notification. + /// + internal static string Category_DockingNotification { + get { + return ResourceManager.GetString("Category_DockingNotification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Performance. + /// + internal static string Category_Performance { + get { + return ResourceManager.GetString("Category_Performance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property Changed. + /// + internal static string Category_PropertyChanged { + get { + return ResourceManager.GetString("Category_PropertyChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (Float). + /// + internal static string DockAreaEditor_FloatCheckBoxText { + get { + return ResourceManager.GetString("DockAreaEditor_FloatCheckBoxText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Determines if end user drag and drop docking is allowed.. + /// + internal static string DockContent_AllowEndUserDocking_Description { + get { + return ResourceManager.GetString("DockContent_AllowEndUserDocking_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The size to display the content in auto hide mode. Value < 1 to specify the size in portion; value >= 1 to specify the size in pixel.. + /// + internal static string DockContent_AutoHidePortion_Description { + get { + return ResourceManager.GetString("DockContent_AutoHidePortion_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enable/Disable the close button of the content.. + /// + internal static string DockContent_CloseButton_Description { + get { + return ResourceManager.GetString("DockContent_CloseButton_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shows or hides the close button of the content. This property does not function with System MDI Document Style.. + /// + internal static string DockContent_CloseButtonVisible_Description { + get { + return ResourceManager.GetString("DockContent_CloseButtonVisible_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The form must be of type IDockContent.. + /// + internal static string DockContent_Constructor_InvalidForm { + get { + return ResourceManager.GetString("DockContent_Constructor_InvalidForm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gets or sets a value indicating in which area of the DockPanel the content allowed to show.. + /// + internal static string DockContent_DockAreas_Description { + get { + return ResourceManager.GetString("DockContent_DockAreas_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when the value of DockState property changed.. + /// + internal static string DockContent_DockStateChanged_Description { + get { + return ResourceManager.GetString("DockContent_DockStateChanged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indicates the content will be hidden instead of being closed.. + /// + internal static string DockContent_HideOnClose_Description { + get { + return ResourceManager.GetString("DockContent_HideOnClose_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The desired docking state when first showing.. + /// + internal static string DockContent_ShowHint_Description { + get { + return ResourceManager.GetString("DockContent_ShowHint_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Context menu displayed for the dock pane tab strip.. + /// + internal static string DockContent_TabPageContextMenu_Description { + get { + return ResourceManager.GetString("DockContent_TabPageContextMenu_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The tab text displayed in the dock pane. If not set, the Text property will be used.. + /// + internal static string DockContent_TabText_Description { + get { + return ResourceManager.GetString("DockContent_TabText_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The text displayed when mouse hovers over the tab.. + /// + internal static string DockContent_ToolTipText_Description { + get { + return ResourceManager.GetString("DockContent_ToolTipText_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided value is out of range.. + /// + internal static string DockContentHandler_AutoHidePortion_OutOfRange { + get { + return ResourceManager.GetString("DockContentHandler_AutoHidePortion_OutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Value: The value of DockAreas conflicts with current DockState.. + /// + internal static string DockContentHandler_DockAreas_InvalidValue { + get { + return ResourceManager.GetString("DockContentHandler_DockAreas_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.. + /// + internal static string DockContentHandler_DockPane_InvalidValue { + get { + return ResourceManager.GetString("DockContentHandler_DockPane_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.. + /// + internal static string DockContentHandler_FloatPane_InvalidValue { + get { + return ResourceManager.GetString("DockContentHandler_FloatPane_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid value, conflicts with DockableAreas property.. + /// + internal static string DockContentHandler_IsFloat_InvalidValue { + get { + return ResourceManager.GetString("DockContentHandler_IsFloat_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dock state is invalid.. + /// + internal static string DockContentHandler_SetDockState_InvalidState { + get { + return ResourceManager.GetString("DockContentHandler_SetDockState_InvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dock panel is null.. + /// + internal static string DockContentHandler_SetDockState_NullPanel { + get { + return ResourceManager.GetString("DockContentHandler_SetDockState_NullPanel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid beforeContent, it must be contained by the pane.. + /// + internal static string DockContentHandler_Show_InvalidBeforeContent { + get { + return ResourceManager.GetString("DockContentHandler_Show_InvalidBeforeContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid DockState: Content can not be showed as "Unknown" or "Hidden".. + /// + internal static string DockContentHandler_Show_InvalidDockState { + get { + return ResourceManager.GetString("DockContentHandler_Show_InvalidDockState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The previous pane is invalid. It can not be null, and its docking state must not be auto-hide.. + /// + internal static string DockContentHandler_Show_InvalidPrevPane { + get { + return ResourceManager.GetString("DockContentHandler_Show_InvalidPrevPane", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DockPanel can not be null.. + /// + internal static string DockContentHandler_Show_NullDockPanel { + get { + return ResourceManager.GetString("DockContentHandler_Show_NullDockPanel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Pane can not be null.. + /// + internal static string DockContentHandler_Show_NullPane { + get { + return ResourceManager.GetString("DockContentHandler_Show_NullPane", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid value, check DockableAreas property.. + /// + internal static string DockContentHandler_ShowHint_InvalidValue { + get { + return ResourceManager.GetString("DockContentHandler_ShowHint_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Context menu displayed for the dock pane tab strip.. + /// + internal static string DockHandler_TabPageContextMenuStrip_Description { + get { + return ResourceManager.GetString("DockHandler_TabPageContextMenuStrip_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.. + /// + internal static string DockPane_ActiveContent_InvalidValue { + get { + return ResourceManager.GetString("DockPane_ActiveContent_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid argument: Content can not be "null".. + /// + internal static string DockPane_Constructor_NullContent { + get { + return ResourceManager.GetString("DockPane_Constructor_NullContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid argument: The content's DockPanel can not be "null".. + /// + internal static string DockPane_Constructor_NullDockPanel { + get { + return ResourceManager.GetString("DockPane_Constructor_NullDockPanel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified container conflicts with the IsFloat property.. + /// + internal static string DockPane_DockTo_InvalidContainer { + get { + return ResourceManager.GetString("DockPane_DockTo_InvalidContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The previous pane does not exist in the nested docking pane collection.. + /// + internal static string DockPane_DockTo_NoPrevPane { + get { + return ResourceManager.GetString("DockPane_DockTo_NoPrevPane", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The container can not be null.. + /// + internal static string DockPane_DockTo_NullContainer { + get { + return ResourceManager.GetString("DockPane_DockTo_NullContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The previous pane can not be null when the nested docking pane collection is not empty.. + /// + internal static string DockPane_DockTo_NullPrevPane { + get { + return ResourceManager.GetString("DockPane_DockTo_NullPrevPane", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The previous pane can not be itself.. + /// + internal static string DockPane_DockTo_SelfPrevPane { + get { + return ResourceManager.GetString("DockPane_DockTo_SelfPrevPane", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Content: Content not within the collection.. + /// + internal static string DockPane_SetContentIndex_InvalidContent { + get { + return ResourceManager.GetString("DockPane_SetContentIndex_InvalidContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Index: The index is out of range.. + /// + internal static string DockPane_SetContentIndex_InvalidIndex { + get { + return ResourceManager.GetString("DockPane_SetContentIndex_InvalidIndex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The state for the dock pane is invalid.. + /// + internal static string DockPane_SetDockState_InvalidState { + get { + return ResourceManager.GetString("DockPane_SetDockState_InvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Content: The content must be auto-hide state and associates with this DockPanel.. + /// + internal static string DockPanel_ActiveAutoHideContent_InvalidValue { + get { + return ResourceManager.GetString("DockPanel_ActiveAutoHideContent_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when the value of the AutoHideWindow's ActiveContent changed.. + /// + internal static string DockPanel_ActiveAutoHideContentChanged_Description { + get { + return ResourceManager.GetString("DockPanel_ActiveAutoHideContentChanged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when the value of ActiveContentProperty changed.. + /// + internal static string DockPanel_ActiveContentChanged_Description { + get { + return ResourceManager.GetString("DockPanel_ActiveContentChanged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when the value of ActiveDocument property changed.. + /// + internal static string DockPanel_ActiveDocumentChanged_Description { + get { + return ResourceManager.GetString("DockPanel_ActiveDocumentChanged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when the value of ActivePane property changed.. + /// + internal static string DockPanel_ActivePaneChanged_Description { + get { + return ResourceManager.GetString("DockPanel_ActivePaneChanged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Determines if the drag and drop docking is allowed.. + /// + internal static string DockPanel_AllowEndUserDocking_Description { + get { + return ResourceManager.GetString("DockPanel_AllowEndUserDocking_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Determines if the drag and drop nested docking is allowed.. + /// + internal static string DockPanel_AllowEndUserNestedDocking_Description { + get { + return ResourceManager.GetString("DockPanel_AllowEndUserNestedDocking_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when a content added to the DockPanel.. + /// + internal static string DockPanel_ContentAdded_Description { + get { + return ResourceManager.GetString("DockPanel_ContentAdded_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when a content removed from the DockPanel.. + /// + internal static string DockPanel_ContentRemoved_Description { + get { + return ResourceManager.GetString("DockPanel_ContentRemoved_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default size of float window.. + /// + internal static string DockPanel_DefaultFloatWindowSize_Description { + get { + return ResourceManager.GetString("DockPanel_DefaultFloatWindowSize_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provides Visual Studio .Net style docking.. + /// + internal static string DockPanel_Description { + get { + return ResourceManager.GetString("DockPanel_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Size of the bottom docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.. + /// + internal static string DockPanel_DockBottomPortion_Description { + get { + return ResourceManager.GetString("DockPanel_DockBottomPortion_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Size of the left docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.. + /// + internal static string DockPanel_DockLeftPortion_Description { + get { + return ResourceManager.GetString("DockPanel_DockLeftPortion_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The visual skin to use when displaying the docked windows.. + /// + internal static string DockPanel_DockPanelSkin_Description { + get { + return ResourceManager.GetString("DockPanel_DockPanelSkin_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Size of the right docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.. + /// + internal static string DockPanel_DockRightPortion_Description { + get { + return ResourceManager.GetString("DockPanel_DockRightPortion_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Size of the top docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.. + /// + internal static string DockPanel_DockTopPortion_Description { + get { + return ResourceManager.GetString("DockPanel_DockTopPortion_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when a document or pane is dragged within the dock panel.. + /// + internal static string DockPanel_DocumentDragged_Description { + get { + return ResourceManager.GetString("DockPanel_DocumentDragged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The style of the document window.. + /// + internal static string DockPanel_DocumentStyle_Description { + get { + return ResourceManager.GetString("DockPanel_DocumentStyle_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Determines where the tab strip for Document style content is drawn.. + /// + internal static string DockPanel_DocumentTabStripLocation_Description { + get { + return ResourceManager.GetString("DockPanel_DocumentTabStripLocation_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The DockPanel has already been initialized.. + /// + internal static string DockPanel_LoadFromXml_AlreadyInitialized { + get { + return ResourceManager.GetString("DockPanel_LoadFromXml_AlreadyInitialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration file's version is invalid.. + /// + internal static string DockPanel_LoadFromXml_InvalidFormatVersion { + get { + return ResourceManager.GetString("DockPanel_LoadFromXml_InvalidFormatVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The XML file format is invalid.. + /// + internal static string DockPanel_LoadFromXml_InvalidXmlFormat { + get { + return ResourceManager.GetString("DockPanel_LoadFromXml_InvalidXmlFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid parent form. When using DockingMdi or SystemMdi document style, the DockPanel control must be the child control of the main MDI container form.. + /// + internal static string DockPanel_ParentForm_Invalid { + get { + return ResourceManager.GetString("DockPanel_ParentForm_Invalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DockPanel configuration file. Author: Weifen Luo, all rights reserved.. + /// + internal static string DockPanel_Persistor_XmlFileComment1 { + get { + return ResourceManager.GetString("DockPanel_Persistor_XmlFileComment1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!. + /// + internal static string DockPanel_Persistor_XmlFileComment2 { + get { + return ResourceManager.GetString("DockPanel_Persistor_XmlFileComment2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indicates whether the control layout is right-to-left when the RightToLeft property is set to Yes.. + /// + internal static string DockPanel_RightToLeftLayout_Description { + get { + return ResourceManager.GetString("DockPanel_RightToLeftLayout_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Index: The index is out of range.. + /// + internal static string DockPanel_SetPaneIndex_InvalidIndex { + get { + return ResourceManager.GetString("DockPanel_SetPaneIndex_InvalidIndex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Pane: DockPane not within the collection.. + /// + internal static string DockPanel_SetPaneIndex_InvalidPane { + get { + return ResourceManager.GetString("DockPanel_SetPaneIndex_InvalidPane", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shows the hidden autohide content when hovering over the tab. When disabled, the tab must be clicked to show the content.. + /// + internal static string DockPanel_ShowAutoHideContentOnHover_Description { + get { + return ResourceManager.GetString("DockPanel_ShowAutoHideContentOnHover_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Determines if the document icon will be displayed in the tab strip.. + /// + internal static string DockPanel_ShowDocumentIcon_Description { + get { + return ResourceManager.GetString("DockPanel_ShowDocumentIcon_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Support deeply nested controls. Disabling this setting may improve resize performance but may cause heavily nested content not to resize.. + /// + internal static string DockPanel_SupportDeeplyNestedContent_Description { + get { + return ResourceManager.GetString("DockPanel_SupportDeeplyNestedContent_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid argument: DockPanel can not be "null".. + /// + internal static string FloatWindow_Constructor_NullDockPanel { + get { + return ResourceManager.GetString("FloatWindow_Constructor_NullDockPanel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid DockPanel.. + /// + internal static string IDockDragSource_DockTo_InvalidPanel { + get { + return ResourceManager.GetString("IDockDragSource_DockTo_InvalidPanel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Before applying themes all dock contents must be closed.. + /// + internal static string Theme_DockContentNotClosed { + get { + return ResourceManager.GetString("Theme_DockContentNotClosed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Before applying themes all float windows must be closed.. + /// + internal static string Theme_FloatWindowNotClosed { + get { + return ResourceManager.GetString("Theme_FloatWindowNotClosed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Before applying themes all factories must be configured.. + /// + internal static string Theme_MissingFactory { + get { + return ResourceManager.GetString("Theme_MissingFactory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DockPanel.Theme must be set to a valid theme.. + /// + internal static string Theme_NoTheme { + get { + return ResourceManager.GetString("Theme_NoTheme", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Before applying themes all panes must be closed.. + /// + internal static string Theme_PaneNotClosed { + get { + return ResourceManager.GetString("Theme_PaneNotClosed", resourceCulture); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Strings.resx b/WeifenLuoLinux/WinFormsUI/Docking/Strings.resx new file mode 100644 index 000000000..0410b044b --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Strings.resx @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Docking + + + Docking Notification + + + Property Changed + + + Determines if end user drag and drop docking is allowed. + + + The size to display the content in auto hide mode. Value < 1 to specify the size in portion; value >= 1 to specify the size in pixel. + + + Enable/Disable the close button of the content. + + + Gets or sets a value indicating in which area of the DockPanel the content allowed to show. + + + Occurs when the value of DockState property changed. + + + Indicates the content will be hidden instead of being closed. + + + The desired docking state when first showing. + + + Context menu displayed for the dock pane tab strip. + + + The tab text displayed in the dock pane. If not set, the Text property will be used. + + + The text displayed when mouse hovers over the tab. + + + Context menu displayed for the dock pane tab strip. + + + Occurs when the value of ActiveContentProperty changed. + + + Occurs when a document or pane is dragged within the dock panel. + + + Occurs when the value of ActiveDocument property changed. + + + Occurs when the value of ActivePane property changed. + + + Determines if the drag and drop docking is allowed. + + + Determines if the drag and drop nested docking is allowed. + + + Occurs when the value of the AutoHideWindow's ActiveContent changed. + + + Occurs when a content added to the DockPanel. + + + Occurs when a content removed from the DockPanel. + + + The default size of float window. + + + Provides Visual Studio .Net style docking. + + + Size of the bottom docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels. + + + Size of the left docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels. + + + Size of the right docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels. + + + Size of the top docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels. + + + The style of the document window. + + + Indicates whether the control layout is right-to-left when the RightToLeft property is set to Yes. + + + Determines if the document icon will be displayed in the tab strip. + + + Shows or hides the close button of the content. This property does not function with System MDI Document Style. + + + The visual skin to use when displaying the docked windows. + + + Determines where the tab strip for Document style content is drawn. + + + Performance + + + Support deeply nested controls. Disabling this setting may improve resize performance but may cause heavily nested content not to resize. + + + Shows the hidden autohide content when hovering over the tab. When disabled, the tab must be clicked to show the content. + + + (Float) + + + The form must be of type IDockContent. + + + The provided value is out of range. + + + Invalid Value: The value of DockAreas conflicts with current DockState. + + + The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane. + + + The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane. + + + Invalid value, conflicts with DockableAreas property. + + + The dock state is invalid. + + + The dock panel is null. + + + Invalid beforeContent, it must be contained by the pane. + + + Invalid DockState: Content can not be showed as "Unknown" or "Hidden". + + + The previous pane is invalid. It can not be null, and its docking state must not be auto-hide. + + + DockPanel can not be null. + + + The Pane can not be null. + + + Invalid value, check DockableAreas property. + + + Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content. + + + Invalid argument: Content can not be "null". + + + Invalid argument: The content's DockPanel can not be "null". + + + The specified container conflicts with the IsFloat property. + + + The previous pane does not exist in the nested docking pane collection. + + + The container can not be null. + + + The previous pane can not be null when the nested docking pane collection is not empty. + + + The previous pane can not be itself. + + + Invalid Content: Content not within the collection. + + + Invalid Index: The index is out of range. + + + The state for the dock pane is invalid. + + + Invalid Content: The content must be auto-hide state and associates with this DockPanel. + + + The DockPanel has already been initialized. + + + The configuration file's version is invalid. + + + The XML file format is invalid. + + + Invalid parent form. When using DockingMdi or SystemMdi document style, the DockPanel control must be the child control of the main MDI container form. + + + DockPanel configuration file. Author: Weifen Luo, all rights reserved. + + + !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! + + + Invalid Index: The index is out of range. + + + Invalid Pane: DockPane not within the collection. + + + Invalid argument: DockPanel can not be "null". + + + Invalid DockPanel. + + + Before applying themes all dock contents must be closed. + + + Before applying themes all float windows must be closed. + + + Before applying themes all factories must be configured. + + + DockPanel.Theme must be set to a valid theme. + + + Before applying themes all panes must be closed. + + \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/Docking/ThemeBase.cs b/WeifenLuoLinux/WinFormsUI/Docking/ThemeBase.cs new file mode 100644 index 000000000..795b29b47 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/ThemeBase.cs @@ -0,0 +1,189 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public abstract class ThemeBase : Component + { + private Color _dockBackColor; + private bool _showAutoHideContentOnHover; + + protected ThemeBase() + { + Extender = new DockPanelExtender(); + } + + public DockPanelSkin Skin { get; protected set; } + + public DockPanelColorPalette ColorPalette { get; protected set; } + + public IImageService ImageService { get; protected set; } + + public IPaintingService PaintingService { get; protected set; } + + protected ToolStripRenderer ToolStripRenderer { get; set;} + + private Dictionary> _stripBefore + = new Dictionary>(); + + public void ApplyTo(ToolStrip toolStrip) + { + if (toolStrip == null) + return; + + _stripBefore[toolStrip] = new KeyValuePair(toolStrip.RenderMode, toolStrip.Renderer); + if(ToolStripRenderer != null) + toolStrip.Renderer = ToolStripRenderer; + + if (Win32Helper.IsRunningOnMono) + { + foreach (var item in toolStrip.Items.OfType()) + { + ItemResetOwnerHack(item); + } + } + } + + private void ItemResetOwnerHack(ToolStripDropDownItem item) + { + var oldOwner = item.DropDown.OwnerItem; + item.DropDown.OwnerItem = null; + item.DropDown.OwnerItem = oldOwner; + + foreach (var child in item.DropDownItems.OfType()) + { + ItemResetOwnerHack(child); + } + } + + private KeyValuePair _managerBefore; + + public void ApplyToToolStripManager() + { + _managerBefore = new KeyValuePair(ToolStripManager.RenderMode, ToolStripManager.Renderer); + } + + public Measures Measures { get; } = new Measures(); + + public bool ShowAutoHideContentOnHover { get; protected set; } = true; + + public void ApplyTo(DockPanel dockPanel) + { + if (Extender.AutoHideStripFactory == null + || Extender.AutoHideWindowFactory == null + || Extender.DockIndicatorFactory == null + || Extender.DockOutlineFactory == null + || Extender.DockPaneCaptionFactory == null + || Extender.DockPaneFactory == null + || Extender.DockPaneSplitterControlFactory == null + || Extender.DockPaneStripFactory == null + || Extender.DockWindowFactory == null + || Extender.FloatWindowFactory == null + || Extender.PaneIndicatorFactory == null + || Extender.PanelIndicatorFactory == null + || Extender.WindowSplitterControlFactory == null) + { + throw new InvalidOperationException(Strings.Theme_MissingFactory); + } + + if (dockPanel.Panes.Count > 0) + throw new InvalidOperationException(Strings.Theme_PaneNotClosed); + + if (dockPanel.FloatWindows.Count > 0) + throw new InvalidOperationException(Strings.Theme_FloatWindowNotClosed); + + if (dockPanel.Contents.Count > 0) + throw new InvalidOperationException(Strings.Theme_DockContentNotClosed); + + if (ColorPalette == null) + { + dockPanel.ResetDummy(); + } + else + { + _dockBackColor = dockPanel.DockBackColor; + dockPanel.DockBackColor = ColorPalette.MainWindowActive.Background; + dockPanel.SetDummy(); + } + + _showAutoHideContentOnHover = dockPanel.ShowAutoHideContentOnHover; + dockPanel.ShowAutoHideContentOnHover = ShowAutoHideContentOnHover; + } + + internal void PostApply(DockPanel dockPanel) + { + dockPanel.ResetAutoHideStripControl(); + dockPanel.ResetAutoHideStripWindow(); + dockPanel.ResetDockWindows(); + } + + public virtual void CleanUp(DockPanel dockPanel) + { + if (dockPanel != null) + { + if (ColorPalette != null) + { + dockPanel.DockBackColor = _dockBackColor; + } + + dockPanel.ShowAutoHideContentOnHover = _showAutoHideContentOnHover; + } + + foreach (var item in _stripBefore) + { + var strip = item.Key; + var cache = item.Value; + if (cache.Key == ToolStripRenderMode.Custom) + { + if (cache.Value != null) + strip.Renderer = cache.Value; + } + else + { + strip.RenderMode = cache.Key; + } + } + + _stripBefore.Clear(); + if (_managerBefore.Key == ToolStripManagerRenderMode.Custom) + { + if (_managerBefore.Value != null) + ToolStripManager.Renderer = _managerBefore.Value; + } + else + { + ToolStripManager.RenderMode = _managerBefore.Key; + } + } + + public DockPanelExtender Extender { get; private set; } + + public static byte[] Decompress(byte[] fileToDecompress) + { + using (MemoryStream originalFileStream = new MemoryStream(fileToDecompress)) + { + using (MemoryStream decompressedFileStream = new MemoryStream()) + { + using (GZipStream decompressionStream = new GZipStream(originalFileStream, CompressionMode.Decompress)) + { + //Copy the decompression stream into the output file. + byte[] buffer = new byte[4096]; + int numRead; + while ((numRead = decompressionStream.Read(buffer, 0, buffer.Length)) != 0) + { + decompressedFileStream.Write(buffer, 0, numRead); + } + + return decompressedFileStream.ToArray(); + } + } + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/VisibleNestedPaneCollection.cs b/WeifenLuoLinux/WinFormsUI/Docking/VisibleNestedPaneCollection.cs new file mode 100644 index 000000000..c6b53616a --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/VisibleNestedPaneCollection.cs @@ -0,0 +1,185 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Drawing; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public sealed class VisibleNestedPaneCollection : ReadOnlyCollection + { + private NestedPaneCollection m_nestedPanes; + + internal VisibleNestedPaneCollection(NestedPaneCollection nestedPanes) + : base(new List()) + { + m_nestedPanes = nestedPanes; + } + + public NestedPaneCollection NestedPanes + { + get { return m_nestedPanes; } + } + + public INestedPanesContainer Container + { + get { return NestedPanes.Container; } + } + + public DockState DockState + { + get { return NestedPanes.DockState; } + } + + public bool IsFloat + { + get { return NestedPanes.IsFloat; } + } + + internal void Refresh() + { + Items.Clear(); + for (int i=0; i IndexOf(pane); i--) + { + if (PatchController.EnableDisplayingPaneFix == true) + { + if (this[i].NestedDockingStatus.DisplayingPreviousPane == pane) + { + lastNestedPane = this[i]; + break; + } + } + else + { + if (this[i].NestedDockingStatus.PreviousPane == pane) + { + lastNestedPane = this[i]; + break; + } + } + } + + if (lastNestedPane != null) + { + int indexLastNestedPane = IndexOf(lastNestedPane); + Items.Remove(lastNestedPane); + Items[IndexOf(pane)] = lastNestedPane; + NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; + lastNestedDock.SetDisplayingStatus(true, statusPane.DisplayingPreviousPane, statusPane.DisplayingAlignment, statusPane.DisplayingProportion); + for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) + { + NestedDockingStatus status = this[i].NestedDockingStatus; + if (PatchController.EnableDisplayingPaneFix == true) + { + if (status.DisplayingPreviousPane == pane) + status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion); + } + else + { + if (status.PreviousPane == pane) + status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion); + } + } + } + else + Items.Remove(pane); + + statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); + } + + private void CalculateBounds() + { + if (Count == 0) + return; + + this[0].NestedDockingStatus.SetDisplayingBounds(Container.DisplayingRectangle, Container.DisplayingRectangle, Rectangle.Empty); + + for (int i=1; i + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripExtender.cs b/WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripExtender.cs new file mode 100644 index 000000000..f5890d799 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripExtender.cs @@ -0,0 +1,125 @@ +using System; +using System.Windows.Forms; +using System.ComponentModel; +using System.Collections.Generic; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ProvideProperty("EnableVSStyle", typeof(ToolStrip))] + public partial class VisualStudioToolStripExtender : Component, IExtenderProvider + { + private class ToolStripProperties + { + private VsVersion version = VsVersion.Unknown; + private readonly ToolStrip strip; + private readonly Dictionary menuText = new Dictionary(); + + + public ToolStripProperties(ToolStrip toolstrip) + { + if (toolstrip == null) throw new ArgumentNullException(nameof(toolstrip)); + strip = toolstrip; + + if (strip is MenuStrip) + SaveMenuStripText(); + } + + public VsVersion VsVersion + { + get { return this.version; } + set + { + this.version = value; + UpdateMenuText(this.version == VsVersion.Vs2012 || this.version == VsVersion.Vs2013); + } + } + + private void SaveMenuStripText() + { + foreach (ToolStripItem item in strip.Items) + menuText.Add(item, item.Text); + } + + public void UpdateMenuText(bool caps) + { + foreach (ToolStripItem item in menuText.Keys) + { + var text = menuText[item]; + item.Text = caps ? text.ToUpper() : text; + } + } + } + + private readonly Dictionary strips = new Dictionary(); + + public VisualStudioToolStripExtender() + { + InitializeComponent(); + } + + public VisualStudioToolStripExtender(IContainer container) + { + container.Add(this); + + InitializeComponent(); + } + + #region IExtenderProvider Members + + public bool CanExtend(object extendee) + { + return extendee is ToolStrip; + } + + #endregion + + public ToolStripRenderer DefaultRenderer { get; set; } + + [DefaultValue(false)] + public VsVersion GetStyle(ToolStrip strip) + { + if (strips.ContainsKey(strip)) + return strips[strip].VsVersion; + + return VsVersion.Unknown; + } + + public void SetStyle(ToolStrip strip, VsVersion version, ThemeBase theme) + { + ToolStripProperties properties = null; + + if (!strips.ContainsKey(strip)) + { + properties = new ToolStripProperties(strip) { VsVersion = version }; + strips.Add(strip, properties); + } + else + { + properties = strips[strip]; + } + + if (theme == null) + { + if (DefaultRenderer != null) + strip.Renderer = DefaultRenderer; + } + else + { + theme.ApplyTo(strip); + } + properties.VsVersion = version; + } + + public enum VsVersion + { + Unknown, + Vs2003, + Vs2005, + Vs2008, + Vs2010, + Vs2012, + Vs2013, + Vs2015 + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripRenderer.cs b/WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripRenderer.cs new file mode 100644 index 000000000..42c72de8e --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/VisualStudioToolStripRenderer.cs @@ -0,0 +1,683 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + public class VisualStudioToolStripRenderer : ToolStripProfessionalRenderer + { + private static Rectangle[] baseSizeGripRectangles = + { + new Rectangle(6,0,1,1), + new Rectangle(6,2,1,1), + new Rectangle(6,4,1,1), + new Rectangle(6,6,1,1), + new Rectangle(4,2,1,1), + new Rectangle(4,4,1,1), + new Rectangle(4,6,1,1), + new Rectangle(2,4,1,1), + new Rectangle(2,6,1,1), + new Rectangle(0,6,1,1) + }; + + private const int GRIP_PADDING = 4; + private SolidBrush _statusBarBrush; + private SolidBrush _statusGripBrush; + private SolidBrush _statusGripAccentBrush; + private SolidBrush _toolBarBrush; + private SolidBrush _gripBrush; + private Pen _toolBarBorderPen; + private VisualStudioColorTable _table; + private DockPanelColorPalette _palette; + + public bool UseGlassOnMenuStrip { get; set; } + + public VisualStudioToolStripRenderer(DockPanelColorPalette palette) + : base(new VisualStudioColorTable(palette)) + { + _table = (VisualStudioColorTable)ColorTable; + _palette = palette; + RoundedEdges = false; + _statusBarBrush = new SolidBrush(palette.MainWindowStatusBarDefault.Background); + _statusGripBrush = new SolidBrush(palette.MainWindowStatusBarDefault.ResizeGrip); + _statusGripAccentBrush = new SolidBrush(palette.MainWindowStatusBarDefault.ResizeGripAccent); + _toolBarBrush = new SolidBrush(palette.CommandBarToolbarDefault.Background); + _gripBrush = new SolidBrush(palette.CommandBarToolbarDefault.Grip); + _toolBarBorderPen = new Pen(palette.CommandBarToolbarDefault.Border); + + UseGlassOnMenuStrip = true; + } + + #region Rendering Improvements (includes fixes for bugs occured when Windows Classic theme is on). + //* + protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) + { + // Do not draw disabled item background. + if (e.Item.Enabled) + { + bool isMenuDropDown = e.Item.Owner is MenuStrip; + if (isMenuDropDown && e.Item.Pressed) + { + base.OnRenderMenuItemBackground(e); + } + else if (e.Item.Selected) + { + // Rect of item's content area. + Rectangle contentRect = e.Item.ContentRectangle; + + // Fix item rect. + Rectangle itemRect = isMenuDropDown + ? new Rectangle( + contentRect.X + 2, contentRect.Y - 2, + contentRect.Width - 5, contentRect.Height + 3) + : new Rectangle( + contentRect.X, contentRect.Y - 1, + contentRect.Width, contentRect.Height + 1); + + // Border pen and fill brush. + Color pen = ColorTable.MenuItemBorder; + Color brushBegin; + Color brushEnd; + + if (isMenuDropDown) + { + brushBegin = ColorTable.MenuItemSelectedGradientBegin; + brushEnd = ColorTable.MenuItemSelectedGradientEnd; + } + else + { + brushBegin = ColorTable.MenuItemSelected; + brushEnd = Color.Empty; + } + + DrawRectangle(e.Graphics, itemRect, brushBegin, brushEnd, pen, UseGlassOnMenuStrip); + } + } + } + + protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) + { + var status = e.ToolStrip as StatusStrip; + if (status != null) + { + // IMPORTANT: left empty to remove white border. + return; + } + + var context = e.ToolStrip as MenuStrip; + if (context != null) + { + base.OnRenderToolStripBorder(e); + return; + } + + var drop = e.ToolStrip as ToolStripDropDown; + if (drop != null) + { + base.OnRenderToolStripBorder(e); + return; + } + + var rect = e.ToolStrip.ClientRectangle; + e.Graphics.DrawRectangle(_toolBarBorderPen, new Rectangle(rect.Location, new Size(rect.Width - 1, rect.Height - 1))); + } + + protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) + { + var status = e.ToolStrip as StatusStrip; + if (status != null) + { + base.OnRenderToolStripBackground(e); + return; + } + + var context = e.ToolStrip as MenuStrip; + if (context != null) + { + base.OnRenderToolStripBackground(e); + return; + } + + var drop = e.ToolStrip as ToolStripDropDown; + if (drop != null) + { + base.OnRenderToolStripBackground(e); + return; + } + + e.Graphics.FillRectangle(_toolBarBrush, e.ToolStrip.ClientRectangle); + } + + protected override void OnRenderStatusStripSizingGrip(ToolStripRenderEventArgs e) + { + // IMPORTANT: below code was taken from Microsoft's reference code (MIT license). + Graphics g = e.Graphics; + StatusStrip statusStrip = e.ToolStrip as StatusStrip; + + // we have a set of stock rectangles. Translate them over to where the grip is to be drawn + // for the white set, then translate them up and right one pixel for the grey. + + + if (statusStrip != null) + { + Rectangle sizeGripBounds = statusStrip.SizeGripBounds; + if (!LayoutUtils.IsZeroWidthOrHeight(sizeGripBounds)) + { + Rectangle[] whiteRectangles = new Rectangle[baseSizeGripRectangles.Length]; + Rectangle[] greyRectangles = new Rectangle[baseSizeGripRectangles.Length]; + + for (int i = 0; i < baseSizeGripRectangles.Length; i++) + { + Rectangle baseRect = baseSizeGripRectangles[i]; + if (statusStrip.RightToLeft == RightToLeft.Yes) + { + baseRect.X = sizeGripBounds.Width - baseRect.X - baseRect.Width; + } + baseRect.Offset(sizeGripBounds.X, sizeGripBounds.Bottom - 12 /*height of pyramid (10px) + 2px padding from bottom*/); + greyRectangles[i] = baseRect; + if (statusStrip.RightToLeft == RightToLeft.Yes) + { + baseRect.Offset(1, -1); + } + else + { + baseRect.Offset(-1, -1); + } + whiteRectangles[i] = baseRect; + } + + g.FillRectangles(_statusGripAccentBrush, whiteRectangles); + g.FillRectangles(_statusGripBrush, greyRectangles); + } + } + } + + protected override void OnRenderGrip(ToolStripGripRenderEventArgs e) + { + Graphics g = e.Graphics; + Rectangle bounds = e.GripBounds; + ToolStrip toolStrip = e.ToolStrip; + + bool rightToLeft = (e.ToolStrip.RightToLeft == RightToLeft.Yes); + + int height = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Height : bounds.Width; + int width = (toolStrip.Orientation == Orientation.Horizontal) ? bounds.Width : bounds.Height; + + int numRectangles = (height - (GRIP_PADDING * 2)) / 4; + + if (numRectangles > 0) + { + numRectangles++; + // a MenuStrip starts its grip lower and has fewer grip rectangles. + int yOffset = (toolStrip is MenuStrip) ? 2 : 0; + + Rectangle[] shadowRects = new Rectangle[numRectangles]; + int startY = GRIP_PADDING + 1 + yOffset; + int startX = (width / 2); + + for (int i = 0; i < numRectangles; i++) + { + shadowRects[i] = (toolStrip.Orientation == Orientation.Horizontal) ? + new Rectangle(startX, startY, 1, 1) : + new Rectangle(startY, startX, 1, 1); + + startY += 4; + } + + // in RTL the GripLight rects should paint to the left of the GripDark rects. + int xOffset = (rightToLeft) ? 2 : -2; + + if (rightToLeft) + { + // scoot over the rects in RTL so they fit within the bounds. + for (int i = 0; i < numRectangles; i++) + { + shadowRects[i].Offset(-xOffset, 0); + } + } + + Brush b = _gripBrush; + for (int i = 0; i < numRectangles - 1; i++) + { + g.FillRectangle(b, shadowRects[i]); + } + + for (int i = 0; i < numRectangles; i++) + { + shadowRects[i].Offset(xOffset, -2); + } + + g.FillRectangles(b, shadowRects); + + for (int i = 0; i < numRectangles; i++) + { + shadowRects[i].Offset(-2 * xOffset, 0); + } + + g.FillRectangles(b, shadowRects); + } + } + + protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e) + { + ToolStripButton button = e.Item as ToolStripButton; + if (button != null && button.Enabled) + { + if (button.Selected || button.Checked) + { + // Rect of item's content area. + Rectangle contentRect = new Rectangle(0, 0, button.Width - 1, button.Height - 1); + + Color pen; + Color brushBegin; + Color brushMiddle; + Color brushEnd; + + if (button.Checked) + { + if (button.Selected) + { + pen = _table.ButtonCheckedHoveredBorder; + brushBegin = _table.ButtonCheckedHoveredBackground; + brushMiddle = _table.ButtonCheckedHoveredBackground; + brushEnd = _table.ButtonCheckedHoveredBackground; + } + else + { + pen = _table.ButtonCheckedBorder; + brushBegin = ColorTable.ButtonCheckedGradientBegin; + brushMiddle = ColorTable.ButtonCheckedGradientMiddle; + brushEnd = ColorTable.ButtonCheckedGradientEnd; + } + } + else if (button.Pressed) + { + pen = ColorTable.ButtonPressedBorder; + brushBegin = ColorTable.ButtonPressedGradientBegin; + brushMiddle = ColorTable.ButtonPressedGradientMiddle; + brushEnd = ColorTable.ButtonPressedGradientEnd; + } + else + { + pen = ColorTable.ButtonSelectedBorder; + brushBegin = ColorTable.ButtonSelectedGradientBegin; + brushMiddle = ColorTable.ButtonSelectedGradientMiddle; + brushEnd = ColorTable.ButtonSelectedGradientEnd; + } + + DrawRectangle(e.Graphics, contentRect, + brushBegin, brushMiddle, brushEnd, pen, false); + } + } + else + { + base.OnRenderButtonBackground(e); + } + } + + protected override void Initialize(ToolStrip toolStrip) + { + base.Initialize(toolStrip); + // IMPORTANT: enlarge grip area so grip can be rendered fully. + toolStrip.GripMargin = new Padding(toolStrip.GripMargin.All + 1); + } + + protected override void OnRenderOverflowButtonBackground(ToolStripItemRenderEventArgs e) + { + var cache = _palette.CommandBarMenuPopupDefault.BackgroundTop; + + // IMPORTANT: not 100% accurate as the color change should only happen when the overflow menu is hovered. + // here color change happens when the overflow menu is displayed. + if (e.Item.Pressed) + _palette.CommandBarMenuPopupDefault.BackgroundTop = _palette.CommandBarToolbarOverflowPressed.Background; + base.OnRenderOverflowButtonBackground(e); + if (e.Item.Pressed) + _palette.CommandBarMenuPopupDefault.BackgroundTop = cache; + } + + protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) + { + e.ArrowColor = e.Item.Selected ? _palette.CommandBarMenuPopupHovered.Arrow : _palette.CommandBarMenuPopupDefault.Arrow; + base.OnRenderArrow(e); + } + + protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e) + { + ////base.OnRenderItemCheck(e); + using (var imageAttr = new ImageAttributes()) + { + Color foreColor = e.Item.Selected ? _palette.CommandBarMenuPopupHovered.Checkmark : _palette.CommandBarMenuPopupDefault.Checkmark; + Color backColor = e.Item.Selected ? _palette.CommandBarMenuPopupHovered.CheckmarkBackground : _palette.CommandBarMenuPopupDefault.CheckmarkBackground; + Color borderColor = _palette.CommandBarMenuPopupDefault.Border; + + // Create a color map. + ColorMap[] colorMap = new ColorMap[1]; + colorMap[0] = new ColorMap(); + + // old color determined from testing + colorMap[0].OldColor = Color.FromArgb(4, 2, 4); + colorMap[0].NewColor = foreColor; + imageAttr.SetRemapTable(colorMap); + + using (var b = new SolidBrush(backColor)) + { + e.Graphics.FillRectangle(b, e.ImageRectangle); + } + e.Graphics.DrawImage(e.Image, e.ImageRectangle, 0, 0, e.Image.Width, e.Image.Height, GraphicsUnit.Pixel, imageAttr); + using (var p = new Pen(borderColor)) + { + e.Graphics.DrawRectangle(p, e.ImageRectangle); + } + } + } + + protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) + { + Rectangle r = e.Item.ContentRectangle; + if (e.Vertical) + { + using (var p = new Pen(_palette.CommandBarToolbarDefault.Separator)) + { + e.Graphics.DrawLine(p, r.X, r.Y, r.X, r.Y + r.Height); + } + using (var p = new Pen(_palette.CommandBarToolbarDefault.SeparatorAccent)) + { + e.Graphics.DrawLine(p, r.X + 1, r.Y, r.X + 1, r.Y + r.Height); + } + } + else + { + // if this is a menu, then account for the image column + int x1 = r.X; + int x2 = r.X + r.Width; + var menu = e.ToolStrip as ToolStripDropDownMenu; + if (menu != null) + { + x1 += menu.Padding.Left; + x2 -= menu.Padding.Right; + } + + using (var p = new Pen(_palette.CommandBarToolbarDefault.Separator)) + { + e.Graphics.DrawLine(p, x1, r.Y, x2, r.Y); + } + using (var p = new Pen(_palette.CommandBarToolbarDefault.SeparatorAccent)) + { + e.Graphics.DrawLine(p, x1, r.Y + 1, x2, r.Y + 1); + } + } + } + + protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) + { + Color color = Color.Black; + var toolStrip = e.ToolStrip; + if (toolStrip is StatusStrip) + { + if (e.Item.Selected) + { + color = _palette.MainWindowStatusBarDefault.HighlightText; + } + else + { + color = _palette.MainWindowStatusBarDefault.Text; + } + } + else if (toolStrip is MenuStrip) + { + var button = e.Item as ToolStripButton; + var checkedButton = button != null && button.Checked; + if (!e.Item.Enabled) + { + color = _palette.CommandBarMenuPopupDisabled.Text; + } + else if (button != null && button.Pressed) + { + color = _palette.CommandBarToolbarButtonPressed.Text; + } + else if (e.Item.Selected && checkedButton) + { + color = _palette.CommandBarToolbarButtonCheckedHovered.Text; + } + else if (e.Item.Selected) + { + color = _palette.CommandBarMenuTopLevelHeaderHovered.Text; + } + else if (checkedButton) + { + color = _palette.CommandBarToolbarButtonChecked.Text; + } + else + { + color = _palette.CommandBarMenuDefault.Text; + } + } + else if (toolStrip is ToolStripDropDown) + { + // This might differ from above branch, but left the same here. + var button = e.Item as ToolStripButton; + var checkedButton = button != null && button.Checked; + if (!e.Item.Enabled) + { + color = _palette.CommandBarMenuPopupDisabled.Text; + } + else if (button != null && button.Pressed) + { + color = _palette.CommandBarToolbarButtonPressed.Text; + } + else if (e.Item.Selected && checkedButton) + { + color = _palette.CommandBarToolbarButtonCheckedHovered.Text; + } + else if (e.Item.Selected) + { + color = _palette.CommandBarMenuTopLevelHeaderHovered.Text; + } + else if (checkedButton) + { + color = _palette.CommandBarToolbarButtonChecked.Text; + } + else + { + color = _palette.CommandBarMenuDefault.Text; + } + } + else + { + // Default color, if not it will be black no matter what + if (!e.Item.Enabled) + { + color = _palette.CommandBarMenuPopupDisabled.Text; + } + else + { + color = _palette.CommandBarMenuDefault.Text; + } + } + + TextRenderer.DrawText(e.Graphics, e.Text, e.TextFont, e.TextRectangle, color, e.TextFormat); + } + + #region helpers + private static void DrawRectangle(Graphics graphics, Rectangle rect, Color brushBegin, + Color brushMiddle, Color brushEnd, Color penColor, bool glass) + { + RectangleF firstHalf = new RectangleF( + rect.X, rect.Y, + rect.Width, (float)rect.Height / 2); + + RectangleF secondHalf = new RectangleF( + rect.X, rect.Y + (float)rect.Height / 2, + rect.Width, (float)rect.Height / 2); + + if (brushMiddle.IsEmpty && brushEnd.IsEmpty) + { + graphics.FillRectangle(new SolidBrush(brushBegin), rect); + } + if (brushMiddle.IsEmpty) + { + rect.SafelyDrawLinearGradient(brushBegin, brushEnd, LinearGradientMode.Vertical, graphics); + } + else + { + firstHalf.SafelyDrawLinearGradientF(brushBegin, brushMiddle, LinearGradientMode.Vertical, graphics); + secondHalf.SafelyDrawLinearGradientF(brushMiddle, brushEnd, LinearGradientMode.Vertical, graphics); + } + + if (glass) + { + Brush glassBrush = new SolidBrush(Color.FromArgb(120, Color.White)); + graphics.FillRectangle(glassBrush, firstHalf); + } + + if (penColor.A > 0) + { + graphics.DrawRectangle(new Pen(penColor), rect); + } + } + + private static void DrawRectangle(Graphics graphics, Rectangle rect, Color brushBegin, + Color brushEnd, Color penColor, bool glass) + { + DrawRectangle(graphics, rect, brushBegin, Color.Empty, brushEnd, penColor, glass); + } + + private static void DrawRectangle(Graphics graphics, Rectangle rect, Color brush, + Color penColor, bool glass) + { + DrawRectangle(graphics, rect, brush, Color.Empty, Color.Empty, penColor, glass); + } + + private static void FillRoundRectangle(Graphics graphics, Brush brush, Rectangle rect, int radius) + { + float fx = Convert.ToSingle(rect.X); + float fy = Convert.ToSingle(rect.Y); + float fwidth = Convert.ToSingle(rect.Width); + float fheight = Convert.ToSingle(rect.Height); + float fradius = Convert.ToSingle(radius); + FillRoundRectangle(graphics, brush, fx, fy, fwidth, fheight, fradius); + } + + private static void FillRoundRectangle(Graphics graphics, Brush brush, float x, float y, float width, float height, float radius) + { + RectangleF rectangle = new RectangleF(x, y, width, height); + GraphicsPath path = GetRoundedRect(rectangle, radius); + graphics.FillPath(brush, path); + } + + private static void DrawRoundRectangle(Graphics graphics, Pen pen, Rectangle rect, int radius) + { + float fx = Convert.ToSingle(rect.X); + float fy = Convert.ToSingle(rect.Y); + float fwidth = Convert.ToSingle(rect.Width); + float fheight = Convert.ToSingle(rect.Height); + float fradius = Convert.ToSingle(radius); + DrawRoundRectangle(graphics, pen, fx, fy, fwidth, fheight, fradius); + } + + private static void DrawRoundRectangle(Graphics graphics, Pen pen, float x, float y, float width, float height, float radius) + { + RectangleF rectangle = new RectangleF(x, y, width, height); + GraphicsPath path = GetRoundedRect(rectangle, radius); + graphics.DrawPath(pen, path); + } + + private static GraphicsPath GetRoundedRect(RectangleF baseRect, float radius) + { + // if corner radius is less than or equal to zero, + // return the original rectangle + + if (radius <= 0) + { + GraphicsPath mPath = new GraphicsPath(); + mPath.AddRectangle(baseRect); + mPath.CloseFigure(); + return mPath; + } + + // if the corner radius is greater than or equal to + // half the width, or height (whichever is shorter) + // then return a capsule instead of a lozenge + + if (radius >= (Math.Min(baseRect.Width, baseRect.Height)) / 2.0) + return GetCapsule(baseRect); + + // create the arc for the rectangle sides and declare + // a graphics path object for the drawing + + float diameter = radius * 2.0F; + SizeF sizeF = new SizeF(diameter, diameter); + RectangleF arc = new RectangleF(baseRect.Location, sizeF); + GraphicsPath path = new GraphicsPath(); + + // top left arc + path.AddArc(arc, 180, 90); + + // top right arc + arc.X = baseRect.Right - diameter; + path.AddArc(arc, 270, 90); + + // bottom right arc + arc.Y = baseRect.Bottom - diameter; + path.AddArc(arc, 0, 90); + + // bottom left arc + arc.X = baseRect.Left; + path.AddArc(arc, 90, 90); + + path.CloseFigure(); + return path; + } + + private static GraphicsPath GetCapsule(RectangleF baseRect) + { + RectangleF arc; + GraphicsPath path = new GraphicsPath(); + + try + { + float diameter; + if (baseRect.Width > baseRect.Height) + { + // return horizontal capsule + diameter = baseRect.Height; + SizeF sizeF = new SizeF(diameter, diameter); + arc = new RectangleF(baseRect.Location, sizeF); + path.AddArc(arc, 90, 180); + arc.X = baseRect.Right - diameter; + path.AddArc(arc, 270, 180); + } + else if (baseRect.Width < baseRect.Height) + { + // return vertical capsule + diameter = baseRect.Width; + SizeF sizeF = new SizeF(diameter, diameter); + arc = new RectangleF(baseRect.Location, sizeF); + path.AddArc(arc, 180, 180); + arc.Y = baseRect.Bottom - diameter; + path.AddArc(arc, 0, 180); + } + else + { + // return circle + path.AddEllipse(baseRect); + } + } + catch + { + path.AddEllipse(baseRect); + } + finally + { + path.CloseFigure(); + } + + return path; + } + #endregion + // */ + #endregion + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Win32/Enums.cs b/WeifenLuoLinux/WinFormsUI/Docking/Win32/Enums.cs new file mode 100644 index 000000000..a00fc5acf --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Win32/Enums.cs @@ -0,0 +1,371 @@ +using System; + +namespace WeifenLuo.WinFormsUI.Docking.Win32 +{ + [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 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 + } + + [Flags] + 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, + WS_EX_NOACTIVATE = 0x08000000 + } + + 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 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 ScrollBars : uint + { + SB_HORZ = 0, + SB_VERT = 1, + SB_CTL = 2, + SB_BOTH = 3 + } + + internal enum GetWindowLongIndex + { + GWL_STYLE = -16, + GWL_EXSTYLE = -20 + } + + // Hook Types + internal enum HookType + { + WH_JOURNALRECORD = 0, + WH_JOURNALPLAYBACK = 1, + WH_KEYBOARD = 2, + WH_GETMESSAGE = 3, + WH_CALLWNDPROC = 4, + WH_CBT = 5, + WH_SYSMSGFILTER = 6, + WH_MOUSE = 7, + WH_HARDWARE = 8, + WH_DEBUG = 9, + WH_SHELL = 10, + WH_FOREGROUNDIDLE = 11, + WH_CALLWNDPROCRET = 12, + WH_KEYBOARD_LL = 13, + WH_MOUSE_LL = 14 + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/Docking/Win32/NativeMethods.cs b/WeifenLuoLinux/WinFormsUI/Docking/Win32/NativeMethods.cs new file mode 100644 index 000000000..4f18b683b --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/Docking/Win32/NativeMethods.cs @@ -0,0 +1,61 @@ +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Diagnostics.CodeAnalysis; +using WeifenLuo.WinFormsUI.Docking.Win32; + +namespace WeifenLuo.WinFormsUI.Docking +{ + internal static class NativeMethods + { + [DllImport("User32.dll", CharSet=CharSet.Auto)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DragDetect(IntPtr hWnd, Point pt); + + [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)] + [return: MarshalAs(UnmanagedType.Bool)] + 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 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 int GetWindowLong(IntPtr hWnd, int Index); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + public static extern int SetWindowLong(IntPtr hWnd, int Index, int Value); + + [DllImport("user32.dll", CharSet=CharSet.Auto)] + public static extern int ShowScrollBar(IntPtr hWnd, int wBar, int bShow); + + [DllImport("user32.dll", CharSet=CharSet.Auto)] + //********************************* + // FxCop bug, suppress the message + //********************************* + [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "0")] + public static extern IntPtr WindowFromPoint(Point point); + + [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] + public static extern int GetCurrentThreadId(); + + public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam); + + [DllImport("user32.dll")] + public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID); + + [DllImport("user32.dll")] + public static extern int UnhookWindowsHookEx(IntPtr hhook); + + [DllImport("user32.dll")] + public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wParam, IntPtr lParam); + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005.csproj b/WeifenLuoLinux/WinFormsUI/ThemeVS2005.csproj new file mode 100644 index 000000000..e6c00c8fa --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005.csproj @@ -0,0 +1,158 @@ + + + + DockPanelSuite.ThemeVS2005 + 3.1.0 + 3.1.0.0 + Weifen Luo and other contributors + Visual Studio 2005 theme for DockPanel Suite. + (C) 2007-2020 Weifen Luo and other contributors + false + MIT + http://dockpanelsuite.com + + Release notes can be found at GitHub, + https://github.com/dockpanelsuite/dockpanelsuite/releases + + netcoreapp3.1;net35;net40 + true + + WeifenLuo.WinFormsUI + WeifenLuo.WinFormsUI.Docking.ThemeVS2005Linux + true + dockpanelsuite.snk + false + true + + + + + + Resources.resx + True + True + + + Strings.resx + True + True + + + Component + + + + + Component + + + + Component + + + Component + + + + + + + + + + + Always + + + + + {C75532C4-765B-418E-B09B-46D36B2ABDB1} + WinFormsUI + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + ResXFileCodeGenerator + Strings.Designer.cs + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.Designer.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.Designer.cs new file mode 100644 index 000000000..d845c1459 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.Designer.cs @@ -0,0 +1,303 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WeifenLuo.WinFormsUI.ThemeVS2005.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Bottom { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Bottom", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Fill { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Fill", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpot { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpot", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpotIndex { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpotIndex", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotspotIndex_VS2012 { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotspotIndex_VS2012", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Left { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Left", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Right { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Right", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Top { + get { + object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Top", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelBottom { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelBottom", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelBottom_Active { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelBottom_Active", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelFill { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelFill", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelFill_Active { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelFill_Active", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelLeft { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelLeft_Active { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelLeft_Active", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelRight { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelRight_Active { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelRight_Active", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelTop { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelTop", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockIndicator_PanelTop_Active { + get { + object obj = ResourceManager.GetObject("DockIndicator_PanelTop_Active", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockPane_AutoHide { + get { + object obj = ResourceManager.GetObject("DockPane_AutoHide", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockPane_Close { + get { + object obj = ResourceManager.GetObject("DockPane_Close", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockPane_Dock { + get { + object obj = ResourceManager.GetObject("DockPane_Dock", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockPane_Option { + get { + object obj = ResourceManager.GetObject("DockPane_Option", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DockPane_OptionOverflow { + get { + object obj = ResourceManager.GetObject("DockPane_OptionOverflow", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.resx b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.resx new file mode 100644 index 000000000..3af1feba7 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources.resx @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\DockIndicator_PaneDiamond.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_Bottom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\Dockindicator_PaneDiamond_Fill.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_Hotspot.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_HotspotIndex.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_HotspotIndex_VS2012.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_Left.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_Right.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PaneDiamond_Top.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelBottom.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelBottom_Active.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelFill.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelFill_Active.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelLeft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelLeft_Active.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelRight.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelRight_Active.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelTop.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockIndicator_PanelTop_Active.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockPane_AutoHide.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockPane_Close.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockPane_Dock.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockPane_Option.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\DockPane_OptionOverflow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond.png new file mode 100644 index 0000000000000000000000000000000000000000..23f1353d5ba2ed5c4c88f42ec1b6f0082df4960b GIT binary patch literal 2011 zcmV<12PF83P)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw0005( zP)t-s{{R5BwY9^;!^OqL#>U3U$;r&j%+Aiv(b3V@*VowC*mi}Wc!#2PgrIYQoo{`b zYkHMub&+Fnj9+YsTWEt;V}4Oyc}-h&Nmg-1Q*1#`YCcS6J4s_vK$_Ln)!f|N;Nak( z!2F%P`c-dV%iHbC+U?8R?91Bh(BJRS-tW-g@Xz1x(BAOR-tW}n@zmk+)Zy{f;_=kt z^4H|^|Ns9@PpV8$s!dO+Mq<52W4%UVywA_i+1c5|#Kh9l(&6FZ-{0TJ$jDMbo8#l- z;^N}o-rjnNrFe#;b%URAf1GW6muYvCWpj>UZi-xLg;!;OQeb;dTz5)Wb4FBdLQrf! zO=vtyWluksK1^qLg`#wUowUi}WowpYYnQah;d_6k<>u~ZZI!30!LhT-hKs3zhNXv$ zsiUU7dVZyMd!wMEx~QnAh>fa0OTEx=jx^&Oh4GK@4bD#%Sp;9fXeeG#|}d&1%0p+tcG@9w+N@VV>SzZy&*2g8TXp z9K@SDu($sKpC51T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kXHX($f7y#g~r*ej?^ zxIj_`7-qr)s1X8Qz5J;nC{iJjMW&Dp-}?qE=EU6QpZ84w%8nm-q`~CWcb|=aL zej1{x-Z@lWG@QB`5t2+aJhUGSA**$&TT)Je$2js7_K?mQR+7Kl;%E4g`sz!8M%Lje@V;e+(SFjxDG{Q__BeCmTx;b^<@-{T3N0o31)Vu8CNzPgYT=Ksw)hPQ*6|5 z)33jcxNw#FK{5?F&AvJ0C%*|l?io9_(+onbr!G|Bs`&gUth$MD_KFU7kNTH^_(0t2rminG5?<>L zc)Y@>OcI%+l)qa2Th*tW%pElK`!|PoQcU&Rz;~_p=`ZOt_lMBuRmvb?_pKWIt5*Ee zVfR4^FV_0I|*R zq4|mrY!Z@K9S<6ZD1llZOqp+Cn<9A)t$CQM>9s)x{2k1RoQf23u5yXvx6l{Blm5E$ zL-Z5-O8jSzDAhhqOt!YGkNXL007*~-4N^J1RuhTxT{)cWEFMpW`6Z*mlF`=4M6^r*bFi7kX)xrp`B`r>Gi!@; q)?lmCU<+$7Se@4*{vShJJSsXO?f)A>iJ%{!8$iG=IyE?k=KL2)+3E=Z literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Hotspot.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..3e9c31839553a1307d2432de055c0aae80fe8035 GIT binary patch literal 484 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL3?$vW53m6#mUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l&}f#332`Z|NqvlTmLgK z96o&b!Gi~P?%X+YEaj?aro^`PocvKJT8GEHYeF8Km1qDtCqc0c%#Rv zOaB@2*R}}+G;ztEJlbcFc&LR_SnZE%gu7?KYOX|`X!ZDJ2SUV9Cb^>(MJhHv7`XDQyRdP`(kYX@0Ff`FMu+TL!4KXydGO@HWFxNFOu`)0ayt?fP diiX_$l+3hB+!_)(_&{;U;OXk;vd$@?2>|K~yP^O9 literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_HotspotIndex.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_HotspotIndex.png new file mode 100644 index 0000000000000000000000000000000000000000..1831b8326fc80e2c5b8a0827b971b65dbad558d2 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^%plAHBA2kO=mAnJ>5jgR3=A9lx&I`x0{IHb9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fgAr#;f;`$#5fb9Pa4L}kE z{%bA{tpL)DN#5=*3>~bp9zc$ur;B3<$Mxidl!Sn?goIR}^eKj{8O6&^03}sRTq8{K(MDzdv literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_HotspotIndex_VS2012.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_HotspotIndex_VS2012.png new file mode 100644 index 0000000000000000000000000000000000000000..1419f94fca9bacd0a71532b6b7bca9ff640d4207 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^%plCc1SD^IDZKzvjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt33 zJ=4@yqg0R@PZ!4!iSXnf{46{QLLLSt1`UiMFaFmvytd*mTArzr4phV7>FVdQ&MBb@ E0EHSV@&Et; literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Left.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Left.png new file mode 100644 index 0000000000000000000000000000000000000000..73fb1c747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`$vf9DN{80iX zHy5v*N%%*zX7~2?rb(% z*7?{81a)D73Llaz-B+LYrz+>s=kxb7pS50FePf!TrHwFBUkLG3P=3l-B@V^scp(nQG8njj1H5X`8$HcJL|(M?4p1r+KS?cFn0RIoy|w-fCL87Ibcj_ zHlE=dmzI#edWNjYWdD@HFzmCx#2r~RXlm5872Yd{?X?cLVwt+LPWTr3<;3jh3E4D#)K=VQY!VHybCe|!k?gTls$#wr}UZVp9{MgwI@p+g5 z?KGmfy~Kqkq13f%1rPq%Sd=6xrtALoyIW7i;7X$lrNPut6@1wNA}S+IST4JWAv-V$ z(iDrdxtlT*KNr87qr8uc|DFTN5C)?v*3u1o!xxK!Aj45Y0Cd4;^t8Z+TDs?4&YXeh r89~4XT3|g07`%V5k@p`%Na&3~zu5mb_~4~~{cZqmX%DTr;B)t10Ll6V literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Right.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PaneDiamond_Right.png new file mode 100644 index 0000000000000000000000000000000000000000..ea74bf2f693cb5c9696318e706db9de85880f3fd GIT binary patch literal 2006 zcmV;{2Pyc8P)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw0005( zP)t-s|NsBBwY9^;!^OqL#>U3U$;r&j%+Aiv(b3V@*VowC*mi}Wc!#2PgrIYQoo{`b zYkHMub&+Fnj9+YsTWEt;V}4Oyc}-h&Nmg-1Q*1#`YCcS6J4s_vK$_Ln)!f|N;Nak( z!2F%P`c-dV%iHbC+U?8R?91Bh(BJRS-tW-g@Xz1x(BAOR-tW}n@zmk+)Zy{f;_=kt z^4H|^O;4&!PpVB%sYYVGMq|B3V!Y4K&)M18#KgqX($eAK;osli$jHc2L7U^_UZi-xLg;!;OQeb;dTz5)Wb4FBdLQrf! zO=vtyWluksK1^qLg`#wUowUi}WowpYYnQah;d_6k<>u~ZZI!30!LhT-hKs3zhNXv$ z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v3%zW`q=#~J{K#bcu-O${G|I%l2_FrSBZOPcP zFHRzMcI;+0{=qnZ@PSxioU@Bu@@t>p^|ejpf=H@Iq0vXgEqEWB9skTXy8hN(J zqOMbltI^UrUc&dC%0TRxdm9wN2&lyyF^RP4gkxB$ zW@W9lZ@iRx>6%?7jme^&>{(Dj3e?eF5aDxlBj%!tZ`eO4lF~_BZ9gU{$2nO-(DgqWB^ qz-Ibj69^crIMOupKLZihL#|?o|9=2Qk^k|!0hqm$-IH^u)%%8}uPf(0FP`x@XY&2jo;z{vHzJy@hSXj5ue#t{(d)%+LbbDx*ad0I5{N#3+a*^?in_1{bCz8%|fGpgl!Xv5Wj+DpDw7d^|)xt5%D zE;{X4aO%*ZLnlw3ymIBr|NsB@?%nH_1Vnq>lK1-huk`U>X{ngQHuZ~@Rb>PzTgO{EkxcvOUr56V; zz1V&3$?kJc_ndpW`#cam*?#)*_S28HpLx9P^rI~&A8tAE@aWN_+)q~P00W&d$=lt< z;{(%`S3tIrr;B5V#`)xg1N;&*XG9h-EYK0wmbT_&n39_I_`wmzhD|ze=ETI@vDs7e zhpEZwkkX>0MM;l@CIwwGnzP9v(z22@)74cqRW#JJl-E}`S2kBR*0z>8(|N<1iH6I! zbgrDavvujzt-WjK?rq-Nym<2F?k%f%Jg%Lc8+?md*rR&WX{R?!cdnUkF7Tt`;icEF zpTB?Ke>){JGqdKK*W}k)F`F186r9Wq3^X(h3=Aw(OmtW{oSdDQI;ZjWcXTj3JaIxp zK$h=_$EJ&hhK3sz1cYT}h1r)REuNV2Soo3f?)FK#IZ0z|ch3z(Uu^ yG{n%*%EZ#jz+BhB#LB=x@ancFC>nC}Q!>*kacfBE;EMoiVDNPHb6Mw<&;$S&&Z0g5 literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelBottom_Active.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelBottom_Active.png new file mode 100644 index 0000000000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VW&{#6%z%FmU~d0I5{N%`F8dD9+cPkxZre=n)~ zc5KJZsFv%Y4OatdFZoto^ej8)T5{I8=(JEaloaXvXgfkk5GjK~6pG`9sd!rIc-dpd<18AVVk9oblw5t^p!n8c(H(z{s4Y=U&j|IHAv>L#1EV z;^33Hg(}eU zBhwH=Ln{+YD+6;~0~0F)1Hr4?o}g&R%}>cptHiA#p@T01sDZ)L)z4*}Q$iB};!6?a literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelFill_Active.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelFill_Active.png new file mode 100644 index 0000000000000000000000000000000000000000..8972b3f53ed12545ec57583cc7b1b9213ff96a20 GIT binary patch literal 645 zcmeAS@N?(olHy`uVBq!ia0vp^@*vE?3?wxQo^b;ymUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lsF&Y6XMFi@c+Pp14oV= zId<&Wi4!NzoH=vx;>F9CFJHfY{r2tKL5_2(I+s?oEiP@IUsyjUw`O`~`Q+5%zQnw) zn5@?D)P|shYQLCrukd2GkUXb=9DCmk8?V$GH*U<``+Mfj?+Xt6nY{ID?}kt9tKK&( zeO)>4dGUk$Hrz)%^#*Fr$b7Mk{%^J5}FirDaL4yPC#X(WhD@^x~is% zhMJc0mh$@Q=E~~1?bx$!-oAb7<~1&yxUqBP%$=<}TbEAV$~#>*<{qE4!?f+?8_Ksl zZ*q25kaxXzP)^oj!K>pe8lPe$F2$5wecz$@)?(2ee}#W@HXPY6ys1vTpv!TBpF@XA zzpTaKC$TvjnK#%h{Nt$c{~I literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelLeft.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..9fc387e31160be60b08c715431ddc3ef74a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?Je zbN)V1aMi&}&)t&u9=rbP>Z6a_PCq($>4kXHd0+rDFeZ7syLh& zOquj-(!(jOCr+Q#KB0Z$q_&pk>J_V2W@lt&WM#g7QS|bp!_%+4JiI(#d3$<%ea@cI z)mf{vc1>>1+Z}IiF8svD*XMUmZ(ZIyIk|Zp4La|izGa^B{p*86itk@Mew3l08G%=mS9QB&=o#mNcp`g;$T?BDENViRH? z&eXPN@%G}RAR`xh@o=tX{~la%xh}Edx8ak6?}|A)8h6^O@^=4xxz5nh;x7NUdLOoT zADDmHE7)zm0Xkxq!^403{7+mEOd=bLktbAOf0Po p%ykV+tPBhUuWoySq9HdwB{QuOw}ylcz6hWO22WQ%mvv4FO#p^XtcU;r literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelRight.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelRight.png new file mode 100644 index 0000000000000000000000000000000000000000..c9c0b093dcc22dd32f6ca7f35b7ace1799f32b99 GIT binary patch literal 882 zcmeAS@N?(olHy`uVBq!ia0vp^@<1%h!3-o*cen#d29|V3Uq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a!@$7k65tc!x^?T;0|yQq zIdbIKv12DroH%pl%*BfrFJHcV{rdIWw{HhI&Z+8LTG6(+w0VAE{hZvI>6zt|Q;Yi& z^SWZPTEkNtf)c9zV#>Y3i`_!d{RF5dET@~ z*^?in_1{bCz8%|fGpgl!Xv5Wj+DpDw7d^|)xt5%DE;{X4aBA<~z5oCJzy9R&m4_cM z+V>A73-USI!J=kLEiefy1D(w@_|-W<66 zeEXTlKK`pN-233`zw*NU_q)$OIe+i{g$oxB9XeEWX9*K9pc#|A-CZ31-Hf>bWZQYV zIEHAPPfk!^k(fCnvVfV5O)bo<>`p^tVe^E9gv94h9zA>Z@Y%zskHrN*wX$_bg6s zC|=N?KcU{h@9()r#eEBRd~IiZ`~55TcOJK?{S7bsOZa-a__*A!%L{W~m6sHkZ$0{_ zB|@*`pTT>V@cS1EbUwuh{5{uc=jnLz#XEnG#+UxAzxXfLa%LKQU*7z;KhN&aUx&)= z3U~f}_hN6$Z?ix5q5Kq2iSMBj`h#4#}Ho9Q6+DeI~^FTswJ)wB`Jv|saDBFsX&Us$iUD< z*T6#8$TY;z(8|Qp%D`OLz{JYHK=A6eCny?n^HVa@DsgK_=-`V0YGCkm^>bP0l+XkK DxUsp1 literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelRight_Active.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelRight_Active.png new file mode 100644 index 0000000000000000000000000000000000000000..c3cb4e5f61ded8004bfe975eb27a767fc1502ae7 GIT binary patch literal 885 zcmeAS@N?(olHy`uVBq!ia0vp^@<1%h!3-o*cen#d29|V3Uq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a!@$7k9^ez=%E0h{>(;FY z4jedgFiPrmG=!m;I|Q_>`YJdh}@NoTo)IpOnvio;U4L z_T&d?{r8f(Z^w4rjB2?a+Hf_X_L6VaMbENxt|e!ki%vThoZ7p0@Bjb*uRr;G<>AK* z_uikr_4erXR|hV=*mLgbw$qQcoP2oY;in7tKODUV6nwt>+|%u+A6#ug7e|qK7r|qX7yCvI*_dfXgue@;o{qFNm&fj}~;lhPOhYsDlcW>YRJ)OX?W=!&ScX9Z4Gv)@6 zZRhFY7@~1LIYEIzV&;shw-2LOnub+=6l$Y=n z@O}Bn`-%V9%KMfEN6baG|1((dcVFGZc?VZ~5;XWb@myozMaPFPekCU@{H6T((c%p= z<_nzWy(s@|?u%E_Qhl!Tq!-<{yr{0JA$j*Nr>4Q*l@9+Ccj+tgKKoa);s3?6?mOf) z-ix)|{vY@9z=yLRj!XXYo7uR|bH=;&*ZnM~e(!pGjlX1mw#mF7-9F`=pImw4Wf;`- zXHU)T=RI&qUVOUFwJZGI`zUftDnm{ Hr-UW|6q~jD literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelTop.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelTop.png new file mode 100644 index 0000000000000000000000000000000000000000..255ba0ef2b4d46468a8a4baede528440ec1613ea GIT binary patch literal 860 zcmeAS@N?(olHy`uVBq!ia0vp^vOuiB!3-pCu59)LQY`6?zK#qG8~eHcB(j1elRbib z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#N0|TRDfKQ0))~#C)95`^~ z$dO~mj-5Dh;>?*d7cXACeEIVA>(_7JzFpP1w4!ZsY4iNT`Z>8Z(=*E_rxy1m=5@tn zwT7oQ1SM4a#gu!67rTYzIR)g{`)1g9r3N|9xq9{Ly?gf-9QZSL@9&vAzfa!!wRgj( z_Eqm2mcFi>_q=$<Su#lY_*8 z!l20;eqZQw-R*7tX5W?|rKUwJhhlUVYMg%cyS_ng`NT4|Y2vS5N$VpGVS^Zk#R$kXCS-eVAberf6!BsEY*4>wy#m1c?(dM=yGi`BPq(1-v literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelTop_Active.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockIndicator_PanelTop_Active.png new file mode 100644 index 0000000000000000000000000000000000000000..cf2e3ac9af44cf851697b7da6a71d171ae7b4aef GIT binary patch literal 860 zcmeAS@N?(olHy`uVBq!ia0vp^vOuiB!3-pCu59)LQY`6?zK#qG8~eHcB(j1elRbib z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#N0|TRDfKP}k1H=CV2M!!L za^%>tV<%3WICJLA#fuj&U%q_(`t{qlZ&!6Lt!P_Z+C0Coeok)9^vv?fsl|PXd0jDC zt>LK+K?&7l&u3o)*@7}!y2mZ|6`+Mfj?~}KF?cMOH zebxJhrLQaJJujZ|IA`+x)Sf$W?KdKtu7=cI_OH6&Q-1E~(W6!KUzE>%UOMM#(aa}# z(;j6{evsCGFRA->Y{$*0mg}JnR|9G<`Bq)@EIa2~a@M)%v}3`ky?gg=KmB;y=||gv z=*;8Y=br94_jLEUC%ex--F^Pa!Ama=TzY=s(u;#Y^78Xz*Ipe3qU*1YU4M1@_S@69 z-k!ew=Jc&M7w*5maPR$v`ybAO7$45xdw=E8$14v%U3vKNDv%Yp! zf0eKQO1GrFZpnMylJ=}wF|#ekco{I18I!!-U6Nz=>8=8@wLM)NLp08By_^}`iu3Y#UWW|y2qDqU-^0Xc>8<$RD(}m`Elfl$fKQKwlDHYt4b@& zt4l1*w48nVSyGx7`QM(LvH?@X#q2HwU4DYDJ1ATD86&+ zfI^6fzKds@qW2<|*i!{cU%YmPEs%Cysj*@0fxdvy%cgI`!b2kzVy}lf@h*;P&Af9p z%PqUrb46xkDfh1R(frFY&7_uju6S!><=>Zmd)?bz1r1X#JWp8CR%8E5=*@c3(x4WB zSljc}wTm-9|7FhlcYbdD!o;7ao}WJWNBs0h#r>WCZ(W|^VE@uEK0Iby=#_s)pp>dw z;u=wsl30>zm0Xkxq!^403{7+mEOd=bLktbAOf0Po%ykV+tPBhUuWoySq9HdwB{QuO Vw}ylcz6hWO22WQ%mvv4FO#nk!t^)u7 literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_AutoHide.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_AutoHide.png new file mode 100644 index 0000000000000000000000000000000000000000..771db310d83f5244c74e959c8392f629e893f6f3 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~q2qYMeauhWIDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&V7%KUyadRT z^K@|x;kcgsX>IlUCFTCG8P9N3GKgeI{~>iKW6^FVpi0#e*NBpo#FA92 zbSp08=E|E9o_!m!i9aRw7ZvY*uRe3hRnK-H=xt`Q|E zi6yC4$wjF^iowXh&_vh3Lf6PN#L&>n#L~*ZT-U(F%D_PI>b55+8glbfGSez?Ye?we RivVh1@O1TaS?83{1OV5hMh^f0 literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Dock.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Dock.png new file mode 100644 index 0000000000000000000000000000000000000000..c1b54b7628f8619b186a2122ac39a57a400ee138 GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~q2qYMeauhWIDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&V7%KUyadRT z^>lFz;kcgs?48kei>9nO2EgLqZ2%1W*Hm Mr>mdKI;Vst06ObNIsgCw literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Option.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_Option.png new file mode 100644 index 0000000000000000000000000000000000000000..455c453a48d649c681b1c7504a7680ef24c3d1f0 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~q2qYMeauhWIDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&V7%KUyadRT z_H=O!;kcgsLD-%mA19M#i6DtD)!K>SzplHa=PsvQH#H}HrgD(Q8fx*+& K&t;ucLK6TA^F&Vo literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_OptionOverflow.png b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Resources/DockPane_OptionOverflow.png new file mode 100644 index 0000000000000000000000000000000000000000..84619ba1396d9eed499873acd1732efd0b32ba7a GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~q2qYMeauhWIDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&V7%KUyadRT z^K@|x;kcgs2X|lFR0j`)%4-Wh9jQklRqCP@Pk` zom{eI7N(h*Hm$RZ&1DoTg{YkM=kJf-=kvVp^Stlp^ZfUG-uH&9%jwOUdo%$6*o<(r zcUQ9akJx0RWKF0bo_RBFz9mA`}2- z0|3CP3;=ekI&~{ zx_+CGS$iq{c0y`Z%$16WmdLZwn=GFfuX48CeQkun)yE{nc35m6)#$roa>1sAf$&!zLulEz%G za8Su3h)XO7+^bXZOxxH&E|=TRl(sP^+LaiRcCseBSd*PBS?BO%=dg^%nW1u~shk;_ zvX4$PUeER^!JB39W|@Nb%s20uf_Ka}@7SURws3(hQVjnPiecdbcj5zA@{ud~Fs2j} zA9=Dx6uJqCZbG3O;h1hXwi}M=0)X}5;o3MJ}tX&AmJI3X`E`lfIAb+2HOdjQeJ7w_bi0QZQtbB%HHu;ahj@3TuoK-y*#r*|Jg5k_%3_4*Pk_eN7v zTIxVxwlRal;VoN{bgHLDyT%?awKp4k{hEL`D+MJGt%Wve$5fZU=;$*l%^&md`7n}Y zsQCG*@5HtIxA=9?7Mo8BNWRUbPy7*VKJ0_+%uDsOUoyqLsnTCvD0-Jy%R_63->>gP zSJ@=4)|dJx>26kg!J>t-s=-&^f3_4}o_mjH`5#S@{JSh%2cDU@1Li}H2e${7Z89Ic zsII67g^d5k>=T2f-g)3`+HQTt(S6f21A+~$H&7*ShE$aH+omFnnZ|Lb+m0d}m0avZ zLsvN6KNPhEW)JQNxx7*+nfL4EaE_eGbAD9QV zY<+z>fD3`zbp|zwF;9;6utACmjv4=ezQXBcW;>>4?!%`NPlVW&ZJgAXAScHdIjZ>k zEejx^<-rni%C}Q0E3>V0ZT)-NJwE#PWW;V1$MS#nnO;o=>u3k!z}o9;g$OcQ9b~De z>DzK{{|<`*`vFJp6`N~^JVFHP@7r-@7e?Jfd={Wg|)SO@4KQc8J1SZ9Jj_WP?lG}YMAW) z?5D-LrW%8bUODX7wcAqvAOfzh&FWQ+Nq=?dC*+bjZ8HAgU^XYx^Q@q|(D_lr*uB&i z&FRgtqkT;kUhWucD|h2|Qn|MZHA&Zprpui1r;!RPn0HmHb6Zj&*scO{0zd0fMlQjn zP_;Un`-bZ4TOd1Zj0qYuT*=Z6Bj@`Zm?8i>DfYf3iz%Obz7Z0h5;0**))`py%tdf=jFhKnuLJR_g(MBgsV1_p|oIP{wrEJC*oo$^Dr700~A7IhVd2hrC^gy8~TKCLe z2!^gu&^2Cb?nQ^2{NhZ9@lv(-d0lCqPb7lR`_kk87-&xnOV3K4E`8K7?=4!@&6_>n zBNqrZmc0ulsb?r^Pk|Rzde-mwf1UOhq{P&|IxfHm5Q)UoU?eCA2GXP7&_A<~K0jYp zxKzwy5Kr(=&$IV4DpLmG?d-`1YjgW^W2y0?o4= +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WeifenLuo.WinFormsUI.ThemeVS2005.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Docking. + /// + internal static string Category_Docking { + get { + return ResourceManager.GetString("Category_Docking", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Docking Notification. + /// + internal static string Category_DockingNotification { + get { + return ResourceManager.GetString("Category_DockingNotification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property Changed. + /// + internal static string Category_PropertyChanged { + get { + return ResourceManager.GetString("Category_PropertyChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Determines if end user drag and drop docking is allowed.. + /// + internal static string DockContent_AllowEndUserDocking_Description { + get { + return ResourceManager.GetString("DockContent_AllowEndUserDocking_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The size to display the content in auto hide mode. Value < 1 to specify the size in portion; value >= 1 to specify the size in pixel.. + /// + internal static string DockContent_AutoHidePortion_Description { + get { + return ResourceManager.GetString("DockContent_AutoHidePortion_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enable/Disable the close button of the content.. + /// + internal static string DockContent_CloseButton_Description { + get { + return ResourceManager.GetString("DockContent_CloseButton_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gets or sets a value indicating in which area of the DockPanel the content allowed to show.. + /// + internal static string DockContent_DockAreas_Description { + get { + return ResourceManager.GetString("DockContent_DockAreas_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occurs when the value of DockState property changed.. + /// + internal static string DockContent_DockStateChanged_Description { + get { + return ResourceManager.GetString("DockContent_DockStateChanged_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indicates the content will be hidden instead of being closed.. + /// + internal static string DockContent_HideOnClose_Description { + get { + return ResourceManager.GetString("DockContent_HideOnClose_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The desired docking state when first showing.. + /// + internal static string DockContent_ShowHint_Description { + get { + return ResourceManager.GetString("DockContent_ShowHint_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Context menu displayed for the dock pane tab strip.. + /// + internal static string DockContent_TabPageContextMenu_Description { + get { + return ResourceManager.GetString("DockContent_TabPageContextMenu_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The tab text displayed in the dock pane. If not set, the Text property will be used.. + /// + internal static string DockContent_TabText_Description { + get { + return ResourceManager.GetString("DockContent_TabText_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The text displayed when mouse hovers over the tab.. + /// + internal static string DockContent_ToolTipText_Description { + get { + return ResourceManager.GetString("DockContent_ToolTipText_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Context menu displayed for the dock pane tab strip.. + /// + internal static string DockHandler_TabPageContextMenuStrip_Description { + get { + return ResourceManager.GetString("DockHandler_TabPageContextMenuStrip_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Press SHIFT for docking to full side.. + /// + internal static string DockIndicator_ToolTipText { + get { + return ResourceManager.GetString("DockIndicator_ToolTipText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FloatWindow property can not be set to "null" when DockState is DockState.Float.. + /// + internal static string DockPane_FloatWindow_InvalidValue { + get { + return ResourceManager.GetString("DockPane_FloatWindow_InvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto Hide. + /// + internal static string DockPaneCaption_ToolTipAutoHide { + get { + return ResourceManager.GetString("DockPaneCaption_ToolTipAutoHide", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close. + /// + internal static string DockPaneCaption_ToolTipClose { + get { + return ResourceManager.GetString("DockPaneCaption_ToolTipClose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Options. + /// + internal static string DockPaneCaption_ToolTipOptions { + get { + return ResourceManager.GetString("DockPaneCaption_ToolTipOptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close. + /// + internal static string DockPaneStrip_ToolTipClose { + get { + return ResourceManager.GetString("DockPaneStrip_ToolTipClose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Window List. + /// + internal static string DockPaneStrip_ToolTipWindowList { + get { + return ResourceManager.GetString("DockPaneStrip_ToolTipWindowList", resourceCulture); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Strings.resx b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Strings.resx new file mode 100644 index 000000000..f40c70f3d --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/Strings.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Docking + + + Docking Notification + + + Property Changed + + + Determines if end user drag and drop docking is allowed. + + + The size to display the content in auto hide mode. Value < 1 to specify the size in portion; value >= 1 to specify the size in pixel. + + + Enable/Disable the close button of the content. + + + Gets or sets a value indicating in which area of the DockPanel the content allowed to show. + + + Occurs when the value of DockState property changed. + + + Indicates the content will be hidden instead of being closed. + + + The desired docking state when first showing. + + + Context menu displayed for the dock pane tab strip. + + + The tab text displayed in the dock pane. If not set, the Text property will be used. + + + The text displayed when mouse hovers over the tab. + + + Context menu displayed for the dock pane tab strip. + + + Press SHIFT for docking to full side. + + + FloatWindow property can not be set to "null" when DockState is DockState.Float. + + + Auto Hide + + + Close + + + Options + + + Close + + + Window List + + \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideStrip.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideStrip.cs new file mode 100644 index 000000000..26758c035 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideStrip.cs @@ -0,0 +1,542 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ToolboxItem(false)] + internal class VS2005AutoHideStrip : AutoHideStripBase + { + private class TabVS2005 : Tab + { + internal TabVS2005(IDockContent content) + : base(content) + { + } + + private int m_tabX = 0; + public int TabX + { + get { return m_tabX; } + set { m_tabX = value; } + } + + private int m_tabWidth = 0; + public int TabWidth + { + get { return m_tabWidth; } + set { m_tabWidth = value; } + } + + } + + private const int _ImageHeight = 16; + private const int _ImageWidth = 16; + private const int _ImageGapTop = 2; + private const int _ImageGapLeft = 4; + private const int _ImageGapRight = 2; + private const int _ImageGapBottom = 2; + private const int _TextGapLeft = 0; + private const int _TextGapRight = 0; + private const int _TabGapTop = 3; + private const int _TabGapLeft = 4; + private const int _TabGapBetween = 10; + + #region Customizable Properties + public Font TextFont + { + get { return DockPanel.Theme.Skin.AutoHideStripSkin.TextFont; } + } + + private static StringFormat _stringFormatTabHorizontal; + private StringFormat StringFormatTabHorizontal + { + get + { + if (_stringFormatTabHorizontal == null) + { + _stringFormatTabHorizontal = new StringFormat(); + _stringFormatTabHorizontal.Alignment = StringAlignment.Near; + _stringFormatTabHorizontal.LineAlignment = StringAlignment.Center; + _stringFormatTabHorizontal.FormatFlags = StringFormatFlags.NoWrap; + _stringFormatTabHorizontal.Trimming = StringTrimming.None; + } + + if (RightToLeft == RightToLeft.Yes) + _stringFormatTabHorizontal.FormatFlags |= StringFormatFlags.DirectionRightToLeft; + else + _stringFormatTabHorizontal.FormatFlags &= ~StringFormatFlags.DirectionRightToLeft; + + return _stringFormatTabHorizontal; + } + } + + private static StringFormat _stringFormatTabVertical; + private StringFormat StringFormatTabVertical + { + get + { + if (_stringFormatTabVertical == null) + { + _stringFormatTabVertical = new StringFormat(); + _stringFormatTabVertical.Alignment = StringAlignment.Near; + _stringFormatTabVertical.LineAlignment = StringAlignment.Center; + _stringFormatTabVertical.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.DirectionVertical; + _stringFormatTabVertical.Trimming = StringTrimming.None; + } + if (RightToLeft == RightToLeft.Yes) + _stringFormatTabVertical.FormatFlags |= StringFormatFlags.DirectionRightToLeft; + else + _stringFormatTabVertical.FormatFlags &= ~StringFormatFlags.DirectionRightToLeft; + + return _stringFormatTabVertical; + } + } + + private static int ImageHeight + { + get { return _ImageHeight; } + } + + private static int ImageWidth + { + get { return _ImageWidth; } + } + + private static int ImageGapTop + { + get { return _ImageGapTop; } + } + + private static int ImageGapLeft + { + get { return _ImageGapLeft; } + } + + private static int ImageGapRight + { + get { return _ImageGapRight; } + } + + private static int ImageGapBottom + { + get { return _ImageGapBottom; } + } + + private static int TextGapLeft + { + get { return _TextGapLeft; } + } + + private static int TextGapRight + { + get { return _TextGapRight; } + } + + private static int TabGapTop + { + get { return _TabGapTop; } + } + + private static int TabGapLeft + { + get { return _TabGapLeft; } + } + + private static int TabGapBetween + { + get { return _TabGapBetween; } + } + + private static Pen PenTabBorder + { + get { return SystemPens.GrayText; } + } + #endregion + + private static Matrix _matrixIdentity = new Matrix(); + private static Matrix MatrixIdentity + { + get { return _matrixIdentity; } + } + + private static DockState[] _dockStates; + private static DockState[] DockStates + { + get + { + if (_dockStates == null) + { + _dockStates = new DockState[4]; + _dockStates[0] = DockState.DockLeftAutoHide; + _dockStates[1] = DockState.DockRightAutoHide; + _dockStates[2] = DockState.DockTopAutoHide; + _dockStates[3] = DockState.DockBottomAutoHide; + } + return _dockStates; + } + } + + private static GraphicsPath _graphicsPath; + internal static GraphicsPath GraphicsPath + { + get + { + if (_graphicsPath == null) + _graphicsPath = new GraphicsPath(); + + return _graphicsPath; + } + } + + public VS2005AutoHideStrip(DockPanel panel) + : base(panel) + { + SetStyle(ControlStyles.ResizeRedraw | + ControlStyles.UserPaint | + ControlStyles.AllPaintingInWmPaint | + ControlStyles.OptimizedDoubleBuffer, true); + BackColor = SystemColors.ControlLight; + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + Graphics g = e.Graphics; + + Color startColor = DockPanel.Theme.Skin.AutoHideStripSkin.DockStripGradient.StartColor; + Color endColor = DockPanel.Theme.Skin.AutoHideStripSkin.DockStripGradient.EndColor; + LinearGradientMode gradientMode = DockPanel.Theme.Skin.AutoHideStripSkin.DockStripGradient.LinearGradientMode; + ClientRectangle.SafelyDrawLinearGradient(startColor, endColor, gradientMode, g); + + 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 (Pane pane in GetPanes(dockState)) + { + foreach (TabVS2005 tab in pane.AutoHideTabs) + 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); + + int x = TabGapLeft + rectTabStrip.X; + foreach (Pane pane in GetPanes(dockState)) + { + foreach (TabVS2005 tab in pane.AutoHideTabs) + { + int width = imageWidth + ImageGapLeft + ImageGapRight + + TextRenderer.MeasureText(tab.Content.DockHandler.TabText, TextFont).Width + + TextGapLeft + TextGapRight; + tab.TabX = x; + tab.TabWidth = width; + x += width; + } + + x += TabGapBetween; + } + } + + private Rectangle RtlTransform(Rectangle rect, DockState dockState) + { + Rectangle rectTransformed; + if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide) + rectTransformed = rect; + else + rectTransformed = DrawHelper.RtlTransform(this, rect); + + return rectTransformed; + } + + private GraphicsPath GetTabOutline(TabVS2005 tab, bool transformed, bool rtlTransform) + { + DockState dockState = tab.Content.DockHandler.DockState; + Rectangle rectTab = GetTabRectangle(tab, transformed); + if (rtlTransform) + rectTab = RtlTransform(rectTab, dockState); + bool upTab = (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockBottomAutoHide); + DrawHelper.GetRoundedCornerTab(GraphicsPath, rectTab, upTab); + + return GraphicsPath; + } + + private void DrawTab(Graphics g, TabVS2005 tab) + { + Rectangle rectTabOrigin = GetTabRectangle(tab); + if (rectTabOrigin.IsEmpty) + return; + + DockState dockState = tab.Content.DockHandler.DockState; + IDockContent content = tab.Content; + + GraphicsPath path = GetTabOutline(tab, false, true); + Color startColor = DockPanel.Theme.Skin.AutoHideStripSkin.TabGradient.StartColor; + Color endColor = DockPanel.Theme.Skin.AutoHideStripSkin.TabGradient.EndColor; + LinearGradientMode gradientMode = DockPanel.Theme.Skin.AutoHideStripSkin.TabGradient.LinearGradientMode; + using (LinearGradientBrush brushPath = new LinearGradientBrush(rectTabOrigin, startColor, endColor, gradientMode)) + { + g.FillPath(brushPath, path); + } + + g.DrawPath(PenTabBorder, path); + + // Set no rotate for drawing icon and text + using (Matrix matrixRotate = g.Transform) + { + g.Transform = MatrixIdentity; + + // Draw the icon + Rectangle rectImage = rectTabOrigin; + rectImage.X += ImageGapLeft; + rectImage.Y += ImageGapTop; + int imageHeight = rectTabOrigin.Height - ImageGapTop - ImageGapBottom; + int imageWidth = ImageWidth; + if (imageHeight > ImageHeight) + imageWidth = ImageWidth * (imageHeight / ImageHeight); + rectImage.Height = imageHeight; + rectImage.Width = imageWidth; + rectImage = GetTransformedRectangle(dockState, rectImage); + + if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide) + { + // The DockState is DockLeftAutoHide or DockRightAutoHide, so rotate the image 90 degrees to the right. + Rectangle rectTransform = RtlTransform(rectImage, dockState); + Point[] rotationPoints = + { + new Point(rectTransform.X + rectTransform.Width, rectTransform.Y), + new Point(rectTransform.X + rectTransform.Width, rectTransform.Y + rectTransform.Height), + new Point(rectTransform.X, rectTransform.Y) + }; + + using (Icon rotatedIcon = new Icon(((Form)content).Icon, 16, 16)) + { + g.DrawImage(rotatedIcon.ToBitmap(), rotationPoints); + } + } + else + { + // Draw the icon normally without any rotation. + g.DrawIcon(((Form)content).Icon, RtlTransform(rectImage, dockState)); + } + + // Draw the text + Rectangle rectText = rectTabOrigin; + rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft; + rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft; + rectText = RtlTransform(GetTransformedRectangle(dockState, rectText), dockState); + + Color textColor = DockPanel.Theme.Skin.AutoHideStripSkin.TabGradient.TextColor; + + if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide) + g.DrawString(content.DockHandler.TabText, TextFont, new SolidBrush(textColor), rectText, StringFormatTabVertical); + else + g.DrawString(content.DockHandler.TabText, TextFont, new SolidBrush(textColor), rectText, StringFormatTabHorizontal); + + // Set rotate back + g.Transform = matrixRotate; + } + } + + 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 (width == 0 || height == 0) + { + return Rectangle.Empty; + } + + var rect = new Rectangle(x, y, width, height); + return transformed ? GetTransformedRectangle(dockState, rect) : rect; + } + + private Rectangle GetTabRectangle(TabVS2005 tab) + { + return GetTabRectangle(tab, false); + } + + private Rectangle GetTabRectangle(TabVS2005 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 = 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); + using (var 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 HitTest(Point point) + { + foreach (DockState state in DockStates) + { + Rectangle rectTabStrip = GetLogicalTabStripRectangle(state, true); + if (!rectTabStrip.Contains(point)) + continue; + + foreach (Pane pane in GetPanes(state)) + { + foreach (TabVS2005 tab in pane.AutoHideTabs) + { + GraphicsPath path = GetTabOutline(tab, true, true); + if (path.IsVisible(point)) + return tab.Content; + } + } + } + + return null; + } + + protected override Rectangle GetTabBounds(Tab tab) + { + GraphicsPath path = GetTabOutline((TabVS2005)tab, true, true); + RectangleF bounds = path.GetBounds(); + return new Rectangle((int)bounds.Left, (int)bounds.Top, (int)bounds.Width, (int)bounds.Height); + } + + protected override int MeasureHeight() + { + return Math.Max(ImageGapBottom + + ImageGapTop + ImageHeight, + TextFont.Height) + TabGapTop; + } + + protected override void OnRefreshChanges() + { + CalculateTabs(); + Invalidate(); + } + + protected override AutoHideStripBase.Tab CreateTab(IDockContent content) + { + return new TabVS2005(content); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowControl.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowControl.cs new file mode 100644 index 000000000..22504f4fa --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowControl.cs @@ -0,0 +1,10 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanel; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowFactory.cs new file mode 100644 index 000000000..b2169e725 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005AutoHideWindowFactory.cs @@ -0,0 +1,90 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanel; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + public class VS2005AutoHideWindowFactory : IAutoHideWindowFactory + { + public DockPanel.AutoHideWindowControl CreateAutoHideWindow(DockPanel panel) + { + return new VS2005AutoHideWindowControl(panel); + } + + [ToolboxItem(false)] + private class VS2005AutoHideWindowControl : AutoHideWindowControl + { + public VS2005AutoHideWindowControl(DockPanel dockPanel) : base(dockPanel) + { + } + + protected override void OnLayout(LayoutEventArgs levent) + { + DockPadding.All = 0; + if (DockState == DockState.DockLeftAutoHide) + { + DockPadding.Right = 2; + m_splitter.Dock = DockStyle.Right; + } + else if (DockState == DockState.DockRightAutoHide) + { + DockPadding.Left = 2; + m_splitter.Dock = DockStyle.Left; + } + else if (DockState == DockState.DockTopAutoHide) + { + DockPadding.Bottom = 2; + m_splitter.Dock = DockStyle.Bottom; + } + else if (DockState == DockState.DockBottomAutoHide) + { + DockPadding.Top = 2; + m_splitter.Dock = DockStyle.Top; + } + + Rectangle rectDisplaying = DisplayingRectangle; + Rectangle rectHidden = new Rectangle(-rectDisplaying.Width, rectDisplaying.Y, rectDisplaying.Width, rectDisplaying.Height); + foreach (Control c in Controls) + { + DockPane pane = c as DockPane; + if (pane == null) + continue; + + + if (pane == ActivePane) + pane.Bounds = rectDisplaying; + else + pane.Bounds = rectHidden; + } + + base.OnLayout(levent); + } + + protected override void OnPaint(PaintEventArgs e) + { + // Draw the border + Graphics g = e.Graphics; + + if (DockState == DockState.DockBottomAutoHide) + g.DrawLine(SystemPens.ControlLightLight, 0, 1, ClientRectangle.Right, 1); + else if (DockState == DockState.DockRightAutoHide) + g.DrawLine(SystemPens.ControlLightLight, 1, 0, 1, ClientRectangle.Bottom); + else if (DockState == DockState.DockTopAutoHide) + { + g.DrawLine(SystemPens.ControlDark, 0, ClientRectangle.Height - 2, ClientRectangle.Right, ClientRectangle.Height - 2); + g.DrawLine(SystemPens.ControlDarkDark, 0, ClientRectangle.Height - 1, ClientRectangle.Right, ClientRectangle.Height - 1); + } + else if (DockState == DockState.DockLeftAutoHide) + { + g.DrawLine(SystemPens.ControlDark, ClientRectangle.Width - 2, 0, ClientRectangle.Width - 2, ClientRectangle.Bottom); + g.DrawLine(SystemPens.ControlDarkDark, ClientRectangle.Width - 1, 0, ClientRectangle.Width - 1, ClientRectangle.Bottom); + } + + base.OnPaint(e); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockIndicatorFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockIndicatorFactory.cs new file mode 100644 index 000000000..527316042 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockIndicatorFactory.cs @@ -0,0 +1,14 @@ +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanel.DockDragHandler; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + public class VS2005DockIndicatorFactory : IDockIndicatorFactory + { + public DockIndicator CreateDockIndicator(DockPanel.DockDragHandler dockDragHandler) + { + return new DockIndicator(dockDragHandler); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockOutlineFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockOutlineFactory.cs new file mode 100644 index 000000000..927d3edaa --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockOutlineFactory.cs @@ -0,0 +1,166 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + public class VS2005DockOutlineFactory : IDockOutlineFactory + { + public DockOutlineBase CreateDockOutline() + { + return new VS2005DockOutline(); + } + + private class VS2005DockOutline : DockOutlineBase + { + public VS2005DockOutline() + { + m_dragForm = new DragForm(); + SetDragForm(Rectangle.Empty); + DragForm.BackColor = SystemColors.ActiveCaption; + 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 = dockPanel.GetDockWindowSize(DockState.DockTop); + rect = new Rectangle(rect.X, rect.Y, rect.Width, height); + } + else if (dock == DockStyle.Bottom) + { + int height = dockPanel.GetDockWindowSize(DockState.DockBottom); + rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height); + } + else if (dock == DockStyle.Left) + { + int width = dockPanel.GetDockWindowSize(DockState.DockLeft); + rect = new Rectangle(rect.X, rect.Y, width, rect.Height); + } + else if (dock == DockStyle.Right) + { + int width = dockPanel.GetDockWindowSize(DockState.DockRight); + 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.GetOutline(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) + { + if (DragForm.Region != null) + { + DragForm.Region.Dispose(); + } + + DragForm.Region = new Region(Rectangle.Empty); + } + else if (DragForm.Region != null) + { + DragForm.Region.Dispose(); + DragForm.Region = null; + } + } + + private void SetDragForm(Rectangle rect, Region region) + { + DragForm.Bounds = rect; + DragForm.Region = region; + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneCaption.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneCaption.cs new file mode 100644 index 000000000..5acaa3acd --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneCaption.cs @@ -0,0 +1,485 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using System.ComponentModel; +using WeifenLuo.WinFormsUI.ThemeVS2005; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ToolboxItem(false)] + internal class VS2005DockPaneCaption : DockPaneCaptionBase + { + [ToolboxItem(false)] + private sealed class InertButton : InertButtonBase + { + private Bitmap m_image, m_imageAutoHide; + + public InertButton(VS2005DockPaneCaption dockPaneCaption, Bitmap image, Bitmap imageAutoHide) + : base() + { + m_dockPaneCaption = dockPaneCaption; + m_image = image; + m_imageAutoHide = imageAutoHide; + RefreshChanges(); + } + + private VS2005DockPaneCaption m_dockPaneCaption; + private VS2005DockPaneCaption DockPaneCaption + { + get { return m_dockPaneCaption; } + } + + public bool IsAutoHide + { + get { return DockPaneCaption.DockPane.IsAutoHide; } + } + + public override Bitmap Image + { + get { return IsAutoHide ? m_imageAutoHide : m_image; } + } + + public override Bitmap HoverImage + { + get { return null; } + } + + public override Bitmap PressImage + { + get { return null; } + } + + protected override void OnRefreshChanges() + { + if (DockPaneCaption.DockPane.DockPanel != null) + { + if (DockPaneCaption.TextColor != ForeColor) + { + ForeColor = DockPaneCaption.TextColor; + Invalidate(); + } + } + } + } + + #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; + #endregion + + private static Bitmap _imageButtonClose; + private static Bitmap ImageButtonClose + { + get + { + if (_imageButtonClose == null) + _imageButtonClose = Resources.DockPane_Close; + + return _imageButtonClose; + } + } + + private InertButton m_buttonClose; + private InertButton ButtonClose + { + get + { + if (m_buttonClose == null) + { + m_buttonClose = new InertButton(this, ImageButtonClose, ImageButtonClose); + m_toolTip.SetToolTip(m_buttonClose, ToolTipClose); + m_buttonClose.Click += new EventHandler(Close_Click); + Controls.Add(m_buttonClose); + } + + return m_buttonClose; + } + } + + private static Bitmap _imageButtonAutoHide; + private static Bitmap ImageButtonAutoHide + { + get + { + if (_imageButtonAutoHide == null) + _imageButtonAutoHide = Resources.DockPane_AutoHide; + + return _imageButtonAutoHide; + } + } + + private static Bitmap _imageButtonDock; + private static Bitmap ImageButtonDock + { + get + { + if (_imageButtonDock == null) + _imageButtonDock = Resources.DockPane_Dock; + + return _imageButtonDock; + } + } + + private InertButton m_buttonAutoHide; + private InertButton ButtonAutoHide + { + get + { + if (m_buttonAutoHide == null) + { + m_buttonAutoHide = new InertButton(this, ImageButtonDock, ImageButtonAutoHide); + m_toolTip.SetToolTip(m_buttonAutoHide, ToolTipAutoHide); + m_buttonAutoHide.Click += new EventHandler(AutoHide_Click); + Controls.Add(m_buttonAutoHide); + } + + return m_buttonAutoHide; + } + } + + private static Bitmap _imageButtonOptions; + private static Bitmap ImageButtonOptions + { + get + { + if (_imageButtonOptions == null) + _imageButtonOptions = Resources.DockPane_Option; + + return _imageButtonOptions; + } + } + + private InertButton m_buttonOptions; + private InertButton ButtonOptions + { + get + { + if (m_buttonOptions == null) + { + m_buttonOptions = new InertButton(this, ImageButtonOptions, ImageButtonOptions); + m_toolTip.SetToolTip(m_buttonOptions, ToolTipOptions); + m_buttonOptions.Click += new EventHandler(Options_Click); + Controls.Add(m_buttonOptions); + } + return m_buttonOptions; + } + } + + private IContainer m_components; + private IContainer Components + { + get { return m_components; } + } + + private ToolTip m_toolTip; + + public VS2005DockPaneCaption(DockPane pane) : base(pane) + { + SuspendLayout(); + + m_components = new Container(); + m_toolTip = new ToolTip(Components); + + ResumeLayout(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + Components.Dispose(); + base.Dispose(disposing); + } + + private static int TextGapTop + { + get { return _TextGapTop; } + } + + public Font TextFont + { + get { return DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.TextFont; } + } + + private static int TextGapBottom + { + get { return _TextGapBottom; } + } + + private static int TextGapLeft + { + get { return _TextGapLeft; } + } + + private static int TextGapRight + { + get { return _TextGapRight; } + } + + private static int ButtonGapTop + { + get { return _ButtonGapTop; } + } + + private static int ButtonGapBottom + { + get { return _ButtonGapBottom; } + } + + private static int ButtonGapLeft + { + get { return _ButtonGapLeft; } + } + + private static int ButtonGapRight + { + get { return _ButtonGapRight; } + } + + private static int ButtonGapBetween + { + get { return _ButtonGapBetween; } + } + + private static string _toolTipClose; + private static string ToolTipClose + { + get + { + if (_toolTipClose == null) + _toolTipClose = Strings.DockPaneCaption_ToolTipClose; + return _toolTipClose; + } + } + + private static string _toolTipOptions; + private static string ToolTipOptions + { + get + { + if (_toolTipOptions == null) + _toolTipOptions = Strings.DockPaneCaption_ToolTipOptions; + + return _toolTipOptions; + } + } + + private static string _toolTipAutoHide; + private static string ToolTipAutoHide + { + get + { + if (_toolTipAutoHide == null) + _toolTipAutoHide = Strings.DockPaneCaption_ToolTipAutoHide; + return _toolTipAutoHide; + } + } + + private static Blend _activeBackColorGradientBlend; + private static Blend ActiveBackColorGradientBlend + { + get + { + if (_activeBackColorGradientBlend == null) + { + Blend blend = new Blend(2); + + blend.Factors = new float[]{0.5F, 1.0F}; + blend.Positions = new float[]{0.0F, 1.0F}; + _activeBackColorGradientBlend = blend; + } + + return _activeBackColorGradientBlend; + } + } + + private Color TextColor + { + get + { + if (DockPane.IsActivated) + return DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor; + else + return DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor; + } + } + + private static TextFormatFlags _textFormat = + TextFormatFlags.SingleLine | + TextFormatFlags.EndEllipsis | + TextFormatFlags.VerticalCenter; + private TextFormatFlags TextFormat + { + get + { + if (RightToLeft == RightToLeft.No) + return _textFormat; + else + return _textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right; + } + } + + protected override int MeasureHeight() + { + int height = TextFont.Height + TextGapTop + TextGapBottom; + + if (height < ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom) + height = ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom; + + return height; + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint (e); + DrawCaption(e.Graphics); + } + + private void DrawCaption(Graphics g) + { + if (ClientRectangle.Width == 0 || ClientRectangle.Height == 0) + return; + + if (DockPane.IsActivated) + { + Color startColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.StartColor; + Color endColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.EndColor; + LinearGradientMode gradientMode = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.LinearGradientMode; + ClientRectangle.SafelyDrawLinearGradient(startColor, endColor, gradientMode, g, ActiveBackColorGradientBlend); + } + else + { + Color startColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.StartColor; + Color endColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.EndColor; + LinearGradientMode gradientMode = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.LinearGradientMode; + ClientRectangle.SafelyDrawLinearGradient(startColor, endColor, gradientMode, g); + } + + Rectangle rectCaption = ClientRectangle; + + Rectangle rectCaptionText = rectCaption; + rectCaptionText.X += TextGapLeft; + rectCaptionText.Width -= TextGapLeft + TextGapRight; + rectCaptionText.Width -= ButtonGapLeft + ButtonClose.Width + ButtonGapRight; + if (ShouldShowAutoHideButton) + rectCaptionText.Width -= ButtonAutoHide.Width + ButtonGapBetween; + if (HasTabPageContextMenu) + rectCaptionText.Width -= ButtonOptions.Width + ButtonGapBetween; + rectCaptionText.Y += TextGapTop; + rectCaptionText.Height -= TextGapTop + TextGapBottom; + + Color colorText; + if (DockPane.IsActivated) + colorText = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor; + else + colorText = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor; + + TextRenderer.DrawText(g, DockPane.CaptionText, TextFont, DrawHelper.RtlTransform(this, rectCaptionText), colorText, TextFormat); + } + + protected override void OnLayout(LayoutEventArgs levent) + { + SetButtonsPosition(); + base.OnLayout (levent); + } + + protected override void OnRefreshChanges() + { + SetButtons(); + Invalidate(); + } + + private bool CloseButtonEnabled + { + get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false; } + } + + /// + /// Determines whether the close button is visible on the content + /// + private bool CloseButtonVisible + { + get { return (DockPane.ActiveContent != null) ? DockPane.ActiveContent.DockHandler.CloseButtonVisible : false; } + } + + private bool ShouldShowAutoHideButton + { + get { return !DockPane.IsFloat; } + } + + private void SetButtons() + { + ButtonClose.Enabled = CloseButtonEnabled; + ButtonClose.Visible = CloseButtonVisible; + ButtonAutoHide.Visible = ShouldShowAutoHideButton; + ButtonOptions.Visible = HasTabPageContextMenu; + ButtonClose.RefreshChanges(); + ButtonAutoHide.RefreshChanges(); + ButtonOptions.RefreshChanges(); + + SetButtonsPosition(); + } + + private void SetButtonsPosition() + { + // set the size and location for close and auto-hide buttons + Rectangle rectCaption = ClientRectangle; + int buttonWidth = ButtonClose.Image.Width; + int buttonHeight = ButtonClose.Image.Height; + int height = rectCaption.Height - ButtonGapTop - ButtonGapBottom; + if (buttonHeight < height) + { + buttonWidth = buttonWidth * height / buttonHeight; + buttonHeight = height; + } + Size buttonSize = new Size(buttonWidth, buttonHeight); + int x = rectCaption.X + rectCaption.Width - 1 - ButtonGapRight - m_buttonClose.Width; + int y = rectCaption.Y + ButtonGapTop; + Point point = new Point(x, y); + ButtonClose.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); + + // If the close button is not visible draw the auto hide button overtop. + // Otherwise it is drawn to the left of the close button. + if (CloseButtonVisible) + point.Offset(-(buttonWidth + ButtonGapBetween), 0); + + ButtonAutoHide.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); + if (ShouldShowAutoHideButton) + point.Offset(-(buttonWidth + ButtonGapBetween), 0); + ButtonOptions.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); + } + + 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 (DockHelper.IsDockStateAutoHide(DockPane.DockState)) + { + DockPane.DockPanel.ActiveAutoHideContent = null; + DockPane.NestedDockingStatus.NestedPanes.SwitchPaneWithFirstChild(DockPane); + } + } + + private void Options_Click(object sender, EventArgs e) + { + ShowTabPageContextMenu(PointToClient(Control.MousePosition)); + } + + protected override void OnRightToLeftChanged(EventArgs e) + { + base.OnRightToLeftChanged(e); + PerformLayout(); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneSplitterControlFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneSplitterControlFactory.cs new file mode 100644 index 000000000..66214fba5 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneSplitterControlFactory.cs @@ -0,0 +1,40 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPane; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + internal class VS2005DockPaneSplitterControlFactory : IDockPaneSplitterControlFactory + { + public SplitterControlBase CreateSplitterControl(DockPane pane) + { + return new VS2005SplitterControl(pane); + } + + [ToolboxItem(false)] + internal class VS2005SplitterControl : SplitterControlBase + { + public VS2005SplitterControl(DockPane pane) : base(pane) + { + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + if (DockPane.DockState != DockState.Document) + return; + + Graphics g = e.Graphics; + Rectangle rect = ClientRectangle; + if (Alignment == DockAlignment.Top || Alignment == DockAlignment.Bottom) + g.DrawLine(SystemPens.ControlDark, rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1); + else if (Alignment == DockAlignment.Left || Alignment == DockAlignment.Right) + g.DrawLine(SystemPens.ControlDarkDark, rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneStrip.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneStrip.cs new file mode 100644 index 000000000..3c20b27c8 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockPaneStrip.cs @@ -0,0 +1,1584 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using System.ComponentModel; +using WeifenLuo.WinFormsUI.ThemeVS2005; + +namespace WeifenLuo.WinFormsUI.Docking +{ + [ToolboxItem(false)] + internal class VS2005DockPaneStrip : DockPaneStripBase + { + private class TabVS2005 : Tab + { + public TabVS2005(IDockContent content) + : base(content) + { + } + + private int m_tabX; + public int TabX + { + get { return m_tabX; } + set { m_tabX = value; } + } + + private int m_tabWidth; + public int TabWidth + { + get { return m_tabWidth; } + set { m_tabWidth = value; } + } + + private int m_maxWidth; + public 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; } + } + } + + protected override DockPaneStripBase.Tab CreateTab(IDockContent content) + { + return new TabVS2005(content); + } + + [ToolboxItem(false)] + private sealed class InertButton : InertButtonBase + { + private Bitmap m_image0, m_image1; + + public InertButton(Bitmap image0, Bitmap image1) + : base() + { + m_image0 = image0; + m_image1 = image1; + } + + private int m_imageCategory = 0; + public int ImageCategory + { + get { return m_imageCategory; } + set + { + if (m_imageCategory == value) + return; + + m_imageCategory = value; + Invalidate(); + } + } + + public override Bitmap Image + { + get { return ImageCategory == 0 ? m_image0 : m_image1; } + } + + public override Bitmap HoverImage + { + get { return null; } + } + + public override Bitmap PressImage + { + get { return null; } + } + } + + #region Constants + + private const int _ToolWindowStripGapTop = 0; + private const int _ToolWindowStripGapBottom = 1; + private const int _ToolWindowStripGapLeft = 0; + private const int _ToolWindowStripGapRight = 0; + private const int _ToolWindowImageHeight = 16; + private const int _ToolWindowImageWidth = 16; + private const int _ToolWindowImageGapTop = 3; + private const int _ToolWindowImageGapBottom = 1; + private const int _ToolWindowImageGapLeft = 2; + private const int _ToolWindowImageGapRight = 0; + private const int _ToolWindowTextGapRight = 3; + private const int _ToolWindowTabSeperatorGapTop = 3; + private const int _ToolWindowTabSeperatorGapBottom = 3; + + private const int _DocumentStripGapTop = 0; + private const int _DocumentStripGapBottom = 1; + private const int _DocumentTabMaxWidth = 600; + private const int _DocumentButtonGapTop = 4; + private const int _DocumentButtonGapBottom = 4; + private const int _DocumentButtonGapBetween = 0; + private const int _DocumentButtonGapRight = 3; + private const int _DocumentTabGapTop = 3; + private const int _DocumentTabGapLeft = 3; + private const int _DocumentTabGapRight = 3; + private const int _DocumentIconGapBottom = 2; + private const int _DocumentIconGapLeft = 8; + private const int _DocumentIconGapRight = 0; + private const int _DocumentIconHeight = 16; + private const int _DocumentIconWidth = 16; + private const int _DocumentTextGapRight = 3; + + #endregion + + #region Members + + private ContextMenuStrip m_selectMenu; + private static Bitmap m_imageButtonClose; + private InertButton m_buttonClose; + private static Bitmap m_imageButtonWindowList; + private static Bitmap m_imageButtonWindowListOverflow; + private InertButton m_buttonWindowList; + private IContainer m_components; + private ToolTip m_toolTip; + private Font m_font; + private Font m_boldFont; + private int m_startDisplayingTab = 0; + private int m_endDisplayingTab = 0; + private int m_firstDisplayingTab = 0; + private bool m_documentTabsOverflow = false; + private static string m_toolTipSelect; + private static string m_toolTipClose; + private bool m_closeButtonVisible = false; + private int _selectMenuMargin = 5; + + #endregion + + #region Properties + + private Rectangle TabStripRectangle + { + get + { + if (Appearance == DockPane.AppearanceStyle.Document) + return TabStripRectangle_Document; + else + return TabStripRectangle_ToolWindow; + } + } + + private Rectangle TabStripRectangle_ToolWindow + { + get + { + Rectangle rect = ClientRectangle; + return new Rectangle(rect.X, rect.Top + ToolWindowStripGapTop, rect.Width, rect.Height - ToolWindowStripGapTop - ToolWindowStripGapBottom); + } + } + + private Rectangle TabStripRectangle_Document + { + get + { + Rectangle rect = ClientRectangle; + return new Rectangle(rect.X, rect.Top + DocumentStripGapTop, rect.Width, rect.Height - DocumentStripGapTop - ToolWindowStripGapBottom); + } + } + + private Rectangle TabsRectangle + { + get + { + if (Appearance == DockPane.AppearanceStyle.ToolWindow) + return TabStripRectangle; + + Rectangle rectWindow = TabStripRectangle; + int x = rectWindow.X; + int y = rectWindow.Y; + int width = rectWindow.Width; + int height = rectWindow.Height; + + x += DocumentTabGapLeft; + width -= DocumentTabGapLeft + + DocumentTabGapRight + + DocumentButtonGapRight + + ButtonClose.Width + + ButtonWindowList.Width + + 2 * DocumentButtonGapBetween; + + return new Rectangle(x, y, width, height); + } + } + + private ContextMenuStrip SelectMenu + { + get { return m_selectMenu; } + } + + public int SelectMenuMargin + { + get { return _selectMenuMargin; } + set { _selectMenuMargin = value; } + } + + private static Bitmap ImageButtonClose + { + get + { + if (m_imageButtonClose == null) + m_imageButtonClose = Resources.DockPane_Close; + + return m_imageButtonClose; + } + } + + private InertButton ButtonClose + { + get + { + if (m_buttonClose == null) + { + m_buttonClose = new InertButton(ImageButtonClose, ImageButtonClose); + m_toolTip.SetToolTip(m_buttonClose, ToolTipClose); + m_buttonClose.Click += new EventHandler(Close_Click); + Controls.Add(m_buttonClose); + } + + return m_buttonClose; + } + } + + private static Bitmap ImageButtonWindowList + { + get + { + if (m_imageButtonWindowList == null) + m_imageButtonWindowList = Resources.DockPane_Option; + + return m_imageButtonWindowList; + } + } + + private static Bitmap ImageButtonWindowListOverflow + { + get + { + if (m_imageButtonWindowListOverflow == null) + m_imageButtonWindowListOverflow = Resources.DockPane_OptionOverflow; + + return m_imageButtonWindowListOverflow; + } + } + + private InertButton ButtonWindowList + { + get + { + if (m_buttonWindowList == null) + { + m_buttonWindowList = new InertButton(ImageButtonWindowList, ImageButtonWindowListOverflow); + m_toolTip.SetToolTip(m_buttonWindowList, ToolTipSelect); + m_buttonWindowList.Click += new EventHandler(WindowList_Click); + Controls.Add(m_buttonWindowList); + } + + return m_buttonWindowList; + } + } + + private static GraphicsPath GraphicsPath + { + get { return VS2005AutoHideStrip.GraphicsPath; } + } + + private IContainer Components + { + get { return m_components; } + } + + public Font TextFont + { + get { return DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.TextFont; } + } + + private Font BoldFont + { + get + { + if (IsDisposed) + return null; + + if (m_boldFont == null) + { + m_font = TextFont; + m_boldFont = new Font(TextFont, FontStyle.Bold); + } + else if (m_font != TextFont) + { + m_boldFont.Dispose(); + m_font = TextFont; + m_boldFont = new Font(TextFont, FontStyle.Bold); + } + + return m_boldFont; + } + } + + private int StartDisplayingTab + { + get { return m_startDisplayingTab; } + set + { + m_startDisplayingTab = value; + Invalidate(); + } + } + + private int EndDisplayingTab + { + get { return m_endDisplayingTab; } + set { m_endDisplayingTab = value; } + } + + private int FirstDisplayingTab + { + get { return m_firstDisplayingTab; } + set { m_firstDisplayingTab = value; } + } + + private bool DocumentTabsOverflow + { + set + { + if (m_documentTabsOverflow == value) + return; + + m_documentTabsOverflow = value; + if (value) + ButtonWindowList.ImageCategory = 1; + else + ButtonWindowList.ImageCategory = 0; + } + } + + #region Customizable Properties + + private static int ToolWindowStripGapTop + { + get { return _ToolWindowStripGapTop; } + } + + private static int ToolWindowStripGapBottom + { + get { return _ToolWindowStripGapBottom; } + } + + private static int ToolWindowStripGapLeft + { + get { return _ToolWindowStripGapLeft; } + } + + private static int ToolWindowStripGapRight + { + get { return _ToolWindowStripGapRight; } + } + + private static int ToolWindowImageHeight + { + get { return _ToolWindowImageHeight; } + } + + private static int ToolWindowImageWidth + { + get { return _ToolWindowImageWidth; } + } + + private static int ToolWindowImageGapTop + { + get { return _ToolWindowImageGapTop; } + } + + private static int ToolWindowImageGapBottom + { + get { return _ToolWindowImageGapBottom; } + } + + private static int ToolWindowImageGapLeft + { + get { return _ToolWindowImageGapLeft; } + } + + private static int ToolWindowImageGapRight + { + get { return _ToolWindowImageGapRight; } + } + + private static int ToolWindowTextGapRight + { + get { return _ToolWindowTextGapRight; } + } + + private static int ToolWindowTabSeperatorGapTop + { + get { return _ToolWindowTabSeperatorGapTop; } + } + + private static int ToolWindowTabSeperatorGapBottom + { + get { return _ToolWindowTabSeperatorGapBottom; } + } + + private static string ToolTipClose + { + get + { + if (m_toolTipClose == null) + m_toolTipClose = Strings.DockPaneStrip_ToolTipClose; + return m_toolTipClose; + } + } + + private static string ToolTipSelect + { + get + { + if (m_toolTipSelect == null) + m_toolTipSelect = Strings.DockPaneStrip_ToolTipWindowList; + return m_toolTipSelect; + } + } + + private TextFormatFlags ToolWindowTextFormat + { + get + { + TextFormatFlags textFormat = TextFormatFlags.EndEllipsis | + TextFormatFlags.HorizontalCenter | + TextFormatFlags.SingleLine | + TextFormatFlags.VerticalCenter; + if (RightToLeft == RightToLeft.Yes) + return textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right; + else + return textFormat; + } + } + + private static int DocumentStripGapTop + { + get { return _DocumentStripGapTop; } + } + + private static int DocumentStripGapBottom + { + get { return _DocumentStripGapBottom; } + } + + private TextFormatFlags DocumentTextFormat + { + get + { + TextFormatFlags textFormat = TextFormatFlags.EndEllipsis | + TextFormatFlags.SingleLine | + TextFormatFlags.VerticalCenter | + TextFormatFlags.HorizontalCenter; + if (RightToLeft == RightToLeft.Yes) + return textFormat | TextFormatFlags.RightToLeft; + else + return textFormat; + } + } + + private static int DocumentTabMaxWidth + { + get { return _DocumentTabMaxWidth; } + } + + private static int DocumentButtonGapTop + { + get { return _DocumentButtonGapTop; } + } + + private static int DocumentButtonGapBottom + { + get { return _DocumentButtonGapBottom; } + } + + private static int DocumentButtonGapBetween + { + get { return _DocumentButtonGapBetween; } + } + + private static int DocumentButtonGapRight + { + get { return _DocumentButtonGapRight; } + } + + private static int DocumentTabGapTop + { + get { return _DocumentTabGapTop; } + } + + private static int DocumentTabGapLeft + { + get { return _DocumentTabGapLeft; } + } + + private static int DocumentTabGapRight + { + get { return _DocumentTabGapRight; } + } + + private static int DocumentIconGapBottom + { + get { return _DocumentIconGapBottom; } + } + + private static int DocumentIconGapLeft + { + get { return _DocumentIconGapLeft; } + } + + private static int DocumentIconGapRight + { + get { return _DocumentIconGapRight; } + } + + private static int DocumentIconWidth + { + get { return _DocumentIconWidth; } + } + + private static int DocumentIconHeight + { + get { return _DocumentIconHeight; } + } + + private static int DocumentTextGapRight + { + get { return _DocumentTextGapRight; } + } + + private static Pen PenToolWindowTabBorder + { + get { return SystemPens.GrayText; } + } + + private static Pen PenDocumentTabActiveBorder + { + get { return SystemPens.ControlDarkDark; } + } + + private static Pen PenDocumentTabInactiveBorder + { + get { return SystemPens.GrayText; } + } + + #endregion + + #endregion + + public VS2005DockPaneStrip(DockPane pane) + : base(pane) + { + SetStyle(ControlStyles.ResizeRedraw | + ControlStyles.UserPaint | + ControlStyles.AllPaintingInWmPaint | + ControlStyles.OptimizedDoubleBuffer, true); + + SuspendLayout(); + + m_components = new Container(); + m_toolTip = new ToolTip(Components); + m_selectMenu = new ContextMenuStrip(Components); + pane.DockPanel.Theme.ApplyTo(m_selectMenu); + + ResumeLayout(); + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + Components.Dispose(); + if (m_boldFont != null) + { + m_boldFont.Dispose(); + m_boldFont = null; + } + } + 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(TextFont.Height + (PatchController.EnableHighDpi == true ? DocumentIconGapBottom : 0), + ToolWindowImageHeight + ToolWindowImageGapTop + ToolWindowImageGapBottom) + + ToolWindowStripGapTop + ToolWindowStripGapBottom; + + return height; + } + + private int MeasureHeight_Document() + { + int height = Math.Max(TextFont.Height + DocumentTabGapTop + (PatchController.EnableHighDpi == true ? DocumentIconGapBottom : 0), + ButtonClose.Height + DocumentButtonGapTop + DocumentButtonGapBottom) + + DocumentStripGapBottom + DocumentStripGapTop; + + return height; + } + + protected override void OnPaint(PaintEventArgs e) + { + Rectangle rect = TabsRectangle; + DockPanelGradient gradient = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.DockStripGradient; + if (Appearance == DockPane.AppearanceStyle.Document) + { + rect.X -= DocumentTabGapLeft; + + // Add these values back in so that the DockStrip color is drawn + // beneath the close button and window list button. + // It is possible depending on the DockPanel DocumentStyle to have + // a Document without a DockStrip. + rect.Width += DocumentTabGapLeft + + DocumentTabGapRight + + DocumentButtonGapRight + + ButtonClose.Width + + ButtonWindowList.Width; + } + else + { + gradient = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.DockStripGradient; + } + + Color startColor = gradient.StartColor; + Color endColor = gradient.EndColor; + LinearGradientMode gradientMode = gradient.LinearGradientMode; + + DrawingRoutines.SafelyDrawLinearGradient(rect, startColor, endColor, gradientMode, e.Graphics); + base.OnPaint(e); + CalculateTabs(); + if (Appearance == DockPane.AppearanceStyle.Document && DockPane.ActiveContent != null) + { + if (EnsureDocumentTabVisible(DockPane.ActiveContent, false)) + CalculateTabs(); + } + + DrawTabStrip(e.Graphics); + } + + protected override void OnRefreshChanges() + { + SetInertButtons(); + Invalidate(); + } + + public override GraphicsPath GetOutline(int index) + { + + if (Appearance == DockPane.AppearanceStyle.Document) + return GetOutline_Document(index); + else + return GetOutline_ToolWindow(index); + + } + + private GraphicsPath GetOutline_Document(int index) + { + Rectangle rectTab = Tabs[index].Rectangle.Value; + rectTab.X -= rectTab.Height / 2; + rectTab.Intersect(TabsRectangle); + rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab)); + Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle); + + GraphicsPath path = new GraphicsPath(); + GraphicsPath pathTab = GetTabOutline_Document(Tabs[index], true, true, true); + path.AddPath(pathTab, true); + + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + path.AddLine(rectTab.Right, rectTab.Top, rectPaneClient.Right, rectTab.Top); + path.AddLine(rectPaneClient.Right, rectTab.Top, rectPaneClient.Right, rectPaneClient.Top); + path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Left, rectPaneClient.Top); + path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Left, rectTab.Top); + path.AddLine(rectPaneClient.Left, rectTab.Top, rectTab.Right, rectTab.Top); + } + else + { + path.AddLine(rectTab.Right, rectTab.Bottom, rectPaneClient.Right, rectTab.Bottom); + path.AddLine(rectPaneClient.Right, rectTab.Bottom, rectPaneClient.Right, rectPaneClient.Bottom); + path.AddLine(rectPaneClient.Right, rectPaneClient.Bottom, rectPaneClient.Left, rectPaneClient.Bottom); + path.AddLine(rectPaneClient.Left, rectPaneClient.Bottom, rectPaneClient.Left, rectTab.Bottom); + path.AddLine(rectPaneClient.Left, rectTab.Bottom, rectTab.Right, rectTab.Bottom); + } + return path; + } + + private GraphicsPath GetOutline_ToolWindow(int index) + { + Rectangle rectTab = Tabs[index].Rectangle.Value; + rectTab.Intersect(TabsRectangle); + rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab)); + Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle); + + GraphicsPath path = new GraphicsPath(); + GraphicsPath pathTab = GetTabOutline(Tabs[index], true, true); + path.AddPath(pathTab, true); + path.AddLine(rectTab.Left, rectTab.Top, rectPaneClient.Left, rectTab.Top); + path.AddLine(rectPaneClient.Left, rectTab.Top, rectPaneClient.Left, rectPaneClient.Top); + path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Right, rectPaneClient.Top); + path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Right, rectTab.Top); + path.AddLine(rectPaneClient.Right, rectTab.Top, rectTab.Right, rectTab.Top); + 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 = TabStripRectangle; + + // Calculate tab widths + int countTabs = Tabs.Count; + foreach (TabVS2005 tab in Tabs) + { + tab.MaxWidth = GetMaxTabWidth(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 (TabVS2005 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 (TabVS2005 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 (TabVS2005 tab in Tabs) + { + tab.TabX = x; + x += tab.TabWidth; + } + } + + private bool CalculateDocumentTab(Rectangle rectTabStrip, ref int x, int index) + { + bool overflow = false; + + TabVS2005 tab = Tabs[index] as TabVS2005; + tab.MaxWidth = GetMaxTabWidth(index); + int width = Math.Min(tab.MaxWidth, DocumentTabMaxWidth); + if (x + width < rectTabStrip.Right || index == StartDisplayingTab) + { + tab.TabX = x; + tab.TabWidth = width; + EndDisplayingTab = index; + } + else + { + tab.TabX = 0; + tab.TabWidth = 0; + overflow = true; + } + x += width; + + return overflow; + } + + /// + /// Calculate which tabs are displayed and in what order. + /// + private void CalculateTabs_Document() + { + if (m_startDisplayingTab >= Tabs.Count) + m_startDisplayingTab = 0; + + Rectangle rectTabStrip = TabsRectangle; + + int x = rectTabStrip.X + rectTabStrip.Height / 2; + bool overflow = false; + + // Originally all new documents that were considered overflow + // (not enough pane strip space to show all tabs) were added to + // the far left (assuming not right to left) and the tabs on the + // right were dropped from view. If StartDisplayingTab is not 0 + // then we are dealing with making sure a specific tab is kept in focus. + if (m_startDisplayingTab > 0) + { + int tempX = x; + TabVS2005 tab = Tabs[m_startDisplayingTab] as TabVS2005; + tab.MaxWidth = GetMaxTabWidth(m_startDisplayingTab); + + // Add the active tab and tabs to the left + for (int i = StartDisplayingTab; i >= 0; i--) + CalculateDocumentTab(rectTabStrip, ref tempX, i); + + // Store which tab is the first one displayed so that it + // will be drawn correctly (without part of the tab cut off) + FirstDisplayingTab = EndDisplayingTab; + + tempX = x; // Reset X location because we are starting over + + // Start with the first tab displayed - name is a little misleading. + // Loop through each tab and set its location. If there is not enough + // room for all of them overflow will be returned. + for (int i = EndDisplayingTab; i < Tabs.Count; i++) + overflow = CalculateDocumentTab(rectTabStrip, ref tempX, i); + + // If not all tabs are shown then we have an overflow. + if (FirstDisplayingTab != 0) + overflow = true; + } + else + { + for (int i = StartDisplayingTab; i < Tabs.Count; i++) + overflow = CalculateDocumentTab(rectTabStrip, ref x, i); + for (int i = 0; i < StartDisplayingTab; i++) + overflow = CalculateDocumentTab(rectTabStrip, ref x, i); + + FirstDisplayingTab = StartDisplayingTab; + } + + if (!overflow) + { + m_startDisplayingTab = 0; + FirstDisplayingTab = 0; + x = rectTabStrip.X + rectTabStrip.Height / 2; + foreach (TabVS2005 tab in Tabs) + { + tab.TabX = x; + x += tab.TabWidth; + } + } + DocumentTabsOverflow = overflow; + } + + protected override void EnsureTabVisible(IDockContent content) + { + if (Appearance != DockPane.AppearanceStyle.Document || !Tabs.Contains(content)) + return; + + CalculateTabs(); + EnsureDocumentTabVisible(content, true); + } + + private bool EnsureDocumentTabVisible(IDockContent content, bool repaint) + { + int index = Tabs.IndexOf(content); + if (index == -1) + { + //somehow we've lost the content from the Tab collection + return false; + } + TabVS2005 tab = Tabs[index] as TabVS2005; + if (tab.TabWidth != 0) + return false; + + StartDisplayingTab = index; + if (repaint) + Invalidate(); + + return true; + } + + private int GetMaxTabWidth(int index) + { + if (Appearance == DockPane.AppearanceStyle.ToolWindow) + return GetMaxTabWidth_ToolWindow(index); + else + return GetMaxTabWidth_Document(index); + } + + private int GetMaxTabWidth_ToolWindow(int index) + { + IDockContent content = Tabs[index].Content; + Size sizeString = TextRenderer.MeasureText(content.DockHandler.TabText, TextFont); + return ToolWindowImageWidth + sizeString.Width + ToolWindowImageGapLeft + + ToolWindowImageGapRight + ToolWindowTextGapRight; + } + + private int GetMaxTabWidth_Document(int index) + { + IDockContent content = Tabs[index].Content; + + int height = GetTabRectangle_Document(index).Height; + + Size sizeText = TextRenderer.MeasureText(content.DockHandler.TabText, BoldFont, new Size(DocumentTabMaxWidth, height), DocumentTextFormat); + + if (DockPane.DockPanel.ShowDocumentIcon) + return sizeText.Width + DocumentIconWidth + DocumentIconGapLeft + DocumentIconGapRight + DocumentTextGapRight; + else + return sizeText.Width + DocumentIconGapLeft + DocumentTextGapRight; + } + + private void DrawTabStrip(Graphics g) + { + if (Appearance == DockPane.AppearanceStyle.Document) + DrawTabStrip_Document(g); + else + DrawTabStrip_ToolWindow(g); + } + + private void DrawTabStrip_Document(Graphics g) + { + int count = Tabs.Count; + if (count == 0) + return; + + Rectangle rectTabStrip = TabStripRectangle; + + // Draw the tabs + Rectangle rectTabOnly = TabsRectangle; + Rectangle rectTab = Rectangle.Empty; + TabVS2005 tabActive = null; + g.SetClip(DrawHelper.RtlTransform(this, rectTabOnly)); + for (int i = 0; i < count; i++) + { + rectTab = GetTabRectangle(i); + if (Tabs[i].Content == DockPane.ActiveContent) + { + tabActive = Tabs[i] as TabVS2005; + tabActive.Rectangle = rectTab; + continue; + } + + if (rectTab.IntersectsWith(rectTabOnly)) + { + var tab = Tabs[i] as TabVS2005; + tab.Rectangle = rectTab; + DrawTab(g, tab); + } + } + + g.SetClip(rectTabStrip); + + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + g.DrawLine(PenDocumentTabActiveBorder, rectTabStrip.Left, rectTabStrip.Top + 1, + rectTabStrip.Right, rectTabStrip.Top + 1); + else + g.DrawLine(PenDocumentTabActiveBorder, rectTabStrip.Left, rectTabStrip.Bottom - 1, + rectTabStrip.Right, rectTabStrip.Bottom - 1); + + g.SetClip(DrawHelper.RtlTransform(this, rectTabOnly)); + if (tabActive != null) + { + rectTab = tabActive.Rectangle.Value; + if (rectTab.IntersectsWith(rectTabOnly)) + { + rectTab.Intersect(rectTabOnly); + tabActive.Rectangle = rectTab; + DrawTab(g, tabActive); + } + } + } + + private void DrawTabStrip_ToolWindow(Graphics g) + { + Rectangle rectTabStrip = TabStripRectangle; + + g.DrawLine(PenToolWindowTabBorder, rectTabStrip.Left, rectTabStrip.Top, + rectTabStrip.Right, rectTabStrip.Top); + + for (int i = 0; i < Tabs.Count; i++) + { + var tab = Tabs[i] as TabVS2005; + tab.Rectangle = GetTabRectangle(i); + DrawTab(g, tab); + } + } + + private 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 = TabStripRectangle; + + TabVS2005 tab = (TabVS2005)(Tabs[index]); + return new Rectangle(tab.TabX, rectTabStrip.Y, tab.TabWidth, rectTabStrip.Height); + } + + private Rectangle GetTabRectangle_Document(int index) + { + Rectangle rectTabStrip = TabStripRectangle; + TabVS2005 tab = (TabVS2005)Tabs[index]; + + Rectangle rect = new Rectangle(); + rect.X = tab.TabX; + rect.Width = tab.TabWidth; + rect.Height = rectTabStrip.Height - DocumentTabGapTop; + + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + rect.Y = rectTabStrip.Y + DocumentStripGapBottom; + else + rect.Y = rectTabStrip.Y + DocumentTabGapTop; + + return rect; + } + + private void DrawTab(Graphics g, TabVS2005 tab) + { + if (Appearance == DockPane.AppearanceStyle.ToolWindow) + DrawTab_ToolWindow(g, tab); + else + DrawTab_Document(g, tab); + } + + private GraphicsPath GetTabOutline(Tab tab, bool rtlTransform, bool toScreen) + { + if (Appearance == DockPane.AppearanceStyle.ToolWindow) + return GetTabOutline_ToolWindow(tab, rtlTransform, toScreen); + else + return GetTabOutline_Document(tab, rtlTransform, toScreen, false); + } + + private GraphicsPath GetTabOutline_ToolWindow(Tab tab, bool rtlTransform, bool toScreen) + { + Rectangle rect = GetTabRectangle(Tabs.IndexOf(tab)); + if (rtlTransform) + rect = DrawHelper.RtlTransform(this, rect); + if (toScreen) + rect = RectangleToScreen(rect); + + DrawHelper.GetRoundedCornerTab(GraphicsPath, rect, false); + return GraphicsPath; + } + + private GraphicsPath GetTabOutline_Document(Tab tab, bool rtlTransform, bool toScreen, bool full) + { + int curveSize = 6; + + GraphicsPath.Reset(); + Rectangle rect = GetTabRectangle(Tabs.IndexOf(tab)); + + // Shorten TabOutline so it doesn't get overdrawn by icons next to it + rect.Intersect(TabsRectangle); + rect.Width--; + + if (rtlTransform) + rect = DrawHelper.RtlTransform(this, rect); + if (toScreen) + rect = RectangleToScreen(rect); + + // Draws the full angle piece for active content (or first tab) + if (tab.Content == DockPane.ActiveContent || full || Tabs.IndexOf(tab) == FirstDisplayingTab) + { + if (RightToLeft == RightToLeft.Yes) + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + // For some reason the next line draws a line that is not hidden like it is when drawing the tab strip on top. + // It is not needed so it has been commented out. + //GraphicsPath.AddLine(rect.Right, rect.Bottom, rect.Right + rect.Height / 2, rect.Bottom); + GraphicsPath.AddLine(rect.Right + rect.Height / 2, rect.Top, rect.Right - rect.Height / 2 + curveSize / 2, rect.Bottom - curveSize / 2); + } + else + { + GraphicsPath.AddLine(rect.Right, rect.Bottom, rect.Right + rect.Height / 2, rect.Bottom); + GraphicsPath.AddLine(rect.Right + rect.Height / 2, rect.Bottom, rect.Right - rect.Height / 2 + curveSize / 2, rect.Top + curveSize / 2); + } + } + else + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + // For some reason the next line draws a line that is not hidden like it is when drawing the tab strip on top. + // It is not needed so it has been commented out. + //GraphicsPath.AddLine(rect.Left, rect.Top, rect.Left - rect.Height / 2, rect.Top); + GraphicsPath.AddLine(rect.Left - rect.Height / 2, rect.Top, rect.Left + rect.Height / 2 - curveSize / 2, rect.Bottom - curveSize / 2); + } + else + { + GraphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left - rect.Height / 2, rect.Bottom); + GraphicsPath.AddLine(rect.Left - rect.Height / 2, rect.Bottom, rect.Left + rect.Height / 2 - curveSize / 2, rect.Top + curveSize / 2); + } + } + } + // Draws the partial angle for non-active content + else + { + if (RightToLeft == RightToLeft.Yes) + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + GraphicsPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Top + rect.Height / 2); + GraphicsPath.AddLine(rect.Right, rect.Top + rect.Height / 2, rect.Right - rect.Height / 2 + curveSize / 2, rect.Bottom - curveSize / 2); + } + else + { + GraphicsPath.AddLine(rect.Right, rect.Bottom, rect.Right, rect.Bottom - rect.Height / 2); + GraphicsPath.AddLine(rect.Right, rect.Bottom - rect.Height / 2, rect.Right - rect.Height / 2 + curveSize / 2, rect.Top + curveSize / 2); + } + } + else + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + GraphicsPath.AddLine(rect.Left, rect.Top, rect.Left, rect.Top + rect.Height / 2); + GraphicsPath.AddLine(rect.Left, rect.Top + rect.Height / 2, rect.Left + rect.Height / 2 - curveSize / 2, rect.Bottom - curveSize / 2); + } + else + { + GraphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left, rect.Bottom - rect.Height / 2); + GraphicsPath.AddLine(rect.Left, rect.Bottom - rect.Height / 2, rect.Left + rect.Height / 2 - curveSize / 2, rect.Top + curveSize / 2); + } + } + } + + if (RightToLeft == RightToLeft.Yes) + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + // Draws the bottom horizontal line (short side) + GraphicsPath.AddLine(rect.Right - rect.Height / 2 - curveSize / 2, rect.Bottom, rect.Left + curveSize / 2, rect.Bottom); + + // Drawing the rounded corner is not necessary. The path is automatically connected + //GraphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90); + } + else + { + // Draws the bottom horizontal line (short side) + GraphicsPath.AddLine(rect.Right - rect.Height / 2 - curveSize / 2, rect.Top, rect.Left + curveSize / 2, rect.Top); + GraphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90); + } + } + else + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + // Draws the bottom horizontal line (short side) + GraphicsPath.AddLine(rect.Left + rect.Height / 2 + curveSize / 2, rect.Bottom, rect.Right - curveSize / 2, rect.Bottom); + + // Drawing the rounded corner is not necessary. The path is automatically connected + //GraphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Bottom, curveSize, curveSize), 90, -90); + } + else + { + // Draws the top horizontal line (short side) + GraphicsPath.AddLine(rect.Left + rect.Height / 2 + curveSize / 2, rect.Top, rect.Right - curveSize / 2, rect.Top); + + // Draws the rounded corner oppposite the angled side + GraphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Top, curveSize, curveSize), -90, 90); + } + } + + if (Tabs.IndexOf(tab) != EndDisplayingTab && + (Tabs.IndexOf(tab) != Tabs.Count - 1 && Tabs[Tabs.IndexOf(tab) + 1].Content == DockPane.ActiveContent) + && !full) + { + if (RightToLeft == RightToLeft.Yes) + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + GraphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Bottom - rect.Height / 2); + GraphicsPath.AddLine(rect.Left, rect.Bottom - rect.Height / 2, rect.Left + rect.Height / 2, rect.Top); + } + else + { + GraphicsPath.AddLine(rect.Left, rect.Top + curveSize / 2, rect.Left, rect.Top + rect.Height / 2); + GraphicsPath.AddLine(rect.Left, rect.Top + rect.Height / 2, rect.Left + rect.Height / 2, rect.Bottom); + } + } + else + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + { + GraphicsPath.AddLine(rect.Right, rect.Bottom - curveSize / 2, rect.Right, rect.Bottom - rect.Height / 2); + GraphicsPath.AddLine(rect.Right, rect.Bottom - rect.Height / 2, rect.Right - rect.Height / 2, rect.Top); + } + else + { + GraphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Top + rect.Height / 2); + GraphicsPath.AddLine(rect.Right, rect.Top + rect.Height / 2, rect.Right - rect.Height / 2, rect.Bottom); + } + } + } + else + { + // Draw the vertical line opposite the angled side + if (RightToLeft == RightToLeft.Yes) + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + GraphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Top); + else + GraphicsPath.AddLine(rect.Left, rect.Top + curveSize / 2, rect.Left, rect.Bottom); + } + else + { + if (DockPane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom) + GraphicsPath.AddLine(rect.Right, rect.Bottom - curveSize / 2, rect.Right, rect.Top); + else + GraphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Bottom); + } + } + + return GraphicsPath; + } + + private void DrawTab_ToolWindow(Graphics g, TabVS2005 tab) + { + var rect = tab.Rectangle.Value; + Rectangle rectIcon = new Rectangle( + rect.X + ToolWindowImageGapLeft, + rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight, + ToolWindowImageWidth, ToolWindowImageHeight); + Rectangle rectText = PatchController.EnableHighDpi == true + ? new Rectangle( + rect.X + ToolWindowImageGapLeft, + rect.Y - 1 + rect.Height - ToolWindowImageGapBottom - TextFont.Height, + ToolWindowImageWidth, TextFont.Height) + : rectIcon; + rectText.X += rectIcon.Width + ToolWindowImageGapRight; + rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft - + ToolWindowImageGapRight - ToolWindowTextGapRight; + + Rectangle rectTab = DrawHelper.RtlTransform(this, rect); + rectText = DrawHelper.RtlTransform(this, rectText); + rectIcon = DrawHelper.RtlTransform(this, rectIcon); + GraphicsPath path = GetTabOutline(tab, true, false); + if (DockPane.ActiveContent == tab.Content) + { + Color startColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.StartColor; + Color endColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.EndColor; + LinearGradientMode gradientMode = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.LinearGradientMode; + using (LinearGradientBrush brush = new LinearGradientBrush(rectTab, startColor, endColor, gradientMode)) + { + g.FillPath(brush, path); + } + + g.DrawPath(PenToolWindowTabBorder, path); + + Color textColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.TextColor; + TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, textColor, ToolWindowTextFormat); + } + else + { + Color startColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.StartColor; + Color endColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.EndColor; + LinearGradientMode gradientMode = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.LinearGradientMode; + using (LinearGradientBrush brush1 = new LinearGradientBrush(rectTab, startColor, endColor, gradientMode)) + { + g.FillPath(brush1, path); + } + + if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(tab) + 1) + { + Point pt1 = new Point(rect.Right, rect.Top + ToolWindowTabSeperatorGapTop); + Point pt2 = new Point(rect.Right, rect.Bottom - ToolWindowTabSeperatorGapBottom); + g.DrawLine(PenToolWindowTabBorder, DrawHelper.RtlTransform(this, pt1), DrawHelper.RtlTransform(this, pt2)); + } + + Color textColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.TextColor; + TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, textColor, ToolWindowTextFormat); + } + + if (rectTab.Contains(rectIcon)) + g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon); + } + + private void DrawTab_Document(Graphics g, TabVS2005 tab) + { + var rect = tab.Rectangle.Value; + if (tab.TabWidth == 0) + return; + + Rectangle rectIcon = new Rectangle( + rect.X + DocumentIconGapLeft, + rect.Y + rect.Height - 1 - DocumentIconGapBottom - DocumentIconHeight, + DocumentIconWidth, DocumentIconHeight); + Rectangle rectText = PatchController.EnableHighDpi == true + ? new Rectangle( + rect.X + DocumentIconGapLeft, + rect.Y + rect.Height - DocumentIconGapBottom - TextFont.Height, + DocumentIconWidth, TextFont.Height) + : rectIcon; + if (DockPane.DockPanel.ShowDocumentIcon) + { + rectText.X += rectIcon.Width + DocumentIconGapRight; + rectText.Y = rect.Y; + rectText.Width = rect.Width - rectIcon.Width - DocumentIconGapLeft - + DocumentIconGapRight - DocumentTextGapRight; + rectText.Height = rect.Height; + } + else + rectText.Width = rect.Width - DocumentIconGapLeft - DocumentTextGapRight; + + Rectangle rectTab = DrawHelper.RtlTransform(this, rect); + Rectangle rectBack = DrawHelper.RtlTransform(this, rect); + rectBack.Width += DocumentIconGapLeft; + rectBack.X -= DocumentIconGapLeft; + + rectText = DrawHelper.RtlTransform(this, rectText); + rectIcon = DrawHelper.RtlTransform(this, rectIcon); + GraphicsPath path = GetTabOutline(tab, true, false); + if (DockPane.ActiveContent == tab.Content) + { + Color startColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.StartColor; + Color endColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.EndColor; + LinearGradientMode gradientMode = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.LinearGradientMode; + using (LinearGradientBrush brush = new LinearGradientBrush(rectBack, startColor, endColor, gradientMode)) + { + g.FillPath(brush, path); + } + + g.DrawPath(PenDocumentTabActiveBorder, path); + + Color textColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.TextColor; + if (DockPane.IsActiveDocumentPane) + TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, BoldFont, rectText, textColor, DocumentTextFormat); + else + TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, textColor, DocumentTextFormat); + } + else + { + Color startColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.StartColor; + Color endColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.EndColor; + LinearGradientMode gradientMode = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.LinearGradientMode; + using (LinearGradientBrush brush1 = new LinearGradientBrush(rectBack, startColor, endColor, gradientMode)) + { + g.FillPath(brush1, path); + } + + g.DrawPath(PenDocumentTabInactiveBorder, path); + + Color textColor = DockPane.DockPanel.Theme.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.TextColor; + TextRenderer.DrawText(g, tab.Content.DockHandler.TabText, TextFont, rectText, textColor, DocumentTextFormat); + } + + if (rectTab.Contains(rectIcon) && DockPane.DockPanel.ShowDocumentIcon) + g.DrawIcon(tab.Content.DockHandler.Icon, rectIcon); + } + + private void WindowList_Click(object sender, EventArgs e) + { + SelectMenu.Items.Clear(); + foreach (TabVS2005 tab in Tabs) + { + IDockContent content = tab.Content; + ToolStripItem item = SelectMenu.Items.Add(content.DockHandler.TabText, content.DockHandler.Icon.ToBitmap()); + item.Tag = tab.Content; + item.Click += new EventHandler(ContextMenuItem_Click); + } + + var workingArea = Screen.GetWorkingArea(ButtonWindowList.PointToScreen(new Point(ButtonWindowList.Width / 2, ButtonWindowList.Height / 2))); + var menu = new Rectangle(ButtonWindowList.PointToScreen(new Point(0, ButtonWindowList.Location.Y + ButtonWindowList.Height)), SelectMenu.Size); + var menuMargined = new Rectangle(menu.X - SelectMenuMargin, menu.Y - SelectMenuMargin, menu.Width + SelectMenuMargin, menu.Height + SelectMenuMargin); + if (workingArea.Contains(menuMargined)) + { + SelectMenu.Show(menu.Location); + } + else + { + var newPoint = menu.Location; + newPoint.X = DrawHelper.Balance(SelectMenu.Width, SelectMenuMargin, newPoint.X, workingArea.Left, workingArea.Right); + newPoint.Y = DrawHelper.Balance(SelectMenu.Size.Height, SelectMenuMargin, newPoint.Y, workingArea.Top, workingArea.Bottom); + var button = ButtonWindowList.PointToScreen(new Point(0, ButtonWindowList.Height)); + if (newPoint.Y < button.Y) + { + // flip the menu up to be above the button. + newPoint.Y = button.Y - ButtonWindowList.Height; + SelectMenu.Show(newPoint, ToolStripDropDownDirection.AboveRight); + } + else + { + SelectMenu.Show(newPoint); + } + } + } + + private void ContextMenuItem_Click(object sender, EventArgs e) + { + ToolStripMenuItem item = sender as ToolStripMenuItem; + if (item != null) + { + IDockContent content = (IDockContent)item.Tag; + DockPane.ActiveContent = content; + } + } + + private void SetInertButtons() + { + if (Appearance == DockPane.AppearanceStyle.ToolWindow) + { + if (m_buttonClose != null) + m_buttonClose.Left = -m_buttonClose.Width; + + if (m_buttonWindowList != null) + m_buttonWindowList.Left = -m_buttonWindowList.Width; + } + else + { + ButtonClose.Enabled = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton; + m_closeButtonVisible = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButtonVisible; + ButtonClose.Visible = m_closeButtonVisible; + ButtonClose.RefreshChanges(); + ButtonWindowList.RefreshChanges(); + } + } + + protected override void OnLayout(LayoutEventArgs levent) + { + if (Appearance == DockPane.AppearanceStyle.Document) + { + LayoutButtons(); + OnRefreshChanges(); + } + + base.OnLayout(levent); + } + + private void LayoutButtons() + { + Rectangle rectTabStrip = TabStripRectangle; + + // Set position and size of the buttons + int buttonWidth = ButtonClose.Image.Width; + int buttonHeight = ButtonClose.Image.Height; + int height = rectTabStrip.Height - DocumentButtonGapTop - DocumentButtonGapBottom; + if (buttonHeight < height) + { + buttonWidth = buttonWidth * height / buttonHeight; + buttonHeight = height; + } + Size buttonSize = new Size(buttonWidth, buttonHeight); + + int x = rectTabStrip.X + rectTabStrip.Width - DocumentTabGapLeft + - DocumentButtonGapRight - buttonWidth; + int y = rectTabStrip.Y + DocumentButtonGapTop; + Point point = new Point(x, y); + ButtonClose.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); + + // If the close button is not visible draw the window list button overtop. + // Otherwise it is drawn to the left of the close button. + if (m_closeButtonVisible) + point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0); + + ButtonWindowList.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize)); + } + + private void Close_Click(object sender, EventArgs e) + { + DockPane.CloseActiveContent(); + if (PatchController.EnableMemoryLeakFix == true) + { + ContentClosed(); + } + } + + protected override int HitTest(Point point) + { + if (!TabsRectangle.Contains(point)) + return -1; + + foreach (Tab tab in Tabs) + { + GraphicsPath path = GetTabOutline(tab, true, false); + if (path.IsVisible(point)) + return Tabs.IndexOf(tab); + } + return -1; + } + + protected override Rectangle GetTabBounds(Tab tab) + { + GraphicsPath path = GetTabOutline(tab, true, false); + RectangleF rectangle = path.GetBounds(); + return new Rectangle((int)rectangle.Left, (int)rectangle.Top, (int)rectangle.Width, (int)rectangle.Height); + } + + protected override void OnMouseHover(EventArgs e) + { + int index = HitTest(PointToClient(Control.MousePosition)); + string toolTip = string.Empty; + + base.OnMouseHover(e); + + if (index != -1) + { + TabVS2005 tab = Tabs[index] as TabVS2005; + if (!String.IsNullOrEmpty(tab.Content.DockHandler.ToolTipText)) + toolTip = tab.Content.DockHandler.ToolTipText; + else if (tab.MaxWidth > tab.TabWidth) + toolTip = tab.Content.DockHandler.TabText; + } + + if (m_toolTip.GetToolTip(this) != toolTip) + { + m_toolTip.Active = false; + m_toolTip.SetToolTip(this, toolTip); + m_toolTip.Active = true; + } + + // requires further tracking of mouse hover behavior, + ResetMouseEventArgs(); + } + + protected override void OnRightToLeftChanged(EventArgs e) + { + base.OnRightToLeftChanged(e); + PerformLayout(); + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockWindowFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockWindowFactory.cs new file mode 100644 index 000000000..2611a2226 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005DockWindowFactory.cs @@ -0,0 +1,36 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + internal class VS2005DockWindowFactory : IDockWindowFactory + { + public DockWindow CreateDockWindow(DockPanel dockPanel, DockState dockState) + { + return new VS2005DockWindow(dockPanel, dockState); + } + + /// + /// Dock window of Visual Studio 2005 theme. + /// + [ToolboxItem(false)] + private class VS2005DockWindow : DockWindow + { + internal VS2005DockWindow(DockPanel dockPanel, DockState dockState) : base(dockPanel, dockState) + { + } + + protected override void OnPaint(PaintEventArgs e) + { + // if DockWindow is document, draw the border + if (DockState == DockState.Document) + e.Graphics.DrawRectangle(SystemPens.ControlDark, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1); + + base.OnPaint(e); + } + } + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PaneIndicatorFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PaneIndicatorFactory.cs new file mode 100644 index 000000000..730488a10 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PaneIndicatorFactory.cs @@ -0,0 +1,93 @@ +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanel; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + public class VS2005PaneIndicatorFactory : IPaneIndicatorFactory + { + public IPaneIndicator CreatePaneIndicator(ThemeBase theme) + { + return new VS2005PaneIndicator(); + } + + [ToolboxItem(false)] + internal class VS2005PaneIndicator : PictureBox, IPaneIndicator + { + private static Bitmap _bitmapPaneDiamond = Resources.DockIndicator_PaneDiamond; + private static Bitmap _bitmapPaneDiamondLeft = Resources.DockIndicator_PaneDiamond_Left; + private static Bitmap _bitmapPaneDiamondRight = Resources.DockIndicator_PaneDiamond_Right; + private static Bitmap _bitmapPaneDiamondTop = Resources.DockIndicator_PaneDiamond_Top; + private static Bitmap _bitmapPaneDiamondBottom = Resources.DockIndicator_PaneDiamond_Bottom; + private static Bitmap _bitmapPaneDiamondFill = Resources.DockIndicator_PaneDiamond_Fill; + private static Bitmap _bitmapPaneDiamondHotSpot = Resources.DockIndicator_PaneDiamond_HotSpot; + private static Bitmap _bitmapPaneDiamondHotSpotIndex = Resources.DockIndicator_PaneDiamond_HotSpotIndex; + private static HotSpotIndex[] _hotSpots = + { + 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) + }; + + private GraphicsPath _displayingGraphicsPath = DrawHelper.CalculateGraphicsPathFromBitmap(_bitmapPaneDiamond); + + public VS2005PaneIndicator() + { + SizeMode = PictureBoxSizeMode.AutoSize; + Image = _bitmapPaneDiamond; + Region = new Region(DisplayingGraphicsPath); + } + + public GraphicsPath DisplayingGraphicsPath + { + get { return _displayingGraphicsPath; } + } + + public DockStyle HitTest(Point pt) + { + if (!Visible) + return DockStyle.None; + + 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; + } + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PanelIndicatorFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PanelIndicatorFactory.cs new file mode 100644 index 000000000..00c14df64 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005PanelIndicatorFactory.cs @@ -0,0 +1,116 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanel; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + public class VS2005PanelIndicatorFactory : IPanelIndicatorFactory + { + public IPanelIndicator CreatePanelIndicator(DockStyle style, ThemeBase theme) + { + return new VS2005PanelIndicator(style); + } + + [ToolboxItem(false)] + private class VS2005PanelIndicator : PictureBox, IPanelIndicator + { + private static Image _imagePanelLeft = Resources.DockIndicator_PanelLeft; + private static Image _imagePanelRight = Resources.DockIndicator_PanelRight; + private static Image _imagePanelTop = Resources.DockIndicator_PanelTop; + private static Image _imagePanelBottom = Resources.DockIndicator_PanelBottom; + private static Image _imagePanelFill = Resources.DockIndicator_PanelFill; + private static Image _imagePanelLeftActive = Resources.DockIndicator_PanelLeft_Active; + private static Image _imagePanelRightActive = Resources.DockIndicator_PanelRight_Active; + private static Image _imagePanelTopActive = Resources.DockIndicator_PanelTop_Active; + private static Image _imagePanelBottomActive = Resources.DockIndicator_PanelBottom_Active; + private static Image _imagePanelFillActive = Resources.DockIndicator_PanelFill_Active; + + public VS2005PanelIndicator(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 this.Visible && ClientRectangle.Contains(PointToClient(pt)) ? DockStyle : DockStyle.None; + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005Theme.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005Theme.cs new file mode 100644 index 000000000..8534b5db0 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005Theme.cs @@ -0,0 +1,103 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using WeifenLuo.WinFormsUI.ThemeVS2005; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.Docking +{ + /// + /// Visual Studio 2005 theme. + /// + public partial class VS2005Theme : ThemeBase + { + public VS2005Theme() + { + Skin = CreateVisualStudio2005(); + Measures.SplitterSize = 4; + Extender.AutoHideStripFactory = new VS2005AutoHideStripFactory(); + Extender.AutoHideWindowFactory = new VS2005AutoHideWindowFactory(); + Extender.DockPaneCaptionFactory = new VS2005DockPaneCaptionFactory(); + Extender.DockPaneStripFactory = new VS2005DockPaneStripFactory(); + Extender.DockPaneSplitterControlFactory = new VS2005DockPaneSplitterControlFactory(); + Extender.WindowSplitterControlFactory = new VS2005WindowSplitterControlFactory(); + Extender.DockWindowFactory = new VS2005DockWindowFactory(); + Extender.PaneIndicatorFactory = new VS2005PaneIndicatorFactory(); + Extender.PanelIndicatorFactory = new VS2005PanelIndicatorFactory(); + Extender.DockOutlineFactory = new VS2005DockOutlineFactory(); + Extender.DockIndicatorFactory = new VS2005DockIndicatorFactory(); + } + + internal static DockPanelSkin CreateVisualStudio2005() + { + DockPanelSkin skin = new DockPanelSkin(); + + skin.AutoHideStripSkin.DockStripGradient.StartColor = SystemColors.ControlLight; + skin.AutoHideStripSkin.DockStripGradient.EndColor = SystemColors.ControlLight; + skin.AutoHideStripSkin.TabGradient.TextColor = SystemColors.ControlDarkDark; + + skin.DockPaneStripSkin.DocumentGradient.DockStripGradient.StartColor = SystemColors.Control; + skin.DockPaneStripSkin.DocumentGradient.DockStripGradient.EndColor = SystemColors.Control; + skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.StartColor = SystemColors.ControlLightLight; + skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.EndColor = SystemColors.ControlLightLight; + skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.StartColor = SystemColors.ControlLight; + skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.EndColor = SystemColors.ControlLight; + + skin.DockPaneStripSkin.ToolWindowGradient.DockStripGradient.StartColor = SystemColors.ControlLight; + skin.DockPaneStripSkin.ToolWindowGradient.DockStripGradient.EndColor = SystemColors.ControlLight; + + skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.StartColor = SystemColors.Control; + skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.EndColor = SystemColors.Control; + + skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.StartColor = Color.Transparent; + skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.EndColor = Color.Transparent; + skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.TextColor = SystemColors.ControlDarkDark; + + skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.StartColor = SystemColors.GradientActiveCaption; + skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.EndColor = SystemColors.ActiveCaption; + skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical; + skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor = SystemColors.ActiveCaptionText; + + skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.StartColor = SystemColors.GradientInactiveCaption; + skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.EndColor = SystemColors.InactiveCaption; + skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.LinearGradientMode = LinearGradientMode.Vertical; + skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor = SystemColors.InactiveCaptionText; + + return skin; + } + + #region DefaultDockPaneCaptionFactory + + private class VS2005DockPaneCaptionFactory : IDockPaneCaptionFactory + { + public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane) + { + return new VS2005DockPaneCaption(pane); + } + } + + #endregion + + #region DefaultAutoHideStripFactory + + private class VS2005AutoHideStripFactory : IAutoHideStripFactory + { + public AutoHideStripBase CreateAutoHideStrip(DockPanel panel) + { + return new VS2005AutoHideStrip(panel); + } + } + + #endregion + + #region DefaultDockPaneTabStripFactory + + private class VS2005DockPaneStripFactory : IDockPaneStripFactory + { + public DockPaneStripBase CreateDockPaneStrip(DockPane pane) + { + return new VS2005DockPaneStrip(pane); + } + } + #endregion + } +} \ No newline at end of file diff --git a/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005WindowSplitterControlFactory.cs b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005WindowSplitterControlFactory.cs new file mode 100644 index 000000000..8465aad25 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/ThemeVS2005/VS2005WindowSplitterControlFactory.cs @@ -0,0 +1,36 @@ +using System.ComponentModel; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using static WeifenLuo.WinFormsUI.Docking.DockPanelExtender; + +namespace WeifenLuo.WinFormsUI.ThemeVS2005 +{ + internal class VS2005WindowSplitterControlFactory : IWindowSplitterControlFactory + { + public SplitterBase CreateSplitterControl(ISplitterHost host) + { + return new VS2005WindowSplitterControl(host); + } + + [ToolboxItem(false)] + private class VS2005WindowSplitterControl : SplitterBase + { + private ISplitterHost _host; + + public VS2005WindowSplitterControl(ISplitterHost host) + { + _host = host; + } + + protected override int SplitterSize + { + get { return _host.DockPanel.Theme.Measures.SplitterSize; } + } + + protected override void StartDrag() + { + _host.DockPanel.BeginDrag(_host, ((Control)_host).RectangleToScreen(Bounds)); + } + } + } +} diff --git a/WeifenLuoLinux/WinFormsUI/WeifenLuo.WinFormsUI.Docking.Linux.csproj b/WeifenLuoLinux/WinFormsUI/WeifenLuo.WinFormsUI.Docking.Linux.csproj new file mode 100644 index 000000000..cb446a04c --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/WeifenLuo.WinFormsUI.Docking.Linux.csproj @@ -0,0 +1,170 @@ + + + + DockPanelSuite + 3.1.0 + 3.1.0.0 + Weifen Luo and other contributors + The docking library for .Net Windows Forms development which mimics Visual Studio .Net. + (C) 2007-2020 Weifen Luo and other contributors + false + MIT + http://dockpanelsuite.com + + Release notes can be found at GitHub, + https://github.com/dockpanelsuite/dockpanelsuite/releases + + Visual Studio 2003 Theme: https://www.nuget.org/packages/DockPanelSuite.ThemeVS2003/ + Visual Studio 2005 Theme: https://www.nuget.org/packages/DockPanelSuite.ThemeVS2005/ + Visual Studio 2012 Themes: https://www.nuget.org/packages/DockPanelSuite.ThemeVS2012/ + Visual Studio 2013 Themes: https://www.nuget.org/packages/DockPanelSuite.ThemeVS2013/ + Visual Studio 2015 Themes: https://www.nuget.org/packages/DockPanelSuite.ThemeVS2015/ + + netcoreapp3.1;net40;net35 + true + + WeifenLuo.WinFormsUI + WeifenLuo.WinFormsUI.DockingLinux + true + dockpanelsuite.snk + false + true + true + + + + + + + Component + + + Component + + + + Form + + + Component + + + Component + + + + + Component + + + + + + + + Component + + + + Component + + + + + Form + + + + + Component + + + + + + UserControl + + + Component + + + + + + Component + + + UserControl + + + Component + + + Component + + + + Component + + + + + Form + + + + Component + + + + + + Component + + + + + + + + Component + + + VisualStudioToolStripExtender.cs + + + + True + True + Strings.resx + + + + + + + Designer + ResXFileCodeGenerator + Strings.Designer.cs + + + + + Component + + + + + + + + + + + + + + + + + diff --git a/WeifenLuoLinux/WinFormsUI/dockpanelsuite.snk b/WeifenLuoLinux/WinFormsUI/dockpanelsuite.snk new file mode 100644 index 0000000000000000000000000000000000000000..39a8b183ce878f16e6cd1527d0eb15c540d62f0c GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa500975(E1I(sk363Dk7vOd#%bukGj_-`VSMz z2r7h-BYJQ!0~L*zWDE0B?)iz^fbzXqIK>MP(IoMP<^@kzfDwj_$M4^2V%of%B6vDG zpI_b2f;Y2D;!LBDc5kxvbM~dlt0x;v3~mUXJ;ts&00I3Xjjt1QjO!y6z7ulV5E{an z{@GnTgpIf#K-BUjo706$Gu@IK$vFF9T^U!ER?J)j0o=@RPm>8^PSn0qxvk1at)z+5 zz|5+mTn!5|kP!I6H^;u{c6_akL2^bc1z4@N*(tR^q`4EJ?dz7F0*FMT$})ORi0RIu zLt0!L#okNz`rDhr;9}ZMuqc$umruyqYkdh0?$Po>XS&jQoQ_NT6^&_dX4-%$kgxh@ z!~IQmN@E$6U55X8A+nH~(!i9s#@FmTkM24VJb5A0ity8cqi#`hqv^_oGIv`mmTLa{ z!`|hXpYB80k4S-Dz~)MIN)$vdf-2cG`KDx*dJST-N$GJL=*VSA1ux=IT_iRbA9iytxv>f%E9i$A3rP8-+!VBXjEzc0d}Xnaq1&%WN##=;ab5fD_5=6O)QIb$!m5p&bx_44{b#ZYR3i_1}U iY literal 0 HcmV?d00001 diff --git a/WeifenLuoLinux/WinFormsUI/license.txt b/WeifenLuoLinux/WinFormsUI/license.txt new file mode 100644 index 000000000..9d7cc5871 --- /dev/null +++ b/WeifenLuoLinux/WinFormsUI/license.txt @@ -0,0 +1,9 @@ +The MIT License + +Copyright (c) 2007-2012 Weifen Luo (email: weifenluo@yahoo.com) and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.