<Compile Include="src\ItemTemplate.cs" />
<Compile Include="src\Style.cs" />
<Compile Include="src\GraphicObjects\Wrapper.cs" />
+ <Compile Include="src\GraphicObjects\TemplatedGroup.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
this.KeyDown += KeyboardKeyDown1;
testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Expandable", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray ();
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray ();
this.Title = testFiles [idx] + ". Press <F3> to switch example.";
CrowInterface.LoadInterface(testFiles[idx]).DataSource = this;
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Fit="true" Background="vgradient|0:DimGray|1:Black">
- <HorizontalStack Fit="True">
- <Button Caption="but" MouseClick="onButClick"/>
- <Button Caption="but" MouseClick="onButClick" Fit="true"/>
- <Button Width="60" Height="40" MouseClick="onButClick"/>
- <Button Caption="Long text button" MouseClick="onButClick"/>
- <Button Font="droid, 20" Caption="Button"/>
- </HorizontalStack>
-</VerticalStack>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Fit="true" Margin="100" Background="DimGray" >
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
- <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
-</VerticalStack>
-
+++ /dev/null
-<?xml version="1.0"?>
-<Container Background="Onyx" Width="300">
- <ComboBox Data="{TestList}" ItemTemplate="#Tests.Interfaces.colorItem.crow"/>
-</Container>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<HorizontalStack>
- <Window Resizable="false" Focusable="true" Title="Open File..." Width="20%" Height="100%"
- MinimumSize="10,1">
- <DirectoryView Name="dv" Margin="10" Root="./" SelectedItemChanged="Tv_SelectedItemChanged"/>
- </Window>
- <Splitter/>
- <VerticalStack Width="80%" Height="100%">
- <Window Resizable="false" Focusable="true" Title="{../dv.SelectedItem}"
- Height="50%" Width="Stretched"
- MinimumSize="10,1">
- <Container Margin="10" Name="crowContainer"/>
- </Window>
- <Splitter/>
- <Window Resizable="false" Focusable="true" Title="{../dv.SelectedItem}"
- Height="50%" Width="Stretched"
- MinimumSize="10,1">
- <TextBox Multiline="true" Margin="10" Height="Stretched"
- Text="{CurSources}"/>
- </Window>
- </VerticalStack>
-</HorizontalStack>
+++ /dev/null
-<?xml version="1.0"?>
-<!--<Container Background="vgradient|0:DarkGray|1:DimGray">-->
- <GroupBox Fit="true" Background="vgradient|0:SteelBlue|1:Transparent"
- Foreground="White">
-<!-- <Label/>-->
- </GroupBox>
-<!--</Container>-->
+++ /dev/null
-<?xml version="1.0"?>
-<Border BorderWidth="2" Fit="true">
- <VerticalStack Fit="true" Margin="5">
- <ListBox Data="{TestList}" Background="0.5,0.5,0.5,0.7"
- HorizontalAlignment="Center" Width="200" Height="200" Margin="5">
- <Template>
- <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
- <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
- <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
- Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
- ValueChanged="../../../_scroller_ValueChanged">
- <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="10,10"
- Name="List" Margin="0"
- VerticalAlignment="Top"
- HorizontalAlignment="Left"
- LayoutChanged="../../../../_list_LayoutChanged"/>
- </Scroller>
- <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="14" Height="{../../../HeightPolicy}" />
- </HorizontalStack>
- </Border>
- </Template>
- <ItemTemplate DataType="Crow.Color">
- <HorizontalStack
- HorizontalAlignment="Left"
- Height="Fit" Width="200" Margin="1" Focusable="true"
- MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}"
- MouseLeave="{Background=Transparent}">
- <GraphicObject Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/>
- <Label Text="{Name}" Margin="0" Width="Stretched"/>
- </HorizontalStack>
- </ItemTemplate>
- </ListBox>
- <HorizontalStack Fit="true" HorizontalAlignment="Right">
- <Button Caption="Load list" MouseClick="OnLoadList"/>
- <Button Caption="Clear" MouseClick="OnClear"/>
- </HorizontalStack>
- </VerticalStack>
-</Border>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<MessageBox Title="message" Message="this is a message box"/>
-<!-- Ok="onMsgBoxOk"
- Cancel="onMsgBoxCancel"/>-->
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack>
- <Border Fit="true" Margin="10">
- <VerticalStack Width="150" Height="Fit">
- <RadioButton Caption="Left" IsChecked="true" Checked="change_alignment"/>
- <RadioButton Caption="Right" Checked="change_alignment"/>
- <RadioButton Caption="Top" Checked="change_alignment"/>
- <RadioButton Caption="Bottom" Checked="change_alignment"/>
- </VerticalStack>
- </Border>
- <GraphicObject Height="200"/>
- <Popper Caption="TestPopper" Width="100" Background="DimGray" PopDirection="{alignment}">
- <Border Fit="True" Background="ArmyGreen">
- <Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/>
- <VerticalStack Fit="true" Margin="10" Background="CornflowerBlue">
- <CheckBox Name="chk1" Background="Red"/>
- <CheckBox Name="chk2" IsChecked="true"/>
- <CheckBox Name="chk3"/>
- <CheckBox Name="chk4"/>
- <HorizontalStack Fit="true" Margin="20">
- <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
- <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>
- </VerticalStack>
- </Border>
- </Popper>
-</VerticalStack>
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGray">
- <RadioButton Caption="Radio1"/>
- <RadioButton Caption="Radio2" IsChecked="true"/>
- <RadioButton Caption="Radio3"/>
- <RadioButton Caption="Radio4"/>
-</VerticalStack>
-
+++ /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" encoding="UTF-8" ?>
-<HorizontalStack Fit="true">
- <VerticalStack Fit="true">
- <TabView Name="tabview1"
- Width="400" Height="200" Orientation="Horizontal" Spacing="20">
- <TabItem Name="TabItem1" Caption="tab item 1" Margin="0">
- <VerticalStack Fit="true">
- <CheckBox/>
- <CheckBox/>
- <CheckBox/>
- <CheckBox/>
- </VerticalStack>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab item 2" Width="Stretched" Height="Stretched" Margin="0" Background="Gray">
- <VerticalStack Fit="true">
- <RadioButton/>
- <RadioButton/>
- <RadioButton/>
- <RadioButton/>
- </VerticalStack>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab item 3" Width="Stretched" Height="Stretched" Margin="0" Background="Gray">
- <Container Margin="5" CornerRadius="2" Width="Stretched" Height="Stretched">
- <TextBox Margin="5" Width="Stretched" Height="Stretched" Multiline="true" TextAlignment="TopLeft"/>
- </Container>
- </TabItem>
- <TabItem Name="TabItem2" Caption="tab item 4" Width="Stretched" Height="Stretched" Margin="0" Background="Gray">
- <TextBox/>
- </TabItem>
- </TabView>
- <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
- Caption="Add new tab" Width="Fit" Height="30" MouseClick="onAddTabButClick"/>
- </VerticalStack>
-</HorizontalStack>
-
+++ /dev/null
-<?xml version="1.0"?>
-<TreeView IsRoot="true" Name="treeView" Data="{CurDirectory}" Background="DimGray">
- <ItemTemplate DataType="System.IO.FileInfo">
- <HorizontalStack Focusable="true" Height="Fit" Width="Stretched" Background="{../Background}" >
- <Image Margin="2" Width="14" Height="14"
- Path="#Crow.Images.Icons.file.svg"/>
- <Label Text="{Name}" Width="Stretched"
- MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
- MouseLeave="{Background=Transparent}"/>
- </HorizontalStack>
- </ItemTemplate>
- <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
- <Expandable Caption="{Name}" >
- <Template>
- <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
- <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
- MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
- MouseLeave="{Background=Transparent}">
- <Image Margin="2" Width="12" Height="12"
- Visible="{./HasContent}"
- Path="{./Image}"
- SvgSub="{./IsExpanded}"/>
- <Image Margin="2" Width="14" Height="14"
- Path="#Crow.Images.Icons.folder.svg"/>
- <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
- </HorizontalStack>
- <Container Name="Content" Visible="false"
- Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
- </VerticalStack>
- </Template>
- <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
- <GraphicObject Width="12" Height="10"/>
- <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}">
- <Template>
- <VerticalStack Height="Fit" Width="{../WidthPolicy}" Name="List"/>
- </Template>
- </TreeView>
- </HorizontalStack>
- </Expandable>
- </ItemTemplate>
-</TreeView>
+++ /dev/null
-<?xml version="1.0"?>
-<Window Left="10" Top="10" Title="Test window"
- Width="250" Height="550" >
- <VerticalStack Name="contentVSStack" Margin="10" Spacing="10" Background="0.4,0.4,0.4,0.4">
- <Slider Name="slider" Height="12" Width="Stretched" CornerRadius="3"/>
- <GroupBox Caption="test" Height="Fit" Width="Stretched" Margin="5">
- <VerticalStack Height="Fit" Width="Stretched" >
- <RadioButton Caption="Radio 1" Background="Red" Width="Stretched"/>
- <RadioButton Caption="Radio 2" IsChecked="true" />
- <RadioButton Caption="Radio 3" />
- <RadioButton Caption="Radio 1" Background="SkyBlue" Width="Stretched"/>
- </VerticalStack>
- </GroupBox>
- <HorizontalStack Width="Stretched" Height="Fit" Margin="10" CornerRadius="5" Background="SkyBlue">
- <RadioButton Width="80" Height="Fit" Caption="Radio 2" IsChecked="true" />
- <GraphicObject Width="Stretched"/>
- <RadioButton Width="80" Height="Fit" Caption="Radio 3" />
- </HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" MinimumSize="10,40" Margin="0" CornerRadius="5"
- Background="vgradient|0:White|0.1:SteelBlue|0.9:SteelBlue|1:Transparent">
- <CheckBox Height="Fit" Width="80"/>
- <GraphicObject Width="Stretched"/>
- <CheckBox Height="Fit" Width="80" IsChecked="true"/>
- </HorizontalStack>
- <Border Fit="true" CornerRadius="5" BorderWidth="1" >
- <Container Name="MainGrp" Background="0.5,0.5,0.5,0.4" Width="120" Fit="true"
- Margin="10" Focusable="True" >
- <VerticalStack Fit="true" Name="vsFps" Spacing="10" >
- <HorizontalStack Fit="true">
- <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
- <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
- Background="vgradient|0:AoEnglish|1:Black"/>
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Text="Clipping:" Width="50" TextAlignment="Right"/>
- <Label Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
- Background="vgradient|0:AoEnglish|1:Black"/>
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
- <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
- Background="vgradient|0:AoEnglish|1:Black"/>
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
- <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center"
- Background="vgradient|0:AoEnglish|1:Black"/>
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Text="Min:" Width="50" TextAlignment="Right"/>
- <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
- Background="vgradient|0:AoEnglish|1:Black"/>
- </HorizontalStack>
- <HorizontalStack Fit="true">
- <Label Text="Max:" Width="50" TextAlignment="Right"/>
- <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
- Background="vgradient|0:AoEnglish|1:Black"/>
- </HorizontalStack>
- </VerticalStack>
- </Container>
- </Border>
- <HorizontalStack Fit="true" Background="BlueCrayola" Margin="3">
- <GraphicObject Margin="10" Background="LimeGreen" Width="5" Height="5"/>
- <TextBox Font="droid, 16" Multiline="true" Text="this is a test\nmultiline" Margin="2"/>
- <GraphicObject Margin="10" Background="LimeGreen" Width="5" Height="5"/>
- </HorizontalStack>
- </VerticalStack>
-</Window>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<Window Focusable="true" Title="Measures" Width="30%" Height="Fit" MinimumSize="100,100">
- <VerticalStack Width="90%" Height="Fit" Spacing="1" Margin="10">
- <HorizontalStack Height="Fit">
- <Label Text="Fps:" Style="FpsLabel"/>
- <Label Text="{fps}" Style="FpsDisp"/>
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Text="Min:" Style="FpsLabel"/>
- <Label Text="{fpsMin}" Style="FpsDisp"/>
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Text="Max:" Style="FpsLabel"/>
- <Label Text="{fpsMax}" Style="FpsDisp"/>
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Text="Update:" Style="FpsLabel"/>
- <Label Text="{update}" Style="FpsDisp"/>
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Text="Layouting:" Style="FpsLabel"/>
- <Label Text="{layouting}" Style="FpsDisp"/>
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Text="Clipping:" Style="FpsLabel"/>
- <Label Text="{clipping}" Style="FpsDisp"/>
- </HorizontalStack>
- <HorizontalStack Height="Fit">
- <Label Text="Drawing:" Style="FpsLabel"/>
- <Label Text="{drawing}" Style="FpsDisp"/>
- </HorizontalStack>
- </VerticalStack>
-</Window>
+++ /dev/null
-<?xml version="1.0"?>
-<Window Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0.5,0.5,0.5,0.8"
- Focusable="True" CornerRadius="20" MinimumSize="100,100" MaximumSize="500,500">
- <Template>
- <Container Margin="20" Name="Content" Height="{../HeightPolicy}" Width="{../WidthPolicy}" Background="0.5,0.5,0.5,0.5"/>
- </Template>
-<!-- <Group Background="Green">-->
- <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>
-<!-- <Scrollbar Orientation="Vertical" Height="Stretched" Width="10" Background="Blue" Margin="0" HorizontalAlignment="Right"/>-->
-<!-- </Group>-->
-</Window>
+++ /dev/null
-<?xml version="1.0"?>
-<!--<ListBox Data="{TestList}" Focusable="true"/>-->
-<Border Margin="50">
- <VerticalStack >
- <Label Text="{../ColorList.SelectedItem}" Background="DarkGreen"/>
- <Label Text="{Hover}" Background="DarkGreen"/>
- <Button Caption="Clear" Width="Stretched" MouseClick="OnClear"/>
- <ListBox Name="ColorList" Data="{TestList}" Background="0.5,0.5,0.5,0.5"
- HorizontalAlignment="Center" Width="Fit" Height="200" Margin="0"
- ItemTemplate="#Tests.Interfaces.colorItem.crow"
- Template="#Crow.Templates.ScrollingListBox.goml">
-<!-- <Template>
- <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
- <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
- <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
- Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
- ValueChanged="../../../_scroller_ValueChanged">
- <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="100,100"
- Name="List" Margin="0" VerticalAlignment="Top"
- LayoutChanged="../../../../_list_LayoutChanged"/>
- </Scroller>
- <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="12" Height="{../../../HeightPolicy}" />
- </HorizontalStack>
- </Border>
- </Template>-->
- </ListBox>
- <Button Caption="Load list" Width="Stretched" MouseClick="../../../OnLoadList"/>
- </VerticalStack>
-</Border>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<Expandable Fit="true" Caption="Test expandable" Background="DimGray">
- <VerticalStack Margin="5" >
- <CheckBox Name="chk1" />
- <CheckBox Name="chk2" IsChecked="true"/>
- <CheckBox Name="chk3" />
- <CheckBox Name="chk4" />
- <HorizontalStack Fit="true" Margin="2" Background="Mantis">
- <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/>
- <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="Fit" TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>
- </VerticalStack>
-</Expandable>
+++ /dev/null
-<Expandable Width="Stretched" Background="Gray">
- <Expandable Width="Stretched" Background="LightBlue">
- <Expandable Width="Stretched" Background="Green">
- <Expandable Width="Stretched" Background="LimeGreen">
- <Expandable Width="Stretched" Background="DimGray">
- <Expandable Width="Stretched" Background="Yellow">
- <Expandable Width="Stretched" Background="NavyBlue">
- <Expandable Width="Stretched" Background="Blue">
- <Expandable Width="Stretched" Background="BlueCrayola">
- <Expandable Width="Stretched" Background="Green">
- <Label Background="Red" Text="{fps}"/>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<VerticalStack Height="Fit" Width="Fit">
- <Label Width="Stretched"/>
- <Expandable Width="Fit" Background="Gray">
- <Expandable Background="LightBlue">
- <Expandable Background="Green">
- <Expandable Background="LimeGreen">
- <Expandable Background="DimGray">
- <Expandable Width="Stretched" Background="Yellow">
- <Expandable Background="NavyBlue">
- <Expandable Width="Stretched" Background="Blue">
- <Expandable Width="Stretched" Background="BlueCrayola">
- <Expandable Width="Stretched" Background="Green">
- <Label Background="Red" Text="{fps}"/>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
- </Expandable>
-</VerticalStack>
--- /dev/null
+<?xml version="1.0"?>
+<Expandable Fit="true" Caption="Test expandable" Background="DimGray">
+ <VerticalStack Margin="5" >
+ <CheckBox Name="chk1" />
+ <CheckBox Name="chk2" IsChecked="true"/>
+ <CheckBox Name="chk3" />
+ <CheckBox Name="chk4" />
+ <HorizontalStack Fit="true" Margin="2" Background="Mantis">
+ <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="Fit" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Expandable>
--- /dev/null
+<Expandable Width="Stretched" Background="Gray">
+ <Expandable Width="Stretched" Background="LightBlue">
+ <Expandable Width="Stretched" Background="Green">
+ <Expandable Width="Stretched" Background="LimeGreen">
+ <Expandable Width="Stretched" Background="DimGray">
+ <Expandable Width="Stretched" Background="Yellow">
+ <Expandable Width="Stretched" Background="NavyBlue">
+ <Expandable Width="Stretched" Background="Blue">
+ <Expandable Width="Stretched" Background="BlueCrayola">
+ <Expandable Width="Stretched" Background="Green">
+ <Label Background="Red" Text="{fps}"/>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Height="Fit" Width="Fit">
+ <Label Width="Stretched"/>
+ <Expandable Width="Fit" Background="Gray">
+ <Expandable Background="LightBlue">
+ <Expandable Background="Green">
+ <Expandable Background="LimeGreen">
+ <Expandable Background="DimGray">
+ <Expandable Width="Stretched" Background="Yellow">
+ <Expandable Background="NavyBlue">
+ <Expandable Width="Stretched" Background="Blue">
+ <Expandable Width="Stretched" Background="BlueCrayola">
+ <Expandable Width="Stretched" Background="Green">
+ <Label Background="Red" Text="{fps}"/>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+ </Expandable>
+</VerticalStack>
--- /dev/null
+<?xml version="1.0"?>
+<HorizontalStack>
+ <Window Resizable="false" Focusable="true" Title="Open File..." Width="20%" Height="100%"
+ MinimumSize="10,1">
+ <DirectoryView Name="dv" Margin="10" Root="./" SelectedItemChanged="Tv_SelectedItemChanged"/>
+ </Window>
+ <Splitter/>
+ <VerticalStack Width="80%" Height="100%">
+ <Window Resizable="false" Focusable="true" Title="{../dv.SelectedItem}"
+ Height="50%" Width="Stretched"
+ MinimumSize="10,1">
+ <Container Margin="10" Name="crowContainer"/>
+ </Window>
+ <Splitter/>
+ <Window Resizable="false" Focusable="true" Title="{../dv.SelectedItem}"
+ Height="50%" Width="Stretched"
+ MinimumSize="10,1">
+ <TextBox Multiline="true" Margin="10" Height="Stretched"
+ Text="{CurSources}"/>
+ </Window>
+ </VerticalStack>
+</HorizontalStack>
--- /dev/null
+<?xml version="1.0"?>
+<!--<Container Background="vgradient|0:DarkGray|1:DimGray">-->
+ <GroupBox Fit="true" Background="vgradient|0:SteelBlue|1:Transparent"
+ Foreground="White">
+<!-- <Label/>-->
+ </GroupBox>
+<!--</Container>-->
--- /dev/null
+<?xml version="1.0"?>
+<MessageBox Title="message" Message="this is a message box"/>
+<!-- Ok="onMsgBoxOk"
+ Cancel="onMsgBoxCancel"/>-->
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack>
+ <Border Fit="true" Margin="10">
+ <VerticalStack Width="150" Height="Fit">
+ <RadioButton Caption="Left" IsChecked="true" Checked="change_alignment"/>
+ <RadioButton Caption="Right" Checked="change_alignment"/>
+ <RadioButton Caption="Top" Checked="change_alignment"/>
+ <RadioButton Caption="Bottom" Checked="change_alignment"/>
+ </VerticalStack>
+ </Border>
+ <GraphicObject Height="200"/>
+ <Popper Caption="TestPopper" Width="100" Background="DimGray" PopDirection="{alignment}">
+ <Border Fit="True" Background="ArmyGreen">
+ <Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/>
+ <VerticalStack Fit="true" Margin="10" Background="CornflowerBlue">
+ <CheckBox Name="chk1" Background="Red"/>
+ <CheckBox Name="chk2" IsChecked="true"/>
+ <CheckBox Name="chk3"/>
+ <CheckBox Name="chk4"/>
+ <HorizontalStack Fit="true" Margin="20">
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </Border>
+ </Popper>
+</VerticalStack>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<HorizontalStack Fit="true">
+ <VerticalStack Fit="true">
+ <TabView Name="tabview1"
+ Width="400" Height="200" Orientation="Horizontal" Spacing="20">
+ <TabItem Name="TabItem1" Caption="tab item 1" Margin="0">
+ <VerticalStack Fit="true">
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ <CheckBox/>
+ </VerticalStack>
+ </TabItem>
+ <TabItem Name="TabItem2" Caption="tab item 2" Width="Stretched" Height="Stretched" Margin="0" Background="Gray">
+ <VerticalStack Fit="true">
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ <RadioButton/>
+ </VerticalStack>
+ </TabItem>
+ <TabItem Name="TabItem2" Caption="tab item 3" Width="Stretched" Height="Stretched" Margin="0" Background="Gray">
+ <Container Margin="5" CornerRadius="2" Width="Stretched" Height="Stretched">
+ <TextBox Margin="5" Width="Stretched" Height="Stretched" Multiline="true" TextAlignment="TopLeft"/>
+ </Container>
+ </TabItem>
+ <TabItem Name="TabItem2" Caption="tab item 4" Width="Stretched" Height="Stretched" Margin="0" Background="Gray">
+ <TextBox/>
+ </TabItem>
+ </TabView>
+ <Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
+ Caption="Add new tab" Width="Fit" Height="30" MouseClick="onAddTabButClick"/>
+ </VerticalStack>
+</HorizontalStack>
--- /dev/null
+<?xml version="1.0"?>
+<TreeView IsRoot="true" Name="treeView" Data="{CurDirectory}" Background="DimGray">
+ <ItemTemplate DataType="System.IO.FileInfo">
+ <HorizontalStack Focusable="true" Height="Fit" Width="Stretched" Background="{../Background}" >
+ <Image Margin="2" Width="14" Height="14"
+ Path="#Crow.Images.Icons.file.svg"/>
+ <Label Text="{Name}" Width="Stretched"
+ MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
+ MouseLeave="{Background=Transparent}"/>
+ </HorizontalStack>
+ </ItemTemplate>
+ <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
+ <Expandable Caption="{Name}" >
+ <Template>
+ <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+ <HorizontalStack Spacing="1" Height="Fit" Width="{./WidthPolicy}"
+ MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
+ MouseLeave="{Background=Transparent}">
+ <Image Margin="2" Width="12" Height="12"
+ Visible="{./HasContent}"
+ Path="{./Image}"
+ SvgSub="{./IsExpanded}"/>
+ <Image Margin="2" Width="14" Height="14"
+ Path="#Crow.Images.Icons.folder.svg"/>
+ <Label Text="{./Caption}" Width="{./WidthPolicy}"/>
+ </HorizontalStack>
+ <Container Name="Content" Visible="false"
+ Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
+ </VerticalStack>
+ </Template>
+ <HorizontalStack Height="Fit" Width="{./WidthPolicy}">
+ <GraphicObject Width="12" Height="10"/>
+ <TreeView Name="List" Height="Fit" Width="{./WidthPolicy}">
+ <Template>
+ <VerticalStack Height="Fit" Width="{../WidthPolicy}" Name="List"/>
+ </Template>
+ </TreeView>
+ </HorizontalStack>
+ </Expandable>
+ </ItemTemplate>
+</TreeView>
--- /dev/null
+<?xml version="1.0"?>
+<Window Left="10" Top="10" Title="Test window"
+ Width="250" Height="550" >
+ <VerticalStack Name="contentVSStack" Margin="10" Spacing="10" Background="0.4,0.4,0.4,0.4">
+ <Slider Name="slider" Height="12" Width="Stretched" CornerRadius="3"/>
+ <GroupBox Caption="test" Height="Fit" Width="Stretched" Margin="5">
+ <VerticalStack Height="Fit" Width="Stretched" >
+ <RadioButton Caption="Radio 1" Background="Red" Width="Stretched"/>
+ <RadioButton Caption="Radio 2" IsChecked="true" />
+ <RadioButton Caption="Radio 3" />
+ <RadioButton Caption="Radio 1" Background="SkyBlue" Width="Stretched"/>
+ </VerticalStack>
+ </GroupBox>
+ <HorizontalStack Width="Stretched" Height="Fit" Margin="10" CornerRadius="5" Background="SkyBlue">
+ <RadioButton Width="80" Height="Fit" Caption="Radio 2" IsChecked="true" />
+ <GraphicObject Width="Stretched"/>
+ <RadioButton Width="80" Height="Fit" Caption="Radio 3" />
+ </HorizontalStack>
+ <HorizontalStack Width="Stretched" Height="Stretched" MinimumSize="10,40" Margin="0" CornerRadius="5"
+ Background="vgradient|0:White|0.1:SteelBlue|0.9:SteelBlue|1:Transparent">
+ <CheckBox Height="Fit" Width="80"/>
+ <GraphicObject Width="Stretched"/>
+ <CheckBox Height="Fit" Width="80" IsChecked="true"/>
+ </HorizontalStack>
+ <Border Fit="true" CornerRadius="5" BorderWidth="1" >
+ <Container Name="MainGrp" Background="0.5,0.5,0.5,0.4" Width="120" Fit="true"
+ Margin="10" Focusable="True" >
+ <VerticalStack Fit="true" Name="vsFps" Spacing="10" >
+ <HorizontalStack Fit="true">
+ <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
+ <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
+ Background="vgradient|0:AoEnglish|1:Black"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Clipping:" Width="50" TextAlignment="Right"/>
+ <Label Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
+ Background="vgradient|0:AoEnglish|1:Black"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
+ <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
+ Background="vgradient|0:AoEnglish|1:Black"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center"
+ Background="vgradient|0:AoEnglish|1:Black"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Min:" Width="50" TextAlignment="Right"/>
+ <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
+ Background="vgradient|0:AoEnglish|1:Black"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Max:" Width="50" TextAlignment="Right"/>
+ <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
+ Background="vgradient|0:AoEnglish|1:Black"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </Container>
+ </Border>
+ <HorizontalStack Fit="true" Background="BlueCrayola" Margin="3">
+ <GraphicObject Margin="10" Background="LimeGreen" Width="5" Height="5"/>
+ <TextBox Font="droid, 16" Multiline="true" Text="this is a test\nmultiline" Margin="2"/>
+ <GraphicObject Margin="10" Background="LimeGreen" Width="5" Height="5"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Window>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<Window Focusable="true" Title="Measures" Width="30%" Height="Fit" MinimumSize="100,100">
+ <VerticalStack Width="90%" Height="Fit" Spacing="1" Margin="10">
+ <HorizontalStack Height="Fit">
+ <Label Text="Fps:" Style="FpsLabel"/>
+ <Label Text="{fps}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Text="Min:" Style="FpsLabel"/>
+ <Label Text="{fpsMin}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Text="Max:" Style="FpsLabel"/>
+ <Label Text="{fpsMax}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Text="Update:" Style="FpsLabel"/>
+ <Label Text="{update}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Text="Layouting:" Style="FpsLabel"/>
+ <Label Text="{layouting}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Text="Clipping:" Style="FpsLabel"/>
+ <Label Text="{clipping}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Label Text="Drawing:" Style="FpsLabel"/>
+ <Label Text="{drawing}" Style="FpsDisp"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Window>
--- /dev/null
+<?xml version="1.0"?>
+<Window Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0.5,0.5,0.5,0.8"
+ Focusable="True" CornerRadius="20" MinimumSize="100,100" MaximumSize="500,500">
+ <Template>
+ <Container Margin="20" Name="Content" Height="{../HeightPolicy}" Width="{../WidthPolicy}" Background="0.5,0.5,0.5,0.5"/>
+ </Template>
+<!-- <Group Background="Green">-->
+ <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>
+<!-- <Scrollbar Orientation="Vertical" Height="Stretched" Width="10" Background="Blue" Margin="0" HorizontalAlignment="Right"/>-->
+<!-- </Group>-->
+</Window>
--- /dev/null
+<?xml version="1.0"?>
+<!--<ListBox Data="{TestList}" Focusable="true"/>-->
+<Border Margin="50">
+ <VerticalStack >
+ <Label Text="{../ColorList.SelectedItem}" Background="DarkGreen"/>
+ <Label Text="{Hover}" Background="DarkGreen"/>
+ <Button Caption="Clear" Width="Stretched" MouseClick="OnClear"/>
+ <ListBox Name="ColorList" Data="{TestList}" Background="0.5,0.5,0.5,0.5"
+ HorizontalAlignment="Center" Width="Fit" Height="200" Margin="0"
+ ItemTemplate="#Tests.Interfaces.colorItem.crow"
+ Template="#Crow.Templates.ScrollingListBox.goml">
+<!-- <Template>
+ <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
+ <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
+ Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
+ ValueChanged="../../../_scroller_ValueChanged">
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="100,100"
+ Name="List" Margin="0" VerticalAlignment="Top"
+ LayoutChanged="../../../../_list_LayoutChanged"/>
+ </Scroller>
+ <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
+ Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Width="12" Height="{../../../HeightPolicy}" />
+ </HorizontalStack>
+ </Border>
+ </Template>-->
+ </ListBox>
+ <Button Caption="Load list" Width="Stretched" MouseClick="../../../OnLoadList"/>
+ </VerticalStack>
+</Border>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Fit="true" Background="vgradient|0:DimGray|1:Black">
+ <HorizontalStack Fit="True">
+ <Button Caption="but" MouseClick="onButClick"/>
+ <Button Caption="but" MouseClick="onButClick" Fit="true"/>
+ <Button Width="60" Height="40" MouseClick="onButClick"/>
+ <Button Caption="Long text button" MouseClick="onButClick"/>
+ <Button Font="droid, 20" Caption="Button"/>
+ </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Fit="true" Margin="100" Background="DimGray" >
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+ <CheckBox Background="Gray" MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}"/>
+</VerticalStack>
--- /dev/null
+<?xml version="1.0"?>
+<Container Background="Onyx" Width="300">
+ <ComboBox Data="{TestList}" ItemTemplate="#Tests.Interfaces.colorItem.crow"/>
+</Container>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<Border BorderWidth="2" Fit="true">
+ <VerticalStack Fit="true" Margin="5">
+ <ListBox Data="{TestList}" Background="0.5,0.5,0.5,0.7"
+ HorizontalAlignment="Center" Width="200" Height="200" Margin="5">
+ <Template>
+ <Border BorderWidth="1" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" >
+ <Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
+ Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
+ ValueChanged="../../../_scroller_ValueChanged">
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="10,10"
+ Name="List" Margin="0"
+ VerticalAlignment="Top"
+ HorizontalAlignment="Left"
+ LayoutChanged="../../../../_list_LayoutChanged"/>
+ </Scroller>
+ <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
+ Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Width="14" Height="{../../../HeightPolicy}" />
+ </HorizontalStack>
+ </Border>
+ </Template>
+ <ItemTemplate DataType="Crow.Color">
+ <HorizontalStack
+ HorizontalAlignment="Left"
+ Height="Fit" Width="200" Margin="1" Focusable="true"
+ MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}"
+ MouseLeave="{Background=Transparent}">
+ <GraphicObject Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/>
+ <Label Text="{Name}" Margin="0" Width="Stretched"/>
+ </HorizontalStack>
+ </ItemTemplate>
+ </ListBox>
+ <HorizontalStack Fit="true" HorizontalAlignment="Right">
+ <Button Caption="Load list" MouseClick="OnLoadList"/>
+ <Button Caption="Clear" MouseClick="OnClear"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Border>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Width="200" Height="Fit" Margin="20" Background="DimGray">
+ <RadioButton Caption="Radio1"/>
+ <RadioButton Caption="Radio2" IsChecked="true"/>
+ <RadioButton Caption="Radio3"/>
+ <RadioButton Caption="Radio4"/>
+</VerticalStack>
--- /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"?>
<None Include="Interfaces\Divers\fps.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\test_Listbox.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\Divers\test_stack.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Interfaces\Divers\test1.2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testButton.crow">
+ <None Include="Interfaces\Divers\testStacks.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\Divers\testTextBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testCheckbox.crow">
+ <None Include="Interfaces\Splitter\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testCombobox.crow">
+ <None Include="OpenTK.dll.config" />
+ <None Include="image\textest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testGroupBox.crow">
+ <None Include="Interfaces\Divers\welcome.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testPopper.crow">
+ <None Include="packages.config" />
+ <None Include="Interfaces\Unsorted\testFileDialog.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testRadioButton.crow">
+ <None Include="Interfaces\Unsorted\testTypeViewer.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testScrollbar.goml">
+ <None Include="Interfaces\Divers\testPropLess.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testSpinner.goml">
+ <None Include="Interfaces\Wrapper\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testStacks.crow">
+ <None Include="Interfaces\Wrapper\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testTextBox.crow">
+ <None Include="Interfaces\Divers\testImage.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\Divers\testOutOfClipUpdate.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testWindow.goml">
+ <None Include="Interfaces\Divers\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testWindow2.goml">
+ <None Include="Interfaces\Divers\testDisable.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testWindow3.goml">
+ <None Include="Interfaces\Divers\3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Expandable\0.crow">
+ <None Include="Interfaces\TemplatedContainer\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Expandable\7.crow">
+ <None Include="Interfaces\TemplatedContainer\6.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Splitter\1.crow">
+ <None Include="Interfaces\TemplatedContainer\7.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="OpenTK.dll.config" />
- <None Include="image\textest.png">
+ <None Include="Interfaces\TemplatedControl\testButton.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\welcome.crow">
+ <None Include="Interfaces\TemplatedControl\testCheckbox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="packages.config" />
- <None Include="Interfaces\Unsorted\testFileDialog.goml">
+ <None Include="Interfaces\TemplatedControl\testCombobox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Unsorted\testTypeViewer.goml">
+ <None Include="Interfaces\TemplatedControl\testItemTemplateTag.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testDirViewer2.crow">
+ <None Include="Interfaces\TemplatedControl\testRadioButton.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testPropLess.crow">
+ <None Include="Interfaces\TemplatedControl\testScrollbar.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Wrapper\1.crow">
+ <None Include="Interfaces\TemplatedControl\testSpinner.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Wrapper\2.crow">
+ <None Include="Interfaces\TemplatedContainer\test_Listbox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testImage.crow">
+ <None Include="Interfaces\TemplatedContainer\testDirViewer2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testOutOfClipUpdate.crow">
+ <None Include="Interfaces\TemplatedContainer\testGroupBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testMsgBox.crow">
+ <None Include="Interfaces\TemplatedContainer\testMsgBox.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testTabView.crow">
+ <None Include="Interfaces\TemplatedContainer\testPopper.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testItemTemplateTag.crow">
+ <None Include="Interfaces\TemplatedContainer\testTabView.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testTreeView.crow">
+ <None Include="Interfaces\TemplatedContainer\testTreeView.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\0.crow">
+ <None Include="Interfaces\TemplatedContainer\testWindow.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Expandable\6.crow">
+ <None Include="Interfaces\TemplatedContainer\testWindow2.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testDisable.crow">
+ <None Include="Interfaces\TemplatedContainer\testWindow3.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\3.crow">
+ <None Include="Interfaces\TemplatedGroup\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Folder Include="Interfaces\GraphicObject\" />
<Folder Include="Interfaces\Group\" />
<Folder Include="Interfaces\Divers\" />
- <Folder Include="Interfaces\Expandable\" />
<Folder Include="Interfaces\Splitter\" />
<Folder Include="Interfaces\Unsorted\" />
<Folder Include="Interfaces\Wrapper\" />
+ <Folder Include="Interfaces\TemplatedControl\" />
+ <Folder Include="Interfaces\TemplatedContainer\" />
+ <Folder Include="Interfaces\TemplatedGroup\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="image\tetra.png">
NotifyValueChanged ("HasContent", HasContent);
}
}
+ //TODO: move loadTemplate and ResolveBinding in TemplatedContainer
protected override void loadTemplate(GraphicObject template = null)
{
base.loadTemplate (template);
bool _multiSelect = false;
List<GraphicObject> children = new List<GraphicObject>();
- public GraphicObject activeWidget;
-
public virtual List<GraphicObject> Children {
get { return children; }
}
--- /dev/null
+//
+// TemplatedContainer.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+// Copyright (c) 2015 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+using System.Xml.Serialization;
+using System.Xml;
+using System.Reflection;
+using System.Collections.Generic;
+
+namespace Crow
+{
+ public abstract class TemplatedGroup : TemplatedControl
+ {
+ #region CTOR
+ public TemplatedGroup () : base(){}
+ #endregion
+
+ protected Group items;
+
+ public virtual List<GraphicObject> Items{ get { return items.Children; }}
+
+ public virtual void AddItem(GraphicObject g){
+ items.AddChild (g);
+ g.LogicalParent = this;
+ }
+ public virtual void RemoveItem(GraphicObject g)
+ {
+ items.RemoveChild (g);
+ }
+
+ public virtual void ClearItems()
+ {
+ items.ClearChildren ();
+ }
+
+ protected override void loadTemplate(GraphicObject template = null)
+ {
+ base.loadTemplate (template);
+
+ items = this.child.FindByName ("ItemsContainer") as Group;
+ if (items == null)
+ throw new Exception ("TemplatedGroup template Must contain a Group named 'ItemsContainer'");
+ }
+
+ #region GraphicObject overrides
+ public override GraphicObject FindByName (string nameToFind)
+ {
+ if (Name == nameToFind)
+ return this;
+
+ foreach (GraphicObject w in Items) {
+ GraphicObject r = w.FindByName (nameToFind);
+ if (r != null)
+ return r;
+ }
+ return null;
+ }
+ public override bool Contains (GraphicObject goToFind)
+ {
+ foreach (GraphicObject w in Items) {
+ if (w == goToFind)
+ return true;
+ if (w.Contains (goToFind))
+ return true;
+ }
+ return false;
+ }
+ #endregion
+
+ #region IXmlSerialisation Overrides
+ public override void ReadXml(System.Xml.XmlReader reader)
+ {
+ using (System.Xml.XmlReader subTree = reader.ReadSubtree ()) {
+ subTree.Read ();
+ string tmp = subTree.ReadOuterXml ();
+
+ //seek for template tag
+ using (XmlReader xr = new XmlTextReader (tmp, XmlNodeType.Element, null)) {
+ xr.Read ();
+ base.ReadXml (xr);
+ }
+ //process content
+ using (XmlReader xr = new XmlTextReader (tmp, XmlNodeType.Element, null)) {
+ xr.Read (); //skip current node
+
+ while (!xr.EOF) {
+ xr.Read (); //read first child
+
+ if (!xr.IsStartElement ())
+ continue;
+
+ if (xr.Name == "Template" || Name == "ItemTemplate"){
+ xr.Skip ();
+ if (!xr.IsStartElement ())
+ continue;
+ }
+
+ Type t = Type.GetType ("Crow." + xr.Name);
+ if (t == null) {
+ Assembly a = Assembly.GetEntryAssembly ();
+ foreach (Type expT in a.GetExportedTypes ()) {
+ if (expT.Name == xr.Name)
+ t = expT;
+ }
+ }
+ if (t == null)
+ throw new Exception (xr.Name + " type not found");
+
+ GraphicObject go = (GraphicObject)Activator.CreateInstance (t);
+
+ (go as IXmlSerializable).ReadXml (xr);
+
+ AddItem (go);
+
+ xr.Read (); //closing tag
+ }
+
+ }
+ }
+ }
+ public override void WriteXml(System.Xml.XmlWriter writer)
+ {
+ throw new NotImplementedException ();
+ }
+ #endregion
+ }
+}
il.Emit (OpCodes.Ldloc_0);//save current go onto the stack if child has to be added
+ #region Template and TemplateItems loading
if (typeof(TemplatedControl).IsAssignableFrom (crowType)) {
//if its a template, first read template elements
using (IMLReader reader = new IMLReader (il, tmpXml)) {
}
}
}
+ #endregion
using (IMLReader reader = new IMLReader(il,tmpXml)){
reader.Read ();
+ #region Styling and default values loading
if (reader.HasAttributes) {
string style = reader.GetAttribute ("Style");
if (!string.IsNullOrEmpty (style)) {
}
reader.il.Emit (OpCodes.Ldloc_0);
reader.il.Emit (OpCodes.Callvirt, typeof(GraphicObject).GetMethod ("loadDefaultValues"));
+ #endregion
+ #region Attributes reading
if (reader.HasAttributes) {
MethodInfo miAddBinding = typeof(GraphicObject).GetMethod ("BindMember");
}
reader.MoveToElement ();
}
+ #endregion
if (reader.IsEmptyElement) {
reader.il.Emit (OpCodes.Pop);//pop saved ref to current object
case XmlNodeType.Element:
//Templates
if (reader.Name == "Template" ||
- reader.Name == "ItemTemplate") {
+ reader.Name == "ItemTemplate") {
reader.Skip ();
continue;
}
miAddChild = typeof(Group).GetMethod ("AddChild");
else if (typeof(Container).IsAssignableFrom (crowType))
miAddChild = typeof(Container).GetMethod ("SetChild");
- else if (typeof(TemplatedContainer).IsAssignableFrom (crowType)&&!templateLoading)
- miAddChild = typeof(TemplatedContainer).GetProperty("Content").GetSetMethod();
+ else if (typeof(TemplatedContainer).IsAssignableFrom (crowType) && !templateLoading)
+ miAddChild = typeof(TemplatedContainer).GetProperty ("Content").GetSetMethod ();
+ else if (typeof(TemplatedGroup).IsAssignableFrom (crowType) && !templateLoading)
+ miAddChild = typeof(TemplatedGroup).GetMethod ("AddItem",
+ BindingFlags.Instance | BindingFlags.Public);
else if (typeof(TemplatedControl).IsAssignableFrom (crowType))
miAddChild = typeof(TemplatedControl).GetMethod ("loadTemplate",
- BindingFlags.Instance | BindingFlags.NonPublic);
+ BindingFlags.Instance | BindingFlags.NonPublic);
else if (typeof(PrivateContainer).IsAssignableFrom (crowType))
miAddChild = typeof(PrivateContainer).GetMethod ("SetChild",
BindingFlags.Instance | BindingFlags.NonPublic);
}
-
//push current instance on stack for parenting
//loc_0 will be used for child
reader.il.Emit (OpCodes.Ldloc_0);
if (t == null)
throw new Exception (reader.Name + " type not found");
- reader.il.Emit(OpCodes.Newobj, t.GetConstructors () [0]);//TODO:search parameterless ctor
+ reader.il.Emit (OpCodes.Newobj, t.GetConstructors () [0]);//TODO:search parameterless ctor
reader.il.Emit (OpCodes.Stloc_0);//child is now loc_0
CompilerServices.emitSetCurInterface (il);
- reader.emitLoader(t);
+ reader.emitLoader (t);
reader.il.Emit (OpCodes.Ldloc_0);//load child on stack for parenting
+ if (miAddChild == null)
+ System.Diagnostics.Debugger.Break ();
reader.il.Emit (OpCodes.Callvirt, miAddChild);
reader.il.Emit (OpCodes.Stloc_0); //reset local to current go
reader.il.Emit (OpCodes.Ldloc_0);//save current go onto the stack if child has to be added