<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>
//Console.WriteLine (lqi.ToString ());
#if DEBUG_LAYOUTING
currentLQI = lqi;
+ currentLQI.ProcessLayouting ();
curLQIsTries.Add(currentLQI);
- #endif
+ #else
lqi.ProcessLayouting ();
+ #endif
}
LayoutingQueue = DiscardQueue;
Monitor.Exit (LayoutMutex);
}
}
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; }
<?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>
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);
#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"){
/// </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
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);
/// 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>
public int LayoutingTries, DiscardCount;
#if DEBUG_LAYOUTING
+ public string Message;
public Stopwatch LQITime;
public GraphicObject graphicObject {
get { return Layoutable as GraphicObject; }
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
//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;
#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;
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
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);
// 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
+
}
}