* 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
<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>
<?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}"
<?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}"
<?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
<?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>
<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>
<?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
<?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"
<?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
<?xml version="1.0"?>
-<HorizontalStack Name="ItemsContainer" Margin="0" Background="{./Background}"
- Width="{./WidthPolicy}" Height="{./HeightPolicy}"/>
+<HorizontalStack Name="ItemsContainer" Margin="0" Background="{./Background}"/>
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}">
<?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"
<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>
<?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
<?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
<?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">
<?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
<?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">
<?xml version="1.0"?>
<GenericStack Orientation="Vertical" Spacing="0"
- Width="{./WidthPolicy}" Height="{./HeightPolicy}"
Background="Onyx"
MouseEnter="{caption.Foreground=White}"
MouseLeave="{caption.Foreground=Gray}">
MouseClick="../../../../butCloseTabClick"/>
</Border>
</HorizontalStack>
- <Container
- Name="Content" Width="{./WidthPolicy}" Height="{./HeightPolicy}"/>
+ <Container Name="Content"/>
</GenericStack>
<?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"
<?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"
<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
<?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
<?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
<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>
<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"
</Scroller>
<ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="14" Height="{../../../HeightPolicy}" />
+ Width="14"/>
</HorizontalStack>
</Border>
</Template>
--- /dev/null
+<?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
+++ /dev/null
-<?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
--- /dev/null
+<?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
+++ /dev/null
-<?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
<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
<?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
<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\" />
<?xml version="1.0"?>
<Label Text="{../Caption}" Style="#Tests.ui.LabelButton.style"
- Height="Fit" Width="{../WidthPolicy}"/>
+ Height="Fit"/>
<?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"
MouseClick="../../../../../butQuitPress"/>
</Border>
</HorizontalStack>
- <Container Name="Content"
- Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
+ <Container Name="Content"/>
</VerticalStack>
</Border>
\ No newline at end of file
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;
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;
/// <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>
/// 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)
{
}
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 ();
}
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))