Browse Source

Merged Corsavy r1425:1470 to trunk.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1471 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
f3d207fcbd
  1. 192
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 38
      data/options/SharpDevelop-templates.xml
  3. BIN
      data/resources/StringResources.cz.resources
  4. BIN
      data/resources/StringResources.de.resources
  5. BIN
      data/resources/StringResources.es-mx.resources
  6. BIN
      data/resources/StringResources.es.resources
  7. BIN
      data/resources/StringResources.fr.resources
  8. BIN
      data/resources/StringResources.hu.resources
  9. BIN
      data/resources/StringResources.it.resources
  10. BIN
      data/resources/StringResources.kr.resources
  11. BIN
      data/resources/StringResources.nl.resources
  12. BIN
      data/resources/StringResources.pl.resources
  13. BIN
      data/resources/StringResources.pt-br.resources
  14. BIN
      data/resources/StringResources.ro.resources
  15. BIN
      data/resources/StringResources.tr.resources
  16. 2
      data/templates/file/CSharp/CSharp.WPFFlowDocument.xft
  17. 2
      data/templates/file/CSharp/CSharp.WPFPage.xft
  18. 2
      data/templates/file/CSharp/CSharp.WPFPageFunction.xft
  19. 4
      data/templates/file/CSharp/CSharp.WPFResourceDictionary.xft
  20. 2
      data/templates/file/CSharp/CSharp.WPFUserControl.xft
  21. 2
      data/templates/file/CSharp/CSharp.WPFWindow.xft
  22. 4
      data/templates/file/CSharp/CSharp.Web.WebControl.xft
  23. 4
      data/templates/file/CSharp/CSharp.Web.WebForm.xft
  24. 4
      data/templates/file/CSharp/CSharp.Web.WebService.xft
  25. 4
      data/templates/project/CSharp/WebpageProject.xpt
  26. 2
      samples/SharpReport/PullData/MSDE/CustOrdersDetail.srd
  27. 10
      samples/SharpReport/ReportSamples/ReportSamples.csproj
  28. 8
      samples/SharpReport/ReportSamples/ReportSamples.sln
  29. 2
      src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.addin
  30. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs
  31. 8
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs
  32. 2
      src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin
  33. 17
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs
  34. 36
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs
  35. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
  36. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs
  37. 2
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs
  38. 2
      src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/BinaryView.cs
  39. 2
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/AssignStylesheetCommand.cs
  40. 2
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlSchemasPanel.cs
  41. 8
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
  42. 2
      src/AddIns/Misc/AddInManager/Project/Src/InstallableAddIn.cs
  43. 7
      src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs
  44. 6
      src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoverageHighlighter.cs
  45. 6
      src/AddIns/Misc/CodeCoverage/Test/AddCodeCoverageMarkersTestFixture.cs
  46. 8
      src/AddIns/Misc/CodeCoverage/Test/CodeCoverageMarkersCoverTwoLinesTestFixture.cs
  47. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
  48. 14
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
  49. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.Menu.cs
  50. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs
  51. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  52. 3
      src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingColorDialog.cs
  53. 2
      src/AddIns/Misc/HighlightingEditor/Project/Src/EditorHighlightColor.cs
  54. 28
      src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
  55. 2
      src/AddIns/Misc/NAntAddIn/Project/NAnt.addin
  56. 2
      src/AddIns/Misc/RegExpTk/Project/Resources/RegExpTkGroupForm.xfrm
  57. 21
      src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs
  58. 2
      src/AddIns/Misc/SharpReport/SharpReport.sln
  59. 3
      src/AddIns/Misc/SharpReport/SharpReport/Designer/Factories.cs
  60. 20
      src/AddIns/Misc/SharpReport/SharpReport/Designer/IDesignerVisitor.cs
  61. 21
      src/AddIns/Misc/SharpReport/SharpReport/Designer/IVisitor.cs
  62. 21
      src/AddIns/Misc/SharpReport/SharpReport/Designer/Report.cs
  63. 11
      src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/BaseDesignerControl.cs
  64. 5
      src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportDetail.cs
  65. 2
      src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportSection.cs
  66. 203
      src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportSectionControlbase.cs
  67. 4
      src/AddIns/Misc/SharpReport/SharpReport/Designer/SideTab/BuildSideTab.cs
  68. 207
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ContainerControl.cs
  69. 14
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ControlHelper.cs
  70. 1
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/FunctionControl.cs
  71. 50
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ITracker.cs
  72. 800
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/RectTracker.cs
  73. 1
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportCircleControl.cs
  74. 184
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportControlBase.cs
  75. 1
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportImageControl.cs
  76. 4
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportObjectControlBase.cs
  77. 1
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportRectangleControl.cs
  78. 5
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportRowControl.cs
  79. 3
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportTextControl.cs
  80. 11
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/Functions/MiscFunctions/PageNumber.cs
  81. 35
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/Functions/MiscFunctions/Today.cs
  82. 10
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportCircleItem.cs
  83. 9
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportImageItem.cs
  84. 10
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportLineItem.cs
  85. 10
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportRectangleItem.cs
  86. 28
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportDataItem.cs
  87. 10
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportRowItem.cs
  88. 11
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportTextItem.cs
  89. 6
      src/AddIns/Misc/SharpReport/SharpReport/SharpReport.csproj
  90. 2
      src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs
  91. 77
      src/AddIns/Misc/SharpReport/SharpReport/Visitors/AbstractVisitor.cs
  92. 63
      src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs
  93. 15
      src/AddIns/Misc/SharpReport/SharpReport/Visitors/SaveReportVisitor.cs
  94. 1
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs
  95. 15
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs
  96. 38
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
  97. 32
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataNavigator.cs
  98. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/CollectionStrategy.cs
  99. 10
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs
  100. 10
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs
  101. Some files were not shown because too many files have changed in this diff Show More

192
AddIns/ICSharpCode.SharpDevelop.addin

@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
<Path name = "/SharpDevelop/Workbench/Combine/FileFilter">
<FileFilter id = "Solution"
name = "Solutions (*.sln)"
name = "${res:SharpDevelop.FileFilter.SolutionFiles}"
class = "ICSharpCode.SharpDevelop.Project.LoadSolution"
extensions = "*.sln"/>
@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ToolBar/File">
<ToolbarItem id = "OpenFile"
icon = "Icons.16x16.OpenFileIcon"
tooltip = "Open"
tooltip = "${res:Gui.ProjectBrowser.Open}"
class = "ICSharpCode.SharpDevelop.Project.Commands.OpenFileEvent"/>
</Path>
@ -298,25 +298,7 @@ @@ -298,25 +298,7 @@
<MenuItem id = "AddSeparator" type = "Separator"/>
<Include id = "ProjectActions" path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectActions"/>
<MenuItem id = "Separator2" type = "Separator"/>
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
type = "Item"
icon = "Icons.16x16.CutIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.CutProjectBrowserNode"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
type = "Item"
icon = "Icons.16x16.PasteIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.PasteProjectBrowserNode"/>
<MenuItem id = "Remove"
label = "${res:Global.RemoveButtonText}"
type = "Item"
icon = "Icons.16x16.DeleteIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.DeleteProjectBrowserNode"/>
<MenuItem id = "Rename"
label = "${res:ProjectComponent.ContextMenu.Rename}"
shortcut = "F2"
class = "ICSharpCode.SharpDevelop.Project.Commands.RenameEntryEvent"/>
<Include id="inc" path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutPasteRemoveRename"/>
<MenuItem id = "CutCopyPasteSeparator" type = "Separator"/>
<MenuItem id = "Properties"
icon = "Icons.16x16.PropertiesIcon"
@ -324,6 +306,14 @@ @@ -324,6 +306,14 @@
class = "ICSharpCode.SharpDevelop.Project.Commands.ShowPropertiesForNode"/>
</Path>
<Path name="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/MissingProjectNode">
<Include id="inc" path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutPasteRemoveRename"/>
</Path>
<Path name="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/UnknownProjectNode">
<Include id="inc" path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutPasteRemoveRename"/>
</Path>
<Path name="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectActions">
<Condition name="IsProcessRunning" isprocessrunning="False" isdebugging="False" action="Disable">
<MenuItem id = "Run"
@ -415,30 +405,7 @@ @@ -415,30 +405,7 @@
<MenuItem id = "ExcludeSeparator" type = "Separator" />
</ComplexCondition>
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
type = "Item"
icon = "Icons.16x16.CutIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.CutProjectBrowserNode"/>
<MenuItem id = "Copy"
label = "${res:XML.MainMenu.EditMenu.Copy}"
type = "Item"
icon = "Icons.16x16.CopyIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.CopyProjectBrowserNode"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
type = "Item"
icon = "Icons.16x16.PasteIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.PasteProjectBrowserNode"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"
type = "Item"
icon = "Icons.16x16.DeleteIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.DeleteProjectBrowserNode"/>
<MenuItem id = "Rename"
label = "${res:ProjectComponent.ContextMenu.Rename}"
shortcut = "F2"
class = "ICSharpCode.SharpDevelop.Project.Commands.RenameEntryEvent"/>
<Include id="CutCopyPasteDeleteRename" path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutCopyPasteDeleteRename"/>
<MenuItem id = "RenameSeparator" type = "Separator" />
<MenuItem id = "Properties"
icon = "Icons.16x16.PropertiesIcon"
@ -447,6 +414,62 @@ @@ -447,6 +414,62 @@
</ComplexCondition>
</Path>
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutPasteRemoveRename">
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
type = "Item"
icon = "Icons.16x16.CutIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.CutProjectBrowserNode"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
type = "Item"
icon = "Icons.16x16.PasteIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.PasteProjectBrowserNode"/>
<MenuItem id = "Remove"
label = "${res:Global.RemoveButtonText}"
type = "Item"
icon = "Icons.16x16.DeleteIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.DeleteProjectBrowserNode"/>
<MenuItem id = "Rename"
label = "${res:ProjectComponent.ContextMenu.Rename}"
shortcut = "F2"
class = "ICSharpCode.SharpDevelop.Project.Commands.RenameEntryEvent"/>
</Path>
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutCopyPasteDeleteRename">
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
type = "Item"
icon = "Icons.16x16.CutIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.CutProjectBrowserNode"/>
<MenuItem id = "Copy"
label = "${res:XML.MainMenu.EditMenu.Copy}"
type = "Item"
icon = "Icons.16x16.CopyIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.CopyProjectBrowserNode"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
type = "Item"
icon = "Icons.16x16.PasteIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.PasteProjectBrowserNode"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"
type = "Item"
icon = "Icons.16x16.DeleteIcon"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Project.Commands.DeleteProjectBrowserNode"/>
<MenuItem id = "Rename"
label = "${res:ProjectComponent.ContextMenu.Rename}"
shortcut = "F2"
class = "ICSharpCode.SharpDevelop.Project.Commands.RenameEntryEvent"/>
</Path>
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/FolderNode">
<Condition name = "Ownerstate" ownerstate = "Missing">
<MenuItem id = "CreateMissing"
@ -499,30 +522,7 @@ @@ -499,30 +522,7 @@
<MenuItem id = "ExcludeSeparator" type = "Separator" />
</ComplexCondition>
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
type = "Item"
icon = "Icons.16x16.CutIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.CutProjectBrowserNode"/>
<MenuItem id = "Copy"
label = "${res:XML.MainMenu.EditMenu.Copy}"
type = "Item"
icon = "Icons.16x16.CopyIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.CopyProjectBrowserNode"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
icon = "Icons.16x16.PasteIcon"
type = "Item"
class = "ICSharpCode.SharpDevelop.Project.Commands.PasteProjectBrowserNode"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"
type = "Item"
icon = "Icons.16x16.DeleteIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.DeleteProjectBrowserNode"/>
<MenuItem id = "Rename"
label = "${res:ProjectComponent.ContextMenu.Rename}"
shortcut = "F2"
class = "ICSharpCode.SharpDevelop.Project.Commands.RenameEntryEvent"/>
<Include id="CutCopyPasteDeleteRename" path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/CutCopyPasteDeleteRename"/>
</ComplexCondition>
</Path>
@ -670,10 +670,12 @@ @@ -670,10 +670,12 @@
<ToolbarItem id = "Back"
icon = "Icons.16x16.BrowserBefore"
tooltip = "${res:MainWindow.Windows.ClassBrowser.BackButton.ToolTip}"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserNavigateBackward"/>
<ToolbarItem id = "Forward"
icon = "Icons.16x16.BrowserAfter"
tooltip = "${res:MainWindow.Windows.ClassBrowser.ForwardButton.ToolTip}"
loadclasslazy = "false"
class = "ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserNavigateForward"/>
<ToolbarItem id = "NavigationSeparator" type = "Separator"/>
@ -741,7 +743,7 @@ @@ -741,7 +743,7 @@
class = "ICSharpCode.SharpDevelop.Commands.OpenFile"/>
<ToolbarItem id = "OpenProject"
tooltip = "${res:XML.MainMenu.FileMenu.Open.Project}"
tooltip = "${res:XML.MainMenu.FileMenu.Open.Project.Description}"
icon = "Icons.16x16.OpenProjectIcon"
class = "ICSharpCode.SharpDevelop.Project.Commands.LoadSolution"
/>
@ -1685,34 +1687,34 @@ @@ -1685,34 +1687,34 @@
<Path name = "/SharpDevelop/Workbench/ToolBar/Standard">
<ToolbarItem id = "SearchSeparator" type = "Separator"/>
<!-- <Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable"> -->
<ToolbarItem id = "Comment"
icon = "Icons.16x16.CommentRegion"
tooltip = "${res:XML.TextAreaContextMenu.CommentUncommentSelection}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.CommentRegion"/>
<!-- <ToolbarItem id = "Uncomment"
<Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable">
<ToolbarItem id = "Comment"
icon = "Icons.16x16.CommentRegion"
tooltip = "${res:XML.TextAreaContextMenu.CommentUncommentSelection}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.CommentRegion"/>
<!-- <ToolbarItem id = "Uncomment"
icon = "Icons.16x16.UnCommentRegion"
tooltip = "${res:XML.TextAreaContextMenu.UncommentSelection}"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.UncommentRegion"/> -->
<ToolbarItem id = "SearchSeparator2" type = "Separator"/>
<ToolbarItem id = "ToggleBookmark"
icon = "Bookmarks.ToggleMark"
tooltip = "${res:XML.MainMenu.SearchMenu.ToggleBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.ToggleBookmark"/>
<ToolbarItem id = "PrevBookmark"
icon = "Bookmarks.GotoPrevInFile"
tooltip = "${res:XML.MainMenu.SearchMenu.PrevBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.PrevBookmark"/>
<ToolbarItem id = "NextBookmark"
icon = "Bookmarks.GotoNextInFile"
tooltip = "${res:XML.MainMenu.SearchMenu.NextBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.NextBookmark"/>
<ToolbarItem id = "ClearBookmarks"
icon = "Bookmarks.ClearAll"
tooltip = "${res:XML.MainMenu.SearchMenu.ClrBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.ClearBookmarks"/>
<!-- </Condition> -->
<ToolbarItem id = "SearchSeparator2" type = "Separator"/>
<ToolbarItem id = "ToggleBookmark"
icon = "Bookmarks.ToggleMark"
tooltip = "${res:XML.MainMenu.SearchMenu.ToggleBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.ToggleBookmark"/>
<ToolbarItem id = "PrevBookmark"
icon = "Bookmarks.GotoPrevInFile"
tooltip = "${res:XML.MainMenu.SearchMenu.PrevBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.PrevBookmark"/>
<ToolbarItem id = "NextBookmark"
icon = "Bookmarks.GotoNextInFile"
tooltip = "${res:XML.MainMenu.SearchMenu.NextBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.NextBookmark"/>
<ToolbarItem id = "ClearBookmarks"
icon = "Bookmarks.ClearAll"
tooltip = "${res:XML.MainMenu.SearchMenu.ClrBookmark.Description}"
class = "ICSharpCode.SharpDevelop.Bookmarks.ClearBookmarks"/>
</Condition>
</Path>

38
data/options/SharpDevelop-templates.xml

@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
${Selection}
}</CodeTemplate>
<CodeTemplate template="forb" description="for block">for (|; ; ) {
${Selection}
${Selection}
}</CodeTemplate>
<CodeTemplate template="fors" description="for (no braces)">for (|; ; )
${Selection}</CodeTemplate>
${Selection}</CodeTemplate>
<CodeTemplate template="ifb" description="if statement">if (|) {
${Selection}
}</CodeTemplate>
@ -18,41 +18,41 @@ ${Selection}</CodeTemplate> @@ -18,41 +18,41 @@ ${Selection}</CodeTemplate>
}</CodeTemplate>
<CodeTemplate template="ifs" description="if statement (no braces)">if (|)
${Selection}</CodeTemplate>
${Selection}</CodeTemplate>
<CodeTemplate template="switchd" description="switch statement (with default)">switch (|) {
case:
break;
default:
${Selection}
break;
case:
break;
default:
${Selection}
break;
}</CodeTemplate>
<CodeTemplate template="switchs" description="switch statement">switch (|) {
case :
${Selection}
break;
case :
${Selection}
break;
}</CodeTemplate>
<CodeTemplate template="tryc" description="try / catch">try {
${Selection}|
${Selection}|
} catch (Exception) {
}</CodeTemplate>
<CodeTemplate template="trycf" description="try / catch / finally">try {
${Selection}|
${Selection}|
} catch (Exception) {
} finally {
}</CodeTemplate>
<CodeTemplate template="tryf" description="try / finally">try {
${Selection}|
${Selection}|
} finally {
}</CodeTemplate>
<CodeTemplate template="whileb" description="while">while (|) {
${Selection}
${Selection}
}</CodeTemplate>
<CodeTemplate template="whiles" description="while (no braces)">while (|)
${Selection}</CodeTemplate>
${Selection}</CodeTemplate>
<CodeTemplate template="scwl" description="System.Console.WriteLine">System.Console.WriteLine(${Selection}|);</CodeTemplate>
<CodeTemplate template="scw" description="System.Console.Write">System.Console.Write(${Selection}|);</CodeTemplate>
</CodeTemplateGroup>

BIN
data/resources/StringResources.cz.resources

Binary file not shown.

BIN
data/resources/StringResources.de.resources

Binary file not shown.

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.es.resources

Binary file not shown.

BIN
data/resources/StringResources.fr.resources

Binary file not shown.

BIN
data/resources/StringResources.hu.resources

Binary file not shown.

BIN
data/resources/StringResources.it.resources

Binary file not shown.

BIN
data/resources/StringResources.kr.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

BIN
data/resources/StringResources.pl.resources

Binary file not shown.

BIN
data/resources/StringResources.pt-br.resources

Binary file not shown.

BIN
data/resources/StringResources.ro.resources

Binary file not shown.

BIN
data/resources/StringResources.tr.resources

Binary file not shown.

2
data/templates/file/CSharp/CSharp.WPFFlowDocument.xft

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
defaultname = "FlowDocument${Number}.xaml"
language = "XML"/>
<Description>A WinFX Flow Document</Description>
<Description>${res:Templates.File.WinFXFlowDocument.Name}</Description>
<!--
Special new file templates:

2
data/templates/file/CSharp/CSharp.WPFPage.xft

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
defaultname = "Page${Number}.xaml"
language = "C#"/>
<Description>A WinFX Page</Description>
<Description>${res:Templates.File.WinFXPage.Name}</Description>
<!--
Special new file templates:

2
data/templates/file/CSharp/CSharp.WPFPageFunction.xft

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
defaultname = "PageFunction${Number}.xaml"
language = "XML"/>
<Description>A WinFX Page Function</Description>
<Description>${res:Templates.File.WinFXPageFunction.Name}</Description>
<!--
Special new file templates:

4
data/templates/file/CSharp/CSharp.WPFResourceDictionary.xft

@ -2,14 +2,14 @@ @@ -2,14 +2,14 @@
<Template author="Mathias Simmack" version="1.0">
<Config
name = "WinFX Resource Dictionary"
name = "${res:Templates.File.WinFXResourceDictionary.Name}"
icon = "Icons.32x32.XMLFileIcon"
subcategory = "WinFX"
category = "C#"
defaultname = "Dictionary${Number}.xaml"
language = "XML"/>
<Description>A WinFX Resource Dictionary</Description>
<Description>${res:Templates.File.WinFXResourceDictionary.Name}</Description>
<!--
Special new file templates:

2
data/templates/file/CSharp/CSharp.WPFUserControl.xft

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
defaultname = "UserControl${Number}.xaml"
language = "C#"/>
<Description>A WinFX Custom Control</Description>
<Description>${res:Templates.File.WinFXUserControl.Description}</Description>
<!--
Special new file templates:

2
data/templates/file/CSharp/CSharp.WPFWindow.xft

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
defaultname = "Window${Number}.xaml"
language = "C#"/>
<Description>A WinFX Window</Description>
<Description>${res:Templates.File.WinFXWindow.Description}</Description>
<!--
Special new file templates:

4
data/templates/file/CSharp/CSharp.Web.WebControl.xft

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<Template author="Tom Schroeter" version="1.0">
<Config
name = "ASP.NET Web Control"
name = "${res:Templates.File.WebControl.Name}"
icon = "C#.File.NewClass"
category = "C#"
subcategory = "ASP.NET"
@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
language = "C#"
/>
<Description>Custom Web Control. Enter the name of a new control.</Description>
<Description>${res:Templates.File.WebControl.Description}</Description>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension

4
data/templates/file/CSharp/CSharp.Web.WebForm.xft

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<Template author="Tom Schroeter" version="1.0">
<Config
name = "ASP.NET Web Form"
name = "${res:Templates.File.WebForm.Name}"
icon = "C#.File.NewClass"
category = "C#"
subcategory = "ASP.NET"
@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
language = "C#"
/>
<Description>Component Frame for ASPX Code Behind. Enter the name of a new page.</Description>
<Description>${res:Templates.File.WebForm.Description}</Description>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension

4
data/templates/file/CSharp/CSharp.Web.WebService.xft

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<Template author="Tom Schroeter" version="1.0">
<Config
name = "ASP.NET Web Service"
name = "${res:Templates.File.WebService.Name}"
icon = "C#.File.NewClass"
category = "C#"
subcategory = "ASP.NET"
@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
language = "C#"
/>
<Description>Component Frame for ASMX Web Service. Enter the name of a new service.</Description>
<Description>${res:Templates.File.WebService.Description}</Description>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension

4
data/templates/project/CSharp/WebpageProject.xpt

@ -5,12 +5,12 @@ @@ -5,12 +5,12 @@
<!-- Template Header -->
<TemplateConfiguration>
<Name>ASP.net webpage project</Name>
<Name>${res:Templates.Project.WebPage.Name}</Name>
<Category>C#</Category>
<Subcategory>ASP.NET</Subcategory>
<Icon>C#.Project.Form</Icon>
<LanguageName>C#</LanguageName>
<Description>ASP.net web application</Description>
<Description>${res:Templates.Project.WebPage.Description}</Description>
</TemplateConfiguration>
<!-- Actions -->

2
samples/SharpReport/PullData/MSDE/CustOrdersDetail.srd

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
</params>
</SqlParams>
<ReportType value="DataReport"/>
<CommandText value="update CustOrdersDetail"/>
<CommandText value="CustOrdersDetail"/>
<CommandType value="StoredProcedure"/>
<DataModel value="PullData"/>
<DefaultFont value="Microsoft Sans Serif, 16pt"/>

10
samples/SharpReport/ReportSamples/ReportSamples.csproj

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>ReportSamples</RootNamespace>
<AssemblyName>ReportSamples</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -38,10 +38,6 @@ @@ -38,10 +38,6 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="SharpReportCore">
<HintPath>..\..\..\..\..\..\AddIns\AddIns\Misc\SharpReport\SharpReportCore.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs" />
@ -70,6 +66,10 @@ @@ -70,6 +66,10 @@
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
<ProjectReference Include="..\..\..\src\AddIns\Misc\SharpReport\SharpReportCore\SharpReportCore.csproj">
<Project>{4B2239FF-8FD6-431D-9D22-1B8049BA6917}</Project>
<Name>SharpReportCore</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

8
samples/SharpReport/ReportSamples/ReportSamples.sln

@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.1100
# SharpDevelop 2.0.0.1438
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportSamples", "ReportSamples.csproj", "{0D46CC0C-FC27-4258-BC0D-F4A9E617FA0E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportCore", "..\..\..\src\AddIns\Misc\SharpReport\SharpReportCore\SharpReportCore.csproj", "{4B2239FF-8FD6-431D-9D22-1B8049BA6917}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -12,5 +14,9 @@ Global @@ -12,5 +14,9 @@ Global
{0D46CC0C-FC27-4258-BC0D-F4A9E617FA0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D46CC0C-FC27-4258-BC0D-F4A9E617FA0E}.Release|Any CPU.Build.0 = Release|Any CPU
{0D46CC0C-FC27-4258-BC0D-F4A9E617FA0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Release|Any CPU.Build.0 = Release|Any CPU
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal

2
src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.addin

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "Boo"
insertbefore="AllFiles"
name = "Boo Files (*.boo)"
name = "${res:SharpDevelop.FileFilter.Boo} (*.boo)"
extensions = "*.boo"/>
</Path>

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs

@ -417,8 +417,8 @@ namespace CSharpBinding.FormattingStrategy @@ -417,8 +417,8 @@ namespace CSharpBinding.FormattingStrategy
return IndentLine(textArea, lineNr) + "#endregion".Length;
}
if (lineAbove.HighlightSpanStack != null && lineAbove.HighlightSpanStack.Count > 0) {
if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments
if (lineAbove.HighlightSpanStack != null && !lineAbove.HighlightSpanStack.IsEmpty) {
if (!lineAbove.HighlightSpanStack.Peek().StopEOL) { // case for /* style comments
int index = lineAboveText.IndexOf("/*");
if (index > 0) {
StringBuilder indentation = new StringBuilder(GetIndentation(textArea, lineNr - 1));

8
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/Indentation.cs

@ -321,7 +321,8 @@ namespace CSharpBinding.FormattingStrategy @@ -321,7 +321,8 @@ namespace CSharpBinding.FormattingStrategy
// statement).
if (!oldBlock.Continuation && !oldBlock.OneLineBlock &&
oldBlock.StartLine == block.StartLine &&
block.StartLine < doc.LineNumber && lastRealChar != ':') {
block.StartLine < doc.LineNumber && lastRealChar != ':')
{
// use indent StringBuilder to get the indentation of the current line
indent.Length = 0;
line = doc.Text; // get untrimmed line
@ -330,6 +331,11 @@ namespace CSharpBinding.FormattingStrategy @@ -330,6 +331,11 @@ namespace CSharpBinding.FormattingStrategy
break;
indent.Append(line[i]);
}
// /* */ multiline comments have an extra space - do not count it
// for the block's indentation.
if (startInComment && indent.Length > 0 && indent[indent.Length - 1] == ' ') {
indent.Length -= 1;
}
block.InnerIndent = indent.ToString();
}
return;

2
src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "ILASM"
insertbefore="AllFiles"
name = "IL Files (*.il)"
name = "${res:SharpDevelop.FileFilter.ILAsm} (*.il)"
extensions = "*.il"/>
</Path>

17
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/AbstractDesignerGenerator.cs

@ -353,6 +353,16 @@ namespace ICSharpCode.FormsDesigner @@ -353,6 +353,16 @@ namespace ICSharpCode.FormsDesigner
protected abstract string CreateEventHandler(EventDescriptor edesc, string eventMethodName, string body, string indentation);
protected virtual int GetCursorLine(IDocument document, IMethod method)
{
return method.BodyRegion.BeginLine + 1;
}
protected virtual int GetCursorLineAfterEventHandlerCreation()
{
return 2;
}
/// <summary>
/// If found return true and int as position
/// </summary>
@ -371,7 +381,7 @@ namespace ICSharpCode.FormsDesigner @@ -371,7 +381,7 @@ namespace ICSharpCode.FormsDesigner
foreach (IMethod method in completeClass.Methods) {
if (method.Name == eventMethodName) {
position = method.Region.BeginLine + 1;
position = GetCursorLine(document, method);
file = method.DeclaringType.CompilationUnit.FileName;
return true;
}
@ -379,12 +389,13 @@ namespace ICSharpCode.FormsDesigner @@ -379,12 +389,13 @@ namespace ICSharpCode.FormsDesigner
viewContent.MergeFormChanges();
Reparse();
position = c.Region.EndLine + 1;
file = c.CompilationUnit.FileName;
int line = GetEventHandlerInsertionLine(c);
int offset = viewContent.Document.GetLineSegment(GetEventHandlerInsertionLine(c) - 1).Offset;
int offset = viewContent.Document.GetLineSegment(line - 1).Offset;
viewContent.Document.Insert(offset, CreateEventHandler(edesc, eventMethodName, body, tabs));
position = line + GetCursorLineAfterEventHandlerCreation();
return false;
}

36
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs

@ -19,19 +19,7 @@ namespace ICSharpCode.FormsDesigner @@ -19,19 +19,7 @@ namespace ICSharpCode.FormsDesigner
{
protected override DomRegion GetReplaceRegion(ICSharpCode.TextEditor.Document.IDocument document, IMethod method)
{
DomRegion r = method.BodyRegion;
int offset = document.PositionToOffset(new Point(r.BeginColumn - 1, r.BeginLine - 1));
string tmp = document.GetText(offset, 10);
while (offset < document.TextLength) {
char c = document.GetCharAt(offset++);
if (c == '{') {
return new DomRegion(r.BeginLine + 1, 1, r.EndLine, 1);
}
if (c != ' ') {
break;
}
}
return new DomRegion(r.BeginLine + 2, 1, r.EndLine, 1);
return new DomRegion(GetCursorLine(document, method), 1, method.BodyRegion.EndLine, 1);
}
protected override System.CodeDom.Compiler.CodeDomProvider CreateCodeProvider()
@ -52,6 +40,28 @@ namespace ICSharpCode.FormsDesigner @@ -52,6 +40,28 @@ namespace ICSharpCode.FormsDesigner
return b.ToString();
}
protected override int GetCursorLineAfterEventHandlerCreation()
{
return 3;
}
protected override int GetCursorLine(ICSharpCode.TextEditor.Document.IDocument document, IMethod method)
{
DomRegion r = method.BodyRegion;
int offset = document.PositionToOffset(new Point(r.BeginColumn - 1, r.BeginLine - 1));
string tmp = document.GetText(offset, 10);
while (offset < document.TextLength) {
char c = document.GetCharAt(offset++);
if (c == '{') {
return r.BeginLine + 1;
}
if (c != ' ') {
break;
}
}
return r.BeginLine + 2;
}
protected static string GenerateParams(EventDescriptor edesc, bool paramNames)
{
System.Type type = edesc.EventType;

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs

@ -289,7 +289,7 @@ namespace ICSharpCode.FormsDesigner @@ -289,7 +289,7 @@ namespace ICSharpCode.FormsDesigner
public void ShowSourceCode(int lineNumber)
{
ShowSourceCode();
textAreaControlProvider.TextEditorControl.ActiveTextAreaControl.JumpTo(lineNumber, 255);
textAreaControlProvider.TextEditorControl.ActiveTextAreaControl.JumpTo(lineNumber - 1);
}
public void ShowSourceCode(IComponent component, EventDescriptor edesc, string eventMethodName)
@ -300,7 +300,7 @@ namespace ICSharpCode.FormsDesigner @@ -300,7 +300,7 @@ namespace ICSharpCode.FormsDesigner
if (FileUtility.IsEqualFileName(file, this.TextEditorControl.FileName)) {
ShowSourceCode(position);
} else {
FileService.JumpToFilePosition(file, position, 255);
FileService.JumpToFilePosition(file, position - 1, 0);
}
}

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs

@ -183,7 +183,7 @@ namespace ICSharpCode.FormsDesigner.Gui @@ -183,7 +183,7 @@ namespace ICSharpCode.FormsDesigner.Gui
void loadButtonClick(object sender, System.EventArgs e)
{
if (!System.IO.File.Exists(ControlDictionary["fileNameTextBox"].Text)) {
MessageBox.Show("Please enter a valid file name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageService.ShowWarning("${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.AddSidebarComponents.EnterValidFilename}");
return;
}
@ -192,7 +192,7 @@ namespace ICSharpCode.FormsDesigner.Gui @@ -192,7 +192,7 @@ namespace ICSharpCode.FormsDesigner.Gui
Assembly asm = Assembly.LoadFrom(assemblyFileName);
FillComponents(asm, Path.GetDirectoryName(assemblyFileName));
} catch {
MessageBox.Show("Please enter the file name of a valid .NET assembly.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageService.ShowWarning("${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.AddSidebarComponents.FileIsNotAssembly}");
FillComponents(null, null);
}
}

2
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/ToolboxProvider.cs

@ -124,7 +124,7 @@ namespace ICSharpCode.FormsDesigner @@ -124,7 +124,7 @@ namespace ICSharpCode.FormsDesigner
}
}
}
SideTabDesigner customTab = new CustomComponentsSideTab(SharpDevelopSideBar.SideBar, "Custom Components", toolboxService);
SideTabDesigner customTab = new CustomComponentsSideTab(SharpDevelopSideBar.SideBar, ResourceService.GetString("ICSharpCode.SharpDevelop.FormDesigner.ToolboxProvider.CustomComponents"), toolboxService);
customTab.ItemRemoved += SideTabItemRemoved;
customTab.ItemsExchanged += SideTabItemsExchanged;
SideTabs.Add(customTab);

2
src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/BinaryView.cs

@ -50,7 +50,7 @@ namespace ResourceEditor @@ -50,7 +50,7 @@ namespace ResourceEditor
viewHexDumpCheckBox.Location = new Point(8, 4);
viewHexDumpCheckBox.Size = new Size(Width - 16, 16);
viewHexDumpCheckBox.Text = "Show as Hex Dump";
viewHexDumpCheckBox.Text = StringParser.Parse("${res:ResourceEditor.ResourceEdit.ShowAsHexDump}");
viewHexDumpCheckBox.CheckedChanged += new EventHandler(CheckEvt);
Controls.Add(byteDataTextBox);

2
src/AddIns/DisplayBindings/XmlEditor/Project/Src/AssignStylesheetCommand.cs

@ -43,7 +43,7 @@ namespace ICSharpCode.XmlEditor @@ -43,7 +43,7 @@ namespace ICSharpCode.XmlEditor
dialog.AddExtension = true;
dialog.Multiselect = false;
dialog.CheckFileExists = true;
dialog.Title = "Assign XSLT Stylesheet";
dialog.Title = ResourceService.GetString("ICSharpCode.XmlEditor.AssignXSLT.Title");
AddInTreeNode node = AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter");
if (node != null) {

2
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlSchemasPanel.cs

@ -105,7 +105,7 @@ namespace ICSharpCode.XmlEditor @@ -105,7 +105,7 @@ namespace ICSharpCode.XmlEditor
changed = AddSchema(schemaFileName);
}
} catch (Exception ex) {
MessageService.ShowError(ex, "${res:ICSharpCode.XmlEditor.XmlSchemasPanel.UnableToAddSchema}");
MessageService.ShowError("${res:ICSharpCode.XmlEditor.XmlSchemasPanel.UnableToAddSchema}\n\n" + ex.Message);
}
}

8
src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin

@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
extensions = "*.xml"/>
<FileFilter id = "Xsl"
insertbefore="AllFiles"
name = "XSL files (*.xsl;*.xslt)"
name = "${res:SharpDevelop.FileFilter.XslFiles} (*.xsl;*.xslt)"
extensions = "*.xsl;*.xslt"/>
</Path>
@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
<Condition name = "WindowActive" activewindow = "ICSharpCode.XmlEditor.XslOutputView"/>
</Not>
<MenuItem id="AssignStylesheet"
label="&amp;Assign XSLT..."
label="${res:ICSharpCode.XmlEditor.AssignXSLT}"
class="ICSharpCode.XmlEditor.AssignStylesheetCommand"/>
<ComplexCondition action="Disable">
<!-- evaluate StylesheetAssigned only when XmlView is active - important for lazy loading! -->
@ -74,11 +74,11 @@ @@ -74,11 +74,11 @@
<Condition name = "StylesheetAssigned" action="Disable"/>
</And>
<MenuItem id="OpenStylesheet"
label="&amp;Open XSLT"
label="${res:ICSharpCode.XmlEditor.OpenXSLT}"
class="ICSharpCode.XmlEditor.OpenStylesheetCommand"/>
</ComplexCondition>
<MenuItem id="RunTransform"
label="Run XSL&amp;T"
label="${res:ICSharpCode.XmlEditor.RunXSLT}"
class="ICSharpCode.XmlEditor.RunXslTransformCommand"
shortcut="Control|Shift|T"/>
</ComplexCondition>

2
src/AddIns/Misc/AddInManager/Project/Src/InstallableAddIn.cs

@ -40,7 +40,7 @@ namespace ICSharpCode.AddInManager @@ -40,7 +40,7 @@ namespace ICSharpCode.AddInManager
addIn = AddIn.Load(fileName);
}
if (addIn.Manifest.PrimaryIdentity == null)
throw new AddInLoadException("The AddIn must have an <Identity> for use with the AddIn-Manager.");
throw new AddInLoadException(ResourceService.GetString("AddInManager.AddInMustHaveIdentity"));
}
void LoadAddInFromZip(ZipFile file)

7
src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs

@ -453,8 +453,7 @@ namespace ICSharpCode.AddInManager @@ -453,8 +453,7 @@ namespace ICSharpCode.AddInManager
switch (Path.GetExtension(file).ToLowerInvariant()) {
case ".addin":
if (FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, file)) {
MessageService.ShowMessage("You cannot install AddIns inside the ${ProductName} directory, " +
"they will be picked up as pre-installed AddIns automatically.");
MessageService.ShowMessage("${res:AddInManager.CannotInstallIntoApplicationDirectory}");
return false;
}
list.Add(new InstallableAddIn(file, false));
@ -464,7 +463,7 @@ namespace ICSharpCode.AddInManager @@ -464,7 +463,7 @@ namespace ICSharpCode.AddInManager
list.Add(new InstallableAddIn(file, true));
break;
default:
MessageService.ShowMessage("Unknown file format: " + Path.GetExtension(file));
MessageService.ShowMessage("${res:AddInManager.UnknownFileFormat} " + Path.GetExtension(file));
return false;
}
} catch (AddInLoadException ex) {
@ -651,7 +650,7 @@ namespace ICSharpCode.AddInManager @@ -651,7 +650,7 @@ namespace ICSharpCode.AddInManager
case AddInAction.Disable:
for (int i = 0; i < selected.Count; i++) {
if (selected[i].Manifest.PrimaryIdentity == "ICSharpCode.AddInManager") {
MessageService.ShowMessage("You cannot disable the AddInManager because you need it to re-enable AddIns!");
MessageService.ShowMessage("${res:AddInManager.CannotDisableAddInManager}");
selected.RemoveAt(i--);
}
}

6
src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoverageHighlighter.cs

@ -40,19 +40,19 @@ namespace ICSharpCode.CodeCoverage @@ -40,19 +40,19 @@ namespace ICSharpCode.CodeCoverage
if (sequencePoint.EndLine == sequencePoint.Line) {
LineSegment lineSegment = markerStrategy.Document.GetLineSegment(sequencePoint.Line - 1);
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset + sequencePoint.Column, sequencePoint));
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset + sequencePoint.Column - 1, sequencePoint));
} else {
// Sequence point spread across lines.
for (int line = sequencePoint.Line; line <= sequencePoint.EndLine; ++line) {
LineSegment lineSegment = markerStrategy.Document.GetLineSegment(line - 1);
if (line == sequencePoint.Line) {
// First line.
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset + sequencePoint.Column, lineSegment.Length - (lineSegment.DelimiterLength - 1) - sequencePoint.Column, sequencePoint));
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset + sequencePoint.Column - 1, lineSegment.Length - (sequencePoint.Column - 1), sequencePoint));
} else if (line == sequencePoint.EndLine) {
// Last line.
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset, sequencePoint.EndColumn - 1, sequencePoint));
} else {
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset, lineSegment.Length - (lineSegment.DelimiterLength - 1), sequencePoint));
markerStrategy.AddMarker(new CodeCoverageTextMarker(lineSegment.Offset, lineSegment.Length, sequencePoint));
}
}
}

6
src/AddIns/Misc/CodeCoverage/Test/AddCodeCoverageMarkersTestFixture.cs

@ -78,7 +78,7 @@ namespace ICSharpCode.CodeCoverage.Tests @@ -78,7 +78,7 @@ namespace ICSharpCode.CodeCoverage.Tests
[Test]
public void MarkerOneOffset()
{
Assert.AreEqual(3, markerOne.Offset);
Assert.AreEqual(2, markerOne.Offset);
}
[Test]
@ -108,7 +108,7 @@ namespace ICSharpCode.CodeCoverage.Tests @@ -108,7 +108,7 @@ namespace ICSharpCode.CodeCoverage.Tests
[Test]
public void MarkerTwoOffset()
{
Assert.AreEqual(9, markerTwo.Offset);
Assert.AreEqual(8, markerTwo.Offset);
}
[Test]
@ -132,7 +132,7 @@ namespace ICSharpCode.CodeCoverage.Tests @@ -132,7 +132,7 @@ namespace ICSharpCode.CodeCoverage.Tests
[Test]
public void MarkerThreeOffset()
{
Assert.AreEqual(27, markerThree.Offset);
Assert.AreEqual(26, markerThree.Offset);
}
[Test]

8
src/AddIns/Misc/CodeCoverage/Test/CodeCoverageMarkersCoverTwoLinesTestFixture.cs

@ -70,7 +70,7 @@ namespace ICSharpCode.CodeCoverage.Tests @@ -70,7 +70,7 @@ namespace ICSharpCode.CodeCoverage.Tests
[Test]
public void MarkerOneOffset()
{
Assert.AreEqual(3, markerOne.Offset);
Assert.AreEqual(2, markerOne.Offset);
}
[Test]
@ -82,13 +82,13 @@ namespace ICSharpCode.CodeCoverage.Tests @@ -82,13 +82,13 @@ namespace ICSharpCode.CodeCoverage.Tests
[Test]
public void MarkerTwoOffset()
{
Assert.AreEqual(9, markerTwo.Offset);
Assert.AreEqual(8, markerTwo.Offset);
}
[Test]
public void MarkerTwoLength()
{
Assert.AreEqual(56, markerTwo.Length);
Assert.AreEqual(58, markerTwo.Length);
}
[Test]
@ -112,7 +112,7 @@ namespace ICSharpCode.CodeCoverage.Tests @@ -112,7 +112,7 @@ namespace ICSharpCode.CodeCoverage.Tests
[Test]
public void MarkerFourOffset()
{
Assert.AreEqual(129, markerFour.Offset);
Assert.AreEqual(128, markerFour.Offset);
}
}
}

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs

@ -75,10 +75,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -75,10 +75,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
debuggerCore.OnDebuggeeStateChanged(); // Force refresh of pads
}
} else {
MessageBox.Show("You can not switch to function without symbols", "Function switch");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWithoutSymbols}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}");
}
} else {
MessageBox.Show("You can not switch functions while the debugger is running.", "Function switch");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWhileRunning}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}");
}
}

14
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs

@ -57,11 +57,17 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -57,11 +57,17 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
RedrawContent();
}
static string privateMembersName, staticMembersName, privateStaticMembersName;
public override void RedrawContent()
{
name.Text = ResourceService.GetString("Global.Name");
val.Text = ResourceService.GetString("Dialog.HighlightingEditor.Properties.Value");
type.Text = ResourceService.GetString("ResourceEditor.ResourceEdit.TypeColumn");
privateMembersName = StringParser.Parse("<${res:MainWindow.Windows.Debug.LocalVariables.PrivateMembers}>");
staticMembersName = StringParser.Parse("<${res:MainWindow.Windows.Debug.LocalVariables.StaticMembers}>");
privateStaticMembersName = StringParser.Parse("<${res:MainWindow.Windows.Debug.LocalVariables.PrivateStaticMembers}>");
}
// This is a walkarond for a visual issue
@ -88,9 +94,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -88,9 +94,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
public static void AddVariableCollectionToTree(VariableCollection varCollection, TreeListViewItemCollection tree)
{
TreeListViewItem privateInstanceMenu = new TreeListViewItem("<Private Members>", 0);
TreeListViewItem staticMenu = new TreeListViewItem("<Static Members>", 0);
TreeListViewItem privateStaticMenu = new TreeListViewItem("<Private Static Members>", 0);
TreeListViewItem privateInstanceMenu = new TreeListViewItem(privateMembersName, 0);
TreeListViewItem staticMenu = new TreeListViewItem(staticMembersName, 0);
TreeListViewItem privateStaticMenu = new TreeListViewItem(privateStaticMembersName, 0);
AddVariableMethod addVariable = delegate(Variable variable) {
ClassVariable classVariable = variable as ClassVariable;
@ -146,7 +152,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -146,7 +152,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
((TreeListViewDebuggerItem)e.Item).BeforeExpand();
}
} else {
MessageBox.Show("You can not explore variables while the debuggee is running.");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.LocalVariables.CannotExploreVariablesWhileRunning}");
e.Cancel = true;
}
}

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.Menu.cs

@ -56,7 +56,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -56,7 +56,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
bool suspended = (selItems[0].Tag as Thread).Suspended;
if (!debuggerCore.IsPaused) {
MessageBox.Show("You can not freeze or thaw thread while the debugger is running.", "Thread freeze");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.Threads.CannotFreezeWhileRunning}", "${res:MainWindow.Windows.Debug.Threads.Freeze}");
return;
}

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs

@ -97,7 +97,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -97,7 +97,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
debuggerCore.OnDebuggeeStateChanged(); // Force refresh of pads
}
} else {
MessageBox.Show("You can not switch threads while the debugger is running.", "Thread switch");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.Threads.CannotSwitchWhileRunning}", "${res:MainWindow.Windows.Debug.Threads.ThreadSwitch}");
}
}
@ -147,7 +147,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -147,7 +147,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
item.SubItems.Add(thread.Priority.ToString());
break;
}
item.SubItems.Add(StringParser.Parse(thread.Suspended ? "${res:Global.Yes}" : "${res:Global.No}"));
item.SubItems.Add(ResourceService.GetString(thread.Suspended ? "Global.Yes" : "Global.No"));
return;
}
}

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -120,7 +120,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -120,7 +120,7 @@ namespace ICSharpCode.SharpDevelop.Services
public void StepInto()
{
if (debugger.SelectedFunction == null || debugger.IsRunning) {
MessageBox.Show("You can not step because there is no function selected to be stepped","Step into");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.Threads.CannotStepNoActiveFunction}", "${res:XML.MainMenu.DebugMenu.StepInto}");
} else {
debugger.StepInto();
}
@ -129,7 +129,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -129,7 +129,7 @@ namespace ICSharpCode.SharpDevelop.Services
public void StepOver()
{
if (debugger.SelectedFunction == null || debugger.IsRunning) {
MessageBox.Show("You can not step because there is no function selected to be stepped","Step over");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.Threads.CannotStepNoActiveFunction}", "${res:XML.MainMenu.DebugMenu.StepOver.Description}");
} else {
debugger.StepOver();
}
@ -138,7 +138,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -138,7 +138,7 @@ namespace ICSharpCode.SharpDevelop.Services
public void StepOut()
{
if (debugger.SelectedFunction == null || debugger.IsRunning) {
MessageBox.Show("You can not step because there is no function selected to be stepped","Step out");
MessageService.ShowMessage("${res:MainWindow.Windows.Debug.Threads.CannotStepNoActiveFunction}", "${res:XML.MainMenu.DebugMenu.StepOut}");
} else {
debugger.StepOut();
}

3
src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingColorDialog.cs

@ -38,6 +38,9 @@ namespace ICSharpCode.SharpDevelop.Gui { @@ -38,6 +38,9 @@ namespace ICSharpCode.SharpDevelop.Gui {
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.ColorDialog.xfrm"));
if (color == null) {
color = new EditorHighlightColor(true);
}
Color = color;
boldBox = (CheckBox)ControlDictionary["boldBox"];

2
src/AddIns/Misc/HighlightingEditor/Project/Src/EditorHighlightColor.cs

@ -148,7 +148,7 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes @@ -148,7 +148,7 @@ namespace ICSharpCode.SharpDevelop.AddIns.HighlightingEditor.Nodes
public static EditorHighlightColor FromTextEditor(ICSharpCode.TextEditor.Document.HighlightColor color)
{
return new EditorHighlightColor(color.HasForgeground, color.Color, color.HasBackground, color.BackgroundColor, color.Bold, color.Italic);
return new EditorHighlightColor(color.HasForeground, color.Color, color.HasBackground, color.BackgroundColor, color.Bold, color.Italic);
}
public EditorHighlightColor(bool hascolor, Color Color, bool hasbackcolor, Color BackColor, bool bold, bool italic)

28
src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs

@ -300,7 +300,11 @@ namespace HtmlHelp2 @@ -300,7 +300,11 @@ namespace HtmlHelp2
#region published Help2 TOC Commands
public void SynchronizeToc(string topicUrl)
{
tocControl.Synchronize(topicUrl);
try {
tocControl.Synchronize(topicUrl);
} catch (System.Runtime.InteropServices.COMException) {
// SD2-812: ignore exception when trying to synchronize non-existing URL
}
}
public void GetNextFromNode()
@ -312,9 +316,14 @@ namespace HtmlHelp2 @@ -312,9 +316,14 @@ namespace HtmlHelp2
public void GetNextFromUrl(string url)
{
int currentNode = tocControl.Hierarchy.GetNextFromUrl(url);
string topicUrl = tocControl.Hierarchy.GetURL(currentNode);
this.CallHelp(topicUrl, true);
try {
int currentNode = tocControl.Hierarchy.GetNextFromUrl(url);
string topicUrl = tocControl.Hierarchy.GetURL(currentNode);
this.CallHelp(topicUrl, true);
} catch (System.Runtime.InteropServices.COMException) {
} catch (ArgumentException) {
// SD2-812: ignore exception when trying to synchronize non-existing URL
}
}
public void GetPrevFromNode()
@ -326,9 +335,14 @@ namespace HtmlHelp2 @@ -326,9 +335,14 @@ namespace HtmlHelp2
public void GetPrevFromUrl(string url)
{
int currentNode = tocControl.Hierarchy.GetPrevFromUrl(url);
string topicUrl = tocControl.Hierarchy.GetURL(currentNode);
this.CallHelp(topicUrl, true);
try {
int currentNode = tocControl.Hierarchy.GetPrevFromUrl(url);
string topicUrl = tocControl.Hierarchy.GetURL(currentNode);
this.CallHelp(topicUrl, true);
} catch (ArgumentException) {
} catch (System.Runtime.InteropServices.COMException) {
// SD2-812: ignore exception when trying to synchronize non-existing URL
}
}
public bool IsNotFirstNode

2
src/AddIns/Misc/NAntAddIn/Project/NAnt.addin

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "NAnt"
insertbefore="AllFiles"
name = "NAnt Build Files (*.build;*.include)"
name = "${res:SharpDevelop.FileFilter.NAnt} (*.build;*.include)"
extensions = "*.build;*.include"/>
</Path>

2
src/AddIns/Misc/RegExpTk/Project/Resources/RegExpTkGroupForm.xfrm

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<System.Windows.Forms.Form>
<Name value="GroupsForm" />
<FormBorderStyle value="SizableToolWindow" />
<Text value="Groups" />
<Text value="${res:RegExpTk.MainDialog.GroupsColumn}" />
<ClientSize value="{Width=460, Height=222}" />
<Controls>
<System.Windows.Forms.Button>

21
src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs

@ -32,7 +32,7 @@ namespace Plugins.RegExpTk { @@ -32,7 +32,7 @@ namespace Plugins.RegExpTk {
public QuickInsert(string name, string text)
{
Name = name;
Name = StringParser.Parse(name);
Text = text;
}
@ -67,13 +67,14 @@ namespace Plugins.RegExpTk { @@ -67,13 +67,14 @@ namespace Plugins.RegExpTk {
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.RegExpTkMainForm.xfrm"));
ArrayList quickies = new ArrayList();
quickies.Add(new QuickInsert("Ungreedy star", "*?"));
quickies.Add(new QuickInsert("Word character value", "\\w"));
quickies.Add(new QuickInsert("Non-word character value", "\\W"));
quickies.Add(new QuickInsert("Whitespace character", "\\s"));
quickies.Add(new QuickInsert("Non-whitespace character", "\\S"));
quickies.Add(new QuickInsert("Digit character", "\\d"));
quickies.Add(new QuickInsert("Non-digit character", "\\D"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.UngreedyStar}", "*?"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.WordCharacter}", "\\w"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.NonWordCharacter}", "\\W"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.WhitespaceCharacter}", "\\s"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.NonWhitespaceCharacter}", "\\S"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.DigitCharacter}", "\\d"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.NonDigitCharacter}", "\\D"));
quickies.Add(new QuickInsert("${res:RegExpTk.RegExpMenu.WordBorder}", "\\b"));
foreach (QuickInsert insert in quickies) {
MenuCommand cmd = new MenuCommand(insert.Name, new EventHandler(quickInsert));
@ -81,7 +82,7 @@ namespace Plugins.RegExpTk { @@ -81,7 +82,7 @@ namespace Plugins.RegExpTk {
quickInsertMenu.Items.Add(cmd);
}
matchListViewContextMenu.Items.Add(new MenuCommand("Show groups", new EventHandler(MatchListViewContextMenu_Clicked)));
matchListViewContextMenu.Items.Add(new MenuCommand("${res:RegExpTk.MainDialog.ShowGroups}", new EventHandler(MatchListViewContextMenu_Clicked)));
((Button)ControlDictionary["OkButton"]).Click += new EventHandler(OkButton_Click);
((CheckBox)ControlDictionary["ReplaceCheckBox"]).CheckedChanged += new EventHandler(ReplaceCheckBox_CheckedChanged);
@ -248,7 +249,7 @@ namespace Plugins.RegExpTk { @@ -248,7 +249,7 @@ namespace Plugins.RegExpTk {
SaveFileDialog sfd = new SaveFileDialog();
sfd.InitialDirectory = "c:\\";
sfd.Filter = "Assemblies (*.dll)|*.dll";
sfd.Filter = ResourceService.GetString("RegExpTk.MainDialog.Assemblies");
sfd.DefaultExt = "dll";
sfd.CheckPathExists = true;

2
src/AddIns/Misc/SharpReport/SharpReport.sln

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.1034
# SharpDevelop 2.0.0.1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportCore", "SharpReportCore\SharpReportCore.csproj", "{4B2239FF-8FD6-431D-9D22-1B8049BA6917}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReport", "SharpReport\SharpReport.csproj", "{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}"

3
src/AddIns/Misc/SharpReport/SharpReport/Designer/Factories.cs

@ -38,7 +38,8 @@ namespace SharpReport.Designer { @@ -38,7 +38,8 @@ namespace SharpReport.Designer {
public class IDesignableFactory : SharpReportCore.GenericFactory {
public IDesignableFactory() :base(Assembly.GetExecutingAssembly(),typeof(IDesignable)){
public IDesignableFactory() :base(Assembly.GetExecutingAssembly(),
typeof(IDesignable)){
}
public new BaseReportItem Create(string name) {

20
src/AddIns/Misc/SharpReport/SharpReport/Designer/IDesignerVisitor.cs

@ -1,20 +0,0 @@ @@ -1,20 +0,0 @@
/*
* Created by SharpDevelop.
* User: Forstmeier Helmut
* Date: 10.08.2005
* Time: 22:14
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
/// <summary>
/// Each DesignControl Visitor has to implement this Interface
/// </summary>
using System;
namespace SharpReport.Designer{
public interface IDesignerVisitor {
void Visit (SharpReport.Designer.BaseDesignerControl designer);
}
}

21
src/AddIns/Misc/SharpReport/SharpReport/Designer/IVisitor.cs

@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
/*
* Created by SharpDevelop.
* User: Forstmeier Peter
* Date: 10.08.2005
* Time: 13:38
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using SharpReport.Designer;
namespace SharpReport.Designer{
/// <summary>
/// Implemented in SharpReportDesigner
/// </summary>
public interface IVisitor{
void Accept(IDesignerVisitor visitor);
}
}

21
src/AddIns/Misc/SharpReport/SharpReport/Designer/Report.cs

@ -340,11 +340,22 @@ namespace SharpReport.Designer{ @@ -340,11 +340,22 @@ namespace SharpReport.Designer{
void SectionSelected(object sender, System.EventArgs e){
ReportSection section = (ReportSection)sender;
if (this.selectedSection != null) {
if (this.selectedSection != section) {
ITracker tracker = selectedSection.VisualControl as ITracker;
if (tracker != null) {
tracker.ClearSelections();
}
}
}
selectedSection = section;
selectedObject = (IBaseRenderer)section;
OnObjectSelected(e);
}
void ItemSelected(object sender, System.EventArgs e){
selectedObject = (IBaseRenderer)sender;
OnObjectSelected(e);
@ -407,7 +418,7 @@ namespace SharpReport.Designer{ @@ -407,7 +418,7 @@ namespace SharpReport.Designer{
this.visualPageFooter.Name = "visualPageFooter";
this.visualPageFooter.Size = new System.Drawing.Size(400, 68);
this.visualPageFooter.TabIndex = 6;
this.visualDetail.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
this.visualPageFooter.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
//
// visualFooter
//
@ -418,7 +429,7 @@ namespace SharpReport.Designer{ @@ -418,7 +429,7 @@ namespace SharpReport.Designer{
this.visualFooter.Name = "visualFooter";
this.visualFooter.Size = new System.Drawing.Size(400, 76);
this.visualFooter.TabIndex = 7;
this.visualDetail.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
this.visualFooter.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
//
// visualPageHeader
//
@ -429,7 +440,7 @@ namespace SharpReport.Designer{ @@ -429,7 +440,7 @@ namespace SharpReport.Designer{
this.visualPageHeader.Name = "visualPageHeader";
this.visualPageHeader.Size = new System.Drawing.Size(400, 84);
this.visualPageHeader.TabIndex = 1;
this.visualDetail.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
this.visualPageHeader.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
//
// visualReportHeader
//
@ -440,7 +451,7 @@ namespace SharpReport.Designer{ @@ -440,7 +451,7 @@ namespace SharpReport.Designer{
this.visualReportHeader.Name = "visualReportHeader";
this.visualReportHeader.Size = new System.Drawing.Size(400, 56);
this.visualReportHeader.TabIndex = 0;
this.visualDetail.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
this.visualReportHeader.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged);
//
// Report
//

11
src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/BaseDesignerControl.cs

@ -21,7 +21,7 @@ namespace SharpReport.Designer{ @@ -21,7 +21,7 @@ namespace SharpReport.Designer{
/// <summary>
/// Description of BaseDesignerControl.
/// </summary>
public class BaseDesignerControl : System.Windows.Forms.UserControl,SharpReport.Designer.IVisitor
public class BaseDesignerControl : UserControl,SharpReportCore.IVisitor
{
private SharpReport.Designer.Report reportControl;
private Ruler.ctrlRuler ctrlRuler1;
@ -96,7 +96,7 @@ namespace SharpReport.Designer{ @@ -96,7 +96,7 @@ namespace SharpReport.Designer{
void ReportControlSizeChanged(object sender, System.EventArgs e){
this.ctrlRuler1.Width = reportControl.Width;
this.ctrlRuler1.Invalidate();
NotifyPropertyChanged(this.Name + "ReportControlSizeChanged");
// NotifyPropertyChanged(this.Name + "ReportControlSizeChanged");
}
void ReportControlSectionChanged (object sender,SectionChangedEventArgs e) {
@ -118,9 +118,12 @@ namespace SharpReport.Designer{ @@ -118,9 +118,12 @@ namespace SharpReport.Designer{
#endregion
#region SharpReport.DelegatesInterfaces.IVisitor interface implementation
public void Accept(IDesignerVisitor visitor) {
visitor.Visit(this);
public void Accept(IModelVisitor visitor){
SharpReportCore.IModelVisitor v = visitor as SharpReportCore.IModelVisitor;
v.Visit(this);
}
#endregion

5
src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportDetail.cs

@ -35,11 +35,6 @@ namespace SharpReport.Designer{ @@ -35,11 +35,6 @@ namespace SharpReport.Designer{
base.ItemDragDrop += new ItemDragDropEventHandler (ItemsChanging);
}
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) {
base.OnPaint (e);
}
protected void ItemsChanging (object sender,ItemDragDropEventArgs e) {
if (ReportItemsHandling != null) {

2
src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportSection.cs

@ -66,7 +66,7 @@ namespace SharpReport{ @@ -66,7 +66,7 @@ namespace SharpReport{
return this.visualControl;
}
set { this.visualControl = value;
this.visualControl.Body.Click += new EventHandler(VisualControlClick);
this.visualControl.Click += new EventHandler(VisualControlClick);
this.visualControl.Body.MouseDown += new MouseEventHandler (VisualControlMouseUp);
}
}

203
src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportSectionControlbase.cs

@ -22,7 +22,9 @@ using SharpReport.ReportItems; @@ -22,7 +22,9 @@ using SharpReport.ReportItems;
///
namespace SharpReport.Designer{
public abstract class ReportSectionControlBase :ReportObjectControlBase{
public abstract class ReportSectionControlBase :ReportObjectControlBase,
ITracker{
private System.Windows.Forms.Panel titlePanel;
private System.Windows.Forms.Panel splitPanel;
private Ruler.ctrlRuler ctrlRuler1;
@ -35,12 +37,16 @@ namespace SharpReport.Designer{ @@ -35,12 +37,16 @@ namespace SharpReport.Designer{
private int currentY;
private IDesignableFactory designableFactory;
private ControlHelper controlHelper;
private BaseReportItem draggedItem;
public event EventHandler <EventArgs> ItemSelected;
public event ItemDragDropEventHandler ItemDragDrop;
public event EventHandler <SectionChangedEventArgs> SectionChanged;
private ReportControlBase selectedControl;
private RectTracker rectTracker = new RectTracker();
internal ReportSectionControlBase(){
InitializeComponent();
this.SetStyle(ControlStyles.DoubleBuffer |
@ -51,12 +57,191 @@ namespace SharpReport.Designer{ @@ -51,12 +57,191 @@ namespace SharpReport.Designer{
this.UpdateStyles();
caption = this.Name;
this.designableFactory = new IDesignableFactory();
this.controlHelper = new ControlHelper(this);
}
void BodyPanelSizeChanged(object sender, System.EventArgs e){
this.Size = new Size (this.Size.Width,this.bodyPanel.Height + this.titlePanel.Height + this.splitPanel.Height);
}
#region overrides
protected override CreateParams CreateParams{
get {
CreateParams cp=base.CreateParams;
cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
#endregion
#region ITracker implementation
public void ClearSelections() {
this.controlHelper.Clear(this.bodyPanel);
this.selectedControl = null;
this.InvalidateEx();
}
public void InvalidateEx() {
this.Invalidate();
if (this.Parent == null) {
return;
}
Rectangle rc = new Rectangle (this.bodyPanel.Location,this.bodyPanel.Size);
this.Invalidate(rc,true);
if(this.selectedControl != null){
rc = this.rectTracker.m_rect;
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height);
this.selectedControl.Invalidate();
}
}
public ReportControlBase SelectedControl {
set {
selectedControl = value;
}
}
public RectTracker RectTracker {
get {
return this.rectTracker;
}
}
public Control DesignSurface {
get{
return this.bodyPanel;
}
}
#endregion
#region tracker
private Rectangle GetParentRectangle(){
return new Rectangle(new Point(0,0),this.bodyPanel.Size);
}
private void OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){
if (this.rectTracker == null) {
return;
}
if(e.Button != MouseButtons .Left){
return;
}
Point pt = this.bodyPanel.PointToClient(Cursor.Position);
Rectangle rcForm = GetParentRectangle();
if(rcForm.Contains(pt)){
Rectangle rcObject;
if (this.rectTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing) {
this.selectedControl = null;
this.rectTracker.m_rect = new Rectangle(0,0,0,0);
// just to demonstrate RectTracker::TrackRubberBand
RectTracker tracker=new RectTracker();
if (tracker.TrackRubberBand(this.bodyPanel, pt, false)){
// see if rubber band intersects with the doc's tracker
// System.Console.WriteLine("3");
tracker.NormalizeRect(ref tracker.m_rect);
Rectangle rectIntersect = tracker.m_rect;
foreach (Control ctrl in this.bodyPanel.Controls){
rcObject = ctrl.Bounds;
//
if(tracker.m_rect.Contains(rcObject)){
this.rectTracker.m_rect = rcObject;
this.selectedControl = (ReportControlBase)ctrl;
this.selectedControl.Selected = true;
break;
}
}
}
else{
// No rubber band, see if the point selects an object.
foreach (Control ctrl in this.bodyPanel.Controls){
rcObject = ctrl.Bounds ;
if(rcObject.Contains(pt)){
this.rectTracker.m_rect = rcObject;
this.selectedControl = (ReportControlBase)ctrl;
break;
}
}
}
if(this.selectedControl == null){
NotifySectionClick();
}
else{
// System.Console.WriteLine("6");
// m_FormTracker.Clear();
}
}
else if(this.selectedControl != null){// normal tracking action, when tracker is hit
if (this.rectTracker.Track(this.bodyPanel, pt, false,null)) {
Rectangle rc = this.rectTracker.m_rect;
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height);
this.selectedControl.NotifyPropertyChanged("Tracker");
}
}
}
else{
if(this.selectedControl == null){//select the container form
System.Console.WriteLine("9");
// MainForm.m_propertyWindow.SetSelectedObject(m_Form);
/*
if(m_FormTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing)
{
m_FormTracker.m_rect = rcForm;
}
else if(!m_FormTracker.IsEmpty())
{
m_FormTracker.Track(this, pt, false,null);
}
*/
}
else{
// System.Console.WriteLine("10");
// m_FormTracker.Clear();
}
}
this.InvalidateEx();
}
private void OnMouseMove(object sender, System.Windows.Forms.MouseEventArgs e){
if (this.rectTracker != null) {
Point mousept=new Point(e.X,e.Y);
if(this.selectedControl != null){
if(!rectTracker.SetCursor(this,0,mousept))
this.Cursor=Cursors.Arrow;
}
// else{
// if(!m_FormTracker.SetCursor(this,0,mousept))
// this.Cursor=Cursors.Arrow;
// }
}
}
#endregion
#region painting
private void BodyPanelPaint(object sender, PaintEventArgs pea) {
pea.Graphics.Clear(this.Body.BackColor);
@ -77,6 +262,9 @@ namespace SharpReport.Designer{ @@ -77,6 +262,9 @@ namespace SharpReport.Designer{
}
}
#endregion
#region splitter
void SplitPanelMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){
mouseDown = true;
currentY = e.Y;
@ -93,6 +281,7 @@ namespace SharpReport.Designer{ @@ -93,6 +281,7 @@ namespace SharpReport.Designer{
}
}
#endregion
#region propertys
@ -115,7 +304,12 @@ namespace SharpReport.Designer{ @@ -115,7 +304,12 @@ namespace SharpReport.Designer{
#endregion
#region events
void NotifySectionClick () {
ClearSelections();
this.OnClick(EventArgs.Empty);
}
void FiredDragDropItem (string item,Point pointAt) {
if (ItemSelected != null) {
ItemSelected (this,new EventArgs());
@ -130,7 +324,7 @@ namespace SharpReport.Designer{ @@ -130,7 +324,7 @@ namespace SharpReport.Designer{
}
#endregion
#region DragDrop
@ -253,6 +447,8 @@ namespace SharpReport.Designer{ @@ -253,6 +447,8 @@ namespace SharpReport.Designer{
this.bodyPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.BodyPanelPaint);
this.bodyPanel.SizeChanged += new System.EventHandler(this.BodyPanelSizeChanged);
this.bodyPanel.DragLeave += new System.EventHandler(this.BodyPanelDragLeave);
this.bodyPanel.MouseMove += new MouseEventHandler(this.OnMouseMove);
this.bodyPanel.MouseDown += new MouseEventHandler(this.OnMouseDown);
//
// ctrlRuler1
//
@ -302,6 +498,7 @@ namespace SharpReport.Designer{ @@ -302,6 +498,7 @@ namespace SharpReport.Designer{
this.Controls.Add(this.titlePanel);
this.Controls.Add(this.splitPanel);
this.Controls.Add(this.ctrlRuler1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(432, 154);
this.titlePanel.ResumeLayout(false);

4
src/AddIns/Misc/SharpReport/SharpReport/Designer/SideTab/BuildSideTab.cs

@ -72,7 +72,7 @@ namespace SharpReport @@ -72,7 +72,7 @@ namespace SharpReport
bitmap);
tab.Items.Add (t);
t = sideTab.SideTabItemFactory.CreateSideTabItem( "DataRow",
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.DataRow"),
GlobalEnums.ReportItemType.ReportRowItem.ToString(),
ResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"));
tab.Items.Add (t);
@ -84,7 +84,7 @@ namespace SharpReport @@ -84,7 +84,7 @@ namespace SharpReport
bitmap = ResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp").ToBitmap();
t = sideTab.SideTabItemFactory.CreateSideTabItem( "Image",
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.Image"),
GlobalEnums.ReportItemType.ReportImageItem.ToString(),
bitmap);
tab.Items.Add (t);

207
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ContainerControl.cs

@ -0,0 +1,207 @@ @@ -0,0 +1,207 @@
/*
* Created by SharpDevelop.
* User: Forstmeier Peter
* Date: 25.05.2006
* Time: 09:19
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
namespace SharpReport.Designer{
/// <summary>
/// Description of ContainerControl.
/// </summary>
public class ContainerControl:ReportControlBase,ITracker{
private RectTracker rectTracker = new RectTracker();
private ReportControlBase selectedControl;
public ContainerControl():base(){
this.Body.MouseMove += new MouseEventHandler( OnMouseMove);
this.Body.MouseDown += new MouseEventHandler(OnMouseDown);
}
private Rectangle GetParentRectangle () {
return this.Body.ClientRectangle;
}
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){
base.OnPaint(e);
}
#region overrides
/*
protected override CreateParams CreateParams{
get {
CreateParams cp=base.CreateParams;
cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
*/
#endregion
private void OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){
if (this.rectTracker == null) {
return;
}
if(e.Button != MouseButtons .Left){
return;
}
Point pt = this.Body.PointToClient(Cursor.Position);
Rectangle rcForm = GetParentRectangle();
if(rcForm.Contains(pt)){
Rectangle rcObject;
if (this.rectTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing) {
// System.Console.WriteLine("2");
this.selectedControl = null;
this.rectTracker.m_rect = new Rectangle(0,0,0,0);
// just to demonstrate RectTracker::TrackRubberBand
RectTracker tracker=new RectTracker();
if (tracker.TrackRubberBand(this.Body, pt, false)){
// see if rubber band intersects with the doc's tracker
tracker.NormalizeRect(ref tracker.m_rect);
Rectangle rectIntersect = tracker.m_rect;
foreach (Control ctrl in this.Body.Controls){
rcObject = ctrl.Bounds;
if(tracker.m_rect.Contains(rcObject)){
this.rectTracker.m_rect = rcObject;
this.selectedControl = (ReportControlBase)ctrl;
this.selectedControl.Selected = true;
// MainForm.m_propertyWindow.SetSelectedObject(m_seletedCtrl);
break;
}
}
}
else{
// No rubber band, see if the point selects an object.
foreach (Control ctrl in this.Body.Controls){
rcObject = ctrl.Bounds ;
if(rcObject.Contains(pt)){
this.rectTracker.m_rect = rcObject;
this.selectedControl = (ReportControlBase)ctrl;
this.selectedControl.Selected = true;
// MainForm.m_propertyWindow.SetSelectedObject(ctrl);
break;
}
}
}
if(this.selectedControl == null){
// NotifySectionClick();
// MainForm.m_propertyWindow.SetSelectedObject(m_Form);
// m_FormTracker.m_rect = rcForm;
}
else{
// System.Console.WriteLine("6");
// m_FormTracker.Clear();
}
}
else if(this.selectedControl != null){// normal tracking action, when tracker is hit
// System.Console.WriteLine("7");
if (this.rectTracker.Track(this.Body, pt, false,null)) {
Rectangle rc = this.rectTracker.m_rect;
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height);
}
}
}
else{
if(this.selectedControl == null){//select the container form
// System.Console.WriteLine("9");
// MainForm.m_propertyWindow.SetSelectedObject(m_Form);
/*
if(m_FormTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing)
{
m_FormTracker.m_rect = rcForm;
}
else if(!m_FormTracker.IsEmpty())
{
m_FormTracker.Track(this, pt, false,null);
}
*/
}
else{
// System.Console.WriteLine("10");
// m_FormTracker.Clear();
}
}
this.InvalidateEx();
}
private void OnMouseMove (object sender, MouseEventArgs e) {
if (this.rectTracker != null) {
Point mousept=new Point(e.X,e.Y);
if(this.selectedControl != null){
if(!rectTracker.SetCursor(this,0,mousept))
this.Cursor=Cursors.Arrow;
}
// else{
// if(!m_FormTracker.SetCursor(this,0,mousept))
// this.Cursor=Cursors.Arrow;
// }
}
}
#region ITracker implementation
public virtual void ClearSelections() {
base.ControlHelper.Clear(this);
this.selectedControl = null;
this.InvalidateEx();
}
public ReportControlBase SelectedControl {
set {
this.selectedControl = value;
}
}
public RectTracker RectTracker {
get {
return this.rectTracker;
}
}
public System.Windows.Forms.Control DesignSurface {
get {
return this.Body;
}
}
public void InvalidateEx(){
this.Invalidate();
if (this.Parent == null) {
return;
}
Rectangle rc = new Rectangle (this.Body.Location,this.Body.Size);
this.Invalidate(rc,true);
if(this.selectedControl != null){
rc = this.rectTracker.m_rect;
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height);
this.selectedControl.Invalidate();
}
}
#endregion
}
}

14
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ControlHelper.cs

@ -77,5 +77,19 @@ namespace SharpReport.Designer @@ -77,5 +77,19 @@ namespace SharpReport.Designer
}
/// <summary>
/// Set the Controls to selected = false, so the Focusrectangle is
/// not draw
/// </summary>
/// <param name="control"></param>
public void Clear (Control control) {
foreach (Control c in control.Controls) {
ReportControlBase rcb = c as ReportControlBase;
if (rcb != null) {
rcb.Selected = false;
Clear (c);
}
}
}
}
}

1
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/FunctionControl.cs

@ -36,7 +36,6 @@ namespace SharpReport.Designer @@ -36,7 +36,6 @@ namespace SharpReport.Designer
{
base.OnPaint(pea);
base.DrawEdges (pea);
base.DrawDecorations(pea);
// StringFormat f = base.StringFormat;
// f.Alignment = base.StringAlignment;

50
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ITracker.cs

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
/*
* Created by SharpDevelop.
* User: Forstmeier Peter
* Date: 25.05.2006
* Time: 09:54
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Windows.Forms;
namespace SharpReport.Designer
{
/// <summary>
/// Description of ITracker.
/// </summary>
public interface ITracker{
/// <summary>
/// Clear all selections
/// </summary>
void ClearSelections();
/// <summary>
/// Invalidate the DesignSurface and draw the Tracking rectangle
/// </summary>
void InvalidateEx();
/// <summary>
/// The selected Control
/// </summary>
ReportControlBase SelectedControl
{set;}
/// <summary>
/// The <see cref="RectTracker"></see>
/// </summary>
RectTracker RectTracker
{get;}
///<summary>
/// The Body Conrol to draw the Treckung Rectangle on
/// </summary>
Control DesignSurface
{get;}
}
}

800
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/RectTracker.cs

@ -0,0 +1,800 @@ @@ -0,0 +1,800 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Imaging;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Drawing.Drawing2D;
namespace SharpReport.Designer
{
/// <summary>
/// Draw a Focus and DragRectangle
/// http://www.codeproject.com/csharp/SharpFormEditorDemo.asp
/// <seealso cref="http://www.codeproject.com/csharp/SharpFormEditorDemo.asp">
/// </seealso>
/// </summary>
public class RectTracker
{
#region Win32API
protected struct POINT
{
public Int32 x;
public Int32 y;
};
protected struct MSG
{
public Int32 hwnd;
public Int32 message;
public Int32 wParam;
public Int32 lParam;
public Int32 time;
public POINT pt;
};
[DllImport("user32.dll", SetLastError=true )]
protected static extern Int32 GetMessage (ref MSG lpMsg,Int32 hwnd,Int32 wMsgFilterMin,Int32 wMsgFilterMax);
[DllImport("user32.dll", SetLastError=true )]
protected static extern Int32 DispatchMessage (ref MSG lpMsg);
[DllImport("user32.dll", SetLastError=true )]
private static extern Int32 TranslateMessage (ref MSG lpMsg);
private const int CX_BORDER=1;
private const int CY_BORDER=1;
protected const int WM_MOUSEFIRST = 0x0200;
protected const int WM_MOUSEMOVE = 0x0200;
protected const int WM_LBUTTONDOWN = 0x0201;
protected const int WM_LBUTTONUP = 0x0202;
protected const int WM_LBUTTONDBLCLK = 0x0203;
protected const int WM_RBUTTONDOWN = 0x0204;
protected const int WM_RBUTTONUP = 0x0205;
protected const int WM_RBUTTONDBLCLK = 0x0206;
protected const int WM_MBUTTONDOWN = 0x0207;
protected const int WM_MBUTTONUP = 0x0208;
protected const int WM_MBUTTONDBLCLK = 0x0209;
protected const int WM_KEYDOWN = 0x100;
protected const int WM_KEYUP = 0x101;
private static Cursor[] Cursors =new Cursor[10];
private static HatchBrush HatchBrush = null;
private static Pen BlackDottedPen = null;
private static int HandleSize = 4;
private static Pen DotedPen=null;
#endregion
//
// Style Flags
public enum StyleFlags
{
solidLine = 1, dottedLine = 2, hatchedBorder = 4,
resizeInside = 8, resizeOutside = 16, hatchInside = 32,
};
// Hit-Test codes
public enum TrackerHit
{
hitNothing = -1,
hitTopLeft = 0, hitTopRight = 1, hitBottomRight = 2, hitBottomLeft = 3,
hitTop = 4, hitRight = 5, hitBottom = 6, hitLeft = 7, hitMiddle = 8
};
public enum backMode
{
TRANSPARENT= 1,
OPAQUE= 2
};
public enum rectPos
{
Left =0,
Right,
Top,
Bottom
};
struct HANDLEINFO
{
public HANDLEINFO(rectPos X,rectPos Y,int CX,int CY,int HX,int HY,int IX,int IY)
{
nOffsetX=X;
nOffsetY=Y;
nCenterX=CX;
nCenterY=CY;
nHandleX=HX;
nHandleY=HY;
nInvertX=IX;
nInvertY=IY;
}
public rectPos nOffsetX; // offset within RECT for X coordinate
public rectPos nOffsetY; // offset within RECT for Y coordinate
public int nCenterX; // adjust X by Width()/2 * this number
public int nCenterY; // adjust Y by Height()/2 * this number
public int nHandleX; // adjust X by handle size * this number
public int nHandleY; // adjust Y by handle size * this number
public int nInvertX; // handle converts to this when X inverted
public int nInvertY; // handle converts to this when Y inverted
};
struct RECTINFO
{
public RECTINFO(rectPos offset,int nsign)
{
nOffsetAcross=offset;
nSignAcross=nsign;
}
public rectPos nOffsetAcross; // offset of opposite point (ie. left->right)
public int nSignAcross; // sign relative to that point (ie. add/subtract)
}
static HANDLEINFO[] HandleInfo=new HANDLEINFO[]{
// corner handles (top-left, top-right, bottom-right, bottom-left
new HANDLEINFO(rectPos.Left, rectPos.Top,0, 0, 0, 0, 1, 3 ),
new HANDLEINFO(rectPos.Right,rectPos.Top,0, 0, -1, 0, 0, 2),
new HANDLEINFO(rectPos.Right,rectPos.Bottom,0, 0, -1, -1, 3, 1),
new HANDLEINFO(rectPos.Left, rectPos.Bottom, 0, 0, 0, -1, 2, 0 ),
// side handles (top, right, bottom, left)
new HANDLEINFO(rectPos.Left, rectPos.Top,1, 0, 0, 0, 4, 6),
new HANDLEINFO(rectPos.Right,rectPos.Top,0, 1, -1, 0, 7, 5),
new HANDLEINFO(rectPos.Left, rectPos.Bottom, 1, 0, 0, -1, 6, 4 ),
new HANDLEINFO(rectPos.Left, rectPos.Top,0, 1, 0, 0, 5, 7)
};
static RECTINFO[] RectInfo=new RECTINFO[]{
new RECTINFO(rectPos.Right, +1),
new RECTINFO(rectPos.Bottom, +1),
new RECTINFO(rectPos.Left,-1),
new RECTINFO(rectPos.Top, -1 )
};
// Attributes
public StyleFlags m_nStyle; // current state
public Rectangle m_rect; // current position (always in pixels)
public Size m_sizeMin; // minimum X and Y size during track operation
public int m_nHandleSize=0; // size of resize handles (default from WIN.INI)
protected bool m_bAllowInvert=false; // flag passed to Track or TrackRubberBand
protected Rectangle m_rectLast;
protected Size m_sizeLast;
protected bool m_bErase=false; // TRUE if DrawTrackerRect is called for erasing
protected bool m_bFinalErase=false; // TRUE if DragTrackerRect called for final erase
protected static bool bInitialized=false;
public RectTracker()
{
Construct();
m_nHandleSize = 6;
m_nStyle = StyleFlags.resizeOutside;
}
public RectTracker(Rectangle rect, StyleFlags nStyle)
{
Construct();
m_rect=rect;
m_nStyle = nStyle;
}
protected void Construct()
{
if(false==bInitialized)
{
// initialize the cursor array
Cursors[0] = System.Windows.Forms.Cursors.SizeNWSE;
Cursors[1] = System.Windows.Forms.Cursors.SizeNESW;
Cursors[2] = Cursors[0];
Cursors[3] = Cursors[1];
Cursors[4] = System.Windows.Forms.Cursors.SizeNS;
Cursors[5] = System.Windows.Forms.Cursors.SizeWE;
Cursors[6] = Cursors[4];
Cursors[7] = Cursors[5];
Cursors[8] = System.Windows.Forms.Cursors.SizeAll;
Cursors[9] = System.Windows.Forms.Cursors.PanSW;
bInitialized = true;
BlackDottedPen=new Pen(System.Drawing.Color.Black,1);
HatchBrush=new HatchBrush(HatchStyle.Percent20,Color.Black,Color.FromArgb(0));
DotedPen=new Pen(Color.Black,1);
DotedPen.DashStyle=DashStyle.Dot;
}
m_nStyle = 0;
m_nHandleSize = HandleSize;
m_sizeMin.Height = m_sizeMin.Width = m_nHandleSize*2;
m_rectLast=new Rectangle(0,0,0,0);
m_sizeLast.Width = m_sizeLast.Height = 0;
m_bErase = false;
m_bFinalErase = false;
}
// Operations
public virtual void Draw(Graphics gs)
{
System.Drawing.Drawing2D.GraphicsState OldState=gs.Save();
// IntPtr hdc = new IntPtr();
// get normalized rectangle
Rectangle rect = m_rect;
NormalizeRect(ref rect);
// draw lines
if ((m_nStyle & (StyleFlags.dottedLine|StyleFlags.solidLine)) != 0)
{
if((m_nStyle&StyleFlags.dottedLine)!=0)
BlackDottedPen.DashStyle=DashStyle.Dot;
else
BlackDottedPen.DashStyle=DashStyle.Solid;
rect.Inflate(new Size(+1, +1)); // borders are one pixel outside
gs.DrawRectangle(BlackDottedPen,rect);
}
// hatch inside
if ((m_nStyle & StyleFlags.hatchInside) != 0)
{
gs.FillRectangle(HatchBrush,rect.Left+1, rect.Top+1, rect.Width-1, rect.Height-1);
}
// draw hatched border
if (true)//(m_nStyle & StyleFlags.hatchedBorder) != 0)
{
Rectangle rectTrue=new Rectangle(0,0,0,0);
GetTrueRect(ref rectTrue);
gs.FillRectangle(HatchBrush,rectTrue.Left, rectTrue.Top, rectTrue.Width,rect.Top-rectTrue.Top);
gs.FillRectangle(HatchBrush,rectTrue.Left, rect.Bottom,rectTrue.Width,rectTrue.Bottom-rect.Bottom);
gs.FillRectangle(HatchBrush,rectTrue.Left, rect.Top, rect.Left-rectTrue.Left,rect.Height);
gs.FillRectangle(HatchBrush,rect.Right, rect.Top, rectTrue.Right-rect.Right,rect.Height);
}
// draw resize handles
if ((m_nStyle & (StyleFlags.resizeInside|StyleFlags.resizeOutside)) != 0)
{
uint mask = GetHandleMask();
for (int i = 0; i < 8; ++i)
{
if ((mask&(1<<i))!=0)
{
GetHandleRect(i, ref rect);
SolidBrush brush=new SolidBrush(Color.Black);
Pen pen = new Pen(brush,1);
SolidBrush brushWhite = new SolidBrush(Color.White);
gs.FillRectangle(brushWhite,rect);
gs.DrawRectangle(pen,rect);
}
}
}
gs.Restore(OldState);
}
public void GetTrueRect(ref Rectangle TrueRect)
{
// get normalized rectangle
Rectangle rect = m_rect;
NormalizeRect(ref rect);
int nInflateBy = 0;
if ((m_nStyle & (StyleFlags.resizeOutside|StyleFlags.hatchedBorder)) != 0)
nInflateBy += GetHandleSize(new Rectangle(0,0,0,0)) - 1;
if ((m_nStyle & (StyleFlags.solidLine|StyleFlags.dottedLine)) != 0)
++nInflateBy;
rect.Inflate(new Size(nInflateBy, nInflateBy));
TrueRect = rect;
}
public virtual bool SetCursor(Control frm, uint nHitTest,Point MousePoint)
{
// trackers should only be in client area
frm.PointToClient(MousePoint);
if (!frm.ClientRectangle.Contains(MousePoint))
return false;
// convert cursor position to client co-ordinates
// do hittest and normalize hit
int nHandle = (int)HitTestHandles(MousePoint);
if (nHandle < 0)
return false;
// need to normalize the hittest such that we get proper cursors
nHandle = NormalizeHit(nHandle);
// handle special case of hitting area between handles
// (logically the same -- handled as a move -- but different cursor)
if (nHandle == (int)TrackerHit.hitMiddle && !m_rect.Contains(MousePoint))
{
// only for trackers with hatchedBorder (ie. in-place resizing)
if ((m_nStyle & StyleFlags.hatchedBorder)!=0)
nHandle = 9;
}
Debug.Assert(nHandle < 10);
frm.Cursor=Cursors[nHandle];
return true;
}
public virtual bool Track(Control frm, Point point, bool bAllowInvert,Form frmClipTo)
{
// perform hit testing on the handles
int nHandle = (int)HitTestHandles(point);
if (nHandle < 0)
{
// didn't hit a handle, so just return FALSE
return false;
}
// otherwise, call helper function to do the tracking
m_bAllowInvert = bAllowInvert;
return TrackHandle(nHandle, frm, point, frmClipTo);
}
public bool TrackRubberBand(Control frm, Point point, bool bAllowInvert)
{
// simply call helper function to track from bottom right handle
m_bAllowInvert = bAllowInvert;
m_rect=new Rectangle(point.X, point.Y,0, 0);
return TrackHandle((int)TrackerHit.hitBottomRight, frm, point, null);
}
public virtual TrackerHit HitTest(Point point)
{
TrackerHit hitResult = TrackerHit.hitNothing;
Rectangle rectTrue=new Rectangle();
GetTrueRect(ref rectTrue);
Debug.Assert(rectTrue.Left <= rectTrue.Right);
Debug.Assert(rectTrue.Top <= rectTrue.Bottom);
if (rectTrue.Contains(point))
{
if ((m_nStyle & (StyleFlags.resizeInside|StyleFlags.resizeOutside)) != 0)
hitResult = HitTestHandles(point);
else
hitResult = TrackerHit.hitMiddle;
}
return hitResult;
}
protected int NormalizeHit(int nHandle)
{
Debug.Assert(nHandle <= 8 && nHandle >= -1);
if (nHandle == (int)TrackerHit.hitMiddle || nHandle ==(int)TrackerHit.hitNothing)
return nHandle;
HANDLEINFO handleInfo = HandleInfo[nHandle];
if (m_rect.Width< 0)
{
nHandle = handleInfo.nInvertX;
handleInfo = HandleInfo[nHandle];
}
if (m_rect.Height< 0)
nHandle = handleInfo.nInvertY;
return nHandle;
}
private void DrawDragRect(Graphics gs,Rectangle rect,Rectangle rectLast)
{
ControlPaint.DrawReversibleFrame(rectLast,Color.White,FrameStyle.Dashed);
ControlPaint.DrawReversibleFrame(rect,Color.White,FrameStyle.Dashed);
}
public virtual void DrawTrackerRect(Rectangle Rect, Form ClipToFrm,Graphics gs,Control frm)
{
Rectangle rect = Rect;
// convert to client coordinates
if (ClipToFrm != null)
{
rect=ClipToFrm.RectangleToScreen(rect);
rect=ClipToFrm.RectangleToClient(rect);
}
Size size=new Size(0, 0);
if (!m_bFinalErase)
{
// otherwise, size depends on the style
if ((m_nStyle & StyleFlags.hatchedBorder)!=0)
{
size.Width = size.Height = Math.Max(1, GetHandleSize(rect)-1);
rect.Inflate(size);
}
else
{
size.Width = CX_BORDER;
size.Height = CY_BORDER;
}
}
if (m_bFinalErase || !m_bErase)
{
Rectangle rcScreen = frm.RectangleToScreen(rect);
Rectangle rcLast = frm.RectangleToScreen(m_rectLast);
DrawDragRect(gs,rcScreen,rcLast);
}
// remember last rectangles
m_rectLast = rect;
m_sizeLast = size;
}
public virtual void AdjustRect(int nHandle, ref Rectangle Rect)
{
if (nHandle ==(int)TrackerHit.hitMiddle)
return;
// convert the handle into locations within m_rect
int px=-1, py=-1;
int ix=-1,iy=-1;
GetModifyPointers(nHandle,ref px, ref py,ref ix, ref iy,false);
// enforce minimum width
int nNewWidth = m_rect.Width;
int nAbsWidth = m_bAllowInvert ? Math.Abs(nNewWidth) : nNewWidth;
if (nAbsWidth < m_sizeMin.Width)
{
nNewWidth = nAbsWidth != 0 ? nNewWidth / nAbsWidth : 1;
RECTINFO refrectinfo=RectInfo[px];
px = GetRectInt((int)refrectinfo.nOffsetAcross) +
nNewWidth * m_sizeMin.Width * -refrectinfo.nSignAcross;
}
// enforce minimum height
int nNewHeight = m_rect.Height;
int nAbsHeight = m_bAllowInvert ? Math.Abs(nNewHeight) : nNewHeight;
if ((py != -1)&&(nAbsHeight < m_sizeMin.Height))
{
nNewHeight = nAbsHeight != 0 ? nNewHeight / nAbsHeight : 1;
Debug.Assert(py<4);
RECTINFO refrectinfo=RectInfo[py];
py = GetRectInt((int)refrectinfo.nOffsetAcross) +
nNewHeight * m_sizeMin.Width * -refrectinfo.nSignAcross;
}
}
public virtual void OnChangedRect(Rectangle rectOld)
{
}
public virtual uint GetHandleMask()
{
uint mask = 0x0F; // always have 4 corner handles
int size = m_nHandleSize*3;
if (Math.Abs(m_rect.Width) - size > 4)
mask |= 0x50;
if (Math.Abs(m_rect.Height) - size > 4)
mask |= 0xA0;
return mask;
}
protected virtual TrackerHit HitTestHandles(Point point)
{
Rectangle Truerect=new Rectangle(0,0,0,0);
uint mask = GetHandleMask();
// see if hit anywhere inside the tracker
GetTrueRect(ref Truerect);
if (!Truerect.Contains(point))
return TrackerHit.hitNothing; // totally missed
// see if we hit a handle
for (int i = 0; i < 8; ++i)
{
if((mask&(1<<i))!=0)
{
GetHandleRect(i, ref Truerect);
if (Truerect.Contains(point))
return (TrackerHit)i;
}
}
// last of all, check for non-hit outside of object, between resize handles
if ((m_nStyle & StyleFlags.hatchedBorder) == 0)
{
// get normalized rectangle
Rectangle rect = m_rect;
NormalizeRect(ref rect);
if ((m_nStyle & (StyleFlags.dottedLine|StyleFlags.solidLine)) != 0)
rect.Inflate(+1, +1);
if (!rect.Contains(point))
return TrackerHit.hitNothing; // must have been between resize handles
}
return TrackerHit.hitMiddle; // no handle hit, but hit object (or object border)
}
protected void GetHandleRect(int nHandle, ref Rectangle Changerect)
{
System.Diagnostics.Debug.Assert(nHandle < 8);
// get normalized rectangle of the tracker
Rectangle rectT = m_rect;
NormalizeRect(ref rectT);
if ((m_nStyle & (StyleFlags.solidLine|StyleFlags.dottedLine)) != 0)
rectT.Inflate(+1, +1);
// since the rectangle itself was normalized, we also have to invert the
// resize handles.
nHandle = NormalizeHit(nHandle);
// handle case of resize handles outside the tracker
int size = GetHandleSize(new Rectangle());
if ((m_nStyle&StyleFlags.resizeOutside)!=0)
rectT.Inflate(size, size);
// calculate position of the resize handle
int nWidth = rectT.Width;
int nHeight = rectT.Height;
Rectangle rect=new Rectangle();
HANDLEINFO handleInfo = HandleInfo[nHandle];
int[] arr=new int[4]{rectT.Left,rectT.Right,rectT.Top,rectT.Bottom};
rect.X = arr[(int)handleInfo.nOffsetX];
rect.Y = arr[(int)handleInfo.nOffsetY];
rect.X += size * handleInfo.nHandleX;
rect.Y += size * handleInfo.nHandleY;
rect.X += handleInfo.nCenterX * (nWidth - size) / 2;
rect.Y += handleInfo.nCenterY * (nHeight - size) / 2;
rect.Width = size;
rect.Height = size;
Changerect = rect;
}
protected int GetRectInt(int index)
{
switch(index)
{
case 0:
return m_rect.Left;
case 1:
return m_rect.Right;
case 2:
return m_rect.Top;
case 3:
return m_rect.Bottom;
default:
return -1;
}
}
protected void SetRectInt(int index,int p)
{
if( p >= 32768)
p=0;
switch(index)
{
case 0://left
m_rect.Width += (m_rect.X - p);
m_rect.X = p;
break;
case 1://right
m_rect.Width = p - m_rect.X;
break;
case 2://top
m_rect.Height += m_rect.Y - p;
m_rect.Y = p ;
break;
case 3://bottom
m_rect.Height = p - m_rect.Y;
break;
default:
break;
}
}
protected void GetModifyPointers(int nHandle,ref int ppx,ref int ppy,ref int px,ref int py,bool bModify)
{
Debug.Assert(nHandle >= 0);
Debug.Assert(nHandle <= 8);
if (nHandle ==(int)TrackerHit.hitMiddle)
nHandle = (int)TrackerHit.hitTopLeft; // same as hitting top-left
ppx = -1;
ppy = -1;
// fill in the part of the rect that this handle modifies
// (Note: handles that map to themselves along a given axis when that
// axis is inverted don't modify the value on that axis)
HANDLEINFO handleInfo = HandleInfo[nHandle];
if (handleInfo.nInvertX != nHandle)
{
ppx=(int)handleInfo.nOffsetX;
if (bModify)
px = GetRectInt(ppx);
}
else
{
// middle handle on X axis
if (bModify)
px = m_rect.Left + Math.Abs(m_rect.Width) / 2;
}
if (handleInfo.nInvertY != nHandle)
{
ppy=(int)handleInfo.nOffsetY;
if (bModify)
py = GetRectInt(ppy);
}
else
{
// middle handle on Y axis
if (bModify)
py = m_rect.Top + Math.Abs(m_rect.Height) / 2;
}
}
protected virtual int GetHandleSize(Rectangle rect)
{
if (rect.IsEmpty)
rect = m_rect;
int size = m_nHandleSize;
if ((m_nStyle & StyleFlags.resizeOutside)==0)
{
// make sure size is small enough for the size of the rect
int sizeMax = Math.Min(Math.Abs(rect.Right - rect.Left),Math.Abs(rect.Bottom - rect.Top));
if (size * 2 > sizeMax)
size = sizeMax / 2;
}
return size;
}
protected bool TrackHandle(int nHandle,Control frm,Point point,Form frmClipTo)
{
Debug.Assert(nHandle >= 0);
Debug.Assert(nHandle <= 8); // handle 8 is inside the rect
// don't handle if capture already set
//if(frm.Capture) return false;
Debug.Assert(!m_bFinalErase);
// save original width & height in pixels
int nWidth = m_rect.Width;
int nHeight = m_rect.Height;
// set capture to the window which received this message
frm.Capture=true;
Debug.Assert(frm.Capture);
frm.Update();
if (frmClipTo!=null)
frmClipTo.Update();
Rectangle rectSave = m_rect;
// find out what x/y coords we are supposed to modify
int px=0, py=0;
int xDiff=0, yDiff=0;
GetModifyPointers(nHandle,ref px,ref py,ref xDiff,ref yDiff,true);
xDiff = point.X - xDiff;
yDiff = point.Y - yDiff;
// get DC for drawing
Graphics gs;
if (frmClipTo!=null)
{
// clip to arbitrary window by using adjusted Window DC
gs=frmClipTo.CreateGraphics();
}
else
{
// otherwise, just use normal DC
gs=frm.CreateGraphics();
}
Rectangle rectOld;
bool bMoved = false;
// get messages until capture lost or cancelled/accepted
for (;;)
{
MSG msg=new MSG();
if(GetMessage(ref msg, 0, 0, 0)!=1) break;
if(!frm.Capture) break;
switch (msg.message)
{
// handle movement/accept messages
case WM_LBUTTONUP:
case WM_MOUSEMOVE:
rectOld = m_rect;
// handle resize cases (and part of move)
SetRectInt(px,LoWord(msg.lParam) - xDiff);
SetRectInt(py,HiWord(msg.lParam) - yDiff);
// handle move case
if (nHandle == (int)TrackerHit.hitMiddle)
{
m_rect.Width=nWidth;
m_rect.Height=nHeight;
}
// allow caller to adjust the rectangle if necessary
AdjustRect(nHandle,ref m_rect);
// only redraw and callback if the rect actually changed!
m_bFinalErase = (msg.message == WM_LBUTTONUP);
if (m_bFinalErase)
goto ExitLoop;
if (!rectOld.Equals(m_rect) || m_bFinalErase)
{
if (bMoved)
{
m_bErase = true;
DrawTrackerRect(rectOld, frmClipTo, gs, frm);
}
OnChangedRect(rectOld);
if (msg.message != WM_LBUTTONUP)
bMoved = true;
}
if (m_bFinalErase)
goto ExitLoop;
if (!rectOld.Equals(m_rect))
{
m_bErase = false;
DrawTrackerRect(m_rect, frmClipTo, gs, frm);
}
break;
// handle cancel messages
case WM_KEYDOWN:
if (msg.wParam != 0x1B)//VK_ESCAPE
break;
goto default;
case WM_RBUTTONDOWN:
if (bMoved)
{
m_bErase = m_bFinalErase = true;
DrawTrackerRect(m_rect, frmClipTo, gs, frm);
}
m_rect = rectSave;
goto ExitLoop;
// just dispatch rest of the messages
default:
DispatchMessage(ref msg);
break;
}
}
ExitLoop:
gs.Dispose();
frm.Capture=false;
// restore rect in case bMoved is still FALSE
if (!bMoved)
m_rect = rectSave;
m_bFinalErase = false;
m_bErase = false;
// return TRUE only if rect has changed
return !rectSave.Equals(m_rect);
}
public void NormalizeRect(ref Rectangle rect)
{
Rectangle rc = new Rectangle(rect.Location,rect.Size);
if(rect.Left > rect.Right)
{
rc.Width = -rect.Width;
rc.X = rect.Right;
}
if(rect.Top > rect.Bottom)
{
rc.Height = -rect.Height;
rc.Y = rect.Bottom;
}
rect = rc;
}
#region Helper functions
static int MakeLong(int LoWord, int HiWord)
{
return (HiWord << 16) | (LoWord & 0xffff);
}
static IntPtr MakeLParam(int LoWord, int HiWord)
{
return (IntPtr) ((HiWord << 16) | (LoWord & 0xffff));
}
static int HiWord(int Number)
{
return (Number >> 16) & 0xffff;
}
static int LoWord(int Number)
{
return Number & 0xffff;
}
#endregion
}
}

1
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportCircleControl.cs

@ -35,7 +35,6 @@ namespace SharpReport.Designer{ @@ -35,7 +35,6 @@ namespace SharpReport.Designer{
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea){
base.OnPaint(pea);
base.DrawEdges (pea);
base.DrawDecorations(pea);
shape.FillShape(pea.Graphics,
new SolidFillPattern(this.BackColor),
(RectangleF)this.ClientRectangle);

184
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportControlBase.cs

@ -19,22 +19,15 @@ namespace SharpReport.Designer{ @@ -19,22 +19,15 @@ namespace SharpReport.Designer{
/// Base Class of all Visible Controls like Graphic or textbased Item's
/// </summary>
public abstract class ReportControlBase : ReportObjectControlBase{
private System.Windows.Forms.Label lblTopLeft;
private System.Windows.Forms.Label lblBottomRight;
public abstract class ReportControlBase : ReportObjectControlBase,
INotifyPropertyChanged{
private ControlHelper controlHelper;
private const string contextMenuPath = "/SharpReport/ContextMenu/Items";
private enum SizeDirection{
None,
TopLeft,
BottomRight,
}
private const string contextMenuPath = "/SharpReport/ContextMenu/Items";
private bool selected;
private int xCoor;
private int yCoor;
private SizeDirection mouseDown;
internal ReportControlBase(){
InitializeComponent();
@ -44,72 +37,71 @@ namespace SharpReport.Designer{ @@ -44,72 +37,71 @@ namespace SharpReport.Designer{
ControlStyles.ResizeRedraw,
true);
this.UpdateStyles();
lblTopLeft.Visible = false;
lblBottomRight.Visible = false;
controlHelper = new ControlHelper((Control)this);
}
private void ReportControlBaseEnter(object sender, System.EventArgs e){
lblTopLeft.Visible = true;
lblBottomRight.Visible = true;
this.Refresh();
private ITracker GetParent {
get {
if (this.Parent is Panel) {
ITracker t = this.Parent.Parent as ITracker;
if (t != null) {
return t;
} else {
System.Console.WriteLine("!!!!!!!!! NO TRACKER !!!!");
return null;
}
} else {
ITracker ct = this.Parent as ITracker;
if (ct != null) {
return ct;
}else {
System.Console.WriteLine("!!!!!!!!! NO TRACKER !!!!");
return null;
}
}
}
}
private void ReportControlBaseLeave(object sender, System.EventArgs e){
lblTopLeft.Visible = false;
lblBottomRight.Visible = false;
this.Refresh();
private void NotifySelected() {
this.GetParent.SelectedControl = this;
this.GetParent.InvalidateEx();
this.OnClick (EventArgs.Empty);
}
private void SizeMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){
if (sender == lblTopLeft){
mouseDown = SizeDirection.TopLeft;
}
if (sender == lblBottomRight){
mouseDown = SizeDirection.BottomRight;
}
xCoor = e.X;
yCoor = e.Y;
private void NotifyUnSelected () {
this.selected = false;
this.GetParent.SelectedControl = null;
this.GetParent.InvalidateEx();
}
private void SizeMouseMove(object sender, System.Windows.Forms.MouseEventArgs e){
if (mouseDown == SizeDirection.TopLeft){
this.Top = this.Top + (e.Y - yCoor);
this.Left = this.Left + (e.X - xCoor);
}
if (mouseDown == SizeDirection.BottomRight){
this.Height = this.Height + (e.Y - yCoor);
this.Width = this.Width + (e.X - xCoor);
private void OnMouseDown (object sender, MouseEventArgs e) {
ITracker tracker = this.GetParent;
if (tracker != null) {
tracker.ClearSelections();
tracker.RectTracker.m_rect = this.Bounds;
this.selected = true;
this.NotifySelected();
tracker.SelectedControl = this;
}
this.selected = true;
}
private void ReportControlBaseMouseUp(object sender, MouseEventArgs e){
private void OnMouseUp(object sender, MouseEventArgs e){
if (e.Button == MouseButtons.Right) {
ContextMenuStrip ctMen = MenuService.CreateContextMenu (this,contextMenuPath);
ctMen.Show (this,new Point (e.X,e.Y));
}
}
private void SizeMouseUp(object sender, System.Windows.Forms.MouseEventArgs e){
mouseDown = SizeDirection.None;
base.OnControlChanged();
}
protected void DrawDecorations(PaintEventArgs e){
// it is not said that the
// focused object in all the app
// is the current report item!
// So I don't check this.Focused.
if (lblBottomRight.Visible){
e.Graphics.Clear(this.Body.BackColor);
ControlPaint.DrawFocusRectangle(e.Graphics,
controlHelper.BuildFocusRectangle);
this.NotifyUnSelected();
}
}
protected void DrawEdges (PaintEventArgs e,Rectangle rectangle) {
controlHelper.DrawEdges(e,rectangle);
}
@ -122,17 +114,49 @@ namespace SharpReport.Designer{ @@ -122,17 +114,49 @@ namespace SharpReport.Designer{
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){
base.OnPaint(e);
if (this.selected) {
RectTracker tracker = this.GetParent.RectTracker;
if (tracker != null) {
tracker.m_rect = this.Bounds;
tracker.Draw(this.GetParent.DesignSurface.CreateGraphics());
}
}
}
protected override void OnResize(EventArgs e){
protected override void OnResize(EventArgs e){
base.OnResize(e);
this.Invalidate();
}
protected ControlHelper ControlHelper {
get {
return controlHelper;
}
}
protected Rectangle FocusRectangle {
get {return this.controlHelper.BuildFocusRectangle;}
}
public bool Selected {
set {
selected = value;
}
}
#region SharpReportCore.IPropertyChange interface implementation
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string property) {
if (this.PropertyChanged != null) {
this.PropertyChanged(this,new System.ComponentModel.PropertyChangedEventArgs (property));
}
}
#endregion
#region Windows Forms Designer generated code
/// <summary>
/// This method is required for Windows Forms designer support.
@ -140,46 +164,14 @@ namespace SharpReport.Designer{ @@ -140,46 +164,14 @@ namespace SharpReport.Designer{
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent() {
this.lblBottomRight = new System.Windows.Forms.Label();
this.lblTopLeft = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lblBottomRight
//
this.lblBottomRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lblBottomRight.BackColor = System.Drawing.Color.Transparent;
this.lblBottomRight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblBottomRight.Cursor = System.Windows.Forms.Cursors.SizeNWSE;
this.lblBottomRight.Location = new System.Drawing.Point(283, 47);
this.lblBottomRight.Name = "lblBottomRight";
this.lblBottomRight.Size = new System.Drawing.Size(8, 8);
this.lblBottomRight.TabIndex = 0;
this.lblBottomRight.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SizeMouseUp);
this.lblBottomRight.MouseMove += new System.Windows.Forms.MouseEventHandler(this.SizeMouseMove);
this.lblBottomRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SizeMouseDown);
//
// lblTopLeft
//
this.lblTopLeft.BackColor = System.Drawing.Color.Transparent;
this.lblTopLeft.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lblTopLeft.Cursor = System.Windows.Forms.Cursors.SizeAll;
this.lblTopLeft.Location = new System.Drawing.Point(0, 0);
this.lblTopLeft.Name = "lblTopLeft";
this.lblTopLeft.Size = new System.Drawing.Size(8, 8);
this.lblTopLeft.TabIndex = 1;
this.lblTopLeft.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SizeMouseUp);
this.lblTopLeft.MouseMove += new System.Windows.Forms.MouseEventHandler(this.SizeMouseMove);
this.lblTopLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SizeMouseDown);
//
// ReportControlBase
//
this.Controls.Add(this.lblTopLeft);
this.Controls.Add(this.lblBottomRight);
this.Name = "ReportControlBase";
this.Size = new System.Drawing.Size(292, 56);
this.Enter += new System.EventHandler(this.ReportControlBaseEnter);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ReportControlBaseMouseUp);
this.Leave += new System.EventHandler(this.ReportControlBaseLeave);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnMouseUp);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseDown);
this.ResumeLayout(false);
}
#endregion

1
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportImageControl.cs

@ -40,7 +40,6 @@ namespace SharpReport.ReportItems { @@ -40,7 +40,6 @@ namespace SharpReport.ReportItems {
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) {
base.OnPaint (pea);
base.DrawEdges (pea);
base.DrawDecorations(pea);
if (this.image != null) {
if (this.scaleImageToSize) {

4
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportObjectControlBase.cs

@ -41,7 +41,9 @@ namespace SharpReport.Designer @@ -41,7 +41,9 @@ namespace SharpReport.Designer
}
#endregion
protected void OnControlChanged () {
public void NotifyControlChanged () {
if ( VisualControlChanged != null ) {
VisualControlChanged (this,EventArgs.Empty);
}

1
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportRectangleControl.cs

@ -41,7 +41,6 @@ namespace SharpReport.Designer { @@ -41,7 +41,6 @@ namespace SharpReport.Designer {
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) {
base.OnPaint(pea);
base.DrawDecorations(pea);
shape.FillShape(pea.Graphics,
new SolidFillPattern(this.BackColor),

5
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportRowControl.cs

@ -20,9 +20,11 @@ namespace SharpReport.Designer{ @@ -20,9 +20,11 @@ namespace SharpReport.Designer{
/// Description of ReportTableControl.
/// </summary>
internal class ReportRowControl:ReportControlBase{
internal class ReportRowControl:ContainerControl{
private RectangleShape shape = new RectangleShape();
private bool drawBorder;
public ReportRowControl():base(){
InitializeComponent();
this.SetStyle(ControlStyles.DoubleBuffer |
@ -42,7 +44,6 @@ namespace SharpReport.Designer{ @@ -42,7 +44,6 @@ namespace SharpReport.Designer{
base.OnPaint(pea);
base.DrawEdges (pea,
new Rectangle(0,5,this.ClientSize.Width - 1,this.ClientSize.Height - 6) );
base.DrawDecorations(pea);
if (this.drawBorder) {
shape.DrawShape (pea.Graphics,

3
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportTextControl.cs

@ -72,7 +72,6 @@ namespace SharpReport.Designer{ @@ -72,7 +72,6 @@ namespace SharpReport.Designer{
base.OnPaint(pea);
base.DrawEdges (pea);
base.DrawDecorations(pea);
string str;
@ -91,7 +90,7 @@ namespace SharpReport.Designer{ @@ -91,7 +90,7 @@ namespace SharpReport.Designer{
this.textDrawer.DrawString (pea.Graphics,this.Text,this.Font,
new SolidBrush(this.ForeColor),(RectangleF)this.ClientRectangle,
this.stringTrimming,this.contentAlignment);
}

11
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/Functions/MiscFunctions/PageNumber.cs

@ -44,6 +44,9 @@ namespace SharpReport.ReportItems.Functions { @@ -44,6 +44,9 @@ namespace SharpReport.ReportItems.Functions {
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.Text = functionName;
@ -58,6 +61,12 @@ namespace SharpReport.ReportItems.Functions { @@ -58,6 +61,12 @@ namespace SharpReport.ReportItems.Functions {
this.visualControl.ResumeLayout();
}
#region Events
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
if (initDone == true) {
@ -89,6 +98,8 @@ namespace SharpReport.ReportItems.Functions { @@ -89,6 +98,8 @@ namespace SharpReport.ReportItems.Functions {
}
}
#endregion
#region Properties
public override Size Size {
get {

35
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/Functions/MiscFunctions/Today.cs

@ -18,15 +18,16 @@ using SharpReport.Designer; @@ -18,15 +18,16 @@ using SharpReport.Designer;
using System.Windows.Forms;
/// <summary>
/// This Function show's the date like
/// 'Printed : 04.23.2005'
/// Localise it by just overriding the Text Property
/// </summary>
/// <remarks>
/// created by - Forstmeier Peter
/// created on - 24.04.2005 10:29:05
/// </remarks>
/// <summary>
/// This Function show's the date like
/// 'Printed : 04.23.2005'
/// Localise it by just overriding the Text Property
/// </summary>
/// <remarks>
/// created by - Forstmeier Peter
/// created on - 24.04.2005 10:29:05
/// </remarks>
namespace SharpReport.ReportItems.Functions {
public class TodaysDate : SharpReportCore.BaseToday,SharpReport.Designer.IDesignable {
@ -48,6 +49,10 @@ namespace SharpReport.ReportItems.Functions { @@ -48,6 +49,10 @@ namespace SharpReport.ReportItems.Functions {
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.Text = functionName;
@ -62,6 +67,13 @@ namespace SharpReport.ReportItems.Functions { @@ -62,6 +67,13 @@ namespace SharpReport.ReportItems.Functions {
}
#region events
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
if (initDone == true) {
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this);
@ -93,10 +105,9 @@ namespace SharpReport.ReportItems.Functions { @@ -93,10 +105,9 @@ namespace SharpReport.ReportItems.Functions {
}
#endregion
#region overrides
public override string ToString() {
return functionName;
}

10
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportCircleItem.cs

@ -41,12 +41,20 @@ namespace SharpReport.ReportItems{ @@ -41,12 +41,20 @@ namespace SharpReport.ReportItems{
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged);
this.visualControl.FontChanged += new EventHandler (OnControlChanged);
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
}
#region EventHandling
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromGraphicBase (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);

9
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportImageItem.cs

@ -40,6 +40,9 @@ namespace SharpReport.ReportItems { @@ -40,6 +40,9 @@ namespace SharpReport.ReportItems {
this.visualControl.FontChanged += new EventHandler (OnControlChanged);
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
}
private void Setup() {
@ -55,6 +58,12 @@ namespace SharpReport.ReportItems { @@ -55,6 +58,12 @@ namespace SharpReport.ReportItems {
#region EventHandling
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
Setup();
ItemsHelper.UpdateControlFromGraphicBase(this.visualControl,this);

10
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportLineItem.cs

@ -42,10 +42,20 @@ namespace SharpReport.ReportItems{ @@ -42,10 +42,20 @@ namespace SharpReport.ReportItems{
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
}
#region EventHandling
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromGraphicBase (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);

10
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/GraphicBased/ReportRectangleItem.cs

@ -44,10 +44,20 @@ namespace SharpReport.ReportItems{ @@ -44,10 +44,20 @@ namespace SharpReport.ReportItems{
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
}
#region EventHandling
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromGraphicBase (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);

28
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportDataItem.cs

@ -51,27 +51,30 @@ namespace SharpReport.ReportItems{ @@ -51,27 +51,30 @@ namespace SharpReport.ReportItems{
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged);
this.visualControl.FontChanged += new EventHandler (OnControlChanged);
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange);
}
#endregion
#region overrides
public override string ToString(){
return this.Name;
}
#region events's
#endregion
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
#region events's
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this);
this.visualControl.ContentAlignment = base.ContentAlignment;
this.visualControl.StringTrimming = base.StringTrimming;
this.visualControl.DrawBorder = base.DrawBorder;
this.HandlePropertyChanged(e.PropertyName);
}
@ -102,6 +105,7 @@ namespace SharpReport.ReportItems{ @@ -102,6 +105,7 @@ namespace SharpReport.ReportItems{
}
#endregion
#region Property's
public override Size Size {
@ -179,6 +183,14 @@ namespace SharpReport.ReportItems{ @@ -179,6 +183,14 @@ namespace SharpReport.ReportItems{
#endregion
#region overrides
public override string ToString(){
return this.Name;
}
#endregion
/*
#region IDisposable
public override void Dispose(){

10
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportRowItem.cs

@ -45,6 +45,8 @@ namespace SharpReport.ReportItems @@ -45,6 +45,8 @@ namespace SharpReport.ReportItems
this.visualControl.FontChanged += new EventHandler (OnControlChanged);
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
this.visualControl.BackColorChanged += new EventHandler (OnAppereanceChanged);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
base.PropertyChanged += new PropertyChangedEventHandler (BasePropertyChange);
@ -52,7 +54,7 @@ namespace SharpReport.ReportItems @@ -52,7 +54,7 @@ namespace SharpReport.ReportItems
base.Items.Removed += OnRemove;
}
#endregion
#region Events for Childs
private void ChildSelected(object sender, EventArgs e){
@ -104,7 +106,13 @@ namespace SharpReport.ReportItems @@ -104,7 +106,13 @@ namespace SharpReport.ReportItems
this.HandlePropertyChanged("OnChildControlRemoved");
}
}
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromTextBase (this.visualControl,this);

11
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportTextItem.cs

@ -43,7 +43,11 @@ namespace SharpReport.ReportItems { @@ -43,7 +43,11 @@ namespace SharpReport.ReportItems {
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged);
this.visualControl.FontChanged += new EventHandler (OnControlChanged);
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
//Event from Tracker
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange);
base.PropertyChanged += new PropertyChangedEventHandler (BasePropertyChange);
}
@ -52,9 +56,14 @@ namespace SharpReport.ReportItems { @@ -52,9 +56,14 @@ namespace SharpReport.ReportItems {
#region events
//Tracker
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.HandlePropertyChanged(e.PropertyName);
}
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this);
this.visualControl.ContentAlignment = base.ContentAlignment;
this.visualControl.StringTrimming = base.StringTrimming;
this.visualControl.DrawBorder = base.DrawBorder;

6
src/AddIns/Misc/SharpReport/SharpReport/SharpReport.csproj

@ -62,8 +62,6 @@ @@ -62,8 +62,6 @@
<Compile Include="Designer\VisualControls\ReportTextControl.cs" />
<Compile Include="Designer\Factories.cs" />
<Compile Include="Designer\IDesignable.cs" />
<Compile Include="Designer\IDesignerVisitor.cs" />
<Compile Include="Designer\IVisitor.cs" />
<Compile Include="Designer\NameService.cs" />
<Compile Include="Designer\Report.cs" />
<Compile Include="Designer\XmlHelpers.cs" />
@ -76,7 +74,6 @@ @@ -76,7 +74,6 @@
<Compile Include="ReportItems\TextBased\ItemsHelper.cs" />
<Compile Include="ReportItems\TextBased\ReportDataItem.cs" />
<Compile Include="ReportItems\TextBased\ReportTextItem.cs" />
<Compile Include="Visitors\AbstractVisitor.cs" />
<Compile Include="Visitors\LoadReportVisitor.cs" />
<Compile Include="Visitors\SaveReportVisitor.cs" />
<Compile Include="AutoReport.cs" />
@ -90,6 +87,9 @@ @@ -90,6 +87,9 @@
<Compile Include="Designer\VisualControls\ReportRowControl.cs" />
<Compile Include="ReportItems\TextBased\ReportRowItem.cs" />
<Compile Include="Designer\VisualControls\ControlHelper.cs" />
<Compile Include="Designer\VisualControls\RectTracker.cs" />
<Compile Include="Designer\VisualControls\ContainerControl.cs" />
<Compile Include="Designer\VisualControls\ITracker.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Designer" />

2
src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs

@ -261,7 +261,7 @@ namespace SharpReport{ @@ -261,7 +261,7 @@ namespace SharpReport{
public void SaveToFile(string fileName){
try {
SharpReport.Visitors.SaveReportVisitor saveVisitor = new SharpReport.Visitors.SaveReportVisitor();
this.baseDesignerControl.Accept (saveVisitor);
this.baseDesignerControl.Accept ((SharpReportCore.IModelVisitor)saveVisitor);
XmlDocument xmlDoc = saveVisitor.XmlDocument;
XmlTextWriter xw = new XmlTextWriter (fileName,System.Text.Encoding.UTF8);
xmlDoc.PreserveWhitespace = true;

77
src/AddIns/Misc/SharpReport/SharpReport/Visitors/AbstractVisitor.cs

@ -1,77 +0,0 @@ @@ -1,77 +0,0 @@
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.2032
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
using System;
using System.Xml;
using SharpReport.Designer;
using SharpReportCore;
namespace SharpReport.Visitors
{
/// <summary>
/// Abstract Class for Designer Visitor
/// </summary>
/// <remarks>
/// created by - Forstmeier Peter
/// created on - 02.12.2004 16:53:00
/// </remarks>
public class AbstractVisitor : object, SharpReport.Designer.IDesignerVisitor {
private readonly string nodesQuery = "controls/control";
private string fileName;
private XmlFormReader xmlFormReader;
public AbstractVisitor() {
}
public AbstractVisitor(string fileName){
this.fileName = fileName;
xmlFormReader = new XmlFormReader() ;
}
/// <summary>
/// All classes how use this baseclass have to override this method
/// </summary>
/// <remarks>
/// Interface method from IDesignerVisitor
///
/// </remarks>
public virtual void Visit(SharpReport.Designer.BaseDesignerControl designer) {
}
#region Properties
protected string FileName {
get {
return fileName;
}
}
protected XmlFormReader XmlFormReader {
get {
return xmlFormReader;
}
}
protected string NodesQuery {
get {
return nodesQuery;
}
}
#endregion
}
}

63
src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs

@ -28,9 +28,9 @@ using SharpReport.ReportItems; @@ -28,9 +28,9 @@ using SharpReport.ReportItems;
namespace SharpReport.Visitors {
public class LoadReportVisitor : SharpReport.Visitors.AbstractVisitor {
SharpReport.Designer.BaseDesignerControl designer;
public class LoadReportVisitor : SharpReportCore.AbstractModelVisitor {
SharpReport.Designer.BaseDesignerControl baseDesigner;
IDesignableFactory designableFactory ;
public LoadReportVisitor(string fileName):base(fileName) {
@ -41,16 +41,19 @@ namespace SharpReport.Visitors { @@ -41,16 +41,19 @@ namespace SharpReport.Visitors {
/// Loads ReportDefinition from File and set the values in the SharpReportDesigner
/// </summary>
/// <param name='designer'>SharpReportDesigner</param>
public override void Visit(SharpReport.Designer.BaseDesignerControl designer){
public override void Visit(System.Windows.Forms.Control designer){
if (designer == null) {
throw new ArgumentNullException("designer");
}
this.baseDesigner = designer as SharpReport.Designer.BaseDesignerControl;
if (this.baseDesigner == null) {
throw new ArgumentException("designer");
}
XmlDocument xmlDoc;
try {
xmlDoc = XmlHelper.OpenSharpReport (base.FileName);
this.designer = designer;
SetDesigner (xmlDoc);
AdjustSectionsWidth();
} catch (Exception ) {
@ -60,41 +63,36 @@ namespace SharpReport.Visitors { @@ -60,41 +63,36 @@ namespace SharpReport.Visitors {
}
private void AdjustSectionsWidth() {
foreach (ReportSection section in designer.SectionsCollection) {
section.VisualControl.Width = designer.ReportModel.ReportSettings.PageSettings.Bounds.Width;
foreach (ReportSection section in baseDesigner.SectionsCollection) {
section.VisualControl.Width = baseDesigner.ReportModel.ReportSettings.PageSettings.Bounds.Width;
if (section.SectionMargin == 0) {
section.SectionMargin = designer.ReportModel.ReportSettings.PageSettings.Bounds.Left;
section.SectionMargin = baseDesigner.ReportModel.ReportSettings.PageSettings.Bounds.Left;
}
}
}
private void SetDesigner (XmlDocument doc){
this.designer.ReportModel.ReportSettings.SetSettings ((XmlElement)doc.DocumentElement.FirstChild);
this.baseDesigner.ReportModel.ReportSettings.SetSettings ((XmlElement)doc.DocumentElement.FirstChild);
SetSections (doc);
}
private void SetSections (XmlDocument doc) {
XmlNodeList sectionNodes = doc.DocumentElement.ChildNodes;
//Start with node(1)
XmlNode node;
BaseSection baseSection = null;
for (int i = 1;i < sectionNodes.Count ; i++ ) {
node = sectionNodes[i];
XmlNode node = sectionNodes[i];
XmlElement sectionElem = node as XmlElement;
if (sectionElem != null) {
baseSection = (BaseSection)designer.ReportModel.SectionCollection.Find(sectionElem.GetAttribute("name"));
if (baseSection != null) {
XmlHelper.SetSectionValues (base.XmlFormReader,sectionElem,baseSection);
XmlNodeList ctrlList = sectionElem.SelectNodes (base.NodesQuery);
SetReportItems(baseSection,null,ctrlList);
} else {
throw new MissingSectionException();
}
BaseSection baseSection = (BaseSection)baseDesigner.ReportModel.SectionCollection.Find(sectionElem.GetAttribute("name"));
XmlNodeList ctrlList = base.MakeSection(sectionElem,baseSection);
SetReportItems(baseSection,null,ctrlList);
} else {
throw new MissingSectionException();
}
@ -106,7 +104,6 @@ namespace SharpReport.Visitors { @@ -106,7 +104,6 @@ namespace SharpReport.Visitors {
IContainerItem parentContainer,XmlNodeList ctrlList) {
BaseReportItem baseReportItem;
//BaseReportItem parentItem;
foreach (XmlNode ctrlNode in ctrlList) {
XmlElement ctrlElem = ctrlNode as XmlElement;
if (ctrlElem != null) {
@ -114,28 +111,12 @@ namespace SharpReport.Visitors { @@ -114,28 +111,12 @@ namespace SharpReport.Visitors {
try {
itemRenderer = designableFactory.Create(ctrlElem.GetAttribute("type"));
baseReportItem = (BaseReportItem)itemRenderer;
baseReportItem.SuspendLayout();
XmlHelper.SetReportItemValues (base.XmlFormReader,ctrlElem,baseReportItem);
if (parentContainer == null) {
baseReportItem.Parent = baseSection;
baseSection.Items.Add (baseReportItem);
} else {
baseReportItem.Parent = parentContainer;
parentContainer.Items.Add(baseReportItem);
}
baseReportItem.ResumeLayout();
baseReportItem = base.MakeItem(ctrlElem,parentContainer,baseSection,itemRenderer);
IContainerItem iContainer = baseReportItem as IContainerItem;
if (iContainer != null) {
XmlNodeList newList = ctrlNode.SelectNodes (base.NodesQuery);
if (newList.Count > 0) {
System.Console.WriteLine("\tLoadReportVisitor recursive call for <{0}> with {1} elements",
baseReportItem.Name,
newList.Count);
SetReportItems (baseSection,iContainer,newList);
}
}

15
src/AddIns/Misc/SharpReport/SharpReport/Visitors/SaveReportVisitor.cs

@ -20,17 +20,22 @@ namespace SharpReport.Visitors{ @@ -20,17 +20,22 @@ namespace SharpReport.Visitors{
/// Description of SaveReportVisitor.
/// </summary>
public class SaveReportVisitor : AbstractVisitor
public class SaveReportVisitor :SharpReportCore.AbstractModelVisitor
{
private XmlDocument xmlDoc;
private SharpReport.Designer.BaseDesignerControl baseDesigner;
public SaveReportVisitor ():base() {
public SaveReportVisitor ():base(String.Empty) {
}
public override void Visit (SharpReport.Designer.BaseDesignerControl designer) {
xmlDoc = this.BuildReportDocument(designer);
public override void Visit (Control designer) {
this.baseDesigner = designer as SharpReport.Designer.BaseDesignerControl;
if (this.baseDesigner == null) {
throw new ArgumentException("designer");
}
xmlDoc = this.BuildReportDocument(baseDesigner);
}
private XmlDocument BuildReportDocument (SharpReport.Designer.BaseDesignerControl designer) {

1
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs

@ -68,6 +68,7 @@ namespace SharpReportCore { @@ -68,6 +68,7 @@ namespace SharpReportCore {
string toPrint = CheckForNullValue();
base.Text = base.FireFormatOutput(toPrint,this.FormatString,"");
// System.Console.WriteLine("\tBaseDataItem <{0}> / <{1}>",this.Name,this.Text);
base.Render (rpea);
}

15
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs

@ -35,14 +35,15 @@ namespace SharpReportCore{ @@ -35,14 +35,15 @@ namespace SharpReportCore{
public RowItem(string tableName){
this.tableName = tableName;
this.Items.Added += OnAdded;
// this.Items.Added += OnAdded;
}
/*
void OnAdded (object sender, CollectionItemEventArgs<IItemRenderer> e){
System.Console.WriteLine("");
System.Console.WriteLine("RowItem:OnAdded");
System.Console.WriteLine("RowItem:OnAdded did we use this function???");
}
*/
#region overrides
@ -58,8 +59,8 @@ namespace SharpReportCore{ @@ -58,8 +59,8 @@ namespace SharpReportCore{
if (rpea == null) {
throw new ArgumentNullException("rpea");
}
System.Console.WriteLine("");
System.Console.WriteLine("--Start of {0}",this.ToString());
// System.Console.WriteLine("");
// System.Console.WriteLine("--Start of {0}",this.ToString());
base.Render(rpea);
RectangleF rect = PrepareRectangle (rpea);
@ -83,8 +84,8 @@ namespace SharpReportCore{ @@ -83,8 +84,8 @@ namespace SharpReportCore{
childItem.Render (rpea);
childItem.Location = new Point(loc.X,loc.Y);
}
System.Console.WriteLine("--End of RowItem");
System.Console.WriteLine("");
// System.Console.WriteLine("--End of RowItem");
// System.Console.WriteLine("");
base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
}

38
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs

@ -35,8 +35,8 @@ namespace SharpReportCore { @@ -35,8 +35,8 @@ namespace SharpReportCore {
GroupSeperator groupSeperator;
public event EventHandler <ListChangedEventArgs> ListChanged;
public event EventHandler <GroupChangedEventArgs> GroupChanged;
public event EventHandler <EventArgs> GroupChanging;
// public event EventHandler <GroupChangedEventArgs> GroupChanged;
// public event EventHandler <EventArgs> GroupChanging;
/// <summary>
/// use this Constructor for PullDataReports
@ -62,7 +62,7 @@ namespace SharpReportCore { @@ -62,7 +62,7 @@ namespace SharpReportCore {
this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource,
reportSettings);
this.dataViewStrategy.ListChanged += new EventHandler <ListChangedEventArgs> (NotifyListChanged);
this.dataViewStrategy.GroupChanged += new EventHandler<GroupChangedEventArgs> (OnGroupChange);
// this.dataViewStrategy.GroupChanged += new EventHandler<GroupChangedEventArgs> (OnGroupChange);
}
public DataManager(DataTable dataSource, ReportSettings reportSettings){
@ -272,18 +272,18 @@ namespace SharpReportCore { @@ -272,18 +272,18 @@ namespace SharpReportCore {
}
private void NotifyGroupChanging () {
if (this.GroupChanging!= null) {
this.GroupChanging (this,EventArgs.Empty);
}
// if (this.GroupChanging!= null) {
// this.GroupChanging (this,EventArgs.Empty);
// }
}
private void NotifyGroupChanged() {
if (this.IsGrouped) {
if (this.GroupChanged != null) {
this.GroupChanged (this,new GroupChangedEventArgs(this.groupSeperator));
}
// if (this.GroupChanged != null) {
// this.GroupChanged (this,new GroupChangedEventArgs(this.groupSeperator));
// }
}
}
private void OnGroupChange (object sender,GroupChangedEventArgs e) {
@ -384,7 +384,6 @@ namespace SharpReportCore { @@ -384,7 +384,6 @@ namespace SharpReportCore {
}
}
// Nur zum testen
public DataNavigator GetNavigator {
get {
@ -393,22 +392,6 @@ namespace SharpReportCore { @@ -393,22 +392,6 @@ namespace SharpReportCore {
}
/*
public object Current {
get {
throw new NotImplementedException();
}
}
*/
// public void Reset() {
// this.dataViewStrategy.Reset();
// }
//
// public bool MoveNext() {
// return this.dataViewStrategy.MoveNext();
// }
public bool IsGrouped {
get {
@ -427,6 +410,7 @@ namespace SharpReportCore { @@ -427,6 +410,7 @@ namespace SharpReportCore {
return this.dataViewStrategy.IsFiltered;
}
}
#region System.IDisposable interface implementation
public void Dispose() {
this.Dispose(true);

32
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataNavigator.cs

@ -17,12 +17,16 @@ namespace SharpReportCore @@ -17,12 +17,16 @@ namespace SharpReportCore
public class DataNavigator :IDataNavigator{
IDataViewStrategy store;
public event EventHandler <ListChangedEventArgs> ListChanged;
GroupSeperator groupSeperator;
public event EventHandler <ListChangedEventArgs> ListChanged;
// public event EventHandler <EventArgs> GroupChanging;
public event EventHandler <GroupChangedEventArgs> GroupChanged;
public DataNavigator(IDataViewStrategy store){
this.store = store;
this.store.ListChanged += new EventHandler<ListChangedEventArgs> (OnListChanged);
this.store.GroupChanged += new EventHandler<GroupChangedEventArgs> (OnGroupChange);
}
private void OnListChanged (object sender,System.ComponentModel.ListChangedEventArgs e) {
@ -31,10 +35,34 @@ namespace SharpReportCore @@ -31,10 +35,34 @@ namespace SharpReportCore
}
}
// private void NotifyGroupChanging () {
// if (this.GroupChanging!= null) {
// this.GroupChanging (this,EventArgs.Empty);
// }
// }
private void NotifyGroupChanged() {
if (this.store.IsGrouped) {
if (this.GroupChanged != null) {
this.GroupChanged (this,new GroupChangedEventArgs(this.groupSeperator));
}
}
}
private void OnGroupChange (object sender,GroupChangedEventArgs e) {
this.groupSeperator = e.GroupSeperator;
this.NotifyGroupChanged();
}
#region IDataNavigator implementation
public void Fill (ReportItemCollection collection) {
// this.NotifyGroupChanging();
this.NotifyGroupChanged();
foreach (IItemRenderer item in collection) {
this.store.Fill(item);
}
// this.NotifyGroupChanged();
}
@ -79,5 +107,7 @@ namespace SharpReportCore @@ -79,5 +107,7 @@ namespace SharpReportCore
return this.store.Current;
}
}
#endregion
}
}

4
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/CollectionStrategy.cs

@ -212,13 +212,15 @@ namespace SharpReportCore { @@ -212,13 +212,15 @@ namespace SharpReportCore {
public override void Bind() {
base.Bind();
if ((base.ReportSettings.GroupColumnsCollection != null) && (base.ReportSettings.GroupColumnsCollection.Count > 0)) {
// if ((base.ReportSettings.GroupColumnsCollection != null) && (base.ReportSettings.GroupColumnsCollection.Count > 0)) {
if (base.ReportSettings.GroupColumnsCollection.Count > 0) {
this.Group ();
Reset();
return;
}
if (base.ReportSettings.SortColumnCollection != null) {
// if (base.ReportSettings.SortColumnCollection.Count > 0) {
this.Sort ();
}
Reset();

10
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs

@ -92,8 +92,6 @@ namespace SharpReportCore { @@ -92,8 +92,6 @@ namespace SharpReportCore {
#region Grouping
private void BuildGroup(){
try {
SharpIndexCollection groupedArray = new SharpIndexCollection();
@ -168,15 +166,14 @@ namespace SharpReportCore { @@ -168,15 +166,14 @@ namespace SharpReportCore {
public override void Bind() {
base.Bind();
if ((base.ReportSettings.GroupColumnsCollection != null) && (base.ReportSettings.GroupColumnsCollection.Count > 0)) {
if (base.ReportSettings.GroupColumnsCollection.Count > 0) {
this.Group ();
Reset();
return;
}
if (base.ReportSettings.SortColumnCollection != null) {
this.Sort ();
}
Reset();
}
@ -208,7 +205,7 @@ namespace SharpReportCore { @@ -208,7 +205,7 @@ namespace SharpReportCore {
try {
base.Fill(item);
if (this.Current == null) {
System.Console.WriteLine("ow is null");
System.Console.WriteLine("row is null");
}
if (this.row != null) {
BaseDataItem baseDataItem = item as BaseDataItem;
@ -239,6 +236,7 @@ namespace SharpReportCore { @@ -239,6 +236,7 @@ namespace SharpReportCore {
public override int Count {
get {
return this.IndexList.Count;
// return this.view.Count;
}
}

10
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs

@ -39,7 +39,6 @@ namespace SharpReportCore{ @@ -39,7 +39,6 @@ namespace SharpReportCore{
protected override int RenderSection(BaseSection section, ReportPageEventArgs rpea){
bool hasContainer = false;
IContainerItem container = null;
foreach (BaseReportItem item in section.Items) {
@ -54,7 +53,7 @@ namespace SharpReportCore{ @@ -54,7 +53,7 @@ namespace SharpReportCore{
} else {
return base.RenderSection(section, rpea);
}
}
private int DoContainerControl (BaseSection section,
@ -64,7 +63,6 @@ namespace SharpReportCore{ @@ -64,7 +63,6 @@ namespace SharpReportCore{
if (container == null) {
return section.Size.Height;
}
this.DataNavigator.Fill(container.Items);
Point drawPoint = new Point(0,0);
if (section.Visible){
@ -81,10 +79,8 @@ namespace SharpReportCore{ @@ -81,10 +79,8 @@ namespace SharpReportCore{
}
if ((section.CanGrow == false)&& (section.CanShrink == false)) {
return section.Size.Height;
}
return section.Size.Height;
}
return drawPoint.Y;
}
return drawPoint.Y;

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

Loading…
Cancel
Save