]> O.S.I.I.S - jp/crow.git/commitdiff
Layouting queue, debug 3/head
authorjpbruyere <jp.bruyere@hotmail.com>
Sat, 2 May 2015 07:19:19 +0000 (09:19 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Sat, 2 May 2015 07:19:19 +0000 (09:19 +0200)
test4 validated

20 files changed:
Tests/GOLIBTest_4.1.cs [new file with mode: 0644]
Tests/GOLIBTest_4.cs
Tests/GOLIBTest_fps.cs [new file with mode: 0644]
Tests/Interfaces/fps.goml [new file with mode: 0755]
Tests/Interfaces/test1.1.goml
Tests/Interfaces/test1.2.goml
Tests/Interfaces/test1.3.goml [new file with mode: 0755]
Tests/Interfaces/test1.goml
Tests/Interfaces/test4.1.goml [new file with mode: 0755]
Tests/Tests.csproj
src/GraphicObjects/Border.cs
src/GraphicObjects/Container.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs [changed mode: 0755->0644]
src/GraphicObjects/Group.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/NumericControl.cs
src/GraphicObjects/Scroller.cs
src/LayoutingQueue.cs
src/LayoutingQueueItem.cs

diff --git a/Tests/GOLIBTest_4.1.cs b/Tests/GOLIBTest_4.1.cs
new file mode 100644 (file)
index 0000000..01621df
--- /dev/null
@@ -0,0 +1,55 @@
+#define MONO_CAIRO_DEBUG_DISPOSE\r
+\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using OpenTK;\r
+using OpenTK.Graphics.OpenGL;\r
+using OpenTK.Input;\r
+\r
+using System.Diagnostics;\r
+\r
+//using GGL;\r
+using go;\r
+using System.Threading;\r
+\r
+\r
+namespace test\r
+{\r
+       class GOLIBTest_4_1 : OpenTKGameWindow\r
+       {\r
+               public GOLIBTest_4_1 ()\r
+                       : base(1024, 600,"test")\r
+               {}\r
+\r
+               Group g;\r
+\r
+               protected override void OnLoad (EventArgs e)\r
+               {\r
+                       base.OnLoad (e);\r
+                       LoadInterface("Interfaces/test4.1.goml", out g);\r
+\r
+               }\r
+               protected override void OnRenderFrame (FrameEventArgs e)\r
+               {\r
+                       GL.Clear (ClearBufferMask.ColorBufferBit);\r
+                       base.OnRenderFrame (e);\r
+                       SwapBuffers ();\r
+               }\r
+\r
+               protected override void OnUpdateFrame (FrameEventArgs e)\r
+               {\r
+                       base.OnUpdateFrame (e);\r
+               }\r
+\r
+               [STAThread]\r
+               static void Main ()\r
+               {\r
+                       Console.WriteLine ("starting example");\r
+\r
+                       using (GOLIBTest_4_1 win = new GOLIBTest_4_1( )) {\r
+                               win.Run (30.0);\r
+                       }\r
+               }\r
+       }\r
+}
\ No newline at end of file
index 2482a66ec475ec67249e88ac05936b8d79ca04d5..5ee286b690f72f249ca520322b06e2242013c4ce 100644 (file)
@@ -113,8 +113,8 @@ namespace test
                                        }\r
                                );\r
                                i++;\r
-                               if (i > 50)\r
-                                       break;\r
+//                             if (i > 50)\r
+//                                     break;\r
                        }\r
                }\r
                void pFps_mousemove(object sender, MouseMoveEventArgs e)\r
@@ -124,7 +124,6 @@ namespace test
                        redrawClip.AddRectangle (c.ScreenCoordinates(c.Slot));\r
                        c.Left += e.XDelta;\r
                        c.Top += e.YDelta;\r
-                       c.LayoutIsValid = false;\r
                        c.registerForGraphicUpdate ();\r
                }\r
                protected override void OnRenderFrame (FrameEventArgs e)\r
diff --git a/Tests/GOLIBTest_fps.cs b/Tests/GOLIBTest_fps.cs
new file mode 100644 (file)
index 0000000..946eb5e
--- /dev/null
@@ -0,0 +1,101 @@
+#define MONO_CAIRO_DEBUG_DISPOSE\r
+\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using OpenTK;\r
+using OpenTK.Graphics.OpenGL;\r
+using OpenTK.Input;\r
+\r
+using System.Diagnostics;\r
+\r
+//using GGL;\r
+using go;\r
+using System.Threading;\r
+\r
+\r
+namespace test\r
+{\r
+       class GOLIBTest_fps : OpenTKGameWindow\r
+       {\r
+               #region FPS\r
+               static int _fps = 0;\r
+\r
+               public static int fps {\r
+                       get { return _fps; }\r
+                       set {\r
+                               _fps = value;\r
+                               if (_fps > fpsMax)\r
+                                       fpsMax = _fps;\r
+                               else if (_fps < fpsMin)\r
+                                       fpsMin = _fps;\r
+                       }\r
+\r
+               }\r
+\r
+               public static int fpsMin = int.MaxValue;\r
+               public static int fpsMax = 0;\r
+\r
+               static void resetFps ()\r
+               {\r
+                       fpsMin = int.MaxValue;\r
+                       fpsMax = 0;\r
+                       _fps = 0;\r
+               }\r
+               #endregion\r
+\r
+               public GOLIBTest_fps ()\r
+                       : base(400, 200,"test")\r
+               {}\r
+\r
+               Container g;\r
+               Label labFps, labFpsMin, labFpsMax, labUpdate;\r
+\r
+               protected override void OnLoad (EventArgs e)\r
+               {\r
+                       base.OnLoad (e);\r
+                       LoadInterface("Interfaces/fps.goml", out g);\r
+\r
+                       labFps = g.FindByName ("labFps") as Label;\r
+                       labFpsMin = g.FindByName ("labFpsMin") as Label;\r
+                       labFpsMax = g.FindByName ("labFpsMax") as Label;\r
+                       labUpdate = g.FindByName ("labUpdate") as Label;\r
+\r
+               }\r
+               protected override void OnRenderFrame (FrameEventArgs e)\r
+               {\r
+                       GL.Clear (ClearBufferMask.ColorBufferBit);\r
+                       base.OnRenderFrame (e);\r
+                       SwapBuffers ();\r
+               }\r
+\r
+               private int frameCpt = 0;\r
+               protected override void OnUpdateFrame (FrameEventArgs e)\r
+               {\r
+                       base.OnUpdateFrame (e);\r
+\r
+                       fps = (int)RenderFrequency;\r
+\r
+                       labFps.Text = fps.ToString();\r
+                       labUpdate.Text = this.updateTime.ElapsedMilliseconds.ToString() + " ms";\r
+                       if (frameCpt > 200) {\r
+                               labFpsMin.Text = fpsMin.ToString();\r
+                               labFpsMax.Text = fpsMax.ToString();\r
+                               resetFps ();\r
+                               frameCpt = 0;\r
+\r
+                       }\r
+                       frameCpt++;\r
+               }\r
+\r
+               [STAThread]\r
+               static void Main ()\r
+               {\r
+                       Console.WriteLine ("starting example");\r
+\r
+                       using (GOLIBTest_fps win = new GOLIBTest_fps( )) {\r
+                               win.Run (30.0);\r
+                       }\r
+               }\r
+       }\r
+}
\ No newline at end of file
diff --git a/Tests/Interfaces/fps.goml b/Tests/Interfaces/fps.goml
new file mode 100755 (executable)
index 0000000..85b60af
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>\r
+<Container Name="MainGrp"\r
+       HorizontalAlignment="Right" VerticalAlignment="Bottom"\r
+       Margin="10" Focusable="True" Fit="True">\r
+\r
+               <VerticalStack Fit="True" BorderWidth="1" Margin="5" WidgetSpacing="4">\r
+                       <HorizontalStack>\r
+                               <Label Text="Update:" FontColor="White" VerticalAlignment="Center" />\r
+                               <Label Name="labUpdate" Text="xxxx" FontSize="12" Width="60" TextAlignment="Center" Background="DarkGreen"/>\r
+                       </HorizontalStack>\r
+                       <HorizontalStack>\r
+                               <Label Text="Fps:" Width = "30" VerticalAlignment="Center"  TextAlignment="LeftCenter"/>\r
+                               <Label Name="labFps" Text="xxxx" Font="droid bold, 12"\r
+                                       TextAlignment="Center" Background="AoEnglish"/>\r
+                       </HorizontalStack>\r
+                       <HorizontalStack>\r
+                               <Label Text="Min:" Width = "30" />\r
+                               <Label Name="labFpsMin" Text="xxxx" Font="droid bold, 12"\r
+                                       TextAlignment="Center" Background="AoEnglish"/>\r
+                       </HorizontalStack>\r
+                       <HorizontalStack>\r
+                               <Label Text="Max:" Width = "30"/>\r
+                               <Label Name="labFpsMax" Text="xxxx" Font="droid bold, 12"\r
+                                       TextAlignment="Center" Background="AoEnglish"/>\r
+                       </HorizontalStack>\r
+               </VerticalStack>                                \r
+</Container>
\ No newline at end of file
index 6ccf2c1c239e6f673c5466f76f51de8d28bb3ff2..86faa998bb36fa7f341f62fba0895867311cbd5e 100755 (executable)
@@ -1,15 +1,15 @@
 <?xml version="1.0"?>\r
-<Group Width="0" Height="0" Margin="50"\r
+<Group Name="TopGroup" Width="500" Height="400" Margin="5"\r
        Focusable="True" Background="Yellow">\r
-       <Group Width="-1" Height="-1" Margin="50" \r
+       <Group Name="InnerGroup" Width="-1" Height="-1" Margin="50" \r
                VerticalAlignment="Top" HorizontalAlignment="Left"\r
                Focusable="True" Background="Green">\r
                <Image VerticalAlignment="Bottom"                       \r
-                       Name="PhaseOverlay" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
+                       Name="PhaseOverlay1" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
                <Image Top="100"                \r
-                       Name="PhaseOverlay" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
+                       Name="PhaseOverlay2" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
        </Group>\r
-       <Image Top="100"                \r
-               Name="PhaseOverlay" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
+       <Image VerticalAlignment="Center" HorizontalAlignment="Right"\r
+               Name="PhaseOverlay0" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
 \r
 </Group>
\ No newline at end of file
index 1ccc51ec98258b459bbd1fbac121cccade32f3a4..c467cd517f45a9cd305e2a40b2384f969bc88625 100755 (executable)
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>\r
-<Container>\r
-<VerticalStack>\r
+<Container Background="Green" Height="400" Width="400">\r
+<VerticalStack Margin="10" Background="DarkBlue" Height="-1" Width="0">\r
        <Label Text="label11"/>\r
        <Label Text="label21"/>\r
-       <HorizontalStack Width="-1" Height="-1" Margin="50"\r
-               Focusable="True" Background="DarkBlue">\r
+       <HorizontalStack Width="-1" Height="-1" Margin="5"\r
+               Focusable="True" Background="Blue">\r
                <Label Text="label12"/>\r
                <Label Text="label22"/>\r
                <Label Text="label32"/>\r
diff --git a/Tests/Interfaces/test1.3.goml b/Tests/Interfaces/test1.3.goml
new file mode 100755 (executable)
index 0000000..c6fffe4
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>\r
+<Container Name="MainMenu"     \r
+       Margin="30" Focusable="True" Height="-1" Width="300">\r
+       <Border BorderWidth="1" Margin="40" Background="0,5;0,5;0,5;0,5">\r
+               <VerticalStack WidgetSpacing="10">\r
+                       <Button Margin = "10" Text="Start New Game" Height="-1" Width="0" \r
+                               MouseClick="onStartNewGame"/>\r
+                       <Button Margin = "10" Text="Start New Game" Height="-1" Width="0"/>\r
+                       <Button Margin = "10" Text="Start New Game" Height="-1" Width="0"/>\r
+                       <Button Margin = "10" Text="Exit" Height="-1" Width="0"\r
+                               MouseClick="onButExit_MouseClick" />\r
+               </VerticalStack>\r
+       </Border>                               \r
+</Container>
\ No newline at end of file
index 9601a87be1be00528f7c43cdd590e16581ac79fb..2177065e681c2358c7707c47ed7bd7cee4c1fc2f 100755 (executable)
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>\r
-<Container Width="300" Height="-1"\r
+<Container Name="TopContainer" Width="400" Height="350"\r
        Margin="20" Focusable="True" Background="Yellow">\r
 \r
-       <Container Width="-1" Height="-1"\r
+       <Container Name="MiddleContainer" Width="0" Height="0"\r
                Margin="20" Focusable="True" Background="Green">\r
                        <Image VerticalAlignment="Bottom"                       \r
                                Name="PhaseOverlay" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
diff --git a/Tests/Interfaces/test4.1.goml b/Tests/Interfaces/test4.1.goml
new file mode 100755 (executable)
index 0000000..d854d0a
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version="1.0"?>\r
+<Group Name="MainGrp"\r
+       Width="800" Height="500"\r
+       Background="0,5;0,5;0,5;0,5" Foreground="White"\r
+       Margin="10" >\r
+       <Border \r
+               BorderWidth="2" BorderColor="Transparent"\r
+               Focusable="True"\r
+               MouseEnter="{BorderColor = White}"\r
+               MouseLeave="{BorderColor = Transparent}">\r
+\r
+               <HorizontalStack Name="hs0"\r
+                       WidgetSpacing="10" \r
+                       VerticalAlignment="Top" \r
+                       Background="0,5;0,5;0,5;0,5">\r
+                       <VerticalStack Name="vs1"\r
+                               Margin="20">\r
+                               <Label Name="labMouse" Text="MousePos"/>\r
+                               <HorizontalStack Name="hsPbar">\r
+                                       <ProgressBar Name="pbBar" \r
+                                               Width="100" Height="20"\r
+                                               Value="50"\r
+                                               Foreground="BlueCrayola" Background="DarkGray"\r
+                                               BorderWidth="2" BorderColor="White"/>\r
+                                       <Label Name="labPb"\r
+                                               Width="20"\r
+                                               TextAlignment="RightCenter"/>\r
+                                       <ProgressBar Name="pbBar"\r
+                                               Width="100" Height="10"\r
+                                               Value="30"/>\r
+                               </HorizontalStack>\r
+                               <HorizontalStack  Name="hsFocus" HorizontalAlignment="Left">\r
+                                       <Label Text="Focused:"/>\r
+                                       <Label Name="labFocus" Width="200"/>\r
+                               </HorizontalStack>\r
+                               <HorizontalStack>\r
+                                       <Label Text="Active:"  Name="hsActive"/>\r
+                                       <Label Name="labActive" Width="200"/>\r
+                               </HorizontalStack>\r
+                               <HorizontalStack>\r
+                                       <Label Text="Hover:"  Name="hsHover"/>\r
+                                       <Label Name="labHover" Width="200"/>\r
+                               </HorizontalStack>\r
+                               <Button Margin="5" BorderWidth="0" Background="Gray" Width="-1" Height="-1">\r
+                                       <Label FontSize="10" Text="This is a test" Margin="5" FontColor="White" Foreground="White" />\r
+                               </Button>\r
+                               <TextBoxWidget  TextAlignment="LeftCenter" Font="droid,14"                                              \r
+                                                               Width="300" Height="-1" Margin="2"\r
+                                                               BorderColor="White" BorderWidth="1"\r
+                                                               Text="editable text"/>\r
+                               <GroupBox Title="Group Box" Width="300" Height="100" \r
+                                       BorderColor="White" BorderWidth="2" Margin="3">\r
+                                       <Label Name="labValue" FontSize="14" Text="000" TextAlignment="Center"/>\r
+                               </GroupBox>\r
+                               <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />\r
+                               <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>\r
+                       </VerticalStack>\r
+                       <VerticalStack Width="-1" Height="-1" BorderWidth="1" Margin="5" WidgetSpacing="4">\r
+<!--                           <Button Width="-1" Height="-1" Margin="5">\r
+                                       <Image Path="/mnt/data/Images/130px-Blason_ville_fr_Aubure_(Haut-Rhin).svg.png"/>\r
+                               </Button>-->\r
+                               <HorizontalStack>\r
+                                       <Label Text="Update" FontColor="White" VerticalAlignment="Center" />\r
+                                       <Label Name="labUpdate" Text="xxxx" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>\r
+                               </HorizontalStack>\r
+                               <HorizontalStack>\r
+                                       <Label Text="Fps:" Width = "30" VerticalAlignment="Center"  TextAlignment="LeftCenter"/>\r
+                                       <Label Name="labFps" Text="xxxx" Font="droid bold, 14"\r
+                                               TextAlignment="Center" Background="AoEnglish"/>\r
+                               </HorizontalStack>\r
+                               <HorizontalStack>\r
+                                       <Label Text="Min:" Width = "30" />\r
+                                       <Label Name="labFpsMin" Text="xxxx" Font="droid bold, 14"\r
+                                               TextAlignment="Center" Background="AoEnglish"/>\r
+                               </HorizontalStack>\r
+                               <HorizontalStack>\r
+                                       <Label Text="Max:" Width = "30"/>\r
+                                       <Label Name="labFpsMax" Text="xxxx" Font="droid bold, 14"\r
+                                               TextAlignment="Center" Background="AoEnglish"/>\r
+                               </HorizontalStack>\r
+                       </VerticalStack>\r
+\r
+                       <Scroller Background="DimGray" Height="350" Width="300"  \r
+                                Margin="5" VerticalScrolling="true">\r
+                               <VerticalStack Name="colors" VerticalAlignment="Top" Margin="5">\r
+                                       <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"\r
+                                                               BorderWidth="2" BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
+                               </VerticalStack>\r
+                       </Scroller>\r
+\r
+               </HorizontalStack>\r
+\r
+               <Slider \r
+                       Height="20" Width="300" \r
+                       Background="Transparent"\r
+                       VerticalAlignment="Bottom" />\r
+               </Border>\r
+</Group>
\ No newline at end of file
index a0af8a64fa536443cb32ddf4b9d3628cfadf02e2..02a190058ea8566bd8ca5b858d6f7122f8be515c 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>test.GOLIBTest_1</StartupObject>
+    <StartupObject>test.GOLIBTest_4</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <OutputPath>..\bin\$(configuration)</OutputPath>
     <IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
       <LogicalName>
       </LogicalName>
     </Compile>
+    <Compile Include="GOLIBTest_4.1.cs">
+      <LogicalName>
+      </LogicalName>
+    </Compile>
+    <Compile Include="GOLIBTest_fps.cs">
+      <LogicalName>
+      </LogicalName>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <None Include="image\u.svg">
       <LogicalName>
       </LogicalName>
     </None>
+    <None Include="Interfaces\test4.1.goml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <LogicalName>
+      </LogicalName>
+    </None>
+    <None Include="Interfaces\test1.3.goml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <LogicalName>
+      </LogicalName>
+    </None>
+    <None Include="Interfaces\fps.goml">
+      <LogicalName>
+      </LogicalName>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\">
index 281db215b906fca982ef029739af1678627aaf97..e2451582432aadd1acbb746b3124d713c3947c61 100644 (file)
@@ -48,9 +48,9 @@ namespace go
                        Size raw = Bounds.Size;
 
                        if (child != null) {
-                               if (Bounds.Width < 0 && child.WIsValid)
+                               if (Bounds.Width < 0)
                                        raw.Width = child.Slot.Width + 2 * (Margin+BorderWidth);
-                               if (Bounds.Height < 0 && child.HIsValid)
+                               if (Bounds.Height < 0)
                                        raw.Height = child.Slot.Height + 2 * (Margin+BorderWidth);
                        }
 
index 862f7947c269945a6179964470d4f60088eccfc9..0d0ad5b3ae2c52944bd241fda5f03fb7aea6f67b 100644 (file)
@@ -66,107 +66,58 @@ namespace go
                        return child == null ? Bounds.Size : new Size(child.Slot.Width + 2 * (Margin),child.Slot.Height + 2 * (Margin));\r
                }\r
 \r
-               public override void UpdateLayout (LayoutingType layoutType)\r
+               protected override void OnLayoutChanges (LayoutingType layoutType)\r
                {\r
-                       {                       \r
-                               switch (layoutType) {\r
-                               case LayoutingType.X:\r
-                                       if (Bounds.X == 0) {\r
-                                               switch (HorizontalAlignment) {\r
-                                               case HorizontalAlignment.Left:\r
-                                                       Slot.X = 0;\r
-                                                       break;\r
-                                               case HorizontalAlignment.Right:\r
-                                                       Slot.X = Parent.ClientRectangle.Width - Slot.Width;\r
-                                                       break;\r
-                                               case HorizontalAlignment.Center:\r
-                                                       Slot.X = Parent.ClientRectangle.Width / 2 - Slot.Width / 2;\r
-                                                       break;\r
-                                               }\r
-                                       } else\r
-                                               Slot.X = Bounds.X;\r
-                                       if (LastSlots.X == Slot.X)\r
-                                               break;\r
-                                       //register layouting here for objects depending on this.x\r
-                                       LastSlots.X = Slot.X;\r
-                                       break;\r
-                               case LayoutingType.Y:\r
-                                       if (Bounds.Y == 0) {\r
-                                               switch (VerticalAlignment) {\r
-                                               case VerticalAlignment.Top:\r
-                                                       Slot.Y = 0;\r
-                                                       break;\r
-                                               case VerticalAlignment.Bottom:\r
-                                                       Slot.Y = Parent.ClientRectangle.Height - Slot.Height;\r
-                                                       break;\r
-                                               case VerticalAlignment.Center:\r
-                                                       Slot.Y = Parent.ClientRectangle.Height / 2 - Slot.Height / 2;\r
-                                                       break;\r
-                                               }\r
-                                       }else\r
-                                               Slot.Y = Bounds.Y;\r
-                                       if (LastSlots.Y == Slot.Y)\r
-                                               break;\r
-                                       //register layouting here for objects depending on this.x\r
-                                       LastSlots.Y = Slot.Y;\r
-                                       break;\r
-                               case LayoutingType.Width:                               \r
-                                       if (Width > 0)\r
-                                               Slot.Width = Width;\r
-                                       else if (Width < 0)\r
-                                               Slot.Width = measureRawSize ().Width;\r
+                       switch (layoutType) {\r
+                       case LayoutingType.Width:                               \r
+                               base.OnLayoutChanges (layoutType);\r
+                               if (child != null) {\r
+                                       if (child.getBounds ().Width == 0)\r
+                                               child.RegisterForLayouting ((int)LayoutingType.Width);\r
                                        else\r
-                                               Slot.Width = Parent.ClientRectangle.Width;\r
-\r
-                                       if (LastSlots.Width == Slot.Width)\r
-                                               break;\r
-\r
-                                       if (Parent.getBounds ().Width < 0)\r
-                                               this.Parent.RegisterForLayouting ((int)LayoutingType.Width);\r
-                                       else if (Width != 0) //update position in parent\r
-                                               this.RegisterForLayouting ((int)LayoutingType.X);\r
-\r
-                                       if (child != null) {\r
-                                               if (child.getBounds ().Width == 0)\r
-                                                       child.RegisterForLayouting ((int)LayoutingType.Width);\r
-                                               else\r
-                                                       child.RegisterForLayouting ((int)LayoutingType.X);\r
-                                       }\r
-                                       LastSlots.Width = Slot.Width;\r
-                                       break;\r
-                               case LayoutingType.Height:\r
-                                       if (Height > 0)\r
-                                               Slot.Height = Height;\r
-                                       else if (Height < 0)\r
-                                               Slot.Height = measureRawSize ().Height;\r
+                                               child.RegisterForLayouting ((int)LayoutingType.X);\r
+                               }\r
+                               break;\r
+                       case LayoutingType.Height:\r
+                               base.OnLayoutChanges (layoutType);\r
+                               if (child != null) {\r
+                                       if (child.getBounds ().Height == 0)\r
+                                               child.RegisterForLayouting ((int)LayoutingType.Height);\r
                                        else\r
-                                               Slot.Height = Parent.ClientRectangle.Height;\r
-\r
-                                       if (LastSlots.Height == Slot.Height)\r
-                                               break;\r
-\r
-                                       if (Parent.getBounds().Height < 0)\r
-                                               this.Parent.RegisterForLayouting((int)LayoutingType.Height);\r
-                                       else if (Height != 0) //update position in parent\r
-                                               this.RegisterForLayouting ((int)LayoutingType.Y);\r
-\r
-                                       if (child != null) {\r
-                                               if (child.getBounds ().Height == 0)\r
-                                                       child.RegisterForLayouting ((int)LayoutingType.Height);\r
-                                               else\r
-                                                       child.RegisterForLayouting ((int)LayoutingType.Y);\r
-                                       }\r
-\r
-                                       LastSlots.Height = Slot.Height;\r
-                                       break;\r
+                                               child.RegisterForLayouting ((int)LayoutingType.Y);\r
                                }\r
-\r
-                               //if no layouting remains in queue for item, registre for redraw\r
-                               if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0)\r
-                                       this.RegisterForRedraw ();\r
-                       }               \r
+                               break;\r
+                       }                                                       \r
                }\r
 \r
+//             public override void RegisterForLayouting(int layoutType)\r
+//             {\r
+//                     Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);\r
+//\r
+//                     if ((layoutType & (int)LayoutingType.Width) > 0) {\r
+//                             if (Bounds.Width == 0) //stretch in parent\r
+//                                     Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
+//                             else //fit ou fixed\r
+//                                     Interface.LayoutingQueue.Enqueue (LayoutingType.Width, this);\r
+//                     }\r
+//\r
+//                     if ((layoutType & (int)LayoutingType.Height) > 0) {\r
+//                             if (Bounds.Height == 0) //stretch in parent\r
+//                                     Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
+//                             else//fit ou fixed\r
+//                                     Interface.LayoutingQueue.Enqueue (LayoutingType.Height, this);\r
+//                     }\r
+//\r
+//                     if ((layoutType & (int)LayoutingType.X) > 0)\r
+//                             //for x positionning, sizing of parent and this have to be done\r
+//                             Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.X, this);\r
+//\r
+//                     if ((layoutType & (int)LayoutingType.Y) > 0)\r
+//                             //for x positionning, sizing of parent and this have to be done\r
+//                             Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this);\r
+//\r
+//             }\r
+\r
                public override Rectangle ContextCoordinates (Rectangle r)\r
                {\r
                        return\r
index 04e63d15b2553a3c08fc81796134cf388b02192e..f34e13d394bb1c96850b846e47aefa7b66636ecc 100644 (file)
@@ -24,8 +24,9 @@ namespace go
 \r
                public override T addChild<T> (T child)\r
                {\r
+                       T tmp = base.addChild (child);\r
                        this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
-                       return base.addChild (child);\r
+                       return tmp;\r
                }\r
                public override void removeChild (GraphicObject child)\r
                {\r
@@ -96,17 +97,7 @@ namespace go
                                }\r
                        }\r
                }\r
-//             public void RegisterForLayouting ()\r
-//             {\r
-//                     base.RegisterForLayouting ();\r
-//\r
-//                     int idx = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where (lq => lq.GraphicObject.Parent == this).LastOrDefault ());\r
-//                     if (idx < 0)\r
-//                             return;\r
-//                     Interface.LayoutingQueue.Insert (\r
-//                             idx+1,\r
-//                             new LayoutingQueueItem (LayoutingType.PositionChildren, this));\r
-//             }\r
+\r
                public override void RegisterForLayouting (int layoutType)\r
                {                       \r
                        base.RegisterForLayouting (layoutType);\r
old mode 100755 (executable)
new mode 100644 (file)
index 9317f40..a7b9e93
@@ -66,49 +66,6 @@ namespace go
                        get { return _parent; }\r
                        set { _parent = value; }\r
                }\r
-               [XmlIgnore]public virtual bool SizeIsValid {\r
-                       get { return hIsValid & wIsValid; }\r
-                       set {\r
-                               hIsValid = value;\r
-                               wIsValid = value;\r
-                       }\r
-               }\r
-               [XmlIgnore]public virtual bool WIsValid {\r
-                       get { return wIsValid; }\r
-                       set { wIsValid = value; }\r
-               }\r
-               [XmlIgnore]public virtual bool HIsValid {\r
-                       get { return hIsValid; }\r
-                       set { hIsValid = value; }\r
-               }\r
-               [XmlIgnore]public virtual bool XIsValid {\r
-                       get { return xIsValid; }\r
-                       set { xIsValid = value; }\r
-               }\r
-               [XmlIgnore]public virtual bool YIsValid {\r
-                       get { return yIsValid; }\r
-                       set { yIsValid = value; }\r
-               }\r
-               [XmlIgnore]public virtual bool PositionIsValid {\r
-                       get { return xIsValid & yIsValid; }\r
-                       set {\r
-                               xIsValid = value;\r
-                               yIsValid = value;\r
-                       }\r
-               }\r
-               [XmlIgnore]public virtual bool LayoutIsValid {\r
-                       get { return SizeIsValid & PositionIsValid; }\r
-                       set {\r
-                               if (value == SizeIsValid & PositionIsValid)\r
-                                       return;\r
-\r
-                               SizeIsValid = value;\r
-                               PositionIsValid = value;\r
-\r
-                               //if (!layoutIsValid && Parent != null)\r
-                               //    Parent.layoutIsValid = false;\r
-                       }\r
-               }\r
                [XmlIgnore]public virtual Rectangle ClientRectangle {\r
                        get {\r
                                Rectangle cb = Slot.Size;\r
@@ -119,11 +76,6 @@ namespace go
                [XmlIgnore]public virtual IGOLibHost TopContainer {\r
                        get { return Parent == null ? null : Parent.TopContainer; }\r
                }\r
-               public virtual void InvalidateLayout ()\r
-               {\r
-                       bmp = null;\r
-                       LayoutIsValid = false;\r
-               }\r
                public virtual Rectangle ContextCoordinates(Rectangle r){\r
                        return\r
                                Parent.ContextCoordinates (r);// + ClientRectangle.Position;\r
@@ -190,7 +142,7 @@ namespace go
 \r
                                Bounds.X = value;\r
 \r
-                               Interface.LayoutingQueue.Enqueue (LayoutingType.X, this);\r
+                               this.RegisterForLayouting ((int)LayoutingType.X);\r
                        }\r
                }\r
                [XmlAttributeAttribute()][DefaultValue(0)]\r
@@ -202,7 +154,7 @@ namespace go
 \r
                                Bounds.Y = value;\r
 \r
-                               Interface.LayoutingQueue.Enqueue (LayoutingType.Y, this);\r
+                               this.RegisterForLayouting ((int)LayoutingType.Y);\r
                        }\r
                }\r
                [XmlAttributeAttribute()][DefaultValue(0)]\r
@@ -214,7 +166,7 @@ namespace go
 \r
                                Bounds.Width = value;\r
 \r
-                               InvalidateLayout ();\r
+                               this.RegisterForLayouting ((int)LayoutingType.Width);\r
                        }\r
                }\r
                [XmlAttributeAttribute()][DefaultValue(0)]\r
@@ -226,7 +178,7 @@ namespace go
 \r
                                Bounds.Height = value;\r
 \r
-                               InvalidateLayout ();\r
+                               this.RegisterForLayouting ((int)LayoutingType.Height);\r
                        }\r
                }\r
                [XmlAttributeAttribute()][DefaultValue(false)]\r
@@ -237,7 +189,6 @@ namespace go
                                        return;\r
 \r
                                Bounds.Width = Bounds.Height = -1;\r
-                               InvalidateLayout ();\r
                        }\r
                }\r
                [XmlAttributeAttribute()][DefaultValue(false)]\r
@@ -399,19 +350,36 @@ namespace go
 \r
                public virtual void RegisterForLayouting(int layoutType)\r
                {\r
+                       if (Parent == null)\r
+                               return;\r
+                       \r
                        Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);\r
 \r
                        if ((layoutType & (int)LayoutingType.Width) > 0) {\r
+\r
+                               //force sizing to fit if parent is sizing on children\r
+                               if (Parent.getBounds ().Width < 0 && Width == 0)\r
+                                       Width = -1;\r
+                               \r
                                if (Bounds.Width == 0) //stretch in parent\r
                                        Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
-                               else //fit ou fixed\r
+                               else if (Bounds.Width < 0) //fit \r
+                                       Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Width, this);                         \r
+                               else\r
                                        Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));\r
                        }\r
 \r
                        if ((layoutType & (int)LayoutingType.Height) > 0) {\r
+\r
+                               //force sizing to fit if parent is sizing on children\r
+                               if (Parent.getBounds ().Height < 0 && Height == 0)\r
+                                       Height = -1;\r
+\r
                                if (Bounds.Height == 0) //stretch in parent\r
                                        Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
-                               else//fit ou fixed\r
+                               else if (Bounds.Height < 0) //fit \r
+                                       Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Height, this);\r
+                               else\r
                                        Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));\r
                        }\r
 \r
@@ -425,42 +393,31 @@ namespace go
                        \r
                }\r
 \r
-//             public virtual void RegisterForLayouting()\r
-//             {\r
-//                     //clear previous layouting for item\r
-//                     Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this);\r
-//\r
-//                     if (Bounds.Width == 0) { //stretch in parent\r
-//                             int idxParentW = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Width).FirstOrDefault());\r
-//                             if (idxParentW < 0)\r
-//                                     Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));\r
-//                             else//insert after parent sizing\r
-//                                     Interface.LayoutingQueue.Insert (idxParentW + 1, new LayoutingQueueItem (LayoutingType.Width, this));\r
-//                     } else {//fit ou fixed\r
-//                             Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));\r
-//                             //for x positionning, sizing of obj and parent have to be done\r
-////                           int idxParentW = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Width).FirstOrDefault());\r
-////                           if (idxParentW < 0)\r
-////                                   Interface.LayoutingQueue.Insert (1, new LayoutingQueueItem (LayoutingType.X, this));\r
-////                           else//insert after parent sizing\r
-////                                   Interface.LayoutingQueue.Insert (idxParentW + 1, new LayoutingQueueItem (LayoutingType.X, this));\r
-//                     }\r
-//                     if (Bounds.Height == 0) { //stretch\r
-//                             int idxParentH = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Height).FirstOrDefault());\r
-//                             if (idxParentH < 0)\r
-//                                     Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));\r
-//                             else\r
-//                                     Interface.LayoutingQueue.Insert (idxParentH + 1, new LayoutingQueueItem (LayoutingType.Height, this));\r
-//                     } else {\r
-//                             Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));\r
-////                           int idxParentH = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Height).FirstOrDefault());\r
-////                           if (idxParentH < 0)\r
-////                                   Interface.LayoutingQueue.Insert (1, new LayoutingQueueItem (LayoutingType.Y, this));\r
-////                           else//insert after parent sizing\r
-////                                   Interface.LayoutingQueue.Insert (idxParentH + 1, new LayoutingQueueItem (LayoutingType.Y, this));\r
-//                     }\r
-//             }\r
-//\r
+               protected virtual void OnLayoutChanges(LayoutingType  layoutType)\r
+               {\r
+                       switch (layoutType) {\r
+                       case LayoutingType.Width:                               \r
+                               if (Parent.getBounds ().Width < 0)\r
+                                       this.Parent.RegisterForLayouting ((int)LayoutingType.Width);\r
+                               else if (Width != 0) //update position in parent\r
+                                       this.RegisterForLayouting ((int)LayoutingType.X);\r
+                               if (!(Parent is GenericStack))\r
+                                       break;\r
+                               if ((Parent as GenericStack).Orientation == Orientation.Horizontal)\r
+                                       this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
+                               break;\r
+                       case LayoutingType.Height:\r
+                               if (Parent.getBounds().Height < 0)\r
+                                       this.Parent.RegisterForLayouting((int)LayoutingType.Height);\r
+                               else if (Height != 0) //update position in parent\r
+                                       this.RegisterForLayouting ((int)LayoutingType.Y);\r
+                               if (!(Parent is GenericStack))\r
+                                       break;\r
+                               if ((Parent as GenericStack).Orientation == Orientation.Vertical)\r
+                                       this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
+                               break;\r
+                       }                       \r
+               }\r
                public virtual void UpdateLayout (LayoutingType layoutType)\r
                {                       \r
                        switch (layoutType) {\r
@@ -479,9 +436,14 @@ namespace go
                                        }\r
                                } else\r
                                        Slot.X = Bounds.X;\r
+\r
                                if (LastSlots.X == Slot.X)\r
                                        break;\r
-                               //register layouting here for objects depending on this.x\r
+\r
+                               bmp = null;\r
+\r
+                               OnLayoutChanges (layoutType);\r
+\r
                                LastSlots.X = Slot.X;\r
                                break;\r
                        case LayoutingType.Y:\r
@@ -499,9 +461,14 @@ namespace go
                                        }\r
                                }else\r
                                        Slot.Y = Bounds.Y;\r
+\r
                                if (LastSlots.Y == Slot.Y)\r
                                        break;\r
-                               //register layouting here for objects depending on this.x\r
+\r
+                               bmp = null;\r
+\r
+                               OnLayoutChanges (layoutType);\r
+\r
                                LastSlots.Y = Slot.Y;\r
                                break;\r
                        case LayoutingType.Width:                               \r
@@ -514,11 +481,10 @@ namespace go
 \r
                                if (LastSlots.Width == Slot.Width)\r
                                        break;\r
-                               \r
-                               if (Parent.getBounds().Width < 0)\r
-                                       this.Parent.RegisterForLayouting((int)LayoutingType.Width);\r
-                               else if (Width != 0) //update position in parent\r
-                                       this.RegisterForLayouting ((int)LayoutingType.X);\r
+\r
+                               bmp = null;\r
+\r
+                               OnLayoutChanges (layoutType);\r
 \r
                                LastSlots.Width = Slot.Width;\r
                                break;\r
@@ -533,10 +499,9 @@ namespace go
                                if (LastSlots.Height == Slot.Height)\r
                                        break;\r
 \r
-                               if (Parent.getBounds().Height < 0)\r
-                                       this.Parent.RegisterForLayouting((int)LayoutingType.Height);\r
-                               else if (Height != 0) //update position in parent\r
-                                       this.RegisterForLayouting ((int)LayoutingType.Y);\r
+                               bmp = null;\r
+\r
+                               OnLayoutChanges (layoutType);\r
 \r
                                LastSlots.Height = Slot.Height;\r
                                break;\r
@@ -569,6 +534,7 @@ namespace go
                                        onDraw (gr);\r
                                }\r
                                draw.Flush ();\r
+                               //draw.WriteToPng ("/mnt/data/test.png");\r
                        }\r
                }\r
                        \r
index e1639533c064041cf915cf79872e5e3251ddf1e4..7b63156fcd0cbed6e6349257677dfc89d27d7b8f 100644 (file)
@@ -46,6 +46,7 @@ namespace go
             child.Parent = null;\r
                        this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
         }\r
+\r
                public void putWidgetOnTop(GraphicObject w)\r
                {\r
                        if (Children.Contains(w))\r
@@ -104,12 +105,6 @@ namespace go
                        }\r
                        return false;\r
                }\r
-               public override void InvalidateLayout()\r
-               {\r
-                       base.InvalidateLayout();\r
-                       foreach (GraphicObject w in Children)\r
-                               w.InvalidateLayout();\r
-               }\r
                protected override Size measureRawSize ()\r
                {\r
                        Size tmp = new Size ();\r
@@ -125,39 +120,7 @@ namespace go
                        return tmp;\r
                }\r
 \r
-//             public override void UpdateLayout (LayoutingType layoutType)\r
-//             {\r
-//                     if (LayoutIsValid)\r
-//                             return;\r
-//\r
-//                     bool atLeastOneChildHasWNotDependingOnParent = false;\r
-//                     bool atLeastOneChildHasHNotDependingOnParent = false;\r
-//\r
-////                   foreach (GraphicObject c in Children) {\r
-////                           if (c.LayoutIsValid)\r
-////                                   continue;\r
-////\r
-////                           if (Width < 0 && c.WIsValid) {\r
-////                                   if (!atLeastOneChildHasWNotDependingOnParent && !(this is GenericStack))\r
-////                                           c.XIsValid = true;\r
-////                                   atLeastOneChildHasWNotDependingOnParent = true;\r
-////                           }\r
-////                           if (Height < 0 && c.HIsValid) {\r
-////                                   if (!atLeastOneChildHasHNotDependingOnParent && !(this is GenericStack))\r
-////                                           c.YIsValid = true;\r
-////                                   atLeastOneChildHasHNotDependingOnParent = true;\r
-////                           }\r
-////\r
-////                           c.UpdateLayout ();\r
-////                   }\r
-//\r
-////                   if (Width < 0 && !atLeastOneChildHasWNotDependingOnParent)\r
-////                           Debug.WriteLine ("ERROR: no child has fixed width and parent width is set to content!");\r
-////                   if (Height < 0 && !atLeastOneChildHasHNotDependingOnParent)\r
-////                           Debug.WriteLine ("ERROR: no child has fixed height and parent height is set to content!");\r
-//\r
-//                     //base.UpdateLayout ();\r
-//             }\r
+\r
 \r
                public override Rectangle ContextCoordinates(Rectangle r){\r
                        return r + ClientRectangle.Position;\r
@@ -246,15 +209,15 @@ namespace go
                }\r
                #endregion\r
                                \r
-        public override string ToString()\r
-        {\r
-            string tmp = base.ToString();\r
-            foreach (GraphicObject w in Children)\r
-            {\r
-                tmp += "\n" + w.ToString();\r
-            }\r
-            return tmp;\r
-        }\r
+//        public override string ToString()\r
+//        {\r
+//            string tmp = base.ToString();\r
+//            foreach (GraphicObject w in Children)\r
+//            {\r
+//                tmp += "\n" + w.ToString();\r
+//            }\r
+//            return tmp;\r
+//        }\r
 \r
                #region IXmlSerializable\r
 \r
index ee62a266584054042436d610ce4e01ab46dd5251..1f6048d19ce7211671510979a1e6bc55e72e6f3a 100755 (executable)
@@ -86,7 +86,8 @@ namespace go
                     return;\r
                                                        \r
                 registerForGraphicUpdate();\r
-                InvalidateLayout();\r
+                               this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
+\r
 \r
                 _text = value;\r
 \r
index 51a3fdc5348f3843f7cb55b1d10e781aadb39174..93aadc84885a46e02fac74a60d939041aafb0857 100644 (file)
@@ -43,8 +43,6 @@ namespace go
 
                                _minValue = value;
 
-                               LayoutIsValid = false;
-                               registerForGraphicUpdate ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(10.0)]
@@ -57,8 +55,6 @@ namespace go
 
                                _maxValue = value;
 
-                               LayoutIsValid = false;
-                               registerForGraphicUpdate ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(0.5)]
@@ -71,8 +67,6 @@ namespace go
 
                                _smallStep = value;
 
-                               LayoutIsValid = false;
-                               registerForGraphicUpdate ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(2.0)]
@@ -85,8 +79,6 @@ namespace go
 
                                _bigStep = value;
 
-                               LayoutIsValid = false;
-                               registerForGraphicUpdate ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(0)]
index 6855e9246019bdab8d3a001153b6f35347324b60..19b93cd878156ef4be59d02970dd199ec568a27e 100644 (file)
@@ -115,8 +115,8 @@ namespace go
                {\r
                        TopContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));\r
                }\r
-               public override void UpdateLayout (LayoutingType layoutType)\r
-               {\r
+//             public override void UpdateLayout (LayoutingType layoutType)\r
+//             {\r
 //                     base.UpdateLayout ();\r
 //\r
 //                     if (!LayoutIsValid)\r
@@ -130,7 +130,7 @@ namespace go
 //                             child.Slot.Y = 0;\r
 //                     if (HorizontalScrolling)\r
 //                             child.Slot.X = 0;\r
-               }\r
+               //}\r
                public override void Paint(ref Cairo.Context ctx, Rectangles clip = null)\r
                {\r
                        if (!Visible)//check if necessary??\r
index 142a30794066202a78e79aad8c5a8b31aef496a9..2d96788ff3c280830a1d72703392e46af4a08ed7 100644 (file)
@@ -43,6 +43,17 @@ namespace go
 
                        Interface.LayoutingQueue.Insert (idxParentSz + 1, lqi);                 
                }
+               public void EnqueueBeforeParentSizing (LayoutingType _lt, ILayoutable _object)
+               {
+                       LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object);
+                       int idxParentSz = Interface.LayoutingQueue.IndexOf 
+                               (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == _object.Parent && lq.LayoutType == _lt).FirstOrDefault());
+
+                       if (idxParentSz < 0)
+                               Interface.LayoutingQueue.Enqueue (_lt, _object);
+                       else
+                               Interface.LayoutingQueue.Insert (idxParentSz, lqi);                     
+               }
                public void EnqueueAfterThisAndParentSizing (LayoutingType _lt, ILayoutable _object)
                {
                        LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object);
index e1d21792790b0f06f05b01b68a79d8b6e351815e..b028fb83be76f7cce1169893a10c5a35b8829000 100644 (file)
@@ -47,7 +47,7 @@ namespace go
                }
                public void ProcessLayouting()
                {
-                       Debug.WriteLine ("Layouting => " + this.ToString ());
+                       //Debug.WriteLine ("Layouting => " + this.ToString ());
                        try {
                                GraphicObject.UpdateLayout (LayoutType);
                        } catch (Exception ex) {