From d84f96e04a8e0d16077b627a2ec004d55eeb5f19 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Mon, 22 Aug 2016 21:57:39 +0200 Subject: [PATCH] =?utf8?q?Move=20Debug=20LQIs=20lists=20to=20CurrentInterf?= =?utf8?q?ace=20LQIs=20visualizer=20ItemTemplate=20expandable=20may=20use?= =?utf8?q?=20'self'=20keywork=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20?= =?utf8?q?=20=20=20CrowIDE/CrowIDE.csproj=20=09modifi=C3=A9=C2=A0:=20=20?= =?utf8?q?=20=20=20=20=20=20=20CrowIDE/src/CrowIDE.cs=20=09nouveau=20fichi?= =?utf8?q?er=C2=A0:=20CrowIDE/src/Extensions.cs=20=09modifi=C3=A9=C2=A0:?= =?utf8?q?=20=20=20=20=20=20=20=20=20CrowIDE/src/ImlVisualEditor.cs=20=09n?= =?utf8?q?ouveau=20fichier=C2=A0:=20CrowIDE/ui/LQIsExplorer.crow=20=09nouv?= =?utf8?q?eau=20fichier=C2=A0:=20CrowIDE/ui/bindingExpITemp.crow=20=09nouv?= =?utf8?q?eau=20fichier=C2=A0:=20CrowIDE/ui/bindingExplorer.crow=20=09modi?= =?utf8?q?fi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20Templates/DirectoryVie?= =?utf8?q?w.template=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20Te?= =?utf8?q?mplates/Window.template=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20?= =?utf8?q?=20=20=20=20src/GraphicObjects/GraphicObject.cs=20=09modifi?= =?utf8?q?=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20src/GraphicObjects/Wrapp?= =?utf8?q?er.cs=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20src/Int?= =?utf8?q?erface.cs=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20src?= =?utf8?q?/ItemTemplate.cs=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20?= =?utf8?q?=20=20src/LayoutingQueueItem.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CrowIDE/CrowIDE.csproj | 4 ++ CrowIDE/src/CrowIDE.cs | 30 +++++++++++++ CrowIDE/src/Extensions.cs | 36 ++++++++++++++++ CrowIDE/src/ImlVisualEditor.cs | 4 ++ CrowIDE/ui/LQIsExplorer.crow | 65 +++++++++++++++++++++++++++++ CrowIDE/ui/bindingExpITemp.crow | 23 ++++++++++ CrowIDE/ui/bindingExplorer.crow | 14 +++++++ Templates/DirectoryView.template | 2 +- Templates/Window.template | 4 +- src/GraphicObjects/GraphicObject.cs | 14 +------ src/GraphicObjects/Wrapper.cs | 4 +- src/Interface.cs | 33 ++++++++++++++- src/ItemTemplate.cs | 15 +++++-- src/LayoutingQueueItem.cs | 43 ++++++++++++------- 14 files changed, 254 insertions(+), 37 deletions(-) create mode 100644 CrowIDE/src/Extensions.cs create mode 100644 CrowIDE/ui/LQIsExplorer.crow create mode 100644 CrowIDE/ui/bindingExpITemp.crow create mode 100644 CrowIDE/ui/bindingExplorer.crow 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}"/> - +