]> O.S.I.I.S - jp/crow.git/commitdiff
lqi explorer wip AllStretchedInFitGroup
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 18 Mar 2018 13:59:37 +0000 (14:59 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 18 Mar 2018 14:01:28 +0000 (15:01 +0100)
CrowIDE/CrowIDE.csproj
CrowIDE/src/DesignInterface.cs
CrowIDE/src/ProjectTree/ImlProjectItem.cs
CrowIDE/ui/DockWindows/winLQIs.crow
Tests/BasicTests.cs
src/GraphicObjects/GraphicObject.cs
src/Interface.cs
src/LayoutingQueueItem.cs

index 736877234f3754109d85170d4f2c8c2c128bb886..70483b521a16e5c004323d32e447f8fc93008bf7 100644 (file)
@@ -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>
index 04666b110a7487c904b4c0bf32f269d9ce8a6f07..820cf4d069e91a7036fdfd2a8582da88ca00e862 100644 (file)
@@ -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);
index b967ce50d53ad1f4f1201395addd1eabe2838344..5557647290aac698978e6c3aa042252643df97ed 100644 (file)
@@ -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; }
index 3581141b37e459316085686715bf433316b19843..9ad574f1d0850deabcc68da706497bd8262d47da 100644 (file)
@@ -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>
index af624ee500fe2b33510981251e1e1cfd68aea5a0..e37337cbef3dd215cb5af8605943a6c0fbd9837a 100644 (file)
@@ -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);
index d1ae13c9d633afe4ed5f431c943cc8212d8dfdfb..4ecbe9702a2e45a792732cb368c20b20a874903b 100644 (file)
@@ -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
index 7902424d00b6c9b56801377c676e741a02fd9c2b..e6dce137538f83e980c05bf7c8ed2cb0744d346e 100644 (file)
@@ -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);
index cf72aeb9b5daacce96cf37b42c05bf2b51612f09..d517bf3938da2d2a8b57ccf67ecb91dfa51b7b7a 100644 (file)
@@ -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
+
        }
 }