]> O.S.I.I.S - jp/crow.git/commitdiff
Inherited dims (#31) v0.5
authorj-p <jp.bruyere@live.be>
Tue, 4 Oct 2016 14:55:37 +0000 (16:55 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Oct 2016 14:55:37 +0000 (16:55 +0200)
* Implement 'Inherit' measure to reduce bindings load.

modifié :         Templates/ArrowButTemplate.crow
modifié :         Templates/Button.template
modifié :         Templates/CheckBox.template
modifié :         Templates/ComboBox.template
modifié :         Templates/DirectoryView.template
modifié :         Templates/Expandable.template
modifié :         Templates/GroupBox.template
modifié :         Templates/ListBox.template
modifié :         Templates/Menu.template
modifié :         Templates/MenuItem.template
modifié :         Templates/MessageBox.template
modifié :         Templates/Popper.template
modifié :         Templates/RadioButton.template
modifié :         Templates/ScrollBar.template
modifié :         Templates/ScrollingListBox.goml
modifié :         Templates/Spinner.template
modifié :         Templates/TabItem.template
modifié :         Templates/TreeView.template
modifié :         Templates/Window.template
modifié :         Templates/treeList.crow
modifié :         Tests/Interfaces/Container/0.crow
modifié :         Tests/Interfaces/TemplatedContainer/testTreeView.crow
modifié :         Tests/Interfaces/TemplatedControl/testItemTemplateTag.crow
modifié :         Tests/Interfaces/TmpExpandable.goml
modifié :         Tests/Interfaces/treeList.crow
modifié :         Tests/ui/Popper.template
modifié :         Tests/ui/tmpWindow.crow
modifié :         src/GraphicObjects/GraphicObject.cs
modifié :         src/Measure.cs

* leave template bindings for sizing in ScrollBar template because
Inherited values are not working.
modifié :         Templates/ScrollBar.template
renommé :         Tests/Interfaces/TemplatedControl/testScrollbar.goml -> Tests/Interfaces/TemplatedControl/testScrollbar.crow
renommé :         Tests/Interfaces/TemplatedControl/testSpinner.goml -> Tests/Interfaces/TemplatedControl/testSpinner.crow
modifié :         Tests/Tests.csproj

* update nuspec

35 files changed:
Crow.OpenTK.nuspec
Templates/ArrowButTemplate.crow
Templates/Button.template
Templates/CheckBox.template
Templates/ComboBox.template
Templates/DirectoryView.template
Templates/Expandable.template
Templates/GroupBox.template
Templates/ListBox.template
Templates/Menu.template
Templates/MenuItem.template
Templates/MessageBox.template
Templates/Popper.template
Templates/RadioButton.template
Templates/ScrollBar.template
Templates/ScrollingListBox.goml
Templates/Spinner.template
Templates/TabItem.template
Templates/TreeView.template
Templates/Window.template
Templates/treeList.crow
Tests/Interfaces/Container/0.crow
Tests/Interfaces/TemplatedContainer/testTreeView.crow
Tests/Interfaces/TemplatedControl/testItemTemplateTag.crow
Tests/Interfaces/TemplatedControl/testScrollbar.crow [new file with mode: 0755]
Tests/Interfaces/TemplatedControl/testScrollbar.goml [deleted file]
Tests/Interfaces/TemplatedControl/testSpinner.crow [new file with mode: 0755]
Tests/Interfaces/TemplatedControl/testSpinner.goml [deleted file]
Tests/Interfaces/TmpExpandable.goml
Tests/Interfaces/treeList.crow
Tests/Tests.csproj
Tests/ui/Popper.template
Tests/ui/tmpWindow.crow
src/GraphicObjects/GraphicObject.cs
src/Measure.cs

index 1a6221f79395ce951b979aef1c14543b521bd881..40b76980eee8864bb11fe38391dbd7fe99cf832c 100644 (file)
@@ -2,7 +2,7 @@
 <package >
        <metadata>
                <id>Crow.OpenTK</id>
-               <version>0.4.8</version>
+               <version>0.4.10</version>
                <title>C# Rapid Open Widget Toolkit</title>
                <authors>JP Bruyere</authors>
                <owners>Grand Tetras Software</owners>
index fe0e122c7bb5d5dd3aad82f11533a2043b0d698c..819a51cebbb31114ab85d1b057f379566e6a8b2f 100755 (executable)
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
 <Border Name="Content"
        Background="vgradient|0:White|0.1:LightGray|0.9:LightGray|1:Black" Foreground="DarkGray" 
-       Height="{../HeightPolicy}" Width="{../WidthPolicy}"
        MouseEnter="{Foreground=White}"
        MouseLeave="{Foreground=DarkGray}"
        MouseDown="{Background=vgradient|0:Black|0.1:LightGray|0.9:LightGray|1:White}"
index 959ad8ccbc466d6eac6db89ba38aba360468cc0f..043f8a29f10a4d063b4803068fc9c387cf248fbc 100755 (executable)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<Border Background="{./Background}" MinimumSize="50,20" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
-               Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
+<Border Background="{./Background}" MinimumSize="50,20"
+       Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
        MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black;caption.Foreground=White}"
        MouseLeave="{Foreground=Transparent;caption.Foreground=LightGray}"
        MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
index a3c0f23d3a3093cf757910c70859d99f1d07403b..070f8e2e2fa546dc18830ed86e18c31d670819ae 100755 (executable)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<HorizontalStack Style="Control" Background="{./Background}" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+<HorizontalStack Style="Control" Background="{./Background}">
        <Image Style="Icon" Path="#Crow.Images.Icons.checkbox.svg"
                SvgSub="{./IsChecked}"/>
-       <Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+       <Label Font="{./Font}" Text="{./Caption}"/>
 </HorizontalStack>
\ No newline at end of file
index d28a7b913758b76e6487ec45cc00cf9576ae56cb..906e354d775baf343c3c772439617160fe3f7d7f 100755 (executable)
@@ -1,12 +1,10 @@
 <?xml version="1.0"?>
-<Popper Name="popper" PopDirection="Bottom" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+<Popper Name="popper" PopDirection="Bottom">
        <Template>
-               <Border CornerRadius="0" Foreground="LightGray" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
-                       <HorizontalStack Margin="0
-                                               " Spacing="1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}">
+               <Border CornerRadius="0" Foreground="LightGray">
+                       <HorizontalStack Margin="0" Spacing="1">
                                <TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White"
-                                       Text="{../../../../SelectedItem}"
-                                       Height="{../../../../HeightPolicy}" Width="{../../../../WidthPolicy}"/>
+                                       Text="{../../../../SelectedItem}"/>
                                <Button Width="14" Height="14" Focusable="false"
                                        Template="#Crow.Templates.ArrowButTemplate.crow">
                                        <Image Margin="0"  Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
                MinimumSize="{../../MinimumPopupSize}" Fit="true">
                <Scroller Name="scroller1" Margin="2" VerticalScrolling="true"
                        MaximumSize="0,200"
-                       Height="{../HeightPolicy}" Width="{../WidthPolicy}"
                        HorizontalAlignment="Left"
                        ValueChanged="../../../_scroller_ValueChanged">
                        <VerticalStack LayoutChanged="../../../../_list_LayoutChanged"
-                               Height="Fit" Width="{../../WidthPolicy}" Name="ItemsContainer" Margin="0"
+                               Height="Fit" Name="ItemsContainer" Margin="0"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top"/>
                </Scroller>
index 9b80c1e99f24a9f6027a881fb7383296af97b861..a6a29651c5024821b8d80830f1f18aed0cd1514c 100755 (executable)
@@ -13,8 +13,8 @@
        <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
                <Expandable Caption="{Name}" >
                        <Template>
-                               <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-                                       <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
+                               <VerticalStack>
+                                       <HorizontalStack Spacing="1" Height="Fit"
                                                        MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
                                                        MouseLeave="{Background=Transparent}">
                                                <Image Margin="2" Width="12" Height="12"
                                                        SvgSub="{./IsExpanded}"/>
                                                <Image Margin="2" Width="14" Height="14"
                                                        Path="#Crow.Images.Icons.folder.svg"/>
-                                               <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
+
+                                               <Label Text="{./Caption}"/>
                                        </HorizontalStack>
-                                       <Container Name="Content" Visible="false"
-                                                       Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+                                       <Container Name="Content" Visible="false"/>
                                </VerticalStack>
                        </Template>
-                       <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
+                       <HorizontalStack Height="Fit">
                                <GraphicObject Width="12" Height="10"/>
-                               <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}"
+                               <TreeView Name="List" Height="Fit"
                                        Template="#Crow.Templates.treeList.crow" />
                        </HorizontalStack>
                </Expandable>
index 14a59dd9ed23a825860d362cf2436ffa335b375c..acae6d81716d4faf12a046643288c91977c36a67 100755 (executable)
@@ -1,15 +1,13 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}"
-               Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-               <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}">
+<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
+       <VerticalStack>
+               <HorizontalStack Spacing="1" Height="Fit">
                        <Image Style="Icon" Margin="2"
                                Visible="{./HasContent}"
                                Path="{./Image}" 
                                SvgSub="{./IsExpanded}"/>
-                       <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
+                       <Label Text="{./Caption}"/>
                </HorizontalStack>
-               <Container Name="Content" Visible="false"
-                       Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+               <Container Name="Content" Visible="false"/>
        </VerticalStack>
 </Border>
\ No newline at end of file
index 4e70ceae75cb5f0a13b0eefa712d777bbaf20ec9..199cfe9b938b3b336513d9814098832c3df4b3e8 100755 (executable)
@@ -1,13 +1,10 @@
 <?xml version="1.0"?>
-<Container Background="{./Background}" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-       <Group Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-               <VerticalStack Spacing="0"
-                       Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-                       <GraphicObject Height="6" Width="{./WidthPolicy}"/>
-                       <Border  CornerRadius="5" BorderWidth="1" Margin="10" Foreground="{./Foreground}"
-                               Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-                               <Container Name="Content" Margin="0" MinimumSize="70,10"
-                                               Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
+<Container Background="{./Background}">
+       <Group>
+               <VerticalStack Spacing="0">
+                       <GraphicObject Height="6"/>
+                       <Border  CornerRadius="5" BorderWidth="1" Margin="10" Foreground="{./Foreground}">
+                               <Container Name="Content" Margin="0" MinimumSize="70,10"/>
                        </Border>
                </VerticalStack>
                <Label Text="{./Caption}" VerticalAlignment="Top" Left="8"
index 36f2f61e218e626d375f4edd00a2fabbb0db130a..18f01c9dc10b6f116e09c8044325f1708baf7730 100755 (executable)
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Margin="1" MinimumSize="10,10" Height="{./HeightPolicy}" Width="{./WidthPolicy}" >
+<Border BorderWidth="1" Margin="1" MinimumSize="10,10">
        <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"
-               Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                ValueChanged="./_scroller_ValueChanged">
                <VerticalStack LayoutChanged="./_list_LayoutChanged"
-                       Height="Fit" Width="{./WidthPolicy}" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
+                       Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
        </Scroller>
 </Border>
\ No newline at end of file
index d49e0b311b8e0ab9571fe4e60e7fdb48cee64576..c560043ccca50f69fd87eab617c284cf3b33886b 100644 (file)
@@ -1,3 +1,2 @@
 <?xml version="1.0"?>
-<HorizontalStack Name="ItemsContainer" Margin="0" Background="{./Background}"
-       Width="{./WidthPolicy}" Height="{./HeightPolicy}"/>
+<HorizontalStack Name="ItemsContainer" Margin="0" Background="{./Background}"/>
index c6c545f6d86de5c861013110baa4d1e92ce96306..b814e2c6b3178bc607c07d8ceb46849531edbc8c 100644 (file)
@@ -8,7 +8,6 @@
                                MouseLeave="{Foreground=Transparent}"
                                MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
                                MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
-                               Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                                MinimumSize = "60,0"
                                Foreground="Transparent"
                                Background="{./Background}">
index e9dc5148fc4c03788378801fb8642b153ebc9456..9c361ea691134bc57f5c777a703bfe7a6bdef5b6 100644 (file)
@@ -1,14 +1,14 @@
 <?xml version="1.0"?>
-<Border Height="{./HeightPolicy}" Width="{./WidthPolicy}" CornerRadius="0"
+<Border        CornerRadius="0"
                                MouseEnter="./onBorderMouseEnter"
                                MouseLeave="./onBorderMouseLeave">
-       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}" Background="{./Background}">
-               <Border BorderWidth="0" Foreground="White" Width="{./WidthPolicy}" Height="Fit" 
+       <VerticalStack Background="{./Background}">
+               <Border BorderWidth="0" Foreground="White" Height="Fit" 
                                Background="vgradient|0:0.4,0.6,0.0,0.5|1:0.0,0.8,0.8,0.9">
-                       <HorizontalStack Name="hs" Margin="2" Spacing="1" Width="{./WidthPolicy}" Height="Fit" >
+                       <HorizontalStack Name="hs" Margin="2" Spacing="1" Height="Fit" >
                                <GraphicObject Width="5" Height="5"/>
                                <Image Margin="1" Width="12" Height="12" Path="{./Icon}"/>
-                               <Label Foreground="White" Width="{./WidthPolicy}" Margin="1" TextAlignment="Center" Text="{./Title}" />
+                               <Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Center" Text="{./Title}" />
                                <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
                                        MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
                                        <Image Focusable="true" Name="Image" Path="#Crow.Images.Icons.exit2.svg"
@@ -17,9 +17,9 @@
                                <GraphicObject Width="5" Height="5"/>
                        </HorizontalStack>
                </Border>
-               <HorizontalStack Margin="5" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+               <HorizontalStack Margin="5">
                        <Image Name="Image" Width="20%" Height="20" Path="#Crow.Images.Icons.iconInfo.svg" />
-                       <Label Margin="5" Font="serif, 10" Height="{./HeightPolicy}" Width="80%" Text="{./Message}"
+                       <Label Margin="5" Font="serif, 10" Width="80%" Text="{./Message}"
                                TextAlignment="Left"
                                Multiline="true" />             
                </HorizontalStack>
index a36daaee367c465ceeb0a5ef4c79e36022ce1e0f..c473cecb291dab267410ba5fdf37ddce0af1a9e3 100755 (executable)
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
-<Border Background="{./Background}" BorderWidth="1" Foreground="{./Foreground}" Height="Fit" Width="{./WidthPolicy}">
-       <HorizontalStack Spacing="1" Height="Fit"  Width="{./WidthPolicy}">
+<Border Background="{./Background}" BorderWidth="1" Foreground="{./Foreground}" Height="Fit">
+       <HorizontalStack Spacing="1" Height="Fit">
                <Image Style="Icon" Margin="2"
                                Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsPopped}"/>
-               <Label Text="{./Caption}"  Width="{./WidthPolicy}"/>
+               <Label Text="{./Caption}" />
        </HorizontalStack>
 </Border>
\ No newline at end of file
index 6d2e9de46f7a325ff99503e612f2aa23979431ea..b96eec2c550ff8e09670923fb0e9f03eeb6a0bf0 100755 (executable)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<HorizontalStack Style="Control" Background="{./Background}" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+<HorizontalStack Style="Control" Background="{./Background}">
        <Image Style="Icon" Path="#Crow.Images.Icons.radiobutton.svg"
                SvgSub="{./IsChecked}"/>
-       <Label Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+       <Label Text="{./Caption}"/>
 </HorizontalStack>
\ No newline at end of file
index 4164c30d11952173b16f2c17a1487a74d8d79f20..3cd4d0a4243541c151fbaaea3f614a64561bb145 100755 (executable)
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="LightGray" Width="{./WidthPolicy}" Height="{./HeightPolicy}">
-       <GenericStack Orientation="{./Orientation}" Spacing="0"
-               Width="{./WidthPolicy}" Height="{./HeightPolicy}">
+<Border BorderWidth="1" Foreground="LightGray">
+       <GenericStack Orientation="{./Orientation}" Spacing="0">
                <Button MouseRepeat="true" Width="12" Height="12" MouseClick="./onScrollBack"
                        Template="#Crow.Templates.ArrowButTemplate.crow">
                        <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>
                        Orientation="{./Orientation}"
                        Value="{./Value}"
                        Maximum="{./Maximum}"
+                       Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                        LargeIncrement="{./LargeIncrement}"
                        SmallIncrement="{./SmallIncrement}"
                        Background="hgradient|0:DimGray|0.1:Gray|0.95:Gray|1:White"
-                       Width="{./WidthPolicy}" Height="{./HeightPolicy}"
                        ValueChanged="./onSliderValueChange"/>
                <Button MouseRepeat="true" Width="12" Height="12" MouseClick="./onScrollForth"
                        Template="#Crow.Templates.ArrowButTemplate.crow">
index 54e3eb482c27494e71c849b4117b6b80aed0e4c9..2093d4d8c54745418f69892cb07da8d57e77f8c5 100644 (file)
@@ -1,15 +1,15 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}" Background="{./Background}">
-       <HorizontalStack Margin="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}" >
-               <Scroller Name="scroller1" Height="{./HeightPolicy}" Width="{./WidthPolicy}" 
+<Border BorderWidth="1" Background="{./Background}">
+       <HorizontalStack Margin="1">
+               <Scroller Name="scroller1" 
                                Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
                                ValueChanged="./_scroller_ValueChanged">
-                       <VerticalStack Width="{./WidthPolicy}" Height="-1" MinimumSize="10,10"
+                       <VerticalStack Height="Fit" MinimumSize="10,10"
                                Name="ItemsContainer" Margin="0" VerticalAlignment="Top"
                                LayoutChanged="./_list_LayoutChanged"/>
                </Scroller>
                <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}" 
                        Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical" 
-                       Width="14" Height="{./HeightPolicy}" />
+                       Width="14" />
        </HorizontalStack>
 </Border>
\ No newline at end of file
index b07e17b3f6bb38feabd1b83c006aa09f3f1b2188..af22628c73d047926c6f68814e0c83f6a23d45f7 100755 (executable)
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
-<HorizontalStack MinimumSize="40,10" Name="hstack" Margin="0" Spacing="0"
-               Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-       <Border BorderWidth="1" Height="{./HeightPolicy}" Width="80%"  Background="White" 
+<HorizontalStack MinimumSize="40,10" Name="hstack" Margin="0" Spacing="0">
+       <Border BorderWidth="1" Width="80%"  Background="White" 
                Foreground="DimGray" Margin="0">
-               <Label Foreground="DimGray" Height="{../../../HeightPolicy}" Width="Stretched"
+               <Label Foreground="DimGray" Width="Stretched"
                        Text="{../../../Value}" TextAlignment="Right" Margin="0"/>
        </Border>
        <VerticalStack MinimumSize="8,10" Width="20%" Height="Stretched" Spacing="0" Margin="0" Background="Red">
index ce2a270e917230a57e7bbc15886e6085d4e462f5..8028a8e5b04eeeebe815049635e3baecdea07e31 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <GenericStack Orientation="Vertical" Spacing="0"
-               Width="{./WidthPolicy}" Height="{./HeightPolicy}"
                Background="Onyx"
                MouseEnter="{caption.Foreground=White}"
                MouseLeave="{caption.Foreground=Gray}">
@@ -16,7 +15,6 @@
                                 MouseClick="../../../../butCloseTabClick"/>
                </Border>
        </HorizontalStack>
-       <Container
-               Name="Content" Width="{./WidthPolicy}" Height="{./HeightPolicy}"/>
+       <Container Name="Content"/>
 </GenericStack>
 
index 377de50cc6da730487f44f87b1914d1741c4c890..25c93f15af143b2e791b32bd40c02c8d7f2f405f 100644 (file)
@@ -1,12 +1,11 @@
 <?xml version="1.0"?>
-<HorizontalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+<HorizontalStack>
        <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"
                Background="{./Background}"
-               Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                ScrollY="{../scrollbar1.Value}"
                ValueChanged="./_scroller_ValueChanged">
                <VerticalStack LayoutChanged="./_list_LayoutChanged"
-                       Height="Fit" Width="{./WidthPolicy}" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
+                       Height="Fit" Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
        </Scroller>
        <ScrollBar
                Name="scrollbar1"
index 6b3932c14c80d1beefc84ef8a6db8b10aa474fec..bbd1e57a1f40ac7a1fc3dcef640fb2f13cc66bdd 100755 (executable)
@@ -1,17 +1,16 @@
 <?xml version="1.0"?>
 <Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}"
                                Background="{./Background}"
-                               Height="{./HeightPolicy}" Width="{./WidthPolicy}"
                                MouseEnter="./onBorderMouseEnter"
                                MouseLeave="./onBorderMouseLeave">
-       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}" Spacing="0">
+       <VerticalStack Spacing="0">
 <!--           <Border Name="TitleBar" BorderWidth="1" Foreground="White" Width="{./WidthPolicy}" Height="Fit"
                                Background="vgradient|0:0.4,0.6,0.0,0.5|1:0.0,0.8,0.8,0.9">-->
                        <HorizontalStack Background="vgradient|0:0.4,0.6,0.0,0.5|1:0.0,0.8,0.8,0.9"
-                                       Name="hs" Margin="2" Spacing="0" Width="{./WidthPolicy}" Height="Fit">
+                                       Name="hs" Margin="2" Spacing="0" Height="Fit">
                                <GraphicObject Width="5"/>
                                <Image Margin="1" Width="12" Height="12" Path="{./Icon}"/>
-                               <Label Foreground="White" Width="{./WidthPolicy}" Margin="1" TextAlignment="Center" Text="{./Title}" />
+                               <Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Center" Text="{./Title}" />
                                <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
                                        MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
                                        <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
@@ -20,6 +19,6 @@
                                <GraphicObject Width="5"/>
                        </HorizontalStack>
 <!--           </Border>-->
-               <Container Name="Content" MinimumSize="50,50" Height="{./HeightPolicy}" Width="{./WidthPolicy}" Background="0.5,0.5,0.5,0.5"/>
+               <Container Name="Content" MinimumSize="50,50" Background="0.5,0.5,0.5,0.5"/>
        </VerticalStack>
 </Border>
\ No newline at end of file
index 160f351a7475cce73a98139bbf9d1dccb3f3c89b..fbd47055a6964964563eb71ccf16da13f57c5f39 100755 (executable)
@@ -1,3 +1,3 @@
 <?xml version="1.0"?>
 <VerticalStack
-       Height="Fit" Width="{../WidthPolicy}" Name="ItemsContainer"/>
\ No newline at end of file
+       Height="Fit" Name="ItemsContainer"/>
\ No newline at end of file
index a69e6f6937a281157a4f0954033487602c70b5b7..be2e16e6c23dbebcc99e9526cf822e5588953516 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <Container Background="Onyx" Margin="10" Width="90%" Height="90%">
-       <GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="Mantis"
+       <GraphicObject Margin="10"  Background="Mantis"
                        MinimumSize="50,50"/>
 </Container>
\ No newline at end of file
index e8e7164516887d041631e4959625dab7ab1762d2..fb4cbe873a0c985c6760cc24e8e2030139b20fc2 100755 (executable)
@@ -12,8 +12,8 @@
        <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
                <Expandable Caption="{Name}" >
                        <Template>
-                               <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-                                       <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
+                               <VerticalStack>
+                                       <HorizontalStack Spacing="1" Height="Fit"
                                                        MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
                                                        MouseLeave="{Background=Transparent}">
                                                <Image Margin="2" Width="12" Height="12"
                                                        SvgSub="{./IsExpanded}"/>
                                                <Image Margin="2" Width="14" Height="14"
                                                        Path="#Crow.Images.Icons.folder.svg"/>
-                                               <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
+                                               <Label Text="{./Caption}"/>
                                        </HorizontalStack>
-                                       <Container Name="Content" Visible="false"
-                                                       Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+                                       <Container Name="Content" Visible="false"/>
                                </VerticalStack>
                        </Template>
-                       <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
+                       <HorizontalStack Height="Fit">
                                <GraphicObject Width="12" Height="10"/>
-                               <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}">
+                               <TreeView Name="List" Height="Fit">
                                        <Template>
-                                               <VerticalStack Height="Fit" Width="{../WidthPolicy}" Name="ItemsContainer"/>
+                                               <VerticalStack Height="Fit" Name="ItemsContainer"/>
                                        </Template>
                                </TreeView>
                        </HorizontalStack>
index 94625915349917515fe5ac53dda9bb8e9ff9bb72..f4d37a74c88bc8d2f7a8aea730f77eb114315618 100755 (executable)
@@ -4,12 +4,12 @@
                <ListBox Data="{TestList}" Background="0.5,0.5,0.5,0.7"
                                         HorizontalAlignment="Center" Width="200" Height="200" Margin="5">
                        <Template>
-                               <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
-                                       <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
-                                               <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
+                               <Border BorderWidth="1">
+                                       <HorizontalStack Margin="1">
+                                               <Scroller Name="scroller1"
                                                                Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
                                                                ValueChanged="../../../_scroller_ValueChanged">
-                                                       <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="10,10"
+                                                       <VerticalStack Height="Fit" MinimumSize="10,10"
                                                                Name="ItemsContainer" Margin="0"
                                                                VerticalAlignment="Top"
                                                                HorizontalAlignment="Left"
@@ -17,7 +17,7 @@
                                                </Scroller>
                                                <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
                                                        Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
-                                                       Width="14" Height="{../../../HeightPolicy}" />
+                                                       Width="14"/>
                                        </HorizontalStack>
                                </Border>
                        </Template>
diff --git a/Tests/Interfaces/TemplatedControl/testScrollbar.crow b/Tests/Interfaces/TemplatedControl/testScrollbar.crow
new file mode 100755 (executable)
index 0000000..c494e34
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<Group Name="TopContainer" Width="400" Height="400"
+       Focusable="True" Background="Gray">
+       <ScrollBar Height="Stretched" Orientation="Vertical" Width="16" Maximum="100"/>
+</Group>
\ No newline at end of file
diff --git a/Tests/Interfaces/TemplatedControl/testScrollbar.goml b/Tests/Interfaces/TemplatedControl/testScrollbar.goml
deleted file mode 100755 (executable)
index c494e34..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-<Group Name="TopContainer" Width="400" Height="400"
-       Focusable="True" Background="Gray">
-       <ScrollBar Height="Stretched" Orientation="Vertical" Width="16" Maximum="100"/>
-</Group>
\ No newline at end of file
diff --git a/Tests/Interfaces/TemplatedControl/testSpinner.crow b/Tests/Interfaces/TemplatedControl/testSpinner.crow
new file mode 100755 (executable)
index 0000000..4efd587
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<VerticalStack Name="TopContainer" Width="400" Height="Fit"
+       Margin="20" Background="DarkGray">
+
+       <HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
+               <Spinner Value="{IntValue}" ValueChanged="onSpinnerValueChange"/>
+               <Spinner Value="5"/>
+               <Spinner Value="5"/>
+               <Button/>
+       </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
diff --git a/Tests/Interfaces/TemplatedControl/testSpinner.goml b/Tests/Interfaces/TemplatedControl/testSpinner.goml
deleted file mode 100755 (executable)
index 4efd587..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<VerticalStack Name="TopContainer" Width="400" Height="Fit"
-       Margin="20" Background="DarkGray">
-
-       <HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
-               <Spinner Value="{IntValue}" ValueChanged="onSpinnerValueChange"/>
-               <Spinner Value="5"/>
-               <Spinner Value="5"/>
-               <Button/>
-       </HorizontalStack>
-</VerticalStack>
\ No newline at end of file
index 1cd05fd74790842f108d1a352476fc0acbc9daf6..9dddcebb1eceb396d307b5b634e8be06fb6251a7 100755 (executable)
@@ -3,10 +3,10 @@
        <Label Text="{../../Caption}" Width="{../../WidthPolicy}"/>
        <Container Name="Content" Visible="false" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
 </VerticalStack>-->
-<Group BorderWidth="1" Foreground="LightGray" Height="{../HeightPolicy}" Width="{../WidthPolicy}" 
+<Group BorderWidth="1" Foreground="LightGray" 
                MouseClick="../onMouseClick">
-       <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
-               <Label Text="{../../../Caption}" Width="{../../../WidthPolicy}"/>
-               <Container Name="Content" Visible="false" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
+       <VerticalStack>
+               <Label Text="{../../../Caption}"/>
+               <Container Name="Content" Visible="false"/>
        </VerticalStack>
 </Group>
\ No newline at end of file
index 61ee12a44d01d5c15b1bb979017005673b2ed2f9..ca59c17feb74fcd309edbe17de8330bf793d1589 100755 (executable)
@@ -1,3 +1,2 @@
 <?xml version="1.0"?>
-<VerticalStack
-       Height="Fit" Width="{../WidthPolicy}" Name="List"/>
\ No newline at end of file
+<VerticalStack Height="Fit" Name="List"/>
\ No newline at end of file
index 1095bd6a233f2f52f94bd1e96182810f47358e71..771c8b4ad200e70352ad86a687bb1c904b5aa82d 100644 (file)
     <None Include="Interfaces\TemplatedControl\testRadioButton.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
-    <None Include="Interfaces\TemplatedControl\testScrollbar.goml">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Interfaces\TemplatedControl\testSpinner.goml">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
     <None Include="Interfaces\TemplatedContainer\test_Listbox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\TemplatedGroup\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\TemplatedControl\testScrollbar.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\TemplatedControl\testSpinner.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
index ffcd8d45a73582b4dfbbfd70a6b49c38142e2d6e..ae8c63c26f223a7b4ae4d5977d1709b33ca56650 100755 (executable)
@@ -1,3 +1,3 @@
 <?xml version="1.0"?>
 <Label Text="{../Caption}" Style="#Tests.ui.LabelButton.style"
-       Height="Fit" Width="{../WidthPolicy}"/>
+       Height="Fit"/>
index 824ad7042abb844779194cf8bc10e6dcaf2c3d00..64c97d55e63cab523334f419feb42d27883f71e0 100755 (executable)
@@ -1,11 +1,10 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Foreground="White" CornerRadius="15"   
-       Height="{../HeightPolicy}" Width="{../WidthPolicy}"
+<Border BorderWidth="1" Foreground="White" CornerRadius="15"
        MouseEnter="../onBorderMouseEnter"
        MouseLeave="../onBorderMouseLeave"
        Background="vgradient|0:0.6,0.6,0.6,0.9|1:0.4,0.4,0.4,0.6">
-       <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
-               <HorizontalStack Height="Fit" Width="{../../../WidthPolicy}">
+       <VerticalStack>
+               <HorizontalStack Height="Fit">
                        <Label Margin="2" Font="{../../../../Font}" Text="{../../../../Title}" Width="Stretched"/>
                        <Border HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top"
                                CornerRadius="6" BorderWidth="1" Foreground="Transparent"
@@ -15,7 +14,6 @@
                                         MouseClick="../../../../../butQuitPress"/>
                        </Border>
                </HorizontalStack>
-               <Container Name="Content"
-                       Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
+               <Container Name="Content"/>
        </VerticalStack>
 </Border>
\ No newline at end of file
index 093664d11a16573e8b9584bd69a9ed5667095f29..e69aaaca2f9909294e3a0e2df4efce29c147ac01 100644 (file)
@@ -276,9 +276,13 @@ namespace Crow
                                Width = Height = Measure.Fit;
                        }
                }
-               [XmlAttributeAttribute()][DefaultValue("Stretched")]
+               [XmlAttributeAttribute()][DefaultValue("Inherit")]
                public virtual Measure Width {
-                       get { return width; }
+                       get {
+                               return width.Units == Unit.Inherit ?
+                                       Parent is GraphicObject ? (Parent as GraphicObject).WidthPolicy :
+                                       Measure.Stretched : width;
+                       }
                        set {
                                if (width == value)
                                        return;
@@ -308,9 +312,13 @@ namespace Crow
                                this.RegisterForLayouting (LayoutingType.Width);
                        }
                }
-               [XmlAttributeAttribute()][DefaultValue("Stretched")]
+               [XmlAttributeAttribute()][DefaultValue("Inherit")]
                public virtual Measure Height {
-                       get { return height; }
+                       get {
+                               return height.Units == Unit.Inherit ?
+                                       Parent is GraphicObject ? (Parent as GraphicObject).HeightPolicy :
+                                       Measure.Stretched : height;
+                       }
                        set {
                                if (height == value)
                                        return;
index c9b08f228e35c4da50759b2a589d6d7938305ac2..26c3bfdeef2b74e6bc87cebcff5cb7832fdc6633 100644 (file)
@@ -25,7 +25,7 @@ namespace Crow
        /// <summary>
        /// Measurement unit
        /// </summary>
-       public enum Unit { Pixel, Percent }
+       public enum Unit { Pixel, Percent, Inherit }
        /// <summary>
        /// Measure class allow proportional sizes as well as stretched and fit on content.
        /// </summary>
@@ -49,7 +49,7 @@ namespace Crow
                /// set to 100 Percents
                /// </summary>
                public static Measure Stretched = new Measure(100, Unit.Percent);
-
+               public static Measure Inherit = new Measure (0, Unit.Inherit);
                #region CTOR
                public Measure (int _value, Unit _units = Unit.Pixel)
                {
@@ -98,7 +98,8 @@ namespace Crow
                }
                public override string ToString ()
                {
-                       return Value == -1 ? "Fit" :
+                       return Units == Unit.Inherit ? "Inherit" :
+                               Value == -1 ? "Fit" :
                                Units == Unit.Percent ? Value == 100 ? "Stretched" :
                                Value.ToString () + "%" : Value.ToString ();
                }
@@ -111,10 +112,12 @@ namespace Crow
                        string st = s.Trim ();
                        int tmp = 0;
 
-                       if (string.Equals ("Fit", st, StringComparison.Ordinal))
+                       if (string.Equals ("Inherit", st, StringComparison.Ordinal))
+                               return Measure.Inherit;
+                       else if (string.Equals ("Fit", st, StringComparison.Ordinal))
                                return Measure.Fit;
                        else if (string.Equals ("Stretched", s, StringComparison.Ordinal))
-                               return Measure.Stretched;
+                               return Measure.Stretched;                       
                        else {
                                if (st.EndsWith ("%", StringComparison.Ordinal)) {
                                        if (int.TryParse (s.Substring(0, st.Length - 1), out tmp))