]> O.S.I.I.S - jp/crow.git/commitdiff
- GraphicTree parsing bindings in templates instead of using
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 13 Oct 2015 14:57:26 +0000 (16:57 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 13 Oct 2015 14:57:26 +0000 (16:57 +0200)
datasource which could be kept for other uses
- ListBox bindings debug
- LogicalParent for Popper to get correct DataSource for content

26 files changed:
Templates/Checkbox.goml
Templates/Combobox.goml
Templates/ComboboxOverlay.goml
Templates/Expandable.goml
Templates/Groupbox.goml
Templates/Listbox.goml
Templates/MessageBox.goml
Templates/Popper.goml
Templates/RadioButton.goml
Templates/Scrollbar.goml
Templates/Spinner.goml
Templates/Window.goml
Tests/GOLIBTests.cs
Tests/Interfaces/testCheckbox.goml
Tests/Interfaces/testExpandable.goml
Tests/Interfaces/testPopper.goml
Tests/Interfaces/test_Listbox.goml
src/CompilerServices/CompilerServices.cs
src/GraphicObjects/Combobox.cs
src/GraphicObjects/Expandable.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/ListBox.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/TemplatedContainer.cs
src/GraphicObjects/TemplatedControl.cs
src/Interface.cs

index 44e66817567c1cdee9f179e87841c869a1da3735..80ec112db91b896a1590e792f38698d67795d977 100755 (executable)
@@ -1,5 +1,9 @@
 <?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-       <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
-       <Label Text="{Caption}" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">\r
+       <Image Margin="2" Width="14" Height="14" Path="{../../Image}"  SvgSub="{../../SvgSub}"/>\r
+       <Label Text="{../../Caption}" Height="80" Width="200"/>\r
+</HorizontalStack>-->\r
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+       <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+       <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
 </HorizontalStack>
\ No newline at end of file
index 2182404936f2442dd18be94476341fc772e04eca..9abd6361ed80d003fa263b07bb705a73f36e889b 100755 (executable)
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>\r
-<Border CornerRadius="0" BorderColor="LightGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-       <HorizontalStack Margin="1" Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-               <Label Margin="1" Foreground="Black" Background="White" Text="{Text}" \r
-                       Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+<Border CornerRadius="0" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+       <HorizontalStack Margin="1" Spacing="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <Label Margin="1" Foreground="Black" Background="White" Text="{../../../Text}" \r
+                       Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
                <Button Width="14" Height="14" >\r
                        <Image Margin="0"  Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
                </Button>\r
index 349be3017edf268c3b2305648b0ca5025cc77d67..4665846fc09e51a51cbc71dae233d60ab5b2e04b 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
        <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
-               Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-               <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
        </Scroller>\r
 </Border>
\ No newline at end of file
index 1f3c5281e67625740399895429b7189747ceb7c8..4e9a85407e4134db01c9a45b522f2c47dc198f8c 100755 (executable)
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}" \r
-               MouseClick="onMouseClick">\r
-       <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-               <HorizontalStack Spacing="1" Height="-1" Width="{TemplatedWidth}">\r
-                       <Image Margin="2" Width="12" Height="12" Path="{Image}" SvgSub="{SvgSub}"/>\r
-                       <Label Text="{Title}" Width="{TemplatedWidth}"/>\r
+<Border BorderWidth="1" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" \r
+               MouseClick="../onMouseClick">\r
+       <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <HorizontalStack Spacing="1" Height="-1" Width="{../../../TemplatedWidth}">\r
+                       <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../SvgSub}"/>\r
+                       <Label Text="{../../../../Title}" Width="{../../../../TemplatedWidth}"/>\r
                </HorizontalStack>\r
-               <Container Name="Content" Visible="false" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+               <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
        </VerticalStack>\r
 </Border>
\ No newline at end of file
index d804aab8d7103a2e0cd2b98c9ba3d044a5ac1ff5..789cd60fc7ba366a0ed1a2d93389b9bc9a0f3265 100755 (executable)
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
-<Group Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+<Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
        <Border CornerRadius="5" BorderWidth="1" Margin="6"
-               Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
                <Container Name="Content" Margin="10"
-                               Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>
+                               Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
        </Border>
-       <Label Text="{Title}" VerticalAlignment="Top" Left="15"
+       <Label Text="{../../Title}" VerticalAlignment="Top" Left="15"
                Background="Clear" Margin="1"/>
 </Group>
\ No newline at end of file
index 5092258523a5a747368b3fd6b9594766dea6b8a1..28241e27b44c4db4af1528de13246a70b578b2b5 100755 (executable)
@@ -2,9 +2,9 @@
 <!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
        <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
 </Border>-->\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
        <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
-               Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-               <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
        </Scroller>\r
 </Border>
\ No newline at end of file
index 6488deb9265582d4b082ef1fb113a14eca636c8e..e2eccd717e33a512d0ae599ad0a6752d26ee7b59 100644 (file)
@@ -1,27 +1,27 @@
 <?xml version="1.0"?>
-<Border Height="{TemplatedHeight}" Width="{TemplatedWidth}" BorderWidth="1" BorderColor="White" CornerRadius="10" >
-       <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="0,4;0,4;0,4;0,4">
-               <Border BorderWidth="1" BorderColor="White" Width="{TemplatedWidth}" Height="-1" 
+<Border Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" BorderWidth="1" BorderColor="White" CornerRadius="10" >
+       <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" Background="0,4;0,4;0,4;0,4">
+               <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1" 
                                Background="0,1;0,5;1,0;0,5">
-                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{TemplatedWidth}" Height="-1" >
+                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >
                                <GraphicObject Width="5" Height="5"/>
-                               <Image Margin="1" Width="12" Height="12" Path="{Icon}"/>
-                               <Label Foreground="White" Width="{TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{Title}" />
+                               <Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
+                               <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />
                                <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent"  Height="12" Width="12"
                                        MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
                                        <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"
-                                                MouseClick="butQuitPress"/>
+                                                MouseClick="../../../../../../butQuitPress"/>
                                </Border>
                                <GraphicObject Width="5" Height="5"/>
                        </HorizontalStack>
                </Border>
-               <HorizontalStack Spacing="10" Margin="10" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
+               <HorizontalStack Spacing="10" Margin="10" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}">
                        <Image Name="Image" Width="32" Height="32"
                                Path="#go.Images.Icons.iconInfo.svg" />
-                       <TextRun Font="serif, 12" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Text="{Message}"
+                       <TextRun Font="serif, 12" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Text="{../../../../Message}"
                                Multiline="true" WordWrap="true"/>              
                </HorizontalStack>
-               <HorizontalStack Height="-1" Width="{TemplatedWidth}" Margin="5">
+               <HorizontalStack Height="-1" Width="{../../../TemplatedWidth}" Margin="5">
                        <GraphicObject Height="5"/>
                        <Button Text="Ok"/>
                        <Button Text="Cancel"/>
index 534c677f29e5bea7fd07f9a540c34f3ee6607e00..472fe1833468fa4f3ac093467135503fca5b835b 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{TemplatedWidth}" MouseClick="onMouseClick">\r
-       <HorizontalStack Spacing="1" Height="-1"  Width="{TemplatedWidth}">\r
-               <Image Margin="2" Width="12" Height="12" Path="{Image}" SvgSub="{SvgSub}"/>\r
-               <Label Text="{Title}"  Width="{TemplatedWidth}"/>\r
+<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">\r
+       <HorizontalStack Spacing="1" Height="-1"  Width="{../../TemplatedWidth}">\r
+               <Image Margin="2" Width="12" Height="12" Path="{../../../Image}" SvgSub="{../../../SvgSub}"/>\r
+               <Label Text="{../../../Title}"  Width="{../../../TemplatedWidth}"/>\r
        </HorizontalStack>\r
 </Border>
\ No newline at end of file
index 44e66817567c1cdee9f179e87841c869a1da3735..94b78e244343e7acab8bdace65cfb505a47f217e 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-       <Image Margin="2" Width="14" Height="14" Path="{Image}" SvgSub="{SvgSub}"/>\r
-       <Label Text="{Caption}" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+       <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+       <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
 </HorizontalStack>
\ No newline at end of file
index 0fe9da3d75adb0b04ec0e11a12e0e0328001363e..8dcadc64926096500782a1de241d445ecc65848d 100755 (executable)
@@ -1,14 +1,14 @@
 <?xml version="1.0"?>\r
 <Border BorderWidth="1" BorderColor="LightGray">\r
-       <GenericStack Orientation="{Orientation}" Width="0" Height="0">\r
-               <Button Width="12" Height="12" MouseClick="onScrollBack">\r
-                       <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>\r
+       <GenericStack Orientation="{../../Orientation}" Width="0" Height="0">\r
+               <Button Width="12" Height="12" MouseClick="../../../onScrollBack">\r
+                       <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="../../../../up"/>\r
                </Button>\r
-               <Slider Name="Slider" Value="{Scroll}" Maximum="{MaximumScroll}" \r
-                       Width="{Width}" Height="{Height}" Orientation="{Orientation}"\r
-                       ValueChanged="onSliderValueChange"/>\r
-               <Button Width="12" Height="12" MouseClick="onScrollForth">\r
-                       <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
+               <Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}" \r
+                       Width="{../../../Width}" Height="{../../../Height}" Orientation="{../../../Orientation}"\r
+                       ValueChanged="../../../onSliderValueChange"/>\r
+               <Button Width="12" Height="12" MouseClick="../../../onScrollForth">\r
+                       <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="../../../../down"/>\r
                </Button>\r
        </GenericStack>\r
 </Border>
\ No newline at end of file
index f9bc82b1e7d723cfd804555676ae74d2930966a0..ddfa499105991e8d91170e8cafe32f14200054db 100755 (executable)
@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="White">
-       <HorizontalStack Name="hstack" Margin="0" Spacing="2" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
-               <Label Foreground="DimGray" Height="{TemplatedHeight}" Width="{TemplatedWidth}" 
-                       Text="{Value}" Margin="1" TextAlignment="RightCenter"/>
-               <VerticalStack Width="-1" Height="{TemplatedHeight}" Spacing="1" >
-                       <Button Width="12" Height="8" MouseClick="onUp">
+<Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="White">
+       <HorizontalStack Name="hstack" Margin="0" Spacing="2" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+               <Label Foreground="DimGray" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}" 
+                       Text="{../../../Value}" Margin="1" TextAlignment="RightCenter"/>
+               <VerticalStack Width="-1" Height="{../../../TemplatedHeight}" Spacing="1" >
+                       <Button Width="12" Height="8" MouseClick="../../../../onUp">
                                <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>
                        </Button>
-                       <Button Width="12" Height="8" MouseClick="onDown">
+                       <Button Width="12" Height="8" MouseClick="../../../../onDown">
                                <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>
                        </Button>
                </VerticalStack>
index d6f08cde05f33de82d3d65af7267532e2236ceb1..97bad4ce635869536dd758b480fe4704139e477e 100755 (executable)
@@ -1,20 +1,20 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-       <VerticalStack Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
-               <Border BorderWidth="1" BorderColor="White" Width="{TemplatedWidth}" Height="-1" \r
+<Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+       <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1" \r
                                Background="0,1;0,5;1,0;0,5">\r
-                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{TemplatedWidth}" Height="-1" >\r
+                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >\r
                                <GraphicObject Width="5"/>\r
-                               <Image Margin="1" Width="12" Height="12" Path="{Icon}"/>\r
-                               <Label Foreground="White" Width="{TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{Title}" />\r
+                               <Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>\r
+                               <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />\r
                                <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent"  Height="12" Width="12"\r
                                        MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
                                        <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"\r
-                                                MouseClick="butQuitPress"/>\r
+                                                MouseClick="../../../../../../butQuitPress"/>\r
                                </Border>\r
                                <GraphicObject Width="5"/>\r
                        </HorizontalStack>\r
                </Border>\r
-               <Container Name="Content" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
+               <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
        </VerticalStack>\r
 </Border>
\ No newline at end of file
index 13576b241f07bdecfef0e74883afc863dc74e0a7..5fcbbc386358a2a8ca2aad6645d260e4c2748e81 100644 (file)
@@ -34,6 +34,8 @@ namespace test
                int frameCpt = 0;\r
                int idx = 0;\r
                string[] testFiles = {\r
+                       "test_Listbox.goml",\r
+                       "testCombobox.goml",\r
                        "fps.goml",\r
                        "testCheckbox.goml",\r
                        "testExpandable.goml",\r
@@ -48,7 +50,6 @@ namespace test
                        "testMsgBox.goml",\r
                        "testGrid.goml",\r
                        "testMeter.goml",\r
-//                     "testCombobox.goml",\r
 //                     "test4.goml",\r
                };\r
 \r
@@ -101,7 +102,8 @@ namespace test
                        base.OnLoad (e);\r
                        //this.AddWidget(new test4());\r
 \r
-                       LoadInterface("Interfaces/" + testFiles[idx]);\r
+                       GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);\r
+                       obj.DataSource = this;\r
                }\r
                protected override void OnUpdateFrame (FrameEventArgs e)\r
                {\r
@@ -128,7 +130,8 @@ namespace test
                        if (idx == testFiles.Length)\r
                                idx = 0;\r
                        this.Title = testFiles [idx];\r
-                       LoadInterface("Interfaces/" + testFiles[idx]);\r
+                       GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);\r
+                       obj.DataSource = this;\r
 \r
                }\r
 \r
index 999d79f91395b061e57cff3c15589ff441323c02..966455e6dd70b5071d34b23edbdfaf9990867616 100755 (executable)
@@ -1,3 +1,3 @@
 <?xml version="1.0"?>\r
-<Checkbox Width="100" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>\r
+<Checkbox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="false"/>\r
 \r
index 5cae7ae60f50db2d4a3d4342f519ac15b747752d..35cf3d64e1d9862f68d2d000e25e3aa6d8993765 100755 (executable)
@@ -5,5 +5,9 @@
                        <Checkbox Name="chk2" IsChecked="true"/>\r
                        <Checkbox Name="chk3"/>\r
                        <Checkbox Name="chk4"/>\r
+                       <HorizontalStack Fit="true" Margin="20">\r
+                               <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>\r
+                               <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
+                       </HorizontalStack>\r
                </VerticalStack>\r
 </Expandable>\r
index 4c6ba76bf5488e0bbc2c712ab955b405d6651613..3686599a78242d844a923dadb049a57189964e77 100755 (executable)
@@ -7,6 +7,10 @@
                        <Checkbox Name="chk2" IsChecked="true"/>\r
                        <Checkbox Name="chk3"/>\r
                        <Checkbox Name="chk4"/>\r
+                       <HorizontalStack Fit="true" Margin="20">\r
+                               <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>\r
+                               <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
+                       </HorizontalStack>\r
                </VerticalStack>        \r
        </Border>\r
 </Popper>\r
index b132a87e47b1227f1360e90a95dbde9731222246..9f7645ab2605e07c7344e31551127461b70259b2 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>\r
 <!--<ListBox Data="{TestList}" Focusable="true"/>-->\r
 <ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"\r
-                        HorizontalAlignment="Left" Width="0" Height="0" Margin="50">\r
+                        HorizontalAlignment="Left" Width="-1" Height="-1" Margin="50">\r
 <!--   <Template>\r
                <Border BorderWidth="1" Margin="1" MinimumSize="100;100" Width="0" Height="0" >\r
                        <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true" \r
                        </Scroller>\r
                </Border>\r
        </Template>-->\r
-       <Template>\r
+<!--   <Template>\r
                <Border BorderWidth="1" Margin="1" MinimumSize="100;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" >\r
                        <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true" \r
                                Height="{TemplatedHeight}" Width="{TemplatedWidth}">\r
                                <VerticalStack Height="-1" Width="{TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
                        </Scroller>\r
                </Border>\r
-       </Template>\r
+       </Template>-->\r
 </ListBox>\r
 \r
index c72137df37c0e920e2f2d2a8bc90978265136a33..e739538390864516a4c2132bb527364a0994aeff 100644 (file)
@@ -29,6 +29,8 @@ namespace go
                }
                public bool FindMember(string _memberName)
                {
+                       if (Instance == null)
+                               return false;
                        Type t = Instance.GetType ();
                        Member = t.GetMember (_memberName,BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).FirstOrDefault ();
 
@@ -79,7 +81,7 @@ namespace go
 
                        //if binding exp = '{}' => binding is done on datasource
                        if (string.IsNullOrEmpty (Expression)) {
-                               Target = new MemberReference (Source.Instance);
+                               Target = new MemberReference ((Source.Instance as GraphicObject).DataSource);
                                return true;
                        }
 
@@ -101,7 +103,7 @@ namespace go
                                        if (tmp == null)
                                                return false;
                                        if (bindingExp [ptr] == "..")
-                                               tmp = tmp.Parent as GraphicObject;
+                                               tmp = tmp.Parent as ILayoutable;
                                        else if (bindingExp [ptr] == ".") {
                                                if (ptr > 0)
                                                        throw new Exception ("Syntax error in binding, './' may only appear in first position");                                                
@@ -111,6 +113,9 @@ namespace go
                                        ptr++;
                                }
 
+                               if (tmp == null)
+                                       return false;
+
                                string[] bindTrg = bindingExp [ptr].Split ('.');
 
                                if (bindTrg.Length == 1)
index 0204057011f569e5d6eafa0b61063fa83f83377e..3e841793e3e80223abe69e69e08c1b72880456bf 100644 (file)
@@ -22,7 +22,7 @@ namespace go
 {\r
        [DefaultTemplate("#go.Templates.Combobox.goml")]\r
        [DefaultOverlayTemplate("#go.Templates.ComboboxOverlay.goml")]\r
-       public class Combobox : TemplatedContainer\r
+       public class Combobox : TemplatedControl\r
     {          \r
                #region CTOR\r
                public Combobox() : base(){     }       \r
@@ -48,21 +48,22 @@ namespace go
                        base.loadTemplate (template);\r
                        loadOverlayTemplate (null);\r
                }\r
-               public override GraphicObject Content {\r
-                       get {\r
-                               throw new NotImplementedException ();\r
-                       }\r
-                       set {\r
-                               throw new NotImplementedException ();\r
-                       }\r
-               }\r
+//             public override GraphicObject Content {\r
+//                     get {\r
+//                             throw new NotImplementedException ();\r
+//                     }\r
+//                     set {\r
+//                             throw new NotImplementedException ();\r
+//                     }\r
+//             }\r
                #endregion\r
 \r
                protected virtual void loadOverlayTemplate(GraphicObject overlayTemplate)\r
                {\r
                        if (overlayTemplate == null) {\r
                                DefaultOverlayTemplate dt = (DefaultOverlayTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultOverlayTemplate), true).FirstOrDefault ();\r
-                               Overlay = Interface.Load (dt.Path, this, !Interface.DontResoveGOML);\r
+                               Overlay = Interface.Load (dt.Path);\r
+                               Overlay.ResolveBindings ();\r
                        } else\r
                                Overlay = overlayTemplate;\r
                        _list = Overlay.FindByName ("List") as Group;\r
@@ -173,8 +174,9 @@ namespace go
                        lock (pendingChildrenAddition) {\r
                                if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)\r
                                        return;\r
-                               while (pendingChildrenAddition.Count > 0)\r
+                               while (pendingChildrenAddition.Count > 0) {\r
                                        _list.addChild (pendingChildrenAddition.Dequeue ());\r
+                               }\r
                        }\r
                }\r
 \r
@@ -198,7 +200,8 @@ namespace go
 \r
                        foreach (var item in data) {\r
                                ms.Seek(0,SeekOrigin.Begin);\r
-                               GraphicObject g = Interface.Load (ms, t, item);\r
+                               GraphicObject g = Interface.Load (ms, t);\r
+                               g.DataSource = item;\r
                                g.MouseClick += itemClick;\r
 \r
                                lock (pendingChildrenAddition) {\r
@@ -348,5 +351,6 @@ namespace go
                        base.ClearBinding ();\r
 \r
                }\r
+\r
        }\r
 }\r
index 0bc5d06757dc69a843734a544188edbb3a4149f0..3d4ef2294f1bfe684c27a892185b60e7962a90f9 100644 (file)
@@ -116,6 +116,11 @@ namespace go
                        IsExpanded = !IsExpanded;\r
                        base.onMouseClick (sender, e);\r
                }\r
-\r
+               public override void ResolveBindings ()\r
+               {\r
+                       base.ResolveBindings ();\r
+                       if (Content != null)\r
+                               Content.ResolveBindings ();\r
+               }\r
        }\r
 }\r
index 5d7e0dae036ee9e9c81883ed4862ff11bb23507a..1496e0e5f25bec5a5668025811a9f24e5268c7c3 100644 (file)
@@ -76,6 +76,7 @@ namespace go
                #endregion\r
 \r
                #region public fields\r
+               public GraphicObject LogicalParent;\r
                public Rectangle Bounds;\r
                public Rectangle Slot = new Rectangle ();\r
                public object Tag;\r
@@ -85,8 +86,20 @@ namespace go
                #region ILayoutable\r
                [XmlIgnore]public ILayoutable Parent { \r
                        get { return _parent; }\r
-                       set { _parent = value; }\r
+                       set {\r
+//                             if (_parent == value)\r
+//                                     return;\r
+//                             if (_parent != null)\r
+//                                     ClearBinding ();\r
+//                             \r
+                               _parent = value;\r
+//\r
+//                             if (DataSource != null)\r
+//                                     ResolveBindings ();\r
+                       }\r
                }\r
+\r
+\r
                [XmlIgnore]public virtual Rectangle ClientRectangle {\r
                        get {\r
                                Rectangle cb = Slot.Size;\r
@@ -336,7 +349,7 @@ namespace go
                }\r
                object dataSource;\r
 \r
-               [XmlIgnore]public object DataSource {\r
+               [XmlIgnore]public virtual object DataSource {\r
                        set {\r
                                if (dataSource == value)\r
                                        return;\r
@@ -351,7 +364,8 @@ namespace go
                        }\r
                        get {                           \r
                                return dataSource == null ? \r
-                                       Parent is GraphicObject ? (Parent as GraphicObject).DataSource : null : dataSource;\r
+                                       LogicalParent == null ?\r
+                                       Parent is GraphicObject ? (Parent as GraphicObject).DataSource : null :  LogicalParent.DataSource : dataSource;\r
                        }\r
                }\r
                #endregion\r
@@ -799,6 +813,8 @@ namespace go
                {\r
                        List<Binding> resolved = new List<Binding> ();\r
                        foreach (Binding b in Bindings) {\r
+                               if (!string.IsNullOrEmpty (b.DynMethodId))\r
+                                       continue;\r
                                if (b.Source.Member.MemberType == MemberTypes.Event) {\r
                                        if (b.Expression.StartsWith("{")){\r
                                                CompileEventSource(b);\r
@@ -854,9 +870,13 @@ namespace go
 \r
                                        Type[] args = {typeof(object), typeof(object),handlerArgsType};\r
                                        dm = new DynamicMethod(grouped[0].NewDynMethodId,\r
-                                               typeof(void), \r
+                                               MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot,\r
+                                               CallingConventions.Standard,\r
+                                               typeof(void),\r
                                                args,\r
-                                               sourceType);\r
+                                               sourceType,true);\r
+\r
+\r
                                        \r
 \r
                                        il = dm.GetILGenerator(256);\r
@@ -905,7 +925,7 @@ namespace go
                                                }else\r
                                                        throw new Exception ("unandled source member type for binding");                                                \r
                                        }else if (string.IsNullOrEmpty(b.Expression))\r
-                                               targetValue= grouped [0].Target;//empty binding exp=> bound to target object by default\r
+                                               targetValue= grouped [0].Target.Instance;//empty binding exp=> bound to target object by default\r
                                        //TODO: handle other dest type conversions\r
                                        if (b.Source.Property.PropertyType == typeof(string)){\r
                                                if (targetValue == null){\r
@@ -925,7 +945,7 @@ namespace go
                                        if (b.Target.Member != null)\r
                                                il.Emit (OpCodes.Ldstr, b.Target.Member.Name);\r
                                        else\r
-                                               il.Emit (OpCodes.Ldstr, b.Expression);\r
+                                               il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault());\r
                                        il.Emit (OpCodes.Callvirt, stringEquals);\r
                                        il.Emit (OpCodes.Brtrue, jumpTable[i]);\r
                                        i++;\r
index 9f408b5a9f6af2194a1894b00c56a7b50849ea03..15752f8001bddd0490817cf5fe0323e26a1f581e 100644 (file)
@@ -91,10 +91,15 @@ namespace go
 
                                Thread t = new Thread (loadingThread);
                                t.Start ();
+                               t.Join ();
 
                        }
                }
-
+               public override void UpdateLayout (LayoutingType layoutType)
+               {
+                       CheckPendingChildrenAddition ();
+                       base.UpdateLayout (layoutType);
+               }
                internal void CheckPendingChildrenAddition()
                {
                        if (pendingChildrenAddition == null)
@@ -127,7 +132,8 @@ namespace go
 
                        foreach (var item in data) {
                                ms.Seek(0,SeekOrigin.Begin);
-                               GraphicObject g = Interface.Load (ms, t, item);
+                               GraphicObject g = Interface.Load (ms, t);
+                               g.DataSource = item;
                                g.MouseClick += itemClick;
 
                                lock (pendingChildrenAddition) {
index e1a02fc664481e1996a6ad88a5b0a30ac87a3077..2ec4396fee9c328f6d7155666bd14b94618d8a0f 100644 (file)
@@ -38,6 +38,7 @@ namespace go
                        get { return _content; }\r
                        set { \r
                                if (_content != null) {\r
+                                       _content.LogicalParent = null;\r
                                        _content.LayoutChanged -= _content_LayoutChanged;\r
                                        _content.MouseLeave -= _content_MouseLeave;\r
                                }\r
@@ -47,6 +48,7 @@ namespace go
                                if (_content == null)\r
                                        return;\r
 \r
+                               _content.LogicalParent = this;\r
                                _content.Focusable = true;\r
                                _content.LayoutChanged += _content_LayoutChanged;\r
                                _content.MouseLeave += _content_MouseLeave;\r
@@ -93,7 +95,12 @@ namespace go
                                }\r
                        }\r
                        base.ClearBinding ();\r
-\r
+               }\r
+               public override void ResolveBindings ()\r
+               {\r
+                       base.ResolveBindings ();\r
+                       if (Content != null)\r
+                               Content.ResolveBindings ();\r
                }\r
 \r
                [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
index dcea97d7976d80ecaf1a9b950186ec0c1c5f33b0..cef8266b60b78554ce582961adb105080532a47b 100644 (file)
@@ -35,14 +35,17 @@ namespace go
                #region GraphicObject overrides
                public override void ClearBinding ()
                {
-                       if (Content != null) {
-                               //fix datasource = null to clear bindings, but it's illogic
-                               Content.DataSource = this.DataSource;
+                       if (Content != null)
                                Content.ClearBinding ();
-                       }
 
                        base.ClearBinding ();
                }
+//             public override void ResolveBindings ()
+//             {
+//                     base.ResolveBindings ();
+//                     if (Content != null)
+//                             Content.ResolveBindings ();
+//             }
                public override GraphicObject FindByName (string nameToFind)
                {
                        if (Name == nameToFind)
index e203c0cf4e6206162ff111c1ab98b19c89c3f7c3..d6c7243d0d45537fe4359ff7e1ecd6a04fb1f428 100644 (file)
@@ -115,7 +115,8 @@ namespace go
                {
                        if (template == null) {
                                DefaultTemplate dt = (DefaultTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultTemplate), true).FirstOrDefault();
-                               this.SetChild (Interface.Load (dt.Path, this,!Interface.DontResoveGOML));
+                               this.SetChild (Interface.Load (dt.Path, this));
+                               this.child.ResolveBindings ();
                        }else
                                this.SetChild (template);
                }
index 2ce0266bfd32321ebbeb961b39d9c2248efe3e9f..ddd2a0085004d51dc3994d27e7c932cfbb892ad4 100644 (file)
@@ -441,7 +441,7 @@ namespace go
                        XmlSerializer xs = new XmlSerializer (type);
 
                        result = (GraphicObject)xs.Deserialize (stream);
-                       result.DataSource = hostClass;
+                       //result.DataSource = hostClass;
 
                        #if DEBUG_LOAD_TIME
                        loadingTime.Stop ();