From: Jean-Philippe Bruyère Date: Mon, 5 Mar 2018 07:46:03 +0000 (+0100) Subject: first test with docker in CrowIDE X-Git-Tag: 0.7.3~4^2~27 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=363b9425f0a222d728dd063f5317d97f72c9a4db;p=jp%2Fcrow.git first test with docker in CrowIDE --- diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 0a8150e4..ba425c6e 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -126,6 +126,7 @@ + @@ -172,6 +173,9 @@ + + + diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 6f6e376b..9d2c3814 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -41,7 +41,7 @@ namespace Crow.Coding public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit, CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions, - CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps, + CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps, CMDViewErrors, CMDViewSolution, CMDCompile; void initCommands () { @@ -58,6 +58,11 @@ namespace Crow.Coding CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#Crow.Coding.ui.icons.question.svg")}; CMDOptions = new Command(new Action(() => openOptionsDialog())) { Caption = "Editor Options", Icon = new SvgPicture("#Crow.Coding.ui.icons.tools.svg")}; + CMDViewErrors = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winErrors.crow"))) + { Caption = "Errors pane"}; + CMDViewSolution = new Command(new Action(() => loadDockWindow ("#Crow.Coding.ui.DockWindows.winSolution.crow"))) + { Caption = "Solution Tree"}; + 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"}; CMDCompile = new Command(new Action(() => compileSolution())) { Caption = "Compile"}; @@ -89,6 +94,7 @@ namespace Crow.Coding Instantiator instFileDlg; Solution currentSolution; + Docker mainDock; public static Interface MainIFace; @@ -107,13 +113,14 @@ namespace Crow.Coding MainIFace = ifaceControl[0].CrowInterface; + mainDock = go.FindByName ("mainDock") as Docker; + if (ReopenLastSolution && !string.IsNullOrEmpty (LastOpenSolution)) { CurrentSolution = Solution.LoadSolution (LastOpenSolution); //lock(MainIFace.UpdateMutex) CurrentSolution.ReopenItemsSavedInUserConfig (); } - instFileDlg = Instantiator.CreateFromImlFragment (MainIFace, ""); } @@ -200,6 +207,21 @@ namespace Crow.Coding // loadWindow ("#Crow.Coding.ui.CSProjExplorer.crow"); // } } + void loadDockWindow(string path){ + lock (MainIFace.UpdateMutex) { + try { + GraphicObject g = MainIFace.FindByName (path); + if (g != null) + return; + g = MainIFace.Load (path); + mainDock.AddChild (g); + g.Name = path; + g.DataSource = CurrentSolution; + } catch (Exception ex) { + System.Diagnostics.Debug.WriteLine (ex.ToString ()); + } + } + } void loadWindow(string path, object dataSource = null){ try { GraphicObject g = MainIFace.FindByName (path); diff --git a/CrowIDE/src/Solution.cs b/CrowIDE/src/Solution.cs index b1ccedca..bd100dae 100644 --- a/CrowIDE/src/Solution.cs +++ b/CrowIDE/src/Solution.cs @@ -187,7 +187,7 @@ namespace Crow.Coding{ saveOpenedItemsInUserConfig (); } public void CloseItem (ProjectItem pi) { - Console.WriteLine ("CloseItem"); + Console.WriteLine ("CloseItem: " + pi.ToString()); openedItems.RemoveElement (pi); saveOpenedItemsInUserConfig (); } diff --git a/CrowIDE/ui/CrowIDE.crow b/CrowIDE/ui/CrowIDE.crow index 395503f5..e7d19afc 100644 --- a/CrowIDE/ui/CrowIDE.crow +++ b/CrowIDE/ui/CrowIDE.crow @@ -18,6 +18,8 @@ + + @@ -31,36 +33,19 @@ - - - + + diff --git a/CrowIDE/ui/DockWindows/winEditor.crow b/CrowIDE/ui/DockWindows/winEditor.crow new file mode 100644 index 00000000..f87d34f2 --- /dev/null +++ b/CrowIDE/ui/DockWindows/winEditor.crow @@ -0,0 +1,5 @@ + + + + diff --git a/CrowIDE/ui/DockWindows/winErrors.crow b/CrowIDE/ui/DockWindows/winErrors.crow new file mode 100644 index 00000000..ff7bafdb --- /dev/null +++ b/CrowIDE/ui/DockWindows/winErrors.crow @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/CrowIDE/ui/DockWindows/winSolution.crow b/CrowIDE/ui/DockWindows/winSolution.crow new file mode 100644 index 00000000..c9de649b --- /dev/null +++ b/CrowIDE/ui/DockWindows/winSolution.crow @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/Default.style b/Default.style index d4e7e4a7..3911bafa 100644 --- a/Default.style +++ b/Default.style @@ -73,7 +73,7 @@ Slider { } Splitter { Focusable = "true"; - Margin = "2"; + Margin = "1"; Background = "Gray"; } Spinner { @@ -111,11 +111,11 @@ ToolWindow { } Docker { AllowDrop = "false"; - Margin="1"; + Margin="0"; Focusable="true"; } DockStack { - Margin="3"; + Margin="1"; AllowDrop = "true"; Focusable="true"; //DragEnter="{Background=Blue}"; @@ -125,6 +125,7 @@ DockStack { DockWindow { Focusable = "true"; AllowDrag = "true"; + Margin="0"; } FileDialog { Template = "#Crow.FileDialog.template"; diff --git a/Templates/DockWindow.template b/Templates/DockWindow.template index 62facf06..3e5b499a 100755 --- a/Templates/DockWindow.template +++ b/Templates/DockWindow.template @@ -6,17 +6,17 @@ MouseLeave="./onBorderMouseLeave"> + Name="hs" Margin="0" Spacing="0" Height="Fit"> - + - + diff --git a/src/GraphicObjects/DockStack.cs b/src/GraphicObjects/DockStack.cs index 79643b47..c06be42a 100644 --- a/src/GraphicObjects/DockStack.cs +++ b/src/GraphicObjects/DockStack.cs @@ -29,10 +29,8 @@ using Crow.IML; namespace Crow { public class DockStack : GenericStack - { - internal static Instantiator instStack, instSplit;//, instSpacer; - - int dockingDiv = 5; + { + int dockingDiv = 6; GraphicObject subStack = null; Docker rootDock { get { return LogicalParent as Docker; }} @@ -47,14 +45,6 @@ namespace Crow public DockStack (Interface iface) : base (iface) {} #endregion - protected override void onInitialized (object sender, EventArgs e) - { - base.onInitialized (sender, e); - instStack = IFace.CreateITorFromIMLFragment (@""); - instSplit = IFace.CreateITorFromIMLFragment (@""); - //instSpacer = IFace.CreateITorFromIMLFragment (@""); - } - public override void AddChild (GraphicObject g) { base.AddChild (g); @@ -236,8 +226,7 @@ namespace Crow dsp.SubStack = SubStack; return; } - public void Dock(DockWindow dw){ - Splitter splitter = instSplit.CreateInstance (); + public void Dock(DockWindow dw){ Rectangle r = ClientRectangle; int vTreshold = r.Height / dockingDiv; @@ -249,7 +238,7 @@ namespace Crow activeStack = this; Orientation = dw.DockingPosition.GetOrientation (); }else if (dw.DockingPosition.GetOrientation() != Orientation) { - activeStack = instStack.CreateInstance (); + activeStack = new DockStack (IFace); int ci = Children.IndexOf (rootDock.CenterDockedObj); if (ci <0 ){ DockStack dsp = Parent as DockStack; @@ -284,24 +273,24 @@ namespace Crow dw.Height = vTreshold; dw.Width = Measure.Stretched; activeStack.InsertChild (0, dw); - activeStack.InsertChild (1, splitter); + activeStack.InsertChild (1, new Splitter(IFace)); break; case Alignment.Bottom: dw.Height = vTreshold; dw.Width = Measure.Stretched; - activeStack.AddChild (splitter); + activeStack.AddChild (new Splitter(IFace)); activeStack.AddChild (dw); break; case Alignment.Left: dw.Width = hTreshold; dw.Height = Measure.Stretched; activeStack.InsertChild (0, dw); - activeStack.InsertChild (1, splitter); + activeStack.InsertChild (1, new Splitter(IFace)); break; case Alignment.Right: dw.Width = hTreshold; dw.Height = Measure.Stretched; - activeStack.AddChild (splitter); + activeStack.AddChild (new Splitter(IFace)); activeStack.AddChild (dw); break; case Alignment.Center: diff --git a/src/GraphicObjects/Docker.cs b/src/GraphicObjects/Docker.cs index 3803d8dd..6c55e34e 100644 --- a/src/GraphicObjects/Docker.cs +++ b/src/GraphicObjects/Docker.cs @@ -71,9 +71,9 @@ namespace Crow } public override void RemoveChild (GraphicObject child) { - lock (IFace.UpdateMutex) { - RegisterClip (ScreenCoordinates (LastPaintedSlot)); - } +// lock (IFace.UpdateMutex) { +// RegisterClip (ScreenCoordinates (LastPaintedSlot)); +// } base.RemoveChild (child); } diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs index e8aa60f8..59a70d25 100644 --- a/src/GraphicObjects/Splitter.cs +++ b/src/GraphicObjects/Splitter.cs @@ -43,7 +43,7 @@ namespace Crow int thickness; - [XmlAttributeAttribute][DefaultValue(1)] + [XmlAttributeAttribute][DefaultValue(3)] public virtual int Thickness { get { return thickness; } set {