From: jpbruyere Date: Mon, 22 Aug 2016 19:57:39 +0000 (+0200) Subject: Move Debug LQIs lists to CurrentInterface X-Git-Tag: v0.5.1~28^2~34 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d84f96e04a8e0d16077b627a2ec004d55eeb5f19;p=jp%2Fcrow.git Move Debug LQIs lists to CurrentInterface LQIs visualizer ItemTemplate expandable may use 'self' keywork modifié : CrowIDE/CrowIDE.csproj modifié : CrowIDE/src/CrowIDE.cs nouveau fichier : CrowIDE/src/Extensions.cs modifié : CrowIDE/src/ImlVisualEditor.cs nouveau fichier : CrowIDE/ui/LQIsExplorer.crow nouveau fichier : CrowIDE/ui/bindingExpITemp.crow nouveau fichier : CrowIDE/ui/bindingExplorer.crow modifié : Templates/DirectoryView.template modifié : Templates/Window.template modifié : src/GraphicObjects/GraphicObject.cs modifié : src/GraphicObjects/Wrapper.cs modifié : src/Interface.cs modifié : src/ItemTemplate.cs modifié : src/LayoutingQueueItem.cs --- diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index e04c95e4..8c8f4bf9 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -76,6 +76,7 @@ + @@ -89,6 +90,9 @@ CrowIDE.MembersView.template + + + diff --git a/CrowIDE/src/CrowIDE.cs b/CrowIDE/src/CrowIDE.cs index 72ad48ad..b137ad8d 100644 --- a/CrowIDE/src/CrowIDE.cs +++ b/CrowIDE/src/CrowIDE.cs @@ -23,6 +23,9 @@ using System; using OpenTK; using OpenTK.Graphics.OpenGL; using Crow; +using System.Reflection; +using System.Collections.Generic; +using System.Collections; namespace CrowIDE { @@ -39,16 +42,43 @@ namespace CrowIDE : base(1024, 800,"UIEditor") { } + ImlVisualEditor imlVE; + GraphicObject bindingExp, lqisExp; protected override void OnLoad (EventArgs e) { base.OnLoad (e); + this.KeyDown += CrowIDE_KeyDown; + //this.CrowInterface.LoadInterface ("#CrowIDE.ui.imlEditor.crow").DataSource = this; //GraphicObject go = this.CrowInterface.LoadInterface (@"ui/test.crow"); GraphicObject go = this.CrowInterface.LoadInterface (@"#CrowIDE.ui.imlEditor.crow"); + imlVE = go.FindByName ("crowContainer") as ImlVisualEditor; go.DataSource = this; } + + void CrowIDE_KeyDown (object sender, OpenTK.Input.KeyboardKeyEventArgs e) + { + if (e.Key == OpenTK.Input.Key.Escape) { + Quit (null, null); + return; + } else if (e.Key == OpenTK.Input.Key.F5) { + if (bindingExp != null) { + CrowInterface.DeleteWidget (bindingExp); + } + bindingExp = CrowInterface.LoadInterface ("#CrowIDE.ui.bindingExplorer.crow"); + bindingExp.DataSource = imlVE; + return; + } else if (e.Key == OpenTK.Input.Key.F6) { + if (lqisExp != null) { + CrowInterface.DeleteWidget (lqisExp); + } + lqisExp = CrowInterface.LoadInterface ("#CrowIDE.ui.LQIsExplorer.crow"); + lqisExp.DataSource = imlVE; + return; + } + } protected void onCommandSave(object sender, MouseButtonEventArgs e){ System.Diagnostics.Debug.WriteLine("save"); } diff --git a/CrowIDE/src/Extensions.cs b/CrowIDE/src/Extensions.cs new file mode 100644 index 00000000..e2897e3e --- /dev/null +++ b/CrowIDE/src/Extensions.cs @@ -0,0 +1,36 @@ +// +// Extensions.cs +// +// Author: +// Jean-Philippe Bruyère +// +// Copyright (c) 2016 jp +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +using System.Collections.Generic; + +namespace Crow +{ + public static class Extensions + { + public static List GetChildren(this GraphicObject go){ + if (go is Group) + return (go as Group).Children; + if (go is Container) + return new List( new GraphicObject[] { (go as Container).Child }); + return new List(); + } + } +} diff --git a/CrowIDE/src/ImlVisualEditor.cs b/CrowIDE/src/ImlVisualEditor.cs index d612ea39..0307cd45 100644 --- a/CrowIDE/src/ImlVisualEditor.cs +++ b/CrowIDE/src/ImlVisualEditor.cs @@ -24,6 +24,7 @@ using System.Threading; using System.Xml.Serialization; using System.ComponentModel; using System.IO; +using System.Collections.Generic; namespace CrowIDE { @@ -47,6 +48,9 @@ namespace CrowIDE bool drawGrid; int gridSpacing; + [XmlIgnore]public List LQIs { + get { return imlVE.LQIs; } + } [XmlIgnore]public string ImlSource { get { return imlSource; } set { diff --git a/CrowIDE/ui/LQIsExplorer.crow b/CrowIDE/ui/LQIsExplorer.crow new file mode 100644 index 00000000..94549244 --- /dev/null +++ b/CrowIDE/ui/LQIsExplorer.crow @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrowIDE/ui/bindingExpITemp.crow b/CrowIDE/ui/bindingExpITemp.crow new file mode 100644 index 00000000..0797371e --- /dev/null +++ b/CrowIDE/ui/bindingExpITemp.crow @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/CrowIDE/ui/bindingExplorer.crow b/CrowIDE/ui/bindingExplorer.crow new file mode 100644 index 00000000..13d90be8 --- /dev/null +++ b/CrowIDE/ui/bindingExplorer.crow @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/Templates/DirectoryView.template b/Templates/DirectoryView.template index 13f10f11..44ee0600 100755 --- a/Templates/DirectoryView.template +++ b/Templates/DirectoryView.template @@ -10,7 +10,7 @@ MouseLeave="{Background=Transparent}"/> - +