]> O.S.I.I.S - jp/crow.git/commitdiff
Move Debug LQIs lists to CurrentInterface
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 22 Aug 2016 19:57:39 +0000 (21:57 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 1 Sep 2016 11:24:17 +0000 (13:24 +0200)
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

14 files changed:
CrowIDE/CrowIDE.csproj
CrowIDE/src/CrowIDE.cs
CrowIDE/src/Extensions.cs [new file with mode: 0644]
CrowIDE/src/ImlVisualEditor.cs
CrowIDE/ui/LQIsExplorer.crow [new file with mode: 0644]
CrowIDE/ui/bindingExpITemp.crow [new file with mode: 0644]
CrowIDE/ui/bindingExplorer.crow [new file with mode: 0644]
Templates/DirectoryView.template
Templates/Window.template
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Wrapper.cs
src/Interface.cs
src/ItemTemplate.cs
src/LayoutingQueueItem.cs

index e04c95e463b3d700fb307b82533f78e4bc968376..8c8f4bf98774933f2142d8bca1279c2ce930bdfa 100644 (file)
@@ -76,6 +76,7 @@
     <Compile Include="src\CrowIDE.cs" />
     <Compile Include="src\ImlVisualEditor.cs" />
     <Compile Include="src\MembersView.cs" />
+    <Compile Include="src\Extensions.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="ui\" />
@@ -89,6 +90,9 @@
     <EmbeddedResource Include="ui\MembersView.template">
       <LogicalName>CrowIDE.MembersView.template</LogicalName>
     </EmbeddedResource>
+    <EmbeddedResource Include="ui\bindingExplorer.crow" />
+    <EmbeddedResource Include="ui\bindingExpITemp.crow" />
+    <EmbeddedResource Include="ui\LQIsExplorer.crow" />
   </ItemGroup>
   <ItemGroup>
     <None Include="ui\test.crow">
index 72ad48ad67b1d126411d767c110a588ea31290fe..b137ad8d084260df21ee093e977b1407ad23d77e 100644 (file)
@@ -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 (file)
index 0000000..e2897e3
--- /dev/null
@@ -0,0 +1,36 @@
+//
+//  Extensions.cs
+//
+//  Author:
+//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+//  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 <http://www.gnu.org/licenses/>.
+using System;
+using System.Collections.Generic;
+
+namespace Crow
+{
+       public static class Extensions
+       {
+               public static List<GraphicObject> GetChildren(this GraphicObject go){
+                       if (go is Group)
+                               return (go as Group).Children;
+                       if (go is Container)
+                               return new List<GraphicObject>( new GraphicObject[] { (go as Container).Child });
+                       return new List<GraphicObject>();
+               }
+       }
+}
index d612ea39f44b16bccf738c76fd2589a061f57727..0307cd45d7b14469ce9fdf502ec330beb8001fcb 100644 (file)
@@ -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<LQIList> 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 (file)
index 0000000..9454924
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<Window Width="50%" Height="50%" Background="DimGray">
+       <TreeView IsRoot="true" Name="treeView" Data="{LQIs}">
+               <ItemTemplate DataType="Crow.LayoutingQueueItem" Data="triggeredLQIs">
+                       <Expandable>
+                               <Template>
+                                       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+                                               <VerticalStack Fit="true" Margin="3" Background="Onyx"
+                                                               HorizontalAlignment="Left"
+                                                               MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
+                                                               MouseLeave="{Background=Onyx}">
+                                                       <Label Text="{FullName}" Font="droid, 8" Background="LightGray" Foreground="Black"/>
+                                                       <HorizontalStack Fit="true" Spacing="10">
+                                                               <Label Text="{LayoutingTries}" Foreground="SkyBlue"/>
+                                                               <Label Text="{DiscardCount}" Foreground="Red"/>
+                                                               <Label Text="{Name}" Font="droid bold"/>
+                                                               <Label Text="{LayoutType}" Foreground="Maize"/>
+                                                               <Label Text="{Width}"/>
+                                                               <Label Text="{Height}"/>
+                                                       </HorizontalStack>
+
+                                                       <HorizontalStack Fit="true">
+                                                               <Label Text="{Slot}"/>
+                                                               <Label Text=" => "/>
+                                                               <Label Text="{NewSlot}"/>
+                                                       </HorizontalStack>
+                                                       <GraphicObject Background="Mantis" Height="3" Visible="{HasTriggeredLQIs}"/>
+                                               </VerticalStack>
+                                               <Container Name="Content" Visible="false" HorizontalAlignment="Left"
+                                                               Fit="true"/>
+                                       </VerticalStack>
+                               </Template>
+                               <HorizontalStack Height="Fit" Width="Fit">
+                                       <GraphicObject Width="20" Height="10"/>
+                                       <TreeView Name="List" Height="Fit" Width="Fit"
+                                               Template="#Crow.Templates.treeList.crow" />
+                               </HorizontalStack>
+                       </Expandable>
+               </ItemTemplate>
+               <ItemTemplate DataType="Crow.LQIList" Data="GetRootLQIs">
+                       <Expandable Caption="{}" >
+                               <Template>
+                                       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+                                               <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
+                                                               MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
+                                                               MouseLeave="{Background=Transparent}">
+                                                       <Image Margin="2" Width="12" Height="12"
+
+                                                               Path="{./Image}"
+                                                               SvgSub="{./IsExpanded}"/>
+                                                       <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
+                                               </HorizontalStack>
+                                               <Container Name="Content" Visible="false"
+                                                               Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+                                       </VerticalStack>
+                               </Template>
+                               <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
+                                       <GraphicObject Width="12" Height="10"/>
+                                       <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}"
+                                               Template="#Crow.Templates.treeList.crow" />
+                               </HorizontalStack>
+                       </Expandable>
+               </ItemTemplate>
+       </TreeView>
+</Window>
diff --git a/CrowIDE/ui/bindingExpITemp.crow b/CrowIDE/ui/bindingExpITemp.crow
new file mode 100644 (file)
index 0000000..0797371
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<Expandable Caption="{Name}" >
+       <Template>
+               <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+                       <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
+                                       MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
+                                       MouseLeave="{Background=Transparent}">
+                               <Image Margin="2" Width="12" Height="12"
+                                       Visible="{./HasContent}"
+                                       Path="{./Image}"
+                                       SvgSub="{./IsExpanded}"/>
+                               <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
+                       </HorizontalStack>
+                       <Container Name="Content" Visible="false"
+                                       Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+               </VerticalStack>
+       </Template>
+       <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
+               <GraphicObject Width="12" Height="10"/>
+               <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}"
+                       Template="#Crow.Templates.treeList.crow" />
+       </HorizontalStack>
+</Expandable>
diff --git a/CrowIDE/ui/bindingExplorer.crow b/CrowIDE/ui/bindingExplorer.crow
new file mode 100644 (file)
index 0000000..13d90be
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<Window Width="50%" Height="50%" Background="DimGray">
+       <TreeView IsRoot="true" Name="treeView" Data="{GraphicTree}">
+               <ItemTemplate DataType="Crow.GraphicObject">
+                       <Label Text="{Name}" Width="Stretched"
+                                       MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
+                                       MouseLeave="{Background=Transparent}"/>
+               </ItemTemplate>
+               <ItemTemplate DataType="Crow.Container" Data="GetChildren"
+                       Path="#CrowIDE.ui.bindingExpITemp.crow"/>
+               <ItemTemplate DataType="Crow.Group" Data="GetChildren"
+                       Path="#CrowIDE.ui.bindingExpITemp.crow"/>
+       </TreeView>
+</Window>
index 13f10f1100da5f9feddd327822c23706ebdd7aba..44ee0600f866c0e2f6b20611736ff2e939d2bd61 100755 (executable)
@@ -10,7 +10,7 @@
                                MouseLeave="{Background=Transparent}"/>
                </HorizontalStack>
        </ItemTemplate>
-       <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">             
+       <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
                <Expandable Caption="{Name}" >
                        <Template>
                                <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
index 481c030b119998e31b77797c454eca1a0cda1ff9..6b3932c14c80d1beefc84ef8a6db8b10aa474fec 100755 (executable)
@@ -1,5 +1,7 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+<Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}"
+                               Background="{./Background}"
+                               Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                                MouseEnter="./onBorderMouseEnter"
                                MouseLeave="./onBorderMouseLeave">
        <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}" Spacing="0">
index 026c06bd5d2bc16ba382980ab209633f60d03561..03e8a362647d8e8865af024fb41448038cb30ced 100644 (file)
@@ -748,10 +748,6 @@ namespace Crow
 
                #region Layouting
 
-               #if DEBUG_LAYOUTING
-               public List<LayoutingQueueItem> CurrentDrawLQIs = null;
-               public List<List<LayoutingQueueItem>> LQIs = new List<List<LayoutingQueueItem>>();
-               #endif
                /// <summary> return size of content + margins </summary>
                protected virtual int measureRawSize (LayoutingType lt) {
                        return lt == LayoutingType.Width ?
@@ -802,8 +798,8 @@ namespace Crow
                public virtual void OnLayoutChanges(LayoutingType  layoutType)
                {
                        #if DEBUG_LAYOUTING
-                       LayoutingQueueItem.currentLQI.Slot = LastSlots;
-                       LayoutingQueueItem.currentLQI.NewSlot = Slot;
+                       CurrentInterface.currentLQI.Slot = LastSlots;
+                       CurrentInterface.currentLQI.NewSlot = Slot;
                        #endif
 
                        switch (layoutType) {
@@ -1031,12 +1027,6 @@ namespace Crow
                                return;
 
                        LastPaintedSlot = Slot;
-                       #if DEBUG_LAYOUTING
-                       if (CurrentDrawLQIs != null){
-                               LQIs.Add (CurrentDrawLQIs);
-                               CurrentDrawLQIs = null;
-                       }
-                       #endif
 
                        if (cacheEnabled) {
                                if (Slot.Width > Interface.MaxCacheSize || Slot.Height > Interface.MaxCacheSize)
index 03251af99286e3f59a955719ec650ac94401f5e2..1bfcd92a670ed9f52b3eefdfd22eafd6cf3540e9 100644 (file)
@@ -191,8 +191,8 @@ namespace Crow
                public override void OnLayoutChanges (LayoutingType layoutType)
                {
                        #if DEBUG_LAYOUTING
-                       LayoutingQueueItem.currentLQI.Slot = LastSlots;
-                       LayoutingQueueItem.currentLQI.Slot = Slot;
+                       CurrentInterface.currentLQI.Slot = LastSlots;
+                       CurrentInterface.currentLQI.Slot = Slot;
                        #endif
 
                        switch (layoutType) {
index d01d2e8fdcb11f5cbbe19d57fa8306eca397a441..0c1cd766979efcdd0d33694baed35e5a7f947354 100644 (file)
@@ -320,7 +320,16 @@ namespace Crow
                }
                #endregion
 
-
+               #if DEBUG_LAYOUTING
+               public List<LQIList> LQIsTries = new List<LQIList>();
+               public LQIList curLQIsTries = new LQIList();
+               public List<LQIList> LQIs = new List<LQIList>();
+               public LQIList curLQIs = new LQIList();
+//             public static LayoutingQueueItem[] MultipleRunsLQIs {
+//                     get { return curUpdateLQIs.Where(l=>l.LayoutingTries>2 || l.DiscardCount > 0).ToArray(); }
+//             }
+               public LayoutingQueueItem currentLQI = null;
+               #endif
                public void Update(){
                        if (mouseRepeatCount > 0) {
                                int mc = mouseRepeatCount;
@@ -346,6 +355,15 @@ namespace Crow
 
                        processLayouting ();
 
+                       #if DEBUG_LAYOUTING
+                       if (curLQIsTries.Count > 0){
+                               LQIsTries.Add(curLQIsTries);
+                               curLQIsTries = new LQIList();
+                               LQIs.Add(curLQIs);
+                               curLQIs = new LQIList();
+                       }
+                       #endif
+
                        clippingRegistration ();
 
                        processDrawing ();
@@ -366,7 +384,14 @@ namespace Crow
                                LayoutingQueueItem lqi = null;
                                while (LayoutingQueue.Count > 0) {
                                        lqi = LayoutingQueue.Dequeue ();
+                                       #if DEBUG_LAYOUTING
+                                       currentLQI = lqi;
+                                       curLQIsTries.Add(currentLQI);
+                                       #endif
                                        lqi.ProcessLayouting ();
+                                       #if DEBUG_LAYOUTING
+                                       currentLQI = null;
+                                       #endif
                                }
                                LayoutingQueue = DiscardQueue;
                        }
@@ -496,6 +521,12 @@ namespace Crow
                                g.ClearBinding ();
                                GraphicTree.RemoveAt (0);
                        }
+                       #if DEBUG_LAYOUTING
+                       LQIsTries = new List<LQIList>();
+                       curLQIsTries = new LQIList();
+                       LQIs = new List<LQIList>();
+                       curLQIs = new LQIList();
+                       #endif
                }
                public GraphicObject FindByName (string nameToFind)
                {
index 0e2a98ff6fb17c246ca827af3e93f8668278a750..ed3459a8b2a98f7d163868571fadc63ff61b021d 100644 (file)
@@ -51,7 +51,6 @@ namespace Crow
                #endregion
 
                public void CreateExpandDelegate (TemplatedControl host){
-                       Type dataType = Type.GetType(strDataType);
                        Type hostType = typeof(TemplatedControl);//not sure is the best place to put the dyn method
                        Type evtType = typeof(EventHandler);
                        Type listBoxType = typeof(ListBox);
@@ -105,7 +104,10 @@ namespace Crow
                        il.Emit (OpCodes.Ldarg_1);//get the dataSource of the sender
                        il.Emit (OpCodes.Callvirt, typeof(GraphicObject).GetProperty("DataSource").GetGetMethod ());
 
-                       emitGetSubData(il, dataType);
+                       if (fetchMethodName != "self"){//special keyword self allows the use of recurent list<<<
+                               Type dataType = Type.GetType(strDataType);
+                               emitGetSubData(il, dataType);
+                       }
 
                        //set 'return' from the fetch method as 'data' of the list
                        il.Emit (OpCodes.Callvirt, piListData.GetSetMethod ());
@@ -124,8 +126,13 @@ namespace Crow
 
                        if (miGetDatas == null) {//in last resort, search among properties
                                PropertyInfo piDatas = dataType.GetProperty (fetchMethodName);
-                               if (piDatas == null)
-                                       throw new Exception ("Fetch data member not found in ItemTemplate: " + fetchMethodName);
+                               if (piDatas == null) {
+                                       FieldInfo fiDatas = dataType.GetField (fetchMethodName);
+                                       if (fiDatas == null)//and among fields
+                                               throw new Exception ("Fetch data member not found in ItemTemplate: " + fetchMethodName);
+                                       il.Emit (OpCodes.Ldfld, fiDatas);
+                                       return;
+                               }
                                miGetDatas = piDatas.GetGetMethod ();
                                if (miGetDatas == null)
                                        throw new Exception ("Read only property for fetching data in ItemTemplate: " + fetchMethodName);
index 6de5be7b09b6053607802e354a995e0405647ab7..5ec454c54765e81a436337daf8186dca0d66ee91 100644 (file)
@@ -51,17 +51,25 @@ namespace Crow
                public int LayoutingTries, DiscardCount;
 
                #if DEBUG_LAYOUTING
-               public static List<LayoutingQueueItem> processedLQIs = new List<LayoutingQueueItem>();
-               public static LayoutingQueueItem[] MultipleRunsLQIs {
-                       get { return processedLQIs.Where(l=>l.LayoutingTries>2 || l.DiscardCount > 0).ToArray(); }
-               }
-               public static LayoutingQueueItem currentLQI = null;
                public Stopwatch LQITime = new Stopwatch();
-               public List<LayoutingQueueItem> triggeredLQIs = new List<LayoutingQueueItem>();
+               public LQIList triggeredLQIs = new LQIList();
                public LayoutingQueueItem wasTriggeredBy = null;
                public GraphicObject graphicObject {
                        get { return Layoutable as GraphicObject; }
                }
+               public string Name {
+                       get { return graphicObject.Name; }
+               }
+               public string FullName {
+                       get { return graphicObject.ToString(); }
+               }
+               public Measure Width {
+                       get { return graphicObject.Width; }
+               }
+               public Measure Height {
+                       get { return graphicObject.Height; }
+               }
+               public bool HasTriggeredLQIs { get { return triggeredLQIs.Count > 0; }}
                public Rectangle Slot, NewSlot;
                #endif
 
@@ -72,12 +80,11 @@ namespace Crow
                        Layoutable = _graphicObject;
                        Layoutable.RegisteredLayoutings |= LayoutType;
                        #if DEBUG_LAYOUTING
-                       if (graphicObject.CurrentDrawLQIs == null)
-                               graphicObject.CurrentDrawLQIs = new List<LayoutingQueueItem>();
-                       graphicObject.CurrentDrawLQIs.Add(this);
-                       if (currentLQI != null){
-                               wasTriggeredBy = currentLQI;
-                               currentLQI.triggeredLQIs.Add(this);
+                       GraphicObject g = graphicObject;
+                       g.CurrentInterface.curLQIs.Add(this);
+                       if (g.CurrentInterface.currentLQI != null){
+                               wasTriggeredBy = g.CurrentInterface.currentLQI;
+                               g.CurrentInterface.currentLQI.triggeredLQIs.Add(this);
                        }
                        #endif
                }
@@ -93,13 +100,11 @@ namespace Crow
                                return;
                        }
                        #if DEBUG_LAYOUTING
-                       currentLQI = this;
-                       processedLQIs.Add(this);
                        LQITime.Start();
                        #endif
+                       LayoutingTries++;
                        if (!Layoutable.UpdateLayout (LayoutType)) {
                                if (LayoutingTries < Interface.MaxLayoutingTries) {
-                                       LayoutingTries++;
                                        Layoutable.RegisteredLayoutings |= LayoutType;
                                        (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this);
                                } else if (DiscardCount < Interface.MaxDiscardCount) {
@@ -114,7 +119,6 @@ namespace Crow
                                #endif
                        }
                        #if DEBUG_LAYOUTING
-                       currentLQI = null;
                        LQITime.Stop();
                        #endif
                }
@@ -138,5 +142,12 @@ namespace Crow
                        #endif
                }
        }
+       #if DEBUG_LAYOUTING
+       public class LQIList : List<LayoutingQueueItem>{
+               public List<LayoutingQueueItem> GetRootLQIs(){
+                       return this.Where (lqi => lqi.wasTriggeredBy == null).ToList ();
+               }
+       }
+       #endif
 }