From b40c72b9ed74a41e75d84d3dd856cb0b728afa39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 16 Mar 2018 05:57:48 +0100 Subject: [PATCH] wip --- Crow.csproj | 2 +- CrowIDE/src/CrowIDE.cs | 10 +- CrowIDE/src/Editors/CodeBuffer/TextEditor.cs | 4 +- CrowIDE/src/Editors/SourceEditor.cs | 2 +- CrowIDE/src/Editors/SvgEditor.cs | 2 +- CrowIDE/src/ProjectTree/ProjectFile.cs | 6 +- CrowIDE/ui/MenuItem.template | 2 +- Templates/Expandable.template | 4 +- Tests/BasicTests.cs | 27 +++- Tests/GraphicObjects/TechBorder.cs | 2 +- Tests/Interfaces/Divers/welcome.crow | 7 +- .../TemplatedContainer/testTreeView1.crow | 35 +++++ .../TemplatedContainer/testTreeView2.crow | 45 ++++++ Tests/Tests.csproj | 6 + Tests/test.style | 15 ++ src/BmpPicture.cs | 11 +- src/GraphicObjects/Border.cs | 23 +-- src/GraphicObjects/DockStack.cs | 10 +- src/GraphicObjects/Expandable.cs | 8 + src/GraphicObjects/GenericStack.cs | 49 ++++-- src/GraphicObjects/GraphicObject.cs | 101 ++++++++----- src/GraphicObjects/Group.cs | 143 ++++++++++-------- src/GraphicObjects/Image.cs | 8 +- src/GraphicObjects/Label.cs | 2 +- src/GraphicObjects/PrivateContainer.cs | 21 +-- src/GraphicObjects/Scroller.cs | 22 +-- src/GraphicObjects/Shape.cs | 2 +- src/GraphicObjects/TemplatedControl.cs | 24 ++- src/GraphicObjects/TextRun.cs | 2 +- src/GraphicObjects/Wrapper.cs | 7 +- src/Interface.cs | 4 +- src/LayoutingQueueItem.cs | 1 + src/Picture.cs | 2 + src/SvgPicture.cs | 21 +-- 34 files changed, 438 insertions(+), 192 deletions(-) create mode 100755 Tests/Interfaces/TemplatedContainer/testTreeView1.crow create mode 100755 Tests/Interfaces/TemplatedContainer/testTreeView2.crow diff --git a/Crow.csproj b/Crow.csproj index 1b5b3406..466e5b0a 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -32,7 +32,7 @@ true false $(SolutionDir)build\Debug - DESIGN_MODE;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 + DESIGN_MODE;DEBUG_LAYOUTING;DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_DISPOSE0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 true diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 46a926e3..0332592d 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -47,9 +47,9 @@ namespace Crow.Coding void initCommands () { CMDNew = new Command(new Action(() => newFile())) { Caption = "New", Icon = new SvgPicture("#Crow.Coding.ui.icons.blank-file.svg"), CanExecute = true}; - CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#Crow.Coding.ui.icons.outbox.svg")}; - CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false}; - CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false}; + CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#Crow.Coding.icons.open.svg")}; + CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#Crow.Coding.icons.save.svg"), CanExecute = false}; + CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#Crow.Coding.icons.save.svg"), CanExecute = false}; CMDQuit = new Command(new Action(() => Quit (null, null))) { Caption = "Quit", Icon = new SvgPicture("#Crow.Coding.ui.icons.sign-out.svg")}; CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#Crow.Coding.icons.undo.svg"), CanExecute = false}; CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#Crow.Coding.icons.redo.svg"), CanExecute = false}; @@ -60,7 +60,7 @@ namespace Crow.Coding CMDOptions = new Command(new Action(() => loadWindow("#Crow.Coding.ui.Options.crow"))) { Caption = "Editor Options", Icon = new SvgPicture("#Crow.Coding.icons.tools.svg")}; cmdCloseSolution = new Command(new Action(() => closeSolution())) - { Caption = "Close Solution", Icon = new SvgPicture("#Crow.Coding.ui.icons.paste-on-document.svg"), CanExecute = false}; + { Caption = "Close Solution", Icon = new SvgPicture("#Crow.Coding.icons.paste-on-document.svg"), CanExecute = false}; CMDViewErrors = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winErrors.crow",this))) { Caption = "Errors pane"}; @@ -73,7 +73,7 @@ namespace Crow.Coding CMDViewDesign = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winDesign.crow",this))) { Caption = "Quick Design", CanExecute = true}; CMDViewToolbox = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winToolbox.crow",this))) - { Caption = "Toolbox", CanExecute = false}; + { Caption = "Toolbox", CanExecute = true}; CMDViewSchema = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winSchema.crow",this))) { Caption = "IML Shematic View", CanExecute = true}; CMDViewStyling = new Command(new Action(() => loadWindow ("#Crow.Coding.ui.DockWindows.winStyleView.crow",this))) diff --git a/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs b/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs index 6b7234dc..81abe482 100644 --- a/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs +++ b/CrowIDE/src/Editors/CodeBuffer/TextEditor.cs @@ -230,7 +230,7 @@ namespace Crow.Text } } } - [DefaultValue("BlueGray")] + [DefaultValue("SlateGray")] public virtual Color SelectionBackground { get { return selBackground; } set { @@ -363,7 +363,7 @@ namespace Crow.Text RegisterForGraphicUpdate (); } } - protected override int measureRawSize(LayoutingType lt) + public override int measureRawSize(LayoutingType lt) { if (lt == LayoutingType.Height) return (int)Math.Ceiling((fe.Ascent+fe.Descent) * buffer.LineCount) + Margin * 2; diff --git a/CrowIDE/src/Editors/SourceEditor.cs b/CrowIDE/src/Editors/SourceEditor.cs index 724def34..7e949451 100644 --- a/CrowIDE/src/Editors/SourceEditor.cs +++ b/CrowIDE/src/Editors/SourceEditor.cs @@ -809,7 +809,7 @@ namespace Crow.Coding RegisterForGraphicUpdate (); } } - protected override int measureRawSize(LayoutingType lt) + public override int measureRawSize(LayoutingType lt) { if (lt == LayoutingType.Height) return (int)Math.Ceiling((fe.Ascent+fe.Descent) * buffer.LineCount) + Margin * 2; diff --git a/CrowIDE/src/Editors/SvgEditor.cs b/CrowIDE/src/Editors/SvgEditor.cs index fce3d1aa..8166e66e 100644 --- a/CrowIDE/src/Editors/SvgEditor.cs +++ b/CrowIDE/src/Editors/SvgEditor.cs @@ -91,7 +91,7 @@ namespace Crow.Coding #endregion #region GraphicObject overrides - protected override int measureRawSize(LayoutingType lt) + public override int measureRawSize(LayoutingType lt) { if (_pic == null) return 2 * Margin; diff --git a/CrowIDE/src/ProjectTree/ProjectFile.cs b/CrowIDE/src/ProjectTree/ProjectFile.cs index 2fac2f91..c26cb7cf 100644 --- a/CrowIDE/src/ProjectTree/ProjectFile.cs +++ b/CrowIDE/src/ProjectTree/ProjectFile.cs @@ -51,11 +51,11 @@ namespace Crow.Coding void initCommands (){ cmdSave = new Crow.Command (new Action (() => Save ())) - { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false }; + { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.icons.save.svg"), CanExecute = false }; cmdSaveAs = new Crow.Command (new Action (() => SaveAs ())) - { Caption = "Save As ..", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false }; + { Caption = "Save As ..", Icon = new SvgPicture ("#Crow.Coding.icons.save.svg"), CanExecute = false }; cmdOpen = new Crow.Command (new Action (() => Open ())) - { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.ui.icons.outbox.svg"), CanExecute = false }; + { Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.icons.open.svg"), CanExecute = false }; cmdUndo = new Crow.Command (new Action (() => Undo (null))) { Caption = "Undo", Icon = new SvgPicture ("#Crow.Coding.icons.undo.svg"), CanExecute = false }; cmdRedo = new Crow.Command (new Action (() => Redo (null))) diff --git a/CrowIDE/ui/MenuItem.template b/CrowIDE/ui/MenuItem.template index 97ee0272..dd7de7a9 100644 --- a/CrowIDE/ui/MenuItem.template +++ b/CrowIDE/ui/MenuItem.template @@ -14,7 +14,7 @@ Foreground="Transparent" Background="{./Background}"> - +