protected abstract void updateEditorFromProjFile ();
protected abstract void updateProjFileFromEditor ();
protected abstract bool EditorIsDirty { get; set; }
- protected virtual bool IsReady { get { return true; }}
+ protected virtual bool IsReady { get { return projFile != null; }}
protected virtual void updateCheckPostProcess () {}
protected void backgroundThreadFunc () {
gr.Rectangle (cb, 2.0 / z);
string[] lerrs = Error.ToString ().Split ('\n');
Point p = cb.Center;
- p.Y -= lerrs.Length * 20;
+ p.Y = 20;
foreach (string le in lerrs) {
drawCenteredTextLine(gr, p, le);
p.Y += 20;
#endregion
#region GraphicObject overrides
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
if (_pic == null)
return 2 * Margin;
<?xml version="1.0"?>
<Border BorderWidth="1" Background="{./Background}">
<HorizontalStack Margin="1">
- <Scroller Name="scroller1"
- Margin="2" ScrollY="{../scrollbar1.Value}">
+ <Scroller Name="scroller1" Margin="2">
<VerticalStack Height="Fit" MinimumSize="10,10"
Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
</Scroller>
<ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" CursorSize="{../scroller1.ChildHeightRatio}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Maximum="{../scroller1.MaxScrollY}" Orientation="Vertical"
Width="14" />
</HorizontalStack>
</Border>
<?xml version="1.0"?>
<HorizontalStack>
- <Scroller Name="scroller1" Margin="1"
- Background="{./Background}"
- ScrollY="{../scrollbar1.Value}">
+ <Scroller Name="scroller1" Margin="1" Background="{./Background}">
<VerticalStack
Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
</Scroller>
this.KeyDown += KeyboardKeyDown1;
- testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
+ //testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
//testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ //testFiles = new string [] { @"Interfaces/Divers/0.crow" };
+ testFiles = new string [] { @"Interfaces/TemplatedContainer/testTreeView.crow" };
//testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
+// testFiles = new string[] { @"Interfaces/TemplatedControl/testItemTemplateTag.crow" };
+
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
Load(testFiles[idx]).DataSource = this;
- 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);
- LoadIMLFragment (@"<DockWindow Width=""300"" Height=""150"" Background=""DarkBlue"" />", 0);
+// 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);
+// LoadIMLFragment (@"<DockWindow Width=""300"" Height=""150"" Background=""DarkBlue"" />", 0);
}
public TechBorder () : base() {}
public TechBorder (Interface iface): base (iface){}
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
return base.measureRawSize (lt) + 6;
}
<?xml version="1.0"?>
-<GraphicObject Height="30" Width="30" Background="#500000"/>
\ No newline at end of file
+<ColorCircleSelector />
\ No newline at end of file
<CheckBox Name="chk4" />
<HorizontalStack Fit="true" Margin="2" Background="SeaGreen">
<Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/>
- <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="Fit" TextAlignment="Center" Background="AoEnglish"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="Fit" TextAlignment="Center" Background="Teal"/>
</HorizontalStack>
</VerticalStack>
</Expandable>
+++ /dev/null
-<Expandable Width="Stretched" Background="Gray">
- <Expandable Width="Stretched" Background="LightBlue">
- <Expandable Width="Stretched" Background="Green">
- <Expandable Width="Stretched" Background="LimeGreen">
- <Expandable Width="Stretched" Background="DimGray">
- <Expandable Width="Stretched" Background="Yellow">
- <Expandable Width="Stretched" Background="NavyBlue">
- <Expandable Width="Stretched" Background="Blue">
- <Expandable Width="Stretched" Background="BlueCrayola">
- <Expandable Width="Stretched" Background="Green">
- <Label Background="Red" Text="{fps}"/>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Height="Fit" Width="Fit">
- <Label Width="Stretched"/>
- <Expandable Width="Fit" Background="Gray">
- <Expandable Background="LightBlue">
- <Expandable Background="Green">
- <Expandable Background="LimeGreen">
- <Expandable Background="DimGray">
- <Expandable Width="Stretched" Background="Yellow">
- <Expandable Background="NavyBlue">
- <Expandable Width="Stretched" Background="Blue">
- <Expandable Width="Stretched" Background="BlueCrayola">
- <Expandable Width="Stretched" Background="Green">
- <Label Background="Red" Text="{fps}"/>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
-</VerticalStack>
<?xml version="1.0"?>
-<Border BorderWidth="2" Fit="true">
- <VerticalStack Fit="true" Margin="5">
- <ListBox Data="{TestList}" Background="0.5,0.5,0.5,0.7"
- HorizontalAlignment="Center" Width="200" Height="200" Margin="5">
- <Template>
- <Border BorderWidth="1">
- <HorizontalStack Margin="1">
- <Scroller Name="scroller1"
- Margin="2" ScrollY="{../scrollbar1.Value}">
- <VerticalStack Height="Fit" MinimumSize="10,10"
- Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
- </Scroller>
- <ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
- LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" CursorSize="{../scroller1.ChildHeightRatio}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="14" />
- </HorizontalStack>
- </Border>
- </Template>
- <ItemTemplate DataType="Crow.Color">
- <HorizontalStack
- HorizontalAlignment="Left"
- Height="Fit" Width="200" Margin="1" Focusable="true"
- MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}"
- MouseLeave="{Background=Transparent}">
- <GraphicObject Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/>
- <Label Text="{}" Margin="0" Width="Stretched"/>
- </HorizontalStack>
- </ItemTemplate>
- </ListBox>
- <HorizontalStack Fit="true" HorizontalAlignment="Right">
- <Button Caption="Load list" MouseDown="OnLoadList"/>
- <Button Caption="Clear" MouseDown="OnClear"/>
- </HorizontalStack>
- </VerticalStack>
-</Border>
+<VerticalStack Fit="true" Margin="5">
+ <ListBox Data="{TestList}"
+ HorizontalAlignment="Center" Width="200" Height="200" Margin="5">
+ <Template>
+ <HorizontalStack Margin="1">
+ <Scroller Name="scroller1" Margin="2" >
+ <VerticalStack Height="Fit" MinimumSize="10,10" Width="Stretched"
+ Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
+ </Scroller>
+ <ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
+ LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
+ CursorSize="{../scroller1.ChildHeightRatio}"
+ Maximum="{../scroller1.MaxScrollY}" Orientation="Vertical"
+ Width="14" />
+ </HorizontalStack>
+ </Template>
+ <ItemTemplate DataType="Crow.Color">
+ <HorizontalStack
+ HorizontalAlignment="Left"
+ Height="Fit" Width="200" Margin="1" Focusable="true"
+ MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}"
+ MouseLeave="{Background=Transparent}">
+ <GraphicObject Name="colIco" Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/>
+ <Label Text="{}" Margin="0" Width="Stretched"/>
+ </HorizontalStack>
+ </ItemTemplate>
+ </ListBox>
+ <HorizontalStack Fit="true" HorizontalAlignment="Right">
+ <Button Caption="Load list" MouseDown="OnLoadList"/>
+ <Button Caption="Clear" MouseDown="OnClear"/>
+ </HorizontalStack>
+</VerticalStack>
crowContainer = g.FindByName ("CrowContainer") as Container;
//I set an empty object as datasource at this level to force update when new
//widgets are added to the interface
- crowContainer.DataSource = new object ();
+ //crowContainer.DataSource = new object ();
hideError ();
}
<None Include="Interfaces\TemplatedContainer\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\TemplatedContainer\6.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Interfaces\TemplatedContainer\7.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\TemplatedControl\testButton.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<?xml version="1.0"?>
+<Border Margin="5" Height="90%" Width="20%">
<HorizontalStack Background="Jet" Margin="5">
- <DirectoryView Name="dv" CurrentDirectory="Interfaces" Width="25%" SelectedItemChanged="Dv_SelectedItemChanged"/>
- <Splitter Width="6"/>
+ <DirectoryView Name="dv" CurrentDirectory="Interfaces" SelectedItemChanged="Dv_SelectedItemChanged"/>
+<!-- <Splitter Width="6"/>
<VerticalStack>
<Container Name="CrowContainer" Height="60%" Background="DimGray"/>
<Splitter/>
<ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
CursorSize="{../scroller1.ChildHeightRatio}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Maximum="{../scroller1.MaxScrollY}" Orientation="Vertical"
Width="14" />
</HorizontalStack>
<Label Visible="{ShowError}" Text="{ErrorMessage}" Background="Red" Foreground="White" Width="Stretched" Margin="2"
Multiline="true"/>
- </VerticalStack>
+ </VerticalStack>-->
</HorizontalStack>
+</Border>
}
}
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
int tmp = base.measureRawSize (lt);
return tmp < 0 ? tmp : tmp + 2 * BorderWidth;
else
layoutType &= (~LayoutingType.Y);
}
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
+ childrenRWLock.EnterReadLock ();
int totSpace = Math.Max(0, Spacing * (Children.Count (c => c.Visible) - 1));
+ childrenRWLock.ExitReadLock ();
if (lt == LayoutingType.Width) {
if (Orientation == Orientation.Horizontal)
return contentSize.Width + totSpace + 2 * Margin;
public virtual void ComputeChildrenPositions()
{
int d = 0;
+ childrenRWLock.EnterReadLock ();
if (Orientation == Orientation.Horizontal) {
foreach (GraphicObject c in Children) {
if (!c.Visible)
d += c.Slot.Height + Spacing;
}
}
+ childrenRWLock.ExitReadLock ();
IsDirty = true;
}
GraphicObject stretchedGO = null;
//in the direction of stacking.
ComputeChildrenPositions ();
- //if no layouting remains in queue for item, registre for redraw
- if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- IFace.EnqueueForRepaint (this);
+ EnqueueForRepaint();
return true;
}
//initialized = true;
}
#region private fields
- LayoutingType registeredLayoutings = LayoutingType.All;
+ public LayoutingType registeredLayoutings = LayoutingType.None;
+ public LayoutingType requestedLayoutings = LayoutingType.All;
ILayoutable logicalParent;
ILayoutable parent;
string name;
if (value != null)
rootDataLevel = true;
- lock (IFace.LayoutMutex) {
+ //lock (IFace.LayoutMutex) {
OnDataSourceChanged (this, dse);
NotifyValueChanged ("DataSource", DataSource);
- }
+ //}
}
get {
return rootDataLevel ? dataSource : dataSource == null ?
dataSource;
}
}
- /// <summary>
- /// If true, rendering of GraphicObject is clipped inside client rectangle
- /// </summary>
- [DesignCategory ("Data")][DefaultValue(false)]
- public virtual bool RootDataLevel {
- get { return rootDataLevel; }
- set {
- if (rootDataLevel == value)
- return;
- rootDataLevel = value;
- NotifyValueChanged ("RootDataLevel", rootDataLevel);
- this.RegisterForRedraw ();
- }
- }
+// /// <summary>
+// /// If true, rendering of GraphicObject is clipped inside client rectangle
+// /// </summary>
+// [DesignCategory ("Data")][DefaultValue(false)]
+// public virtual bool RootDataLevel {
+// get { return rootDataLevel; }
+// set {
+// if (rootDataLevel == value)
+// return;
+// rootDataLevel = value;
+// NotifyValueChanged ("RootDataLevel", rootDataLevel);
+// this.RegisterForRedraw ();
+// }
+// }
protected virtual void onLogicalParentDataSourceChanged(object sender, DataSourceChangeEventArgs e){
if (localDataSourceIsNull)
OnDataSourceChanged (this, e);
IsDirty = true;
if (Width.IsFit || Height.IsFit)
RegisterForLayouting (LayoutingType.Sizing);
- else if (RegisteredLayoutings == LayoutingType.None)
- IFace.EnqueueForRepaint (this);
+ else
+ EnqueueForRepaint ();
}
/// <summary> query an update of the content, a redraw </summary>
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RegisterForRedraw ()
{
#if DEBUG_UPDATE
Debug.WriteLine (string.Format("RegisterForRedraw (IsDirty set)-> {0}", this.ToString ()));
#endif
IsDirty = true;
- if (RegisteredLayoutings == LayoutingType.None)
- IFace.EnqueueForRepaint (this);
+ EnqueueForRepaint ();
+ }
+ protected void EnqueueForRepaint (){
+ //if no layouting remains in queue for item, registre for redraw
+ if (requestedLayoutings != LayoutingType.None)
+ RegisterForLayouting (LayoutingType.None);
+ else if (RegisteredLayoutings == LayoutingType.None && IsDirty)
+ IFace.EnqueueForRepaint (this);
}
#endregion
}
public virtual bool ArrangeChildren { get { return false; } }
public virtual void RegisterForLayouting(LayoutingType layoutType){
- if (Parent == null)
+ if (Parent == null || !Monitor.TryEnter(IFace.LayoutMutex)) {
+ requestedLayoutings |= layoutType;
+// if (registeredLayoutings != LayoutingType.None)
+// Debugger.Break ();
return;
- lock (IFace.LayoutMutex) {
- //prevent queueing same LayoutingType for this
- layoutType &= (~RegisteredLayoutings);
+ }
+ layoutType |= requestedLayoutings;
+ requestedLayoutings = LayoutingType.None;
+ layoutType &= (~RegisteredLayoutings);//prevent queueing same LayoutingType for this
- if (layoutType == LayoutingType.None)
- return;
- //dont set position for stretched item
- if (Width == Measure.Stretched)
- layoutType &= (~LayoutingType.X);
- if (Height == Measure.Stretched)
- layoutType &= (~LayoutingType.Y);
+ if (layoutType == LayoutingType.None) {
+ Monitor.Exit (IFace.LayoutMutex);
+ return;
+ }
+ //dont set position for stretched item
+ if (Width == Measure.Stretched)
+ layoutType &= (~LayoutingType.X);
+ if (Height == Measure.Stretched)
+ layoutType &= (~LayoutingType.Y);
- if (!ArrangeChildren)
- layoutType &= (~LayoutingType.ArrangeChildren);
+ if (!ArrangeChildren)
+ layoutType &= (~LayoutingType.ArrangeChildren);
- //apply constraints depending on parent type
- if (Parent is GraphicObject)
- (Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType);
+ //apply constraints depending on parent type
+ if (Parent is GraphicObject)
+ (Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType);
// //prevent queueing same LayoutingType for this
// layoutType &= (~RegisteredLayoutings);
- if (layoutType == LayoutingType.None)
- return;
-
- //enqueue LQI LayoutingTypes separately
- if (layoutType.HasFlag (LayoutingType.Width))
- IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
- if (layoutType.HasFlag (LayoutingType.Height))
- IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
- if (layoutType.HasFlag (LayoutingType.X))
- IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
- if (layoutType.HasFlag (LayoutingType.Y))
- IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
- if (layoutType.HasFlag (LayoutingType.ArrangeChildren))
- IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
+ if (layoutType == LayoutingType.None) {
+ Monitor.Exit (IFace.LayoutMutex);
+ return;
}
+
+ //enqueue LQI LayoutingTypes separately
+ if (layoutType.HasFlag (LayoutingType.Width))
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
+ if (layoutType.HasFlag (LayoutingType.Height))
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
+ if (layoutType.HasFlag (LayoutingType.X))
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
+ if (layoutType.HasFlag (LayoutingType.Y))
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
+ if (layoutType.HasFlag (LayoutingType.ArrangeChildren))
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
+
+ Monitor.Exit (IFace.LayoutMutex);
}
+
/// <summary> trigger dependant sizing component update </summary>
public virtual void OnLayoutChanges(LayoutingType layoutType)
{
IsDirty = true;
+// if (Name == "colIco" && Slot.Height < 5)
+// Debugger.Break ();
+
OnLayoutChanges (layoutType);
LastSlots.Height = Slot.Height;
break;
}
- //if no layouting remains in queue for item, registre for redraw
- if (this.registeredLayoutings == LayoutingType.None && IsDirty)
- IFace.EnqueueForRepaint (this);
+ EnqueueForRepaint ();
return true;
}
public virtual void onDisable(object sender, EventArgs e){
Disabled.Raise (this, e);
}
- protected virtual void onParentChanged(object sender, DataSourceChangeEventArgs e) {
-// if (e.NewDataSource != null) {
-// if (width == Measure.Inherit)
-// RegisterForLayouting (LayoutingType.Width);
-// if (height == Measure.Inherit)
-// RegisterForLayouting (LayoutingType.Height);
-// }
+ protected virtual void onParentChanged(object sender, DataSourceChangeEventArgs e) {
+ RegisterForLayouting (LayoutingType.None);
ParentChanged.Raise (this, e);
if (logicalParent == null)
ComputeChildrenPositions ();
- //if no layouting remains in queue for item, registre for redraw
- if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- IFace.EnqueueForRepaint (this);
+ EnqueueForRepaint ();
return true;
}
if (largestChild == null) {
//if still null, not possible to determine a width
//because all children are stretched, force first one to fit
- Children [0].Width = Measure.Fit;
+ //Children [0].Width = Measure.Fit;
return -1;//cancel actual sizing to let child computation take place
}
} else {
if (tallestChild == null)
searchTallestChild ();
if (tallestChild == null) {
- Children [0].Height = Measure.Fit;
+ //Children [0].Height = Measure.Fit;
return -1;
}
}
#endif
largestChild = null;
contentSize.Width = 0;
+ childrenRWLock.EnterReadLock ();
for (int i = 0; i < Children.Count; i++) {
if (!Children [i].Visible)
continue;
largestChild = Children [i];
}
}
+ childrenRWLock.ExitReadLock ();
}
void searchTallestChild(){
#if DEBUG_LAYOUTING
#endif
tallestChild = null;
contentSize.Height = 0;
+ childrenRWLock.EnterReadLock ();
for (int i = 0; i < Children.Count; i++) {
if (!Children [i].Visible)
continue;
tallestChild = Children [i];
}
}
+ childrenRWLock.ExitReadLock ();
}
contentSize = default(Size);
child.LayoutChanged -= OnChildLayoutChanges;
this.RegisterForGraphicUpdate ();
- }
- child = _child as GraphicObject;
+ GraphicObject tmp = child;
+ child = null;
+ tmp.Parent = null;
+ }
+
+ child = _child;
if (child != null) {
child.Parent = this;
}
}
}
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
if ((lt == LayoutingType.Width && contentSize.Width == 0) || (lt == LayoutingType.Height && contentSize.Height == 0)) {
using (Surface drawing = new ImageSurface (Format.A1, 1,1)) {
curOffset += tabSpace;
}
- //if no layouting remains in queue for item, registre for redraw
- if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- IFace.EnqueueForRepaint (this);
+ EnqueueForRepaint ();
return true;
}
void Ol_ListAdd (object sender, ListChangedEventArg e)
{
if (this.isPaged) {
- throw new NotImplementedException();
+ throw new NotImplementedException ();
// int p = e.Index / itemPerPage;
// int i = e.Index % itemPerPage;
// (items.Children [p] as Group).InsertChild (i, e.Element);
- } else
- loadItem (e.Element, items, dataTest);
+ } else {
+ lock(IFace.UpdateMutex)
+ loadItem (e.Element, items, dataTest);
+ }
}
[XmlAttributeAttribute][DefaultValue("SteelBlue")]
iTemp = ItemTemplates ["default"];
}
- lock (IFace.LayoutMutex) {
- g = iTemp.CreateInstance();
+ //lock (IFace.LayoutMutex) {
+ g = iTemp.CreateInstance ();
+
#if DESIGN_MODE
g.design_isTGItem = true;
#endif
+
+
page.AddChild (g);
// if (isPaged)
g.LogicalParent = this;
g.MouseDown += itemClick;
- }
+ //}
if (iTemp.Expand != null && g is Expandable) {
Expandable e = g as Expandable;
}
#region GraphicObject overrides
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
if (lines == null)
lines = getLines;
#endregion
#region GraphicObject Overrides
- protected override int measureRawSize (LayoutingType lt)
+ protected override int measureRawSize(LayoutingType lt)
{
int tmp = 0;
//Wrapper can't fit in the opposite direction of the wrapper, this func is called only if Fit
return tmp + tallestChild + 2 * Margin;
}
}
-
public override bool UpdateLayout (LayoutingType layoutType)
{
RegisteredLayoutings &= (~layoutType);
ComputeChildrenPositions ();
- //if no layouting remains in queue for item, registre for redraw
- if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- IFace.EnqueueForRepaint (this);
+ EnqueueForRepaint ();
return true;
}
Monitor.Exit (UpdateMutex);
}
+ #if DEBUG_LAYOUTING
+ public string BreakingName;
+ #endif
/// <summary>Layouting loop, this is the first step of the udpate and process registered
/// Layouting queue items. Failing LQI's are requeued in this cycle until MaxTry is reached which
/// trigger an enqueue for the next Update Cycle</summary>
#if DEBUG_LAYOUTING
currentLQI = lqi;
curLQIsTries.Add(currentLQI);
+ if (lqi.graphicObject.Name == BreakingName)
+ Debugger.Break();
#endif
lqi.ProcessLayouting ();
}
public void ProcessLayouting()
{
GraphicObject go = Layoutable as GraphicObject;
-// if (go == null) {
-// Debug.WriteLine ("ERROR: processLayouting on something else than a graphic object: " + this.ToString ());
-// return;
-// }
go.parentRWLock.EnterReadLock ();
if (go.Parent == null) {//TODO:improve this
+ go.registeredLayoutings &= (~LayoutType);
+ go.requestedLayoutings |= LayoutType;
//cancel layouting for object without parent, maybe some were in queue when
//removed from a listbox
#if DEBUG_UPDATE || DEBUG_LAYOUTING
go.parentRWLock.ExitReadLock ();
return;
}
+
#if DEBUG_LAYOUTING
LQITime.Start();
Debug.WriteLine ("=> " + this.ToString ());
Layoutable.RegisteredLayoutings |= LayoutType;
(Layoutable as GraphicObject).IFace.DiscardQueue.Enqueue (this);
}
-// #if DEBUG_LAYOUTING
+ //#if DEBUG_LAYOUTING
else
Debug.WriteLine ("\tDELETED => " + this.ToString ());
-// #endif
+ //#endif
}
+
else{
if (LayoutingTries > 2 || DiscardCount > 0)
Debug.WriteLine (this.ToString ());