diff options
| -rw-r--r-- | CrowIDE/CrowIDE.csproj | 2 | ||||
| -rw-r--r-- | CrowIDE/src/DesignInterface.cs | 4 | ||||
| -rw-r--r-- | CrowIDE/src/ProjectTree/ImlProjectItem.cs | 2 | ||||
| -rw-r--r-- | CrowIDE/ui/DockWindows/winLQIs.crow | 41 | ||||
| -rw-r--r-- | Tests/BasicTests.cs | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 4 | ||||
| -rw-r--r-- | src/Interface.cs | 6 | ||||
| -rw-r--r-- | src/LayoutingQueueItem.cs | 48 |
8 files changed, 82 insertions, 27 deletions
diff --git a/CrowIDE/CrowIDE.csproj b/CrowIDE/CrowIDE.csproj index 73687723..70483b52 100644 --- a/CrowIDE/CrowIDE.csproj +++ b/CrowIDE/CrowIDE.csproj @@ -24,7 +24,7 @@ <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> - <DefineConstants>DEBUG;DBG_EVENTS</DefineConstants> + <DefineConstants>DEBUG;DEBUG_LAYOUTING</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> diff --git a/CrowIDE/src/DesignInterface.cs b/CrowIDE/src/DesignInterface.cs index 04666b11..820cf4d0 100644 --- a/CrowIDE/src/DesignInterface.cs +++ b/CrowIDE/src/DesignInterface.cs @@ -170,9 +170,11 @@ namespace Crow.Coding //Console.WriteLine (lqi.ToString ()); #if DEBUG_LAYOUTING currentLQI = lqi; + currentLQI.ProcessLayouting (); curLQIsTries.Add(currentLQI); - #endif + #else lqi.ProcessLayouting (); + #endif } LayoutingQueue = DiscardQueue; Monitor.Exit (LayoutMutex); diff --git a/CrowIDE/src/ProjectTree/ImlProjectItem.cs b/CrowIDE/src/ProjectTree/ImlProjectItem.cs index b967ce50..55576472 100644 --- a/CrowIDE/src/ProjectTree/ImlProjectItem.cs +++ b/CrowIDE/src/ProjectTree/ImlProjectItem.cs @@ -58,7 +58,7 @@ namespace Crow.Coding } } public List<LQIList> LQIs { - get { return instance == null ? null : instance.IFace.LQIs; } + get { return instance == null ? null : instance.IFace.LQIsTries; } } public Measure DesignWidth { get { return designWidth; } diff --git a/CrowIDE/ui/DockWindows/winLQIs.crow b/CrowIDE/ui/DockWindows/winLQIs.crow index 3581141b..9ad574f1 100644 --- a/CrowIDE/ui/DockWindows/winLQIs.crow +++ b/CrowIDE/ui/DockWindows/winLQIs.crow @@ -1,7 +1,46 @@ <?xml version="1.0"?> -<DockWindow Name="winLQIs" Caption="Layouting Queue Items Explorer" Width="40%" Height="80%"> +<DockWindow Name="winLQIs" Caption="Layouting Queue Items Explorer" Width="90%" Height="80%"> <VerticalStack DataSource="{CurrentSolution}"> <TreeView DataSource="{SelectedItem}" Name="treeView" Data="{LQIs}"> + <ItemTemplate DataType="Crow.LQIList" Data="CompletedLQIs"> + <Expandable Caption="{Count}"> + <Template> + <VerticalStack> + <Border Style="TreeItemBorder" Focusable="false" MouseDoubleClick="./onClickForExpand"> + <HorizontalStack Spacing="1"> + <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand" + Path="{./Image}" + Visible="{./IsExpandable}" + SvgSub="{./IsExpanded}" + MouseEnter="{Background=LightGray}" + MouseLeave="{Background=Transparent}"/> + <Image Style="TreeIcon" + Path="#Crow.Icons.crowproj.svg"/> + <GraphicObject Width="2" Height="9" Background="Green" Visible="{IsStartupProject}"/> + <Label Text="{./Caption}"/> + </HorizontalStack> + </Border> + <Container Name="Content" Visible="false"/> + </VerticalStack> + </Template> + <HorizontalStack Height="Fit"> + <GraphicObject Width="8" Height="10"/> + <VerticalStack Height="Fit" Name="ItemsContainer"/> + </HorizontalStack> + </Expandable> + </ItemTemplate> + <ItemTemplate DataType="Crow.LayoutingQueueItem"> + <HorizontalStack Height="Fit" Focusable="true" Tooltip="{FullName}"> + <Label Text="{LayoutingTries}" Width="18" Background="White" Foreground="Black"/> + <Label Text="{DiscardCount}" Width="18" Background="White" Foreground="Black"/> + <Label Text="{Name}" Width="130" Background="White" Foreground="Black"/> + <Label Text="{LayoutType}" Width="50" Background="White" Foreground="Black"/> + <Label Text="{Slot}" Width="50" Background="White" Foreground="Black"/> + <Label Text="{NewSlot}" Width="50" Background="White" Foreground="Black"/> + <Label Text="{Message}" Width="Stretched" Background="White" Foreground="Black"/> + </HorizontalStack> + </ItemTemplate> + </TreeView> </VerticalStack> </DockWindow> diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index af624ee5..e37337cb 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -215,7 +215,7 @@ namespace Tests Load(testFiles[idx]).DataSource = this; - showTarget = FindByName ("ShowTarget"); +// showTarget = FindByName ("ShowTarget"); // LoadIMLFragment (@"<DockWindow Width=""150"" Height=""150"" Background=""DarkRed"" />", 0); // LoadIMLFragment (@"<DockWindow Width=""200"" Height=""150"" Background=""DarkGreen"" />", 0); // LoadIMLFragment (@"<DockWindow Width=""250"" Height=""150"" Background=""Brown"" />", 0); diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index d1ae13c9..4ecbe970 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -1463,7 +1463,7 @@ namespace Crow #if DEBUG_LAYOUTING IFace.currentLQI.Slot = LastSlots; IFace.currentLQI.NewSlot = Slot; - Debug.WriteLine ("\t\t{0} => {1}",LastSlots,Slot); + //Debug.WriteLine ("\t\t{0} => {1}",LastSlots,Slot); #endif // #if DESIGN_MODE // if (IFace.GetType().Name == "DesignInterface"){ @@ -1637,7 +1637,7 @@ namespace Crow /// </summary> public virtual void LayoutingDiscardCheck (LayoutingType lt) { //#if DEBUG_LAYOUTING - Debug.WriteLine ("LayoutingDiscardCheck for {0}",this.ToString()); + //Debug.WriteLine ("LayoutingDiscardCheck for {0}",this.ToString()); // #endif } #endregion diff --git a/src/Interface.cs b/src/Interface.cs index 7902424d..e6dce137 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -606,11 +606,11 @@ namespace Crow lqi = LayoutingQueue.Dequeue (); #if DEBUG_LAYOUTING currentLQI = lqi; + currentLQI.ProcessLayouting (); curLQIsTries.Add(currentLQI); - if (lqi.graphicObject.Name == BreakingName) - Debugger.Break(); - #endif + #else lqi.ProcessLayouting (); + #endif } LayoutingQueue = DiscardQueue; Monitor.Exit (LayoutMutex); diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index cf72aeb9..d517bf39 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -49,7 +49,7 @@ namespace Crow /// Element class of the LayoutingQueue /// </summary> public struct LayoutingQueueItem - { + { /// <summary> Instance of widget to be layouted</summary> public ILayoutable Layoutable; /// <summary> Bitfield containing the element of the layout to performs (x|y|width|height)</summary> @@ -58,6 +58,7 @@ namespace Crow public int LayoutingTries, DiscardCount; #if DEBUG_LAYOUTING + public string Message; public Stopwatch LQITime; public GraphicObject graphicObject { get { return Layoutable as GraphicObject; } @@ -87,9 +88,9 @@ namespace Crow DiscardCount = 0; #if DEBUG_LAYOUTING LQITime = new Stopwatch(); - Slot = Rectangle.Empty; - NewSlot = Rectangle.Empty; - Debug.WriteLine ("\tRegister => " + this.ToString ()); + Slot = NewSlot = default(Rectangle); + Message = ""; + //Debug.WriteLine ("\tRegister => " + this.ToString ()); #endif } #endregion @@ -107,7 +108,7 @@ namespace Crow //cancel layouting for object without parent, maybe some were in queue when //removed from a listbox #if DEBUG_UPDATE || DEBUG_LAYOUTING - Debug.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ()); + Message = "Parent is null"; #endif go.parentRWLock.ExitReadLock (); return; @@ -115,19 +116,19 @@ namespace Crow #if DEBUG_LAYOUTING LQITime.Start(); - Debug.WriteLine ("=> " + this.ToString ()); + //Debug.WriteLine ("=> " + this.ToString ()); #endif LayoutingTries++; if (!Layoutable.UpdateLayout (LayoutType)) { #if DEBUG_LAYOUTING - Debug.WriteLine ("\t\tRequeued"); + Message = "Requeued"; #endif if (LayoutingTries < Interface.MaxLayoutingTries) { Layoutable.RegisteredLayoutings |= LayoutType; (Layoutable as GraphicObject).IFace.LayoutingQueue.Enqueue (this); } else if (DiscardCount < Interface.MaxDiscardCount) { #if DEBUG_LAYOUTING - Debug.WriteLine ("\t\tDiscarded"); + Message ="Discarded"; #endif go.LayoutingDiscardCheck (LayoutType); LayoutingTries = 0; @@ -135,16 +136,17 @@ namespace Crow Layoutable.RegisteredLayoutings |= LayoutType; (Layoutable as GraphicObject).IFace.DiscardQueue.Enqueue (this); } - //#if DEBUG_LAYOUTING + #if DEBUG_LAYOUTING else - Debug.WriteLine ("\tDELETED => " + this.ToString ()); - //#endif + Message = "Deleted"; + #endif } + //#if DEBUG_LAYOUTING + else + Message = "Succeed"; + //#endif + - else{ - if (LayoutingTries > 2 || DiscardCount > 0) - Debug.WriteLine (this.ToString ()); - } #if DEBUG_LAYOUTING LQITime.Stop(); #endif @@ -162,8 +164,10 @@ namespace Crow public override string ToString () { #if DEBUG_LAYOUTING - return string.Format ("{2};{3};{4} {1}->{0}", LayoutType,Layoutable.ToString(), - LayoutingTries,DiscardCount,LQITime.ElapsedTicks); +// return string.Format ("{2};{3};{4} {1}->{0}", LayoutType,Layoutable.ToString(), +// LayoutingTries,DiscardCount,LQITime.ElapsedTicks); + return string.Format ("{2};{3};{4} {1}->{0};{5}", LayoutType,Layoutable.ToString(), + LayoutingTries,DiscardCount,LQITime.ElapsedTicks, Message); #else return string.Format ("{2};{3} {1}->{0}", LayoutType,Layoutable.ToString(), LayoutingTries, DiscardCount); @@ -176,6 +180,16 @@ namespace Crow // return this.Where (lqi => lqi.wasTriggeredBy == null).ToList (); // } // #endif + public List<LayoutingQueueItem> GetLQIs(){ + return this.ToList(); + } + #if DEBUG_LAYOUTING + public List<LayoutingQueueItem> CompletedLQIs(){ + List<LayoutingQueueItem> tmp = this.Where (lqi => lqi.Message == "Succeed").ToList (); + return tmp; + } + #endif + } } |