From 844e586b634cacacce0abdf8bf5d0f4bf8fb58c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 9 Mar 2018 10:35:06 +0100 Subject: [PATCH] crow ide toolbox, syntax tree depth and generalize node handling accross parser --- Crow.csproj | 2 - CrowIDE/CrowIDE.csproj | 86 +- CrowIDE/CrowIDE.sln | 17 + CrowIDE/CrowIDE.userprefs | 19 + CrowIDE/icons/toolbox/Crow.Border.svg | 6 + CrowIDE/icons/toolbox/Crow.Button.svg | 6 + CrowIDE/icons/toolbox/Crow.CheckBox.svg | 6 + CrowIDE/icons/toolbox/Crow.ColorPicker.svg | 6 + CrowIDE/icons/toolbox/Crow.ComboBox.svg | 7 + CrowIDE/icons/toolbox/Crow.Container.svg | 6 + CrowIDE/icons/toolbox/Crow.DirectoryView.svg | 6 + CrowIDE/icons/toolbox/Crow.Docker.svg | 6 + CrowIDE/icons/toolbox/Crow.Expandable.svg | 6 + CrowIDE/icons/toolbox/Crow.FileDialog.svg | 8 + CrowIDE/icons/toolbox/Crow.Grid.svg | 6 + CrowIDE/icons/toolbox/Crow.Group.svg | 9 + CrowIDE/icons/toolbox/Crow.GroupBox.svg | 10 + .../icons/toolbox/Crow.HorizontalStack.svg | 6 + CrowIDE/icons/toolbox/Crow.IMLContainer.svg | 8 + CrowIDE/icons/toolbox/Crow.Image.svg | 8 + CrowIDE/icons/toolbox/Crow.Label.svg | 7 + CrowIDE/icons/toolbox/Crow.ListBox.svg | 11 + CrowIDE/icons/toolbox/Crow.Menu.svg | 11 + CrowIDE/icons/toolbox/Crow.MenuItem.svg | 7 + CrowIDE/icons/toolbox/Crow.MessageBox.svg | 8 + CrowIDE/icons/toolbox/Crow.ProgressBar.svg | 7 + CrowIDE/icons/toolbox/Crow.RadioButton.svg | 10 + CrowIDE/icons/toolbox/Crow.ScrollBar.svg | 7 + CrowIDE/icons/toolbox/Crow.Scroller.svg | 6 + CrowIDE/icons/toolbox/Crow.Shape.svg | 6 + CrowIDE/icons/toolbox/Crow.Slider.svg | 6 + CrowIDE/icons/toolbox/Crow.Spinner.svg | 7 + CrowIDE/icons/toolbox/Crow.Splitter.svg | 8 + CrowIDE/icons/toolbox/Crow.TabItem.svg | 6 + CrowIDE/icons/toolbox/Crow.TabView.svg | 6 + .../icons/toolbox/Crow.TemplatedContainer.svg | 6 + CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg | 6 + CrowIDE/icons/toolbox/Crow.TextBox.svg | 7 + CrowIDE/icons/toolbox/Crow.TreeView.svg | 6 + CrowIDE/icons/toolbox/Crow.VerticalStack.svg | 6 + CrowIDE/icons/toolbox/Crow.Window.svg | 6 + CrowIDE/icons/toolbox/Crow.Wrapper.svg | 8 + CrowIDE/icons/toolbox/bar-chart.svg | 10 + CrowIDE/icons/toolbox/bar-menu.svg | 8 + CrowIDE/icons/toolbox/bullets.svg | 11 + CrowIDE/icons/toolbox/calendar.svg | 8 + CrowIDE/icons/toolbox/check-square-1.svg | 7 + CrowIDE/icons/toolbox/curly-brackets.svg | 7 + CrowIDE/icons/toolbox/database.svg | 9 + CrowIDE/icons/toolbox/dot-inside-a-circle.svg | 7 + CrowIDE/icons/toolbox/edit.svg | 6 + CrowIDE/icons/toolbox/ellipsis.svg | 8 + CrowIDE/icons/toolbox/eraser.svg | 6 + .../icons/toolbox/exclamation-circle-1.svg | 8 + CrowIDE/icons/toolbox/exclamation-circle.svg | 6 + CrowIDE/icons/toolbox/file-code.svg | 9 + CrowIDE/icons/toolbox/gear.svg | 9 + CrowIDE/icons/toolbox/grab.svg | 6 + CrowIDE/icons/toolbox/hard-drive-1.svg | 7 + CrowIDE/icons/toolbox/hash.svg | 6 + CrowIDE/icons/toolbox/info.svg | 7 + CrowIDE/icons/toolbox/layout.svg | 6 + CrowIDE/icons/toolbox/light-bulb.svg | 7 + CrowIDE/icons/toolbox/line-list.svg | 13 + CrowIDE/icons/toolbox/list.svg | 11 + CrowIDE/icons/toolbox/modal-list.svg | 12 + CrowIDE/icons/toolbox/move-arrows.svg | 6 + CrowIDE/icons/toolbox/package.svg | 6 + CrowIDE/icons/toolbox/padding.svg | 47 ++ CrowIDE/icons/toolbox/paint-brush.svg | 8 + CrowIDE/icons/toolbox/picture-file.svg | 8 + CrowIDE/icons/toolbox/pin.svg | 6 + CrowIDE/icons/toolbox/pointer.svg | 6 + CrowIDE/icons/toolbox/puzzle-piece.svg | 6 + CrowIDE/icons/toolbox/refresh-file.svg | 8 + CrowIDE/icons/toolbox/search.svg | 6 + CrowIDE/icons/toolbox/sliders.svg | 11 + CrowIDE/icons/toolbox/split-browser-1.svg | 6 + CrowIDE/icons/toolbox/table.svg | 6 + CrowIDE/icons/toolbox/tasks.svg | 11 + CrowIDE/icons/toolbox/text-file.svg | 9 + CrowIDE/icons/toolbox/tools.svg | 8 + CrowIDE/icons/toolbox/trash.svg | 7 + CrowIDE/icons/toolbox/warning.svg | 6 + CrowIDE/icons/toolbox/zoom-in.svg | 7 + CrowIDE/icons/toolbox/zoom-out.svg | 7 + CrowIDE/src/CrowIDE.cs | 7 + CrowIDE/src/DesignInterface.cs | 31 + CrowIDE/src/GraphicObjectDesignContainer.cs | 83 ++ CrowIDE/src/ImlVisualEditor.cs | 89 +- CrowIDE/src/MemberView/MembersView.cs | 10 +- CrowIDE/src/Solution.cs | 23 + CrowIDE/src/SourceEditor/BufferParser.cs | 32 + CrowIDE/src/SourceEditor/CSharpParser.cs | 41 +- CrowIDE/src/SourceEditor/CodeBuffer.cs | 23 + CrowIDE/src/SourceEditor/SourceEditor.cs | 43 +- CrowIDE/src/SourceEditor/StyleParser.cs | 14 +- CrowIDE/src/SourceEditor/XMLParser.cs | 18 +- CrowIDE/ui/CrowIDE.crow | 2 + CrowIDE/ui/DockWindows/toolboxBut.template | 7 + CrowIDE/ui/DockWindows/winToolbox.crow | 19 + CrowIDE/ui/IDE.style | 2 +- CrowIDE/ui/IMLEdit.itemp | 3 +- CrowIDE/ui/SrcEdit.itemp | 10 +- Default.style | 3 +- src/GraphicObjects/ColorSelector.cs | 1 + src/GraphicObjects/DockStack.cs | 1 + src/GraphicObjects/GraduatedSlider.cs | 1 + src/GraphicObjects/GraphicObject.cs | 36 +- src/GraphicObjects/HueSelector.cs | 1 + src/GraphicObjects/MDIContainer.cs | 40 - src/GraphicObjects/PrivateContainer.cs | 12 +- src/GraphicObjects/SaturationValueSelector.cs | 1 + src/GraphicObjects/ScrollingObject.cs | 1 + src/GraphicObjects/ScrollingTextBox.cs | 794 ------------------ src/GraphicObjects/TextRun.cs | 1 + src/IMLAttributes.cs | 4 + src/Interface.cs | 2 +- src/LayoutingQueueItem.cs | 8 +- 119 files changed, 1195 insertions(+), 939 deletions(-) create mode 100644 CrowIDE/CrowIDE.sln create mode 100644 CrowIDE/CrowIDE.userprefs create mode 100644 CrowIDE/icons/toolbox/Crow.Border.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Button.svg create mode 100644 CrowIDE/icons/toolbox/Crow.CheckBox.svg create mode 100644 CrowIDE/icons/toolbox/Crow.ColorPicker.svg create mode 100644 CrowIDE/icons/toolbox/Crow.ComboBox.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Container.svg create mode 100644 CrowIDE/icons/toolbox/Crow.DirectoryView.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Docker.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Expandable.svg create mode 100644 CrowIDE/icons/toolbox/Crow.FileDialog.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Grid.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Group.svg create mode 100644 CrowIDE/icons/toolbox/Crow.GroupBox.svg create mode 100644 CrowIDE/icons/toolbox/Crow.HorizontalStack.svg create mode 100644 CrowIDE/icons/toolbox/Crow.IMLContainer.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Image.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Label.svg create mode 100644 CrowIDE/icons/toolbox/Crow.ListBox.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Menu.svg create mode 100644 CrowIDE/icons/toolbox/Crow.MenuItem.svg create mode 100644 CrowIDE/icons/toolbox/Crow.MessageBox.svg create mode 100644 CrowIDE/icons/toolbox/Crow.ProgressBar.svg create mode 100644 CrowIDE/icons/toolbox/Crow.RadioButton.svg create mode 100644 CrowIDE/icons/toolbox/Crow.ScrollBar.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Scroller.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Shape.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Slider.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Spinner.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Splitter.svg create mode 100644 CrowIDE/icons/toolbox/Crow.TabItem.svg create mode 100644 CrowIDE/icons/toolbox/Crow.TabView.svg create mode 100644 CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg create mode 100644 CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg create mode 100644 CrowIDE/icons/toolbox/Crow.TextBox.svg create mode 100644 CrowIDE/icons/toolbox/Crow.TreeView.svg create mode 100644 CrowIDE/icons/toolbox/Crow.VerticalStack.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Window.svg create mode 100644 CrowIDE/icons/toolbox/Crow.Wrapper.svg create mode 100644 CrowIDE/icons/toolbox/bar-chart.svg create mode 100644 CrowIDE/icons/toolbox/bar-menu.svg create mode 100644 CrowIDE/icons/toolbox/bullets.svg create mode 100644 CrowIDE/icons/toolbox/calendar.svg create mode 100644 CrowIDE/icons/toolbox/check-square-1.svg create mode 100644 CrowIDE/icons/toolbox/curly-brackets.svg create mode 100644 CrowIDE/icons/toolbox/database.svg create mode 100644 CrowIDE/icons/toolbox/dot-inside-a-circle.svg create mode 100644 CrowIDE/icons/toolbox/edit.svg create mode 100644 CrowIDE/icons/toolbox/ellipsis.svg create mode 100644 CrowIDE/icons/toolbox/eraser.svg create mode 100644 CrowIDE/icons/toolbox/exclamation-circle-1.svg create mode 100644 CrowIDE/icons/toolbox/exclamation-circle.svg create mode 100644 CrowIDE/icons/toolbox/file-code.svg create mode 100644 CrowIDE/icons/toolbox/gear.svg create mode 100644 CrowIDE/icons/toolbox/grab.svg create mode 100644 CrowIDE/icons/toolbox/hard-drive-1.svg create mode 100644 CrowIDE/icons/toolbox/hash.svg create mode 100644 CrowIDE/icons/toolbox/info.svg create mode 100644 CrowIDE/icons/toolbox/layout.svg create mode 100644 CrowIDE/icons/toolbox/light-bulb.svg create mode 100644 CrowIDE/icons/toolbox/line-list.svg create mode 100644 CrowIDE/icons/toolbox/list.svg create mode 100644 CrowIDE/icons/toolbox/modal-list.svg create mode 100644 CrowIDE/icons/toolbox/move-arrows.svg create mode 100644 CrowIDE/icons/toolbox/package.svg create mode 100644 CrowIDE/icons/toolbox/padding.svg create mode 100644 CrowIDE/icons/toolbox/paint-brush.svg create mode 100644 CrowIDE/icons/toolbox/picture-file.svg create mode 100644 CrowIDE/icons/toolbox/pin.svg create mode 100644 CrowIDE/icons/toolbox/pointer.svg create mode 100644 CrowIDE/icons/toolbox/puzzle-piece.svg create mode 100644 CrowIDE/icons/toolbox/refresh-file.svg create mode 100644 CrowIDE/icons/toolbox/search.svg create mode 100644 CrowIDE/icons/toolbox/sliders.svg create mode 100644 CrowIDE/icons/toolbox/split-browser-1.svg create mode 100644 CrowIDE/icons/toolbox/table.svg create mode 100644 CrowIDE/icons/toolbox/tasks.svg create mode 100644 CrowIDE/icons/toolbox/text-file.svg create mode 100644 CrowIDE/icons/toolbox/tools.svg create mode 100644 CrowIDE/icons/toolbox/trash.svg create mode 100644 CrowIDE/icons/toolbox/warning.svg create mode 100644 CrowIDE/icons/toolbox/zoom-in.svg create mode 100644 CrowIDE/icons/toolbox/zoom-out.svg create mode 100644 CrowIDE/src/GraphicObjectDesignContainer.cs create mode 100644 CrowIDE/ui/DockWindows/toolboxBut.template create mode 100644 CrowIDE/ui/DockWindows/winToolbox.crow delete mode 100644 src/GraphicObjects/MDIContainer.cs delete mode 100644 src/GraphicObjects/ScrollingTextBox.cs diff --git a/Crow.csproj b/Crow.csproj index 7a0ffada..9e474f58 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -151,7 +151,6 @@ - @@ -215,7 +214,6 @@ - diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 9cca73b4..6b720536 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -52,12 +52,6 @@ %24{SolutionDir}\build\%24{ProjectConfigName} false - - Program - %24{TargetName} - %24{SolutionDir}\build\%24{ProjectConfigName} - false - @@ -118,6 +112,7 @@ + @@ -177,6 +172,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrowIDE/CrowIDE.sln b/CrowIDE/CrowIDE.sln new file mode 100644 index 00000000..49e1e026 --- /dev/null +++ b/CrowIDE/CrowIDE.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/CrowIDE/CrowIDE.userprefs b/CrowIDE/CrowIDE.userprefs new file mode 100644 index 00000000..0f4ab212 --- /dev/null +++ b/CrowIDE/CrowIDE.userprefs @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CrowIDE/icons/toolbox/Crow.Border.svg b/CrowIDE/icons/toolbox/Crow.Border.svg new file mode 100644 index 00000000..9337dee7 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Border.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Button.svg b/CrowIDE/icons/toolbox/Crow.Button.svg new file mode 100644 index 00000000..34c2a56f --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Button.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.CheckBox.svg b/CrowIDE/icons/toolbox/Crow.CheckBox.svg new file mode 100644 index 00000000..c6415d81 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.CheckBox.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.ColorPicker.svg b/CrowIDE/icons/toolbox/Crow.ColorPicker.svg new file mode 100644 index 00000000..d2a3f6ea --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.ColorPicker.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.ComboBox.svg b/CrowIDE/icons/toolbox/Crow.ComboBox.svg new file mode 100644 index 00000000..7ed51330 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.ComboBox.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Container.svg b/CrowIDE/icons/toolbox/Crow.Container.svg new file mode 100644 index 00000000..a0015fa1 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Container.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.DirectoryView.svg b/CrowIDE/icons/toolbox/Crow.DirectoryView.svg new file mode 100644 index 00000000..587450a0 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.DirectoryView.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Docker.svg b/CrowIDE/icons/toolbox/Crow.Docker.svg new file mode 100644 index 00000000..1831febd --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Docker.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Expandable.svg b/CrowIDE/icons/toolbox/Crow.Expandable.svg new file mode 100644 index 00000000..3dd36991 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Expandable.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.FileDialog.svg b/CrowIDE/icons/toolbox/Crow.FileDialog.svg new file mode 100644 index 00000000..a495640c --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.FileDialog.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Grid.svg b/CrowIDE/icons/toolbox/Crow.Grid.svg new file mode 100644 index 00000000..acf15945 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Grid.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Group.svg b/CrowIDE/icons/toolbox/Crow.Group.svg new file mode 100644 index 00000000..e679974d --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Group.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.GroupBox.svg b/CrowIDE/icons/toolbox/Crow.GroupBox.svg new file mode 100644 index 00000000..b2c1d03a --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.GroupBox.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg b/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg new file mode 100644 index 00000000..62ea4755 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.HorizontalStack.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.IMLContainer.svg b/CrowIDE/icons/toolbox/Crow.IMLContainer.svg new file mode 100644 index 00000000..81f85248 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.IMLContainer.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Image.svg b/CrowIDE/icons/toolbox/Crow.Image.svg new file mode 100644 index 00000000..f17cce6a --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Image.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Label.svg b/CrowIDE/icons/toolbox/Crow.Label.svg new file mode 100644 index 00000000..56c8c34e --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Label.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.ListBox.svg b/CrowIDE/icons/toolbox/Crow.ListBox.svg new file mode 100644 index 00000000..f466e3ba --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.ListBox.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Menu.svg b/CrowIDE/icons/toolbox/Crow.Menu.svg new file mode 100644 index 00000000..9d0bf4a3 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Menu.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.MenuItem.svg b/CrowIDE/icons/toolbox/Crow.MenuItem.svg new file mode 100644 index 00000000..68932e22 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.MenuItem.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.MessageBox.svg b/CrowIDE/icons/toolbox/Crow.MessageBox.svg new file mode 100644 index 00000000..3e608eb0 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.MessageBox.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.ProgressBar.svg b/CrowIDE/icons/toolbox/Crow.ProgressBar.svg new file mode 100644 index 00000000..63057a7b --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.ProgressBar.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.RadioButton.svg b/CrowIDE/icons/toolbox/Crow.RadioButton.svg new file mode 100644 index 00000000..a149a350 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.RadioButton.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.ScrollBar.svg b/CrowIDE/icons/toolbox/Crow.ScrollBar.svg new file mode 100644 index 00000000..eab0c583 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.ScrollBar.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Scroller.svg b/CrowIDE/icons/toolbox/Crow.Scroller.svg new file mode 100644 index 00000000..b36551be --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Scroller.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Shape.svg b/CrowIDE/icons/toolbox/Crow.Shape.svg new file mode 100644 index 00000000..2ebd68fc --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Shape.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Slider.svg b/CrowIDE/icons/toolbox/Crow.Slider.svg new file mode 100644 index 00000000..f3c62960 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Slider.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Spinner.svg b/CrowIDE/icons/toolbox/Crow.Spinner.svg new file mode 100644 index 00000000..3a3dc5d3 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Spinner.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Splitter.svg b/CrowIDE/icons/toolbox/Crow.Splitter.svg new file mode 100644 index 00000000..be8fb02e --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Splitter.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.TabItem.svg b/CrowIDE/icons/toolbox/Crow.TabItem.svg new file mode 100644 index 00000000..0b5bd9ca --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.TabItem.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.TabView.svg b/CrowIDE/icons/toolbox/Crow.TabView.svg new file mode 100644 index 00000000..8d9f794a --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.TabView.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg b/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg new file mode 100644 index 00000000..a4b3a4f7 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.TemplatedContainer.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg b/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg new file mode 100644 index 00000000..d83ab4df --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.TemplatedGroup.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.TextBox.svg b/CrowIDE/icons/toolbox/Crow.TextBox.svg new file mode 100644 index 00000000..98abb7b9 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.TextBox.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.TreeView.svg b/CrowIDE/icons/toolbox/Crow.TreeView.svg new file mode 100644 index 00000000..33b0cda6 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.TreeView.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.VerticalStack.svg b/CrowIDE/icons/toolbox/Crow.VerticalStack.svg new file mode 100644 index 00000000..b58772bc --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.VerticalStack.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Window.svg b/CrowIDE/icons/toolbox/Crow.Window.svg new file mode 100644 index 00000000..ae8f3aba --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Window.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/Crow.Wrapper.svg b/CrowIDE/icons/toolbox/Crow.Wrapper.svg new file mode 100644 index 00000000..88506a12 --- /dev/null +++ b/CrowIDE/icons/toolbox/Crow.Wrapper.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/bar-chart.svg b/CrowIDE/icons/toolbox/bar-chart.svg new file mode 100644 index 00000000..08c633ba --- /dev/null +++ b/CrowIDE/icons/toolbox/bar-chart.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/bar-menu.svg b/CrowIDE/icons/toolbox/bar-menu.svg new file mode 100644 index 00000000..0bbb97d8 --- /dev/null +++ b/CrowIDE/icons/toolbox/bar-menu.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/bullets.svg b/CrowIDE/icons/toolbox/bullets.svg new file mode 100644 index 00000000..1f8c5697 --- /dev/null +++ b/CrowIDE/icons/toolbox/bullets.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/calendar.svg b/CrowIDE/icons/toolbox/calendar.svg new file mode 100644 index 00000000..35df970f --- /dev/null +++ b/CrowIDE/icons/toolbox/calendar.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/check-square-1.svg b/CrowIDE/icons/toolbox/check-square-1.svg new file mode 100644 index 00000000..fca782c5 --- /dev/null +++ b/CrowIDE/icons/toolbox/check-square-1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/curly-brackets.svg b/CrowIDE/icons/toolbox/curly-brackets.svg new file mode 100644 index 00000000..f70fe9fa --- /dev/null +++ b/CrowIDE/icons/toolbox/curly-brackets.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/database.svg b/CrowIDE/icons/toolbox/database.svg new file mode 100644 index 00000000..bd2d1820 --- /dev/null +++ b/CrowIDE/icons/toolbox/database.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/dot-inside-a-circle.svg b/CrowIDE/icons/toolbox/dot-inside-a-circle.svg new file mode 100644 index 00000000..c84374af --- /dev/null +++ b/CrowIDE/icons/toolbox/dot-inside-a-circle.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/edit.svg b/CrowIDE/icons/toolbox/edit.svg new file mode 100644 index 00000000..f4b3190c --- /dev/null +++ b/CrowIDE/icons/toolbox/edit.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/ellipsis.svg b/CrowIDE/icons/toolbox/ellipsis.svg new file mode 100644 index 00000000..6e1cc428 --- /dev/null +++ b/CrowIDE/icons/toolbox/ellipsis.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/eraser.svg b/CrowIDE/icons/toolbox/eraser.svg new file mode 100644 index 00000000..ae4c190f --- /dev/null +++ b/CrowIDE/icons/toolbox/eraser.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/exclamation-circle-1.svg b/CrowIDE/icons/toolbox/exclamation-circle-1.svg new file mode 100644 index 00000000..8b2f3185 --- /dev/null +++ b/CrowIDE/icons/toolbox/exclamation-circle-1.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/exclamation-circle.svg b/CrowIDE/icons/toolbox/exclamation-circle.svg new file mode 100644 index 00000000..fd1a2581 --- /dev/null +++ b/CrowIDE/icons/toolbox/exclamation-circle.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/file-code.svg b/CrowIDE/icons/toolbox/file-code.svg new file mode 100644 index 00000000..3727328f --- /dev/null +++ b/CrowIDE/icons/toolbox/file-code.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/gear.svg b/CrowIDE/icons/toolbox/gear.svg new file mode 100644 index 00000000..3f6ed2be --- /dev/null +++ b/CrowIDE/icons/toolbox/gear.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/grab.svg b/CrowIDE/icons/toolbox/grab.svg new file mode 100644 index 00000000..a0b75804 --- /dev/null +++ b/CrowIDE/icons/toolbox/grab.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/hard-drive-1.svg b/CrowIDE/icons/toolbox/hard-drive-1.svg new file mode 100644 index 00000000..7bab2e5f --- /dev/null +++ b/CrowIDE/icons/toolbox/hard-drive-1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/hash.svg b/CrowIDE/icons/toolbox/hash.svg new file mode 100644 index 00000000..401536c6 --- /dev/null +++ b/CrowIDE/icons/toolbox/hash.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/info.svg b/CrowIDE/icons/toolbox/info.svg new file mode 100644 index 00000000..af12b4be --- /dev/null +++ b/CrowIDE/icons/toolbox/info.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/layout.svg b/CrowIDE/icons/toolbox/layout.svg new file mode 100644 index 00000000..c3ab446c --- /dev/null +++ b/CrowIDE/icons/toolbox/layout.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/light-bulb.svg b/CrowIDE/icons/toolbox/light-bulb.svg new file mode 100644 index 00000000..c7df82aa --- /dev/null +++ b/CrowIDE/icons/toolbox/light-bulb.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/line-list.svg b/CrowIDE/icons/toolbox/line-list.svg new file mode 100644 index 00000000..f9b157c3 --- /dev/null +++ b/CrowIDE/icons/toolbox/line-list.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/list.svg b/CrowIDE/icons/toolbox/list.svg new file mode 100644 index 00000000..117a58ca --- /dev/null +++ b/CrowIDE/icons/toolbox/list.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/modal-list.svg b/CrowIDE/icons/toolbox/modal-list.svg new file mode 100644 index 00000000..6e0e527b --- /dev/null +++ b/CrowIDE/icons/toolbox/modal-list.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/move-arrows.svg b/CrowIDE/icons/toolbox/move-arrows.svg new file mode 100644 index 00000000..2100ea28 --- /dev/null +++ b/CrowIDE/icons/toolbox/move-arrows.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/package.svg b/CrowIDE/icons/toolbox/package.svg new file mode 100644 index 00000000..7ee34042 --- /dev/null +++ b/CrowIDE/icons/toolbox/package.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/padding.svg b/CrowIDE/icons/toolbox/padding.svg new file mode 100644 index 00000000..5ef0f28b --- /dev/null +++ b/CrowIDE/icons/toolbox/padding.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/paint-brush.svg b/CrowIDE/icons/toolbox/paint-brush.svg new file mode 100644 index 00000000..b98eb856 --- /dev/null +++ b/CrowIDE/icons/toolbox/paint-brush.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/picture-file.svg b/CrowIDE/icons/toolbox/picture-file.svg new file mode 100644 index 00000000..f0b3f7f8 --- /dev/null +++ b/CrowIDE/icons/toolbox/picture-file.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/pin.svg b/CrowIDE/icons/toolbox/pin.svg new file mode 100644 index 00000000..0c66eb39 --- /dev/null +++ b/CrowIDE/icons/toolbox/pin.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/pointer.svg b/CrowIDE/icons/toolbox/pointer.svg new file mode 100644 index 00000000..d0ec0712 --- /dev/null +++ b/CrowIDE/icons/toolbox/pointer.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/puzzle-piece.svg b/CrowIDE/icons/toolbox/puzzle-piece.svg new file mode 100644 index 00000000..889dfe8d --- /dev/null +++ b/CrowIDE/icons/toolbox/puzzle-piece.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/refresh-file.svg b/CrowIDE/icons/toolbox/refresh-file.svg new file mode 100644 index 00000000..77bfdfa5 --- /dev/null +++ b/CrowIDE/icons/toolbox/refresh-file.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/search.svg b/CrowIDE/icons/toolbox/search.svg new file mode 100644 index 00000000..3b13c130 --- /dev/null +++ b/CrowIDE/icons/toolbox/search.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/sliders.svg b/CrowIDE/icons/toolbox/sliders.svg new file mode 100644 index 00000000..7a7b4c8b --- /dev/null +++ b/CrowIDE/icons/toolbox/sliders.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/split-browser-1.svg b/CrowIDE/icons/toolbox/split-browser-1.svg new file mode 100644 index 00000000..019cf269 --- /dev/null +++ b/CrowIDE/icons/toolbox/split-browser-1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/table.svg b/CrowIDE/icons/toolbox/table.svg new file mode 100644 index 00000000..b5466286 --- /dev/null +++ b/CrowIDE/icons/toolbox/table.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/tasks.svg b/CrowIDE/icons/toolbox/tasks.svg new file mode 100644 index 00000000..c8ba6a78 --- /dev/null +++ b/CrowIDE/icons/toolbox/tasks.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/text-file.svg b/CrowIDE/icons/toolbox/text-file.svg new file mode 100644 index 00000000..88fe9798 --- /dev/null +++ b/CrowIDE/icons/toolbox/text-file.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/CrowIDE/icons/toolbox/tools.svg b/CrowIDE/icons/toolbox/tools.svg new file mode 100644 index 00000000..8fa643b0 --- /dev/null +++ b/CrowIDE/icons/toolbox/tools.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CrowIDE/icons/toolbox/trash.svg b/CrowIDE/icons/toolbox/trash.svg new file mode 100644 index 00000000..cf7f7284 --- /dev/null +++ b/CrowIDE/icons/toolbox/trash.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/warning.svg b/CrowIDE/icons/toolbox/warning.svg new file mode 100644 index 00000000..7e0d4c6f --- /dev/null +++ b/CrowIDE/icons/toolbox/warning.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/CrowIDE/icons/toolbox/zoom-in.svg b/CrowIDE/icons/toolbox/zoom-in.svg new file mode 100644 index 00000000..1ec25bb6 --- /dev/null +++ b/CrowIDE/icons/toolbox/zoom-in.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/icons/toolbox/zoom-out.svg b/CrowIDE/icons/toolbox/zoom-out.svg new file mode 100644 index 00000000..414cf9df --- /dev/null +++ b/CrowIDE/icons/toolbox/zoom-out.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index f2b4d9c2..a5e8c249 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -42,6 +42,7 @@ namespace Crow.Coding CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions, CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps, CMDViewErrors, CMDViewSolution, CMDViewEditor, CMDViewProperties, + CMDViewToolbox, CMDCompile; void initCommands () { @@ -66,6 +67,8 @@ namespace Crow.Coding { Caption = "Editor Pane"}; CMDViewProperties = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winProperties.crow"))) { Caption = "Properties"}; + CMDViewToolbox = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow"))) + { Caption = "Toolbox"}; CMDViewGTExp = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.GTreeExplorer.crow"))) { Caption = "Graphic Tree Explorer"}; CMDViewProps = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.MemberView.crow"))) { Caption = "Properties View"}; @@ -134,6 +137,10 @@ namespace Crow.Coding dw = loadDockWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow"); dw.DockingPosition = Alignment.Right; dw.Dock (mainDock.Children [0] as DockStack); + dw = loadDockWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow"); + dw.DockingPosition = Alignment.Left; + dw.Dock (mainDock.Children [0] as DockStack); + } void loadProjProps () { diff --git a/CrowIDE/src/DesignInterface.cs b/CrowIDE/src/DesignInterface.cs index 0ac3e3ba..3c1abf01 100644 --- a/CrowIDE/src/DesignInterface.cs +++ b/CrowIDE/src/DesignInterface.cs @@ -26,6 +26,9 @@ using System; using Crow; using System.Globalization; +using System.Threading; +using System.Collections.Generic; +using System.Diagnostics; namespace Crow.Coding { @@ -156,6 +159,34 @@ namespace Crow.Coding HoverWidget = null; return false; } + + protected override void processLayouting () + { + #if MEASURE_TIME + layoutingMeasure.StartCycle(); + #endif + + if (Monitor.TryEnter (LayoutMutex)) { + DiscardQueue = new Queue (); + LayoutingQueueItem lqi; + while (LayoutingQueue.Count > 0) { + lqi = LayoutingQueue.Dequeue (); + Console.WriteLine (lqi.ToString ()); + #if DEBUG_LAYOUTING + currentLQI = lqi; + curLQIsTries.Add(currentLQI); + #endif + lqi.ProcessLayouting (); + } + LayoutingQueue = DiscardQueue; + Monitor.Exit (LayoutMutex); + DiscardQueue = null; + } + + #if MEASURE_TIME + layoutingMeasure.StopCycle(); + #endif + } } } diff --git a/CrowIDE/src/GraphicObjectDesignContainer.cs b/CrowIDE/src/GraphicObjectDesignContainer.cs new file mode 100644 index 00000000..c8e1a70f --- /dev/null +++ b/CrowIDE/src/GraphicObjectDesignContainer.cs @@ -0,0 +1,83 @@ +// +// GraphicObjectDesignContainer.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2013-2017 Jean-Philippe Bruyère +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using Cairo; + +namespace Crow.Coding +{ + public class GraphicObjectDesignContainer + { + public Type CrowType; + + public string IconPath { + get { return "#Crow.Coding.icons.toolbox." + CrowType.FullName + ".svg"; } + } + public string DisplayName { + get { return CrowType.Name; } + } + + public GraphicObjectDesignContainer (Type crowType) + { + CrowType = crowType; + } + int dis = 32; + void onStartDrag (object sender, EventArgs e) + { + GraphicObject go = sender as GraphicObject; + + lock (go.IFace.UpdateMutex) { + go.IFace.DragImageHeight = dis; + go.IFace.DragImageWidth = dis; + SvgPicture pic = new SvgPicture (); + pic.Load (IconPath); + ImageSurface img = new ImageSurface (Format.Argb32, dis, dis); + using (Context ctx = new Context (img)) { + Rectangle r = new Rectangle (0, 0, dis, dis); + pic.Paint (ctx, r); + ctx.Operator = Operator.In; + ctx.SetSourceRGBA (1.0, 1.0, 1.0, 1.0); + ctx.Rectangle (r); + ctx.Fill (); + + } + go.IFace.DragImage = img; + } + } + void onEndDrag (object sender, DragDropEventArgs e) + { + (sender as GraphicObject).IFace.ClearDragImage (); + + } + void onDrop (object sender, DragDropEventArgs e) + { + ImlVisualEditor imlVE = e.DropTarget as ImlVisualEditor; + if (imlVE != null) + imlVE.ClearDraggedObj (false); + (sender as GraphicObject).IFace.ClearDragImage (); + } + } +} + diff --git a/CrowIDE/src/ImlVisualEditor.cs b/CrowIDE/src/ImlVisualEditor.cs index c9e5484e..88ee2ffe 100644 --- a/CrowIDE/src/ImlVisualEditor.cs +++ b/CrowIDE/src/ImlVisualEditor.cs @@ -194,14 +194,77 @@ namespace Crow.Coding break; } } + bool tryAddDraggedObjTo(GraphicObject g){ + lock (imlVE.UpdateMutex) { + if (g.GetType ().IsSubclassOf (typeof(Container))) { + Container c = g as Container; + c.SetChild (draggedObj); + GraphicTree [0].design_HasChanged = true; + } else if (g.GetType ().IsSubclassOf (typeof(Group))) { + Group c = g as Group; + c.AddChild (draggedObj); + } else + return false; + GraphicTree [0].design_HasChanged = true; + draggedObjContainer = g; + } + return true; + } + bool isPossibleContainer (GraphicObject g){ + if (g.GetType().IsSubclassOf(typeof(Container))){ + Container c = g as Container; + return c.Child == null; + } + return g.GetType ().IsSubclassOf (typeof(Group)); + } + void removeDraggedObjFrom(){ + if (draggedObjContainer == null) + return; + lock (imlVE.UpdateMutex) { + if (draggedObjContainer.GetType().IsSubclassOf(typeof(Container))){ + Container c = draggedObjContainer as Container; + c.SetChild (null); + GraphicTree [0].design_HasChanged = true; + //Console.WriteLine ("remove {0} from {1}", draggedObj, c); + }else if (draggedObjContainer.GetType().IsSubclassOf(typeof(Group))){ + Group c = draggedObjContainer as Group; + c.RemoveChild (draggedObj); + GraphicTree [0].design_HasChanged = true; + //Console.WriteLine ("remove {0} from {1}", draggedObj, c); + }//else + // Console.WriteLine ("Error removing dragged obj"); + } + draggedObjContainer = null; + } + public void ClearDraggedObj (bool removeFromTree = true) { + //Console.WriteLine ("Clear dragged obj {0}, remove from tree = {1}", draggedObj, removeFromTree); + if (removeFromTree) + removeDraggedObjFrom (); + draggedObjContainer = null; + if (draggedObj == null) + return; + if (removeFromTree) + draggedObj.Dispose (); + draggedObj = null; + } public override void onMouseMove (object sender, MouseMoveEventArgs e) { - //base.onMouseMove (sender, e); + base.onMouseMove (sender, e); + GraphicObject oldHW = HoverWidget; Rectangle scr = this.ScreenCoordinates (this.getSlot ()); ProcessMouseMove (e.X - scr.X, e.Y - scr.Y); + if (oldHW == HoverWidget) return; + + if (draggedObj != null) { + if (isPossibleContainer (HoverWidget) && draggedObjContainer != HoverWidget) { + removeDraggedObjFrom (); + tryAddDraggedObjTo (HoverWidget); + } + } + RegisterForRedraw (); } @@ -274,6 +337,30 @@ namespace Crow.Coding gr.SetDash (new double[]{ 5.0, 3.0 },0.0); gr.Rectangle (hr, 1.0); } + + public GraphicObject draggedObj = null; + public GraphicObject draggedObjContainer = null; + + protected override void onDragEnter (object sender, DragDropEventArgs e) + { + base.onDragEnter (sender, e); + GraphicObjectDesignContainer godc = e.DragSource.DataSource as GraphicObjectDesignContainer; + if (godc == null) + return; + Console.WriteLine ("IMLEditor Drag Enter"); + + lock (imlVE.UpdateMutex) { + draggedObj = imlVE.CreateITorFromIMLFragment ("<" + godc.CrowType.Name + "/>").CreateInstance (); + } + } + protected override void onDragLeave (object sender, DragDropEventArgs e) + { + base.onDragLeave (sender, e); + + Console.WriteLine ("IMLEditor Drag Enter"); + + ClearDraggedObj (); + } #endregion void WidgetCheckOver (GraphicObject go, MouseMoveEventArgs e){ diff --git a/CrowIDE/src/MemberView/MembersView.cs b/CrowIDE/src/MemberView/MembersView.cs index 65dc9595..e23a41ba 100644 --- a/CrowIDE/src/MemberView/MembersView.cs +++ b/CrowIDE/src/MemberView/MembersView.cs @@ -112,11 +112,11 @@ namespace Crow.Coding } } - public void updateSource () { - if (projFile == null) - return; - projFile.UpdateSource (this, (Instance as GraphicObject).GetIML ()); - } +// public void updateSource () { +// if (projFile == null) +// return; +// projFile.UpdateSource (this, (Instance as GraphicObject).GetIML ()); +// } // public override void Paint (ref Context ctx) // { diff --git a/CrowIDE/src/Solution.cs b/CrowIDE/src/Solution.cs index bd100dae..fb4bcbfa 100644 --- a/CrowIDE/src/Solution.cs +++ b/CrowIDE/src/Solution.cs @@ -44,6 +44,7 @@ namespace Crow.Coding{ ProjectItem selectedItem = null; object selectedItemElement = null; ObservableList openedItems = new ObservableList(); + ObservableList toolboxItems; public Dictionary Styling; public Dictionary DefaultTemplates; @@ -63,6 +64,17 @@ namespace Crow.Coding{ if (StartupProject != null) StartupProject.GetDefaultTemplates (); } + public void updateToolboxItems () { + Type[] crowItems = AppDomain.CurrentDomain.GetAssemblies () + .SelectMany (t => t.GetTypes ()) + .Where (t => t.IsClass && !t.IsAbstract && t.IsPublic && + t.Namespace == "Crow" && t.IsSubclassOf(typeof(GraphicObject)) && + t.GetCustomAttribute(false) == null).ToArray (); + ToolboxItems = new ObservableList (); + foreach (Type ci in crowItems) { + toolboxItems.AddElement(new GraphicObjectDesignContainer(ci)); + } + } public bool GetProjectFileFromPath (string path, out ProjectFile pi){ pi = null; return StartupProject == null ? false : @@ -78,6 +90,16 @@ namespace Crow.Coding{ NotifyValueChanged ("OpenedItems", openedItems); } } + + public ObservableList ToolboxItems { + get { return toolboxItems; } + set { + if (toolboxItems == value) + return; + toolboxItems = value; + NotifyValueChanged ("ToolboxItems", toolboxItems); + } + } public ProjectItem SelectedItem { get { return selectedItem; } set { @@ -451,6 +473,7 @@ namespace Crow.Coding{ s.UserConfig = new Configuration (s.path + ".user"); s.ReloadStyling (); s.ReloadDefaultTemplates (); + s.updateToolboxItems (); return s; } //LoadSolution #endregion diff --git a/CrowIDE/src/SourceEditor/BufferParser.cs b/CrowIDE/src/SourceEditor/BufferParser.cs index 6bef920d..dfec17a3 100644 --- a/CrowIDE/src/SourceEditor/BufferParser.cs +++ b/CrowIDE/src/SourceEditor/BufferParser.cs @@ -341,6 +341,38 @@ namespace Crow.Coding } #endregion + protected Node addChildNode (Node curNode, CodeLine cl, int tokPtr, string type = "") { + Node n = new Node () { Name = cl.Tokens [tokPtr].Content, StartLine = cl, Type = type }; + curNode.AddChild (n); + if (cl.SyntacticNode == null) + cl.SyntacticNode = n; + SyntacticTreeDepth++; + return n; + } + protected void closeNodeAndGoUp (ref Node n, CodeLine cl, string type = ""){ + while (n != null) { + if (n.Type == type) { + n.EndLine = cl; + n = n.Parent; + SyntacticTreeDepth--; + break; + } + n = n.Parent; + SyntacticTreeDepth--; + } + } + protected void closeNodeAndGoUp (ref Node n, CodeLine cl){ + SyntacticTreeDepth--; + n.EndLine = cl; + n = n.Parent; + } + + protected void initSyntaxAnalysis () { + RootNode = new Node () { Name = "RootNode", Type="Root" }; + SyntacticTreeDepth = SyntacticTreeMaxDepth = 0; + } + + protected void throwParserException(string msg){ throw new ParserException (currentLine, currentColumn, msg); } diff --git a/CrowIDE/src/SourceEditor/CSharpParser.cs b/CrowIDE/src/SourceEditor/CSharpParser.cs index f612dacc..62090bc1 100644 --- a/CrowIDE/src/SourceEditor/CSharpParser.cs +++ b/CrowIDE/src/SourceEditor/CSharpParser.cs @@ -307,49 +307,10 @@ namespace Crow.Coding cl.EndingState = (int)curState; } - Node addChildNode (Node curNode, CodeLine cl, int tokPtr, string type = "") { - Node n = new Node () { Name = cl.Tokens [tokPtr].Content, StartLine = cl, Type = type }; - curNode.AddChild (n); - if (cl.SyntacticNode == null) - cl.SyntacticNode = n; - SyntacticTreeDepth++; - return n; - } - void closeNodeAndGoUp (ref Node n, CodeLine cl, string type = ""){ - while (n != null) { - if (n.Type == type) { - n.EndLine = cl; - n = n.Parent; - SyntacticTreeDepth--; - break; - } - n = n.Parent; - SyntacticTreeDepth--; - } -// if (n.StartLine == cl){//prevent single line node -// n.Parent.Children.Remove (n); -// if (cl.SyntacticNode == n) -// cl.SyntacticNode = null; -// }else - - } - void closeNodeAndGoUp (ref Node n, CodeLine cl){ - // if (n.StartLine == cl){//prevent single line node - // n.Parent.Children.Remove (n); - // if (cl.SyntacticNode == n) - // cl.SyntacticNode = null; - // }else - SyntacticTreeDepth--; - n.EndLine = cl; - n = n.Parent; - } - public override void SyntaxAnalysis () { - RootNode = new Node () { Name = "RootNode", Type="Root" }; - + initSyntaxAnalysis (); Node currentNode = RootNode; - SyntacticTreeDepth = SyntacticTreeMaxDepth = 0; int ptrLine = 0; while (ptrLine < buffer.LineCount) { diff --git a/CrowIDE/src/SourceEditor/CodeBuffer.cs b/CrowIDE/src/SourceEditor/CodeBuffer.cs index 36724797..13c422a6 100644 --- a/CrowIDE/src/SourceEditor/CodeBuffer.cs +++ b/CrowIDE/src/SourceEditor/CodeBuffer.cs @@ -126,6 +126,20 @@ namespace Crow.Coding editMutex.ExitWriteLock (); LineUpadateEvent.Raise (this, new CodeBufferEventArgs (i)); } + public void RemoveLeadingTab (int l) { + if (this [l] [0] == '\t') { + UpdateLine (l, this [l].Content.Substring (1)); + return; + } + int i = 0; + while (i < Interface.TabSize) { + if (this [l] [i] != ' ') + break; + i++; + } + if (i > 0) + UpdateLine (l, this [l].Content.Substring (i)); + } public void ToogleFolding (int line) { if (!this [line].IsFoldable) return; @@ -292,6 +306,15 @@ namespace Crow.Coding selEndPos = CurrentPosition; SelectionChanged.Raise (this, null); } + public void SetSelectionOnFullLines () { + if (!SelectionInProgress) + return; + Point s = new Point (0, SelectionStart.Y); + Point e = new Point (this [SelectionEnd.Y].Length, SelectionEnd.Y); + selStartPos = s; + selEndPos = e; + SelectionChanged.Raise (this, null); + } /// /// Set selection in buffer to -1, empty selection /// diff --git a/CrowIDE/src/SourceEditor/SourceEditor.cs b/CrowIDE/src/SourceEditor/SourceEditor.cs index 760bd2c8..691b6d9d 100644 --- a/CrowIDE/src/SourceEditor/SourceEditor.cs +++ b/CrowIDE/src/SourceEditor/SourceEditor.cs @@ -908,7 +908,22 @@ namespace Crow.Coding #region Mouse handling - void updateCurrentPosFromMouseLocalPos(){ + int hoverLine = -1; + public int HoverLine { + get { return hoverLine; } + set { + if (hoverLine == value) + return; + hoverLine = value; + NotifyValueChanged ("HoverLine", hoverLine); + } + } + void updateHoverLine () { + int hvl = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent))); + hvl = Math.Min (PrintedLines.Count, hvl); + HoverLine = buffer.IndexOf (PrintedLines[hvl]); + } + void updateCurrentPosFromMouseLocalPos(){ PrintedCurrentLine = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / (fe.Ascent+fe.Descent))); int curVisualCol = ScrollX + (int)Math.Round ((mouseLocalPos.X - leftMargin) / fe.MaxXAdvance); @@ -922,9 +937,6 @@ namespace Crow.Coding buffCol++; } buffer.CurrentColumn = buffCol; - -// if (mouseLocalPos.Y < 0) -// ScrollY--; } public override void onMouseEnter (object sender, MouseMoveEventArgs e) { @@ -945,6 +957,8 @@ namespace Crow.Coding mouseLocalPos = e.Position - ScreenCoordinates(Slot).TopLeft - ClientRectangle.TopLeft; + updateHoverLine (); + if (!e.Mouse.IsButtonDown (MouseButton.Left)) { if (mouseLocalPos.X < leftMargin) IFace.MouseCursor = XCursor.Default; @@ -1157,7 +1171,26 @@ namespace Crow.Coding case Key.RWin: break; case Key.Tab: - buffer.Insert ("\t"); + if (e.Shift) { + if (buffer.SelectionIsEmpty || + (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) { + //TODO + break; + } + for (int i = buffer.SelectionStart.Y; i <= buffer.SelectionEnd.Y; i++) + buffer.RemoveLeadingTab (i); + buffer.SetSelectionOnFullLines (); + } else { + if (buffer.SelectionIsEmpty || + (buffer.SelectionStart.Y == buffer.SelectionEnd.Y)) { + buffer.Insert ("\t"); + break; + } + for (int i = buffer.SelectionStart.Y; i <= buffer.SelectionEnd.Y; i++) { + buffer.UpdateLine (i, "\t" + buffer [i].Content); + } + } + break; case Key.F8: toogleFolding (buffer.CurrentLine); diff --git a/CrowIDE/src/SourceEditor/StyleParser.cs b/CrowIDE/src/SourceEditor/StyleParser.cs index 2aba6848..9a1e74cd 100644 --- a/CrowIDE/src/SourceEditor/StyleParser.cs +++ b/CrowIDE/src/SourceEditor/StyleParser.cs @@ -77,7 +77,7 @@ namespace Crow.Coding } break; case ',': - if (curState != States.init || curState != States.classNames ) + if (curState != States.init && curState != States.classNames ) throw new ParserException (currentLine, currentColumn, "Unexpected char ','"); readAndResetCurrentTok (TokenType.OperatorOrPunctuation, true); curState = States.classNames; @@ -151,8 +151,7 @@ namespace Crow.Coding } public override void SyntaxAnalysis () { - RootNode = new Node () { Name = "RootNode", Type="Root" }; - + initSyntaxAnalysis (); Node currentNode = RootNode; for (int i = 0; i < buffer.LineCount; i++) { @@ -165,15 +164,10 @@ namespace Crow.Coding while (tokPtr < cl.Tokens.Count) { switch (cl.Tokens [tokPtr].Type) { case TokenType.OpenBlock: - Node newElt = new Node () { Name = cl.Tokens [tokPtr].Content, StartLine = cl }; - currentNode.AddChild (newElt); - currentNode = newElt; - if (cl.SyntacticNode == null) - cl.SyntacticNode = newElt; + currentNode = addChildNode (currentNode, cl, tokPtr, "style"); break; case TokenType.CloseBlock: - currentNode.EndLine = cl; - currentNode = currentNode.Parent; + closeNodeAndGoUp (ref currentNode, cl, "style"); break; } tokPtr++; diff --git a/CrowIDE/src/SourceEditor/XMLParser.cs b/CrowIDE/src/SourceEditor/XMLParser.cs index ad7aaa62..d31e1023 100644 --- a/CrowIDE/src/SourceEditor/XMLParser.cs +++ b/CrowIDE/src/SourceEditor/XMLParser.cs @@ -255,12 +255,11 @@ namespace Crow.Coding cl.EndingState = (int)curState; } + public override void SyntaxAnalysis () { - RootNode = new Node () { Name = "RootNode", Type="Root" }; - + initSyntaxAnalysis (); Node currentNode = RootNode; - SyntacticTreeDepth = SyntacticTreeMaxDepth = 0; for (int i = 0; i < buffer.LineCount; i++) { CodeLine cl = buffer[i]; @@ -273,23 +272,16 @@ namespace Crow.Coding switch ((XMLParser.TokenType)cl.Tokens [tokPtr].Type) { case TokenType.ElementStart: tokPtr++; - Node newElt = new Node () { Name = cl.Tokens [tokPtr].Content, StartLine = cl }; - currentNode.AddChild (newElt); - currentNode = newElt; - if (cl.SyntacticNode == null) - cl.SyntacticNode = newElt; - SyntacticTreeDepth++; + currentNode = addChildNode (currentNode, cl, tokPtr, "Element"); break; case TokenType.ElementEnd: tokPtr++; if (tokPtr < cl.Tokens.Count) { if ((XMLParser.TokenType)cl.Tokens [tokPtr].Type == TokenType.ElementName && - cl.Tokens [tokPtr].Content != currentNode.Name) + cl.Tokens [tokPtr].Content != currentNode.Name) throw new ParserException (currentLine, currentColumn, "Closing tag mismatch"); } - currentNode.EndLine = cl; - currentNode = currentNode.Parent; - SyntacticTreeDepth--; + closeNodeAndGoUp (ref currentNode, cl, "Element"); break; case TokenType.ElementClosing: //currentNode = currentNode.Parent; diff --git a/CrowIDE/ui/CrowIDE.crow b/CrowIDE/ui/CrowIDE.crow index 22f98ebc..6d056536 100644 --- a/CrowIDE/ui/CrowIDE.crow +++ b/CrowIDE/ui/CrowIDE.crow @@ -21,6 +21,7 @@ + @@ -35,6 +36,7 @@ +