aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-07-31 12:29:20 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-07-31 12:29:20 +0200
commit9a8f162ca773a0a4b8748e631d53935dfd9831dc (patch)
tree70d93447dbfaaf7b04474ddb7542a34bf4faed10
parent5236bd6b11d26f08ed49462252bb815314e9e7dc (diff)
parent58ca25a123f4cf8ac959d9ad372494b0c40a41bb (diff)
Merge branch 'StylingImprovments'
-rw-r--r--Crow.csproj19
-rw-r--r--Default.style38
-rw-r--r--Styles/Button.style2
-rw-r--r--Styles/CheckBox.style2
-rw-r--r--Styles/ComboBox.style2
-rw-r--r--Styles/Expandable.style2
-rw-r--r--Styles/GroupBox.style2
-rw-r--r--Styles/Label.style1
-rw-r--r--Styles/MessageBox.style5
-rw-r--r--Styles/Popper.style2
-rw-r--r--Styles/RadioButton.style2
-rw-r--r--Styles/Slider.style4
-rw-r--r--Styles/Spinner.style2
-rw-r--r--Styles/Splitter.style2
-rw-r--r--Styles/TabItem.style2
-rw-r--r--Styles/TextBox.style5
-rw-r--r--Styles/TextRun.style2
-rw-r--r--Styles/Window.style4
-rwxr-xr-xTemplates/ArrowButTemplate.crow8
-rwxr-xr-xTemplates/Button.crow10
-rwxr-xr-xTemplates/ComboBox.goml6
-rw-r--r--Templates/FileDialog.goml6
-rwxr-xr-xTemplates/GroupBox.goml4
-rwxr-xr-xTemplates/ListBox.goml4
-rw-r--r--Templates/MessageBox.goml6
-rwxr-xr-xTemplates/ScrollBar.goml4
-rw-r--r--Templates/ScrollingListBox.goml4
-rwxr-xr-xTemplates/Spinner.goml4
-rw-r--r--Templates/TreeView.crow2
-rwxr-xr-xTemplates/Window.goml6
-rwxr-xr-xTemplates/imgItemTemplate.goml6
-rw-r--r--Tests/BasicTests.cs1
-rwxr-xr-xTests/Interfaces/Container/0.crow4
-rwxr-xr-xTests/Interfaces/Container/1.crow4
-rwxr-xr-xTests/Interfaces/Container/2.crow4
-rwxr-xr-xTests/Interfaces/Divers/2.crow1
-rwxr-xr-xTests/Interfaces/Divers/5.crow4
-rwxr-xr-xTests/Interfaces/Divers/fps.crow14
-rwxr-xr-xTests/Interfaces/Divers/testBorder.crow4
-rwxr-xr-xTests/Interfaces/Divers/testGrid.crow10
-rwxr-xr-xTests/Interfaces/Divers/testStacks.crow4
-rwxr-xr-xTests/Interfaces/Divers/testWindow.goml10
-rwxr-xr-xTests/Interfaces/Divers/testWindow2.goml10
-rwxr-xr-xTests/Interfaces/Divers/testWindow3.goml8
-rwxr-xr-xTests/Interfaces/Divers/test_Listbox.crow6
-rwxr-xr-xTests/Interfaces/GraphicObject/0.crow4
-rwxr-xr-xTests/Interfaces/GraphicObject/1.crow4
-rwxr-xr-xTests/Interfaces/GraphicObject/2.crow4
-rwxr-xr-xTests/Interfaces/Group/0.crow10
-rwxr-xr-xTests/Interfaces/Group/1.crow20
-rwxr-xr-xTests/Interfaces/Group/2.crow20
-rwxr-xr-xTests/Interfaces/Group/3.crow20
-rwxr-xr-xTests/Interfaces/Group/4.crow4
-rwxr-xr-xTests/Interfaces/Nouveau dossier/test4.1.crow6
-rwxr-xr-xTests/Interfaces/Nouveau dossier/test4.crow4
-rwxr-xr-xTests/Interfaces/Nouveau dossier/test6.crow6
-rwxr-xr-xTests/Interfaces/Nouveau dossier/testColorList.crow6
-rwxr-xr-xTests/Interfaces/Nouveau dossier/testDirViewer.crow6
-rwxr-xr-xTests/Interfaces/Stack/0.crow10
-rwxr-xr-xTests/Interfaces/Stack/0h.crow10
-rwxr-xr-xTests/Interfaces/Stack/1.crow8
-rwxr-xr-xTests/Interfaces/Stack/1h.crow8
-rwxr-xr-xTests/Interfaces/Stack/2.crow8
-rwxr-xr-xTests/Interfaces/Stack/2h.crow8
-rwxr-xr-xTests/Interfaces/Stack/3.crow42
-rwxr-xr-xTests/Interfaces/Stack/3h.crow42
-rwxr-xr-xTests/Interfaces/basicTests/0.crow4
-rw-r--r--Tests/OpenTKGameWindow.cs6
-rw-r--r--Tests/ui/LabelButton.style16
-rw-r--r--Tests/ui/MenuItem.style22
-rwxr-xr-xTests/ui/test.crow6
-rwxr-xr-xTests/ui/tmpWindow.crow4
-rw-r--r--src/Colors.cs6
-rw-r--r--src/CompilerServices/CompilerServices.cs1
-rw-r--r--src/Configuration.cs17
-rw-r--r--src/ExtensionsMethods.cs4
-rw-r--r--src/GraphicObjects/Button.cs1
-rw-r--r--src/GraphicObjects/CheckBox.cs24
-rw-r--r--src/GraphicObjects/ComboBox.cs24
-rw-r--r--src/GraphicObjects/Expandable.cs24
-rw-r--r--src/GraphicObjects/GraphicObject.cs159
-rw-r--r--src/GraphicObjects/GroupBox.cs26
-rw-r--r--src/GraphicObjects/Label.cs47
-rw-r--r--src/GraphicObjects/MessageBox.cs1
-rw-r--r--src/GraphicObjects/Popper.cs24
-rw-r--r--src/GraphicObjects/RadioButton.cs24
-rw-r--r--src/GraphicObjects/Slider.cs27
-rw-r--r--src/GraphicObjects/Spinner.cs1
-rw-r--r--src/GraphicObjects/Splitter.cs3
-rw-r--r--src/GraphicObjects/TabItem.cs7
-rw-r--r--src/GraphicObjects/TemplatedControl.cs6
-rw-r--r--src/GraphicObjects/TextBox.cs30
-rw-r--r--src/GraphicObjects/TextRun.cs136
-rw-r--r--src/GraphicObjects/Window.cs24
-rw-r--r--src/Interface.cs56
-rw-r--r--src/Point.cs4
-rw-r--r--src/Rectangle.cs4
-rw-r--r--src/Size.cs2
-rw-r--r--src/StyleReader.cs134
99 files changed, 851 insertions, 525 deletions
diff --git a/Crow.csproj b/Crow.csproj
index e351c246..1710e316 100644
--- a/Crow.csproj
+++ b/Crow.csproj
@@ -133,6 +133,7 @@
<Compile Include="src\Measure.cs" />
<Compile Include="src\CompilerServices\MemberReference.cs" />
<Compile Include="src\CompilerServices\Bindings.cs" />
+ <Compile Include="src\StyleReader.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@@ -171,7 +172,6 @@
<Folder Include="Images\Icons\" />
<Folder Include="src\CompilerServices\" />
<Folder Include="src\Fill\" />
- <Folder Include="Styles\" />
<Folder Include="src\Input\" />
<Folder Include="src\rsvg\" />
</ItemGroup>
@@ -231,24 +231,9 @@
<EmbeddedResource Include="Templates\TabItem.crow" />
<EmbeddedResource Include="Templates\TreeItem.crow" />
<EmbeddedResource Include="Templates\Dummy.goml" />
- <EmbeddedResource Include="Styles\CheckBox.style" />
- <EmbeddedResource Include="Styles\Splitter.style" />
- <EmbeddedResource Include="Styles\Popper.style" />
- <EmbeddedResource Include="Styles\RadioButton.style" />
- <EmbeddedResource Include="Styles\Button.style" />
- <EmbeddedResource Include="Styles\Expandable.style" />
- <EmbeddedResource Include="Styles\GroupBox.style" />
- <EmbeddedResource Include="Styles\ComboBox.style" />
- <EmbeddedResource Include="Styles\Label.style" />
- <EmbeddedResource Include="Styles\Spinner.style" />
- <EmbeddedResource Include="Styles\MessageBox.style" />
- <EmbeddedResource Include="Styles\Window.style" />
- <EmbeddedResource Include="Styles\TextBox.style" />
- <EmbeddedResource Include="Styles\TextRun.style" />
- <EmbeddedResource Include="Styles\TabItem.style" />
- <EmbeddedResource Include="Styles\Slider.style" />
<EmbeddedResource Include="Images\Icons\crow.png" />
<EmbeddedResource Include="Images\Icons\crow.svg" />
+ <EmbeddedResource Include="Default.style" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
diff --git a/Default.style b/Default.style
new file mode 100644
index 00000000..9e16e38c
--- /dev/null
+++ b/Default.style
@@ -0,0 +1,38 @@
+Button, CheckBox, RadioButton, ComboBox, Expandable,
+MessageBox, Popper, Slider, Spinner, TextBox, Window {
+ Focusable = true;
+ Height = Fit;
+}
+Button {
+ Width = Fit;
+}
+Label {
+ Fit = true;
+ Margin = 0;
+}
+MessageBox {
+ Width=200;
+ Title=MessageBox;
+ MinimumSize=150,80;
+}
+Slider {
+ Background = vgradient|0:Black|0.1:Gray|0.9:Gray|1:LightGray;
+ Foreground = Gray;
+ Width = Fit;
+}
+Splitter {
+ Focusable = true;
+ Background = DimGray;
+}
+TabItem {
+ Focusable = true;
+ CacheEnabled = false;
+}
+TextBox {
+ Background = White;
+ Foreground = Black;
+}
+Window {
+ MinimumSize=50,50;
+ Width = Fit;
+} \ No newline at end of file
diff --git a/Styles/Button.style b/Styles/Button.style
deleted file mode 100644
index 2038c524..00000000
--- a/Styles/Button.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Fit = true
diff --git a/Styles/CheckBox.style b/Styles/CheckBox.style
deleted file mode 100644
index 13d2224a..00000000
--- a/Styles/CheckBox.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Height=Fit
diff --git a/Styles/ComboBox.style b/Styles/ComboBox.style
deleted file mode 100644
index 9fa3b267..00000000
--- a/Styles/ComboBox.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Height = Fit
diff --git a/Styles/Expandable.style b/Styles/Expandable.style
deleted file mode 100644
index 9fa3b267..00000000
--- a/Styles/Expandable.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Height = Fit
diff --git a/Styles/GroupBox.style b/Styles/GroupBox.style
deleted file mode 100644
index c65238fb..00000000
--- a/Styles/GroupBox.style
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/Styles/Label.style b/Styles/Label.style
deleted file mode 100644
index d5b41383..00000000
--- a/Styles/Label.style
+++ /dev/null
@@ -1 +0,0 @@
-Fit = true
diff --git a/Styles/MessageBox.style b/Styles/MessageBox.style
deleted file mode 100644
index ed5cb20f..00000000
--- a/Styles/MessageBox.style
+++ /dev/null
@@ -1,5 +0,0 @@
-Width=200
-Height=Fit
-Title=MessageBox
-Focusable=true
-MinimumSize=150;80
diff --git a/Styles/Popper.style b/Styles/Popper.style
deleted file mode 100644
index 9fa3b267..00000000
--- a/Styles/Popper.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Height = Fit
diff --git a/Styles/RadioButton.style b/Styles/RadioButton.style
deleted file mode 100644
index 9fa3b267..00000000
--- a/Styles/RadioButton.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Height = Fit
diff --git a/Styles/Slider.style b/Styles/Slider.style
deleted file mode 100644
index e767555c..00000000
--- a/Styles/Slider.style
+++ /dev/null
@@ -1,4 +0,0 @@
-Background = vgradient|0:Black|0,1:Gray|0,9:Gray|1:LightGray
-Foreground = Gray
-Focusable = true
-Fit = true
diff --git a/Styles/Spinner.style b/Styles/Spinner.style
deleted file mode 100644
index 9fa3b267..00000000
--- a/Styles/Spinner.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Height = Fit
diff --git a/Styles/Splitter.style b/Styles/Splitter.style
deleted file mode 100644
index 536e13dd..00000000
--- a/Styles/Splitter.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-Background = DimGray
diff --git a/Styles/TabItem.style b/Styles/TabItem.style
deleted file mode 100644
index 9562848d..00000000
--- a/Styles/TabItem.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Focusable = true
-CacheEnabled = false
diff --git a/Styles/TextBox.style b/Styles/TextBox.style
deleted file mode 100644
index 2ad617a5..00000000
--- a/Styles/TextBox.style
+++ /dev/null
@@ -1,5 +0,0 @@
-Fit = true
-Focusable = true
-Background = White
-Foreground = Black
-
diff --git a/Styles/TextRun.style b/Styles/TextRun.style
deleted file mode 100644
index c2eb97fe..00000000
--- a/Styles/TextRun.style
+++ /dev/null
@@ -1,2 +0,0 @@
-Fit = true
-Margin = 2
diff --git a/Styles/Window.style b/Styles/Window.style
deleted file mode 100644
index bfe18f08..00000000
--- a/Styles/Window.style
+++ /dev/null
@@ -1,4 +0,0 @@
-Focusable=true
-Width=150
-Height=150
-MinimumSize=50;50
diff --git a/Templates/ArrowButTemplate.crow b/Templates/ArrowButTemplate.crow
index 8614670d..fe0e122c 100755
--- a/Templates/ArrowButTemplate.crow
+++ b/Templates/ArrowButTemplate.crow
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border Name="Content"
- Background="vgradient|0:White|0,1:LightGray|0,9:LightGray|1:Black" Foreground="DarkGray"
+ 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}"
- MouseUp="{Background=vgradient|0:White|0,1:LightGray|0,9:LightGray|1:Black}"
+ MouseDown="{Background=vgradient|0:Black|0.1:LightGray|0.9:LightGray|1:White}"
+ MouseUp="{Background=vgradient|0:White|0.1:LightGray|0.9:LightGray|1:Black}"
>
</Border> \ No newline at end of file
diff --git a/Templates/Button.crow b/Templates/Button.crow
index 7d128f75..8919f7dc 100755
--- a/Templates/Button.crow
+++ b/Templates/Button.crow
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>
-<Border Background="{../Background}" MinimumSize="50;20" Height="{../HeightPolicy}" Width="{../WidthPolicy}"
+<?xml version="1.0"?>
+<Border Background="{../Background}" MinimumSize="50,20" Height="{../HeightPolicy}" Width="{../WidthPolicy}"
Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
- MouseEnter="{Foreground=vgradient|0:White|0,2:Gray|0,9:Gray|1:Black;caption.Foreground=White}"
+ 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}"
- MouseUp="{Foreground=vgradient|0:White|0,2:Gray|0,9:Gray|1:Black}"
+ 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}"
>
<!-- <Image Height="0" Width="0" Margin="0" Path="{../../Image}" SvgSub="{../../SvgSub}"/>-->
<Label Font="{../../Font}" Name="caption" Margin="5" Foreground="LightGray" Text="{../../Caption}"/>
diff --git a/Templates/ComboBox.goml b/Templates/ComboBox.goml
index 9a5addaf..9688721a 100755
--- a/Templates/ComboBox.goml
+++ b/Templates/ComboBox.goml
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Popper Name="popper" PopDirection="Bottom" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<Template>
<Border CornerRadius="0" Foreground="LightGray" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
<HorizontalStack Margin="0
" Spacing="1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}">
- <TextBox MinimumSize="80;10" Margin="1" Foreground="Black" Background="White"
+ <TextBox MinimumSize="80,10" Margin="1" Foreground="Black" Background="White"
Text="{../../../../SelectedItem}"
Height="{../../../../HeightPolicy}" Width="{../../../../WidthPolicy}"/>
<Button Width="14" Height="14" Focusable="false"
@@ -17,7 +17,7 @@
<Border Background="DimGray" BorderWidth="1" Margin="1"
MinimumSize="{../../MinimumPopupSize}" Fit="true">
<Scroller Name="scroller1" Margin="2" VerticalScrolling="true"
- MaximumSize="0;200"
+ MaximumSize="0,200"
Height="{../HeightPolicy}" Width="{../WidthPolicy}"
HorizontalAlignment="Left"
ValueChanged="../../../_scroller_ValueChanged">
diff --git a/Templates/FileDialog.goml b/Templates/FileDialog.goml
index 3210edb8..c8a10c8d 100644
--- a/Templates/FileDialog.goml
+++ b/Templates/FileDialog.goml
@@ -1,16 +1,16 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Window Caption="OpenFile" Height="300" Width="500">
<VerticalStack Margin="5">
<TextBox Margin="1" Width="0" Height="-1" Text="{CurrentPath}"/>
<HorizontalStack >
<ListBox Data="{Directories}" Width="-1" Height="0"
- Background="0,5;0,5;0,5;0,5"
+ Background="0.5,0.5,0.5,0.5"
SelectedItemChanged="OnSelectedItemChanged"
Template="#Crow.Templates.ScrollingListBox.goml"
ItemTemplate="#Crow.Templates.tmpDirItem.goml" >
</ListBox>
<ListBox Data="{Files}" Width="0" Height="0"
- Background="0,5;0,5;0,5;0,5"
+ Background="0.5,0.5,0.5,0.5"
SelectedItemChanged="onFileListItemChanged"
Template="#Crow.Templates.ScrollingListBox.goml"
ItemTemplate="#Crow.Templates.imgItemTemplate.goml">
diff --git a/Templates/GroupBox.goml b/Templates/GroupBox.goml
index b00af82d..d3a16613 100755
--- a/Templates/GroupBox.goml
+++ b/Templates/GroupBox.goml
@@ -1,8 +1,8 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<Border CornerRadius="5" BorderWidth="1" Margin="6" Foreground="{../../Foreground}"
Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
- <Container Name="Content" Margin="10" MinimumSize="70;10"
+ <Container Name="Content" Margin="10" MinimumSize="70,10"
Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
</Border>
<Label Text="{../../Caption}" VerticalAlignment="Top" Left="15"
diff --git a/Templates/ListBox.goml b/Templates/ListBox.goml
index 8a8ec0d7..7ea306a9 100755
--- a/Templates/ListBox.goml
+++ b/Templates/ListBox.goml
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<Border BorderWidth="1" Margin="1" MinimumSize="10;10" Height="{../HeightPolicy}" Width="{../WidthPolicy}" >
+<?xml version="1.0"?>
+<Border BorderWidth="1" Margin="1" MinimumSize="10,10" Height="{../HeightPolicy}" Width="{../WidthPolicy}" >
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"
ValueChanged="../../_scroller_ValueChanged">
diff --git a/Templates/MessageBox.goml b/Templates/MessageBox.goml
index b8b54724..eef85052 100644
--- a/Templates/MessageBox.goml
+++ b/Templates/MessageBox.goml
@@ -1,8 +1,8 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border Height="{../HeightPolicy}" Width="{../WidthPolicy}" BorderWidth="1" Foreground="White" CornerRadius="10" >
- <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" Background="0,4;0,4;0,4;0,4">
+ <VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}" Background="0.4,0.4,0.4,0.4">
<Border BorderWidth="1" Foreground="White" Width="{../../../WidthPolicy}" Height="-1"
- Background="0,1;0,5;1,0;0,5">
+ Background="0.1,0.5;1,0,0.5">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../WidthPolicy}" Height="-1" >
<GraphicObject Width="5" Height="5"/>
<Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
diff --git a/Templates/ScrollBar.goml b/Templates/ScrollBar.goml
index ffcc121e..1310443d 100755
--- a/Templates/ScrollBar.goml
+++ b/Templates/ScrollBar.goml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border BorderWidth="1" Foreground="LightGray" Width="{../WidthPolicy}" Height="{../HeightPolicy}">
<GenericStack Orientation="{../../Orientation}" Spacing="0"
Width="{../../WidthPolicy}" Height="{../../HeightPolicy}">
@@ -12,7 +12,7 @@
Maximum="{../../../Maximum}"
LargeIncrement="{../../../LargeIncrement}"
SmallIncrement="{../../../SmallIncrement}"
- Background="hgradient|0:DimGray|0,1:Gray|0,95:Gray|1:White"
+ 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"
diff --git a/Templates/ScrollingListBox.goml b/Templates/ScrollingListBox.goml
index 7976e3d7..5d9a572d 100644
--- a/Templates/ScrollingListBox.goml
+++ b/Templates/ScrollingListBox.goml
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<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="-1" MinimumSize="10;10"
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="-1" MinimumSize="10,10"
Name="List" Margin="0" VerticalAlignment="Top"
LayoutChanged="../../../../_list_LayoutChanged"/>
</Scroller>
diff --git a/Templates/Spinner.goml b/Templates/Spinner.goml
index 03986175..0669b228 100755
--- a/Templates/Spinner.goml
+++ b/Templates/Spinner.goml
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<HorizontalStack MinimumSize="40;10" Name="hstack" Margin="0" Spacing="0" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+<?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"
Foreground="DimGray" Margin="0">
<Label Foreground="DimGray" Height="{../../../HeightPolicy}" Width="Stretched"
diff --git a/Templates/TreeView.crow b/Templates/TreeView.crow
index 165cea1c..32e3db21 100644
--- a/Templates/TreeView.crow
+++ b/Templates/TreeView.crow
@@ -1,4 +1,4 @@
-<Border Background="DimGray" BorderWidth="1" Margin="1" MinimumSize="100;100"
+<Border Background="DimGray" BorderWidth="1" Margin="1" MinimumSize="100,100"
Width="{../WidthPolicy}" Height="{../HeightPolicy}">
<VerticalStack
Height="0" Width="0" Name="List" Margin="0" VerticalAlignment="Top"/>
diff --git a/Templates/Window.goml b/Templates/Window.goml
index 5ce4347c..42bc2976 100755
--- a/Templates/Window.goml
+++ b/Templates/Window.goml
@@ -1,10 +1,10 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../HeightPolicy}" Width="{../WidthPolicy}"
MouseEnter="../onBorderMouseEnter"
MouseLeave="../onBorderMouseLeave">
<VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
<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">
+ Background="vgradient|0:0.4,0.6,0.0,0.5|1:0.0,0.8,0.8,0.9">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../WidthPolicy}" Height="Fit"
>
<GraphicObject Width="5"/>
@@ -18,6 +18,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" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}" Background="0.5,0.5,0.5,0.5"/>
</VerticalStack>
</Border> \ No newline at end of file
diff --git a/Templates/imgItemTemplate.goml b/Templates/imgItemTemplate.goml
index 39354891..c08f390e 100755
--- a/Templates/imgItemTemplate.goml
+++ b/Templates/imgItemTemplate.goml
@@ -1,8 +1,8 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<VerticalStack Width="0" Height="-1" Focusable="true"
MouseEnter="{Background=BlueCrayola}"
MouseLeave="{Background=Transparent}">
- <Image Width="-1" Height="-1" Path="{FullName}" MaximumSize="80;80"/>
- <Label Text="{Name}" Width="-1" Height="-1" Margin="0" MaximumSize="100;0"/>
+ <Image Width="-1" Height="-1" Path="{FullName}" MaximumSize="80,80"/>
+ <Label Text="{Name}" Width="-1" Height="-1" Margin="0" MaximumSize="100,0"/>
</VerticalStack>
diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs
index e194bc80..1382d739 100644
--- a/Tests/BasicTests.cs
+++ b/Tests/BasicTests.cs
@@ -78,7 +78,6 @@ namespace Tests
KeyboardKeyDown += GOLIBTests_KeyboardKeyDown1;
-
testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
//testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/basicTests", "*.crow")).ToArray ();
diff --git a/Tests/Interfaces/Container/0.crow b/Tests/Interfaces/Container/0.crow
index eec3a76f..a69e6f69 100755
--- a/Tests/Interfaces/Container/0.crow
+++ b/Tests/Interfaces/Container/0.crow
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Container Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="50;50"/>
+ MinimumSize="50,50"/>
</Container> \ No newline at end of file
diff --git a/Tests/Interfaces/Container/1.crow b/Tests/Interfaces/Container/1.crow
index 081c8715..c75ad4f7 100755
--- a/Tests/Interfaces/Container/1.crow
+++ b/Tests/Interfaces/Container/1.crow
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Container Background="Lust" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="50%" Height="50%" Background="Maize"
- MinimumSize="50;50"/>
+ MinimumSize="50,50"/>
</Container> \ No newline at end of file
diff --git a/Tests/Interfaces/Container/2.crow b/Tests/Interfaces/Container/2.crow
index 839a0fee..a8425272 100755
--- a/Tests/Interfaces/Container/2.crow
+++ b/Tests/Interfaces/Container/2.crow
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Container Background="Teal" Margin="10" Fit="true">
<GraphicObject Margin="10" Width="50%" Height="50%" Background="Malachite"
- MinimumSize="50;50"/>
+ MinimumSize="50,50"/>
</Container> \ No newline at end of file
diff --git a/Tests/Interfaces/Divers/2.crow b/Tests/Interfaces/Divers/2.crow
index 959cadb1..5b4d9c75 100755
--- a/Tests/Interfaces/Divers/2.crow
+++ b/Tests/Interfaces/Divers/2.crow
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<VerticalStack Fit="true">
+ <TextBox Font="droid, 20" Text="test text box" Width="Stretched"/>
<HorizontalStack Margin="5" Fit="true" MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}">
<Label Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/>
<Label Text="top left" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopLeft"/>
diff --git a/Tests/Interfaces/Divers/5.crow b/Tests/Interfaces/Divers/5.crow
index 305639d6..34ee42c3 100755
--- a/Tests/Interfaces/Divers/5.crow
+++ b/Tests/Interfaces/Divers/5.crow
@@ -2,9 +2,9 @@
<HorizontalStack Fit="true" Margin="5">
<VerticalStack Fit="true" Margin="2" Spacing="2">
<TextRun Text="text run test"/>
- <Label Text="label test"/>
+<!-- <Label Text="label test"/>
<TextBox Text="text box test"/>
- <Button Caption="test button"/>
+ <Button Caption="test button"/>-->
<!-- <CheckBox Caption="test checkbox"/>
<RadioButton Caption="test radiobutton"/>
<ComboBox/>
diff --git a/Tests/Interfaces/Divers/fps.crow b/Tests/Interfaces/Divers/fps.crow
index 18f96c02..6747bbd2 100755
--- a/Tests/Interfaces/Divers/fps.crow
+++ b/Tests/Interfaces/Divers/fps.crow
@@ -1,24 +1,24 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border Fit="true" CornerRadius="5" BorderWidth="1">
- <Container Name="MainGrp" Background="0,5;0,5;0,5;0,4" Width="120" Fit="true"
+ <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="Update:" Width="50" TextAlignment="Right"/>
- <Label Name="labUpdate" Text="{update}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ <Label Margin="5" Name="labUpdate" Text="{update}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
</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="AoEnglish"/>
+ <Label Margin="5" Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
<HorizontalStack Fit="true">
<Label Text="Min:" Width="50" TextAlignment="Right"/>
- <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ <Label Margin="5" Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
</HorizontalStack>
<HorizontalStack Fit="true">
<Label Text="Max:" Width="50" TextAlignment="Right"/>
- <Label Text="{fpsMax}" Font="droid , 12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ <Label Margin="5" Text="{fpsMax}" Font="droid , 12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
</HorizontalStack>
- </VerticalStack>
+ </VerticalStack>
</Container>
</Border> \ No newline at end of file
diff --git a/Tests/Interfaces/Divers/testBorder.crow b/Tests/Interfaces/Divers/testBorder.crow
index cae3c33d..40ba7cf1 100755
--- a/Tests/Interfaces/Divers/testBorder.crow
+++ b/Tests/Interfaces/Divers/testBorder.crow
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border BorderWidth="2" Width="200" Height="200" CornerRadius="2" Margin="0"
- Background="vgradient|0,65:Mantis|1:Transparent">
+ Background="vgradient|0.65:Mantis|1:Transparent">
<GraphicObject CornerRadius="20" Background="#Tests.image.crow0.svg" Margin="0" Height="100" Width="120" />
</Border>
diff --git a/Tests/Interfaces/Divers/testGrid.crow b/Tests/Interfaces/Divers/testGrid.crow
index a336c1ed..0342f9a2 100755
--- a/Tests/Interfaces/Divers/testGrid.crow
+++ b/Tests/Interfaces/Divers/testGrid.crow
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Grid RowCount="2" ColumnCount="2">
- <GraphicObject Background="0,0;0,0;0,0;1,0"/>
- <GraphicObject Background="0,0;0,0;0,5;1,0"/>
- <GraphicObject Background="0,0;0,5;0,0;1,0"/>
- <GraphicObject Background="0,5;0,0;0,0;1,0"/>
+ <GraphicObject Background="0.0,0.0,0.0,1.0"/>
+ <GraphicObject Background="0.0,0.0,0.5,1.0"/>
+ <GraphicObject Background="0.0,0.5,0.0,1.0"/>
+ <GraphicObject Background="0.5,0.0,0.0,1.0"/>
</Grid> \ No newline at end of file
diff --git a/Tests/Interfaces/Divers/testStacks.crow b/Tests/Interfaces/Divers/testStacks.crow
index 44c7c7f9..ac2cccc6 100755
--- a/Tests/Interfaces/Divers/testStacks.crow
+++ b/Tests/Interfaces/Divers/testStacks.crow
@@ -1,5 +1,5 @@
-<?xml version="1.0"?>
-<Window Width="500" Height="300" MinimumSize="50;50">
+<?xml version="1.0"?>
+<Window Width="500" Height="300" MinimumSize="50,50">
<HorizontalStack Margin="5" Background="DimGray">
<VerticalStack Width="200" Margin="5" Background="Gray">
<VerticalStack Fit="true" Background="DimGray" Margin="5">
diff --git a/Tests/Interfaces/Divers/testWindow.goml b/Tests/Interfaces/Divers/testWindow.goml
index fd24b50f..9e184dff 100755
--- a/Tests/Interfaces/Divers/testWindow.goml
+++ b/Tests/Interfaces/Divers/testWindow.goml
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?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">
+ <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" >
@@ -16,14 +16,14 @@
<GraphicObject Width="Stretched"/>
<RadioButton Width="80" Height="Fit" Caption="Radio 3" />
</HorizontalStack>
- <HorizontalStack Width="Stretched" Height="Stretched" MinimumSize="10;10" Margin="10" CornerRadius="5"
- Background="vgradient|0:White|0,1:SteelBlue|0,9:SteelBlue|1:Transparent">
+ <HorizontalStack Width="Stretched" Height="Stretched" MinimumSize="10,10" Margin="10" 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"
+ <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">
diff --git a/Tests/Interfaces/Divers/testWindow2.goml b/Tests/Interfaces/Divers/testWindow2.goml
index d7c441e6..6fb61db0 100755
--- a/Tests/Interfaces/Divers/testWindow2.goml
+++ b/Tests/Interfaces/Divers/testWindow2.goml
@@ -1,11 +1,11 @@
-<?xml version="1.0"?>
-<Window Name="window1" 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">
+<?xml version="1.0"?>
+<Window Name="window1" 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>
<Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
<Border BorderWidth="1" Foreground="White" Width="{../../../WidthPolicy}" Height="Fit"
- Background="0,1;0,5;1,0;0,5">
+ Background="0.1,0.5;1,0,0.5">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../WidthPolicy}" Height="Fit" >
<GraphicObject Width="5"/>
<Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
@@ -18,7 +18,7 @@
<GraphicObject Width="5"/>
</HorizontalStack>
</Border>
- <Container Name="Content" Height="{../../../../HeightPolicy}" Width="{../../../../WidthPolicy}" Background="0,5;0,5;0,5;0,5"/>
+ <Container Name="Content" Height="{../../../../HeightPolicy}" Width="{../../../../WidthPolicy}" Background="0.5,0.5,0.5,0.5"/>
</VerticalStack>
</Border>
</Template>
diff --git a/Tests/Interfaces/Divers/testWindow3.goml b/Tests/Interfaces/Divers/testWindow3.goml
index c1784c5d..42459bd5 100755
--- a/Tests/Interfaces/Divers/testWindow3.goml
+++ b/Tests/Interfaces/Divers/testWindow3.goml
@@ -1,8 +1,8 @@
-<?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">
+<?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"/>
+ <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"/>
diff --git a/Tests/Interfaces/Divers/test_Listbox.crow b/Tests/Interfaces/Divers/test_Listbox.crow
index 0cbc4e2a..321ea58c 100755
--- a/Tests/Interfaces/Divers/test_Listbox.crow
+++ b/Tests/Interfaces/Divers/test_Listbox.crow
@@ -1,11 +1,11 @@
-<?xml version="1.0"?>
+<?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"
+ <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">
@@ -15,7 +15,7 @@
<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"
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="100,100"
Name="List" Margin="0" VerticalAlignment="Top"
LayoutChanged="../../../../_list_LayoutChanged"/>
</Scroller>
diff --git a/Tests/Interfaces/GraphicObject/0.crow b/Tests/Interfaces/GraphicObject/0.crow
index 6185bd71..6a01cb63 100755
--- a/Tests/Interfaces/GraphicObject/0.crow
+++ b/Tests/Interfaces/GraphicObject/0.crow
@@ -1,3 +1,3 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="50;50"/> \ No newline at end of file
+ MinimumSize="50,50"/> \ No newline at end of file
diff --git a/Tests/Interfaces/GraphicObject/1.crow b/Tests/Interfaces/GraphicObject/1.crow
index 262fc24e..14ca7961 100755
--- a/Tests/Interfaces/GraphicObject/1.crow
+++ b/Tests/Interfaces/GraphicObject/1.crow
@@ -1,3 +1,3 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<GraphicObject Margin="10" Width="150" Height="150" Background="Mantis"
- MinimumSize="50;50"/> \ No newline at end of file
+ MinimumSize="50,50"/> \ No newline at end of file
diff --git a/Tests/Interfaces/GraphicObject/2.crow b/Tests/Interfaces/GraphicObject/2.crow
index dfd10ab7..74075b28 100755
--- a/Tests/Interfaces/GraphicObject/2.crow
+++ b/Tests/Interfaces/GraphicObject/2.crow
@@ -1,3 +1,3 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<GraphicObject Margin="10" Width="50%" Height="50%" Background="Mantis"
- MinimumSize="50;50"/> \ No newline at end of file
+ MinimumSize="50,50"/> \ No newline at end of file
diff --git a/Tests/Interfaces/Group/0.crow b/Tests/Interfaces/Group/0.crow
index c3cf308f..7eb5a0a6 100755
--- a/Tests/Interfaces/Group/0.crow
+++ b/Tests/Interfaces/Group/0.crow
@@ -1,11 +1,11 @@
-<?xml version="1.0"?>
-<Group MinimumSize="50;50" Background="Onyx" Margin="10" Width="90%" Height="90%">
+<?xml version="1.0"?>
+<Group MinimumSize="50,50" Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
VerticalAlignment="Top"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
VerticalAlignment="Bottom"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/Group/1.crow b/Tests/Interfaces/Group/1.crow
index 6950a8d8..6f07c3f3 100755
--- a/Tests/Interfaces/Group/1.crow
+++ b/Tests/Interfaces/Group/1.crow
@@ -1,33 +1,33 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/Group/2.crow b/Tests/Interfaces/Group/2.crow
index 693e1b05..a7cc91ab 100755
--- a/Tests/Interfaces/Group/2.crow
+++ b/Tests/Interfaces/Group/2.crow
@@ -1,33 +1,33 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Background="Onyx" Margin="10" Fit="true">
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/Group/3.crow b/Tests/Interfaces/Group/3.crow
index 321e219d..7c038551 100755
--- a/Tests/Interfaces/Group/3.crow
+++ b/Tests/Interfaces/Group/3.crow
@@ -1,33 +1,33 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Background="Onyx" Margin="10" Width="70%" Height="50%">
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="100%" Height="20%" Background="Mantis"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Bottom"
HorizontalAlignment="Right"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/Group/4.crow b/Tests/Interfaces/Group/4.crow
index 25e03bd8..02c01b29 100755
--- a/Tests/Interfaces/Group/4.crow
+++ b/Tests/Interfaces/Group/4.crow
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Background="Onyx" Margin="10" Fit="true">
<Label Font="droid bold,40" Text="{fps}" Margin="10" Fit="true"/>
<GraphicObject Margin="10" Width="20%" Height="20%" Background="Mantis"
VerticalAlignment="Top"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</Group> \ No newline at end of file
diff --git a/Tests/Interfaces/Nouveau dossier/test4.1.crow b/Tests/Interfaces/Nouveau dossier/test4.1.crow
index 1cc40e3b..2ac55cd0 100755
--- a/Tests/Interfaces/Nouveau dossier/test4.1.crow
+++ b/Tests/Interfaces/Nouveau dossier/test4.1.crow
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Name="MainGrp"
Width="800" Height="500"
- Background="0,5;0,5;0,5;0,5" Foreground="White"
+ Background="0.5,0.5,0.5,0.5" Foreground="White"
Margin="10" >
<Border
BorderWidth="2" Foreground="Transparent"
@@ -12,7 +12,7 @@
<HorizontalStack Name="hs0" Fit="true"
WidgetSpacing="10"
VerticalAlignment="Center"
- Background="0,5;0,5;0,5;0,5">
+ Background="0.5,0.5,0.5,0.5">
<VerticalStack Name="vs1"
Margin="20" Width="400" Height="Fit">
<Label Name="labMouse" Text="MousePos"/>
diff --git a/Tests/Interfaces/Nouveau dossier/test4.crow b/Tests/Interfaces/Nouveau dossier/test4.crow
index eb200fcc..06476f31 100755
--- a/Tests/Interfaces/Nouveau dossier/test4.crow
+++ b/Tests/Interfaces/Nouveau dossier/test4.crow
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Group Name="MainGrp"
Width="800" Height="500"
- Background="0,5;0,5;0,5;0,5" Foreground="White"
+ Background="0.5,0.5,0.5,0.5" Foreground="White"
Margin="10" >
<Border Margin="10" CornerRadius="10"
Name="mainBorder"
diff --git a/Tests/Interfaces/Nouveau dossier/test6.crow b/Tests/Interfaces/Nouveau dossier/test6.crow
index f75d46c7..532450da 100755
--- a/Tests/Interfaces/Nouveau dossier/test6.crow
+++ b/Tests/Interfaces/Nouveau dossier/test6.crow
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border BorderWidth="1" Foreground="White" CornerRadius="10" Width="500" Height="300">
- <VerticalStack Height="Stretched" Background="0,4;0,4;0,4;0,4">
- <Border BorderWidth="1" Foreground="White" Height="20" Background="0,1;0,5;1,0;0,5">
+ <VerticalStack Height="Stretched" Background="0.4,0.4,0.4,0.4">
+ <Border BorderWidth="1" Foreground="White" Height="20" Background="0.1,0.5;1,0,0.5">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Height="Fit" >
<GraphicObject Width="5"/>
<Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
diff --git a/Tests/Interfaces/Nouveau dossier/testColorList.crow b/Tests/Interfaces/Nouveau dossier/testColorList.crow
index ccbbb094..d9b67410 100755
--- a/Tests/Interfaces/Nouveau dossier/testColorList.crow
+++ b/Tests/Interfaces/Nouveau dossier/testColorList.crow
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?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"
+ <ListBox Data="{TestList}" Background="0.5,0.5,0.5,0.7"
HorizontalAlignment="Center" Width="200" Height="200" Margin="5"
ItemTemplate="#Tests.Interfaces.colorItem.crow">
<Template>
@@ -10,7 +10,7 @@
<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"
+ <VerticalStack Width="{../../../../WidthPolicy}" Height="Fit" MinimumSize="10,10"
Name="List" Margin="0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
diff --git a/Tests/Interfaces/Nouveau dossier/testDirViewer.crow b/Tests/Interfaces/Nouveau dossier/testDirViewer.crow
index ec32d763..dd6f9b8a 100755
--- a/Tests/Interfaces/Nouveau dossier/testDirViewer.crow
+++ b/Tests/Interfaces/Nouveau dossier/testDirViewer.crow
@@ -1,15 +1,15 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<VerticalStack Height="Fit" Width="Fit" Name="hstack" Margin="0" Spacing="Stretched">
<Border Height="Fit" Width="200" BorderWidth="2" CornerRadius="10">
<Label Name="labName" Text="{Name}" Width="Stretched" Height="Fit"/>
</Border>
<ListBox Data="{GetFileSystemInfos}" Width="Fit" Height="400"
- Background="0,5;0,5;0,5;0,5"
+ Background="0.5,0.5,0.5,0.5"
SelectedItemChanged="OnSelectedItemChanged"
ItemTemplate="Interfaces/tmpDirItem.goml" >
<Template>
- <Border BorderWidth="1" MinimumSize="20;20" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+ <Border BorderWidth="1" MinimumSize="20,20" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<HorizontalStack Margin="1" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
<Scroller Name="scroller1" Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
diff --git a/Tests/Interfaces/Stack/0.crow b/Tests/Interfaces/Stack/0.crow
index a178d8cc..63290f9e 100755
--- a/Tests/Interfaces/Stack/0.crow
+++ b/Tests/Interfaces/Stack/0.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
-<VerticalStack MinimumSize="50;50" Background="Onyx" Margin="10" Width="90%" Height="90%">
+<?xml version="1.0"?>
+<VerticalStack MinimumSize="50,50" Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/0h.crow b/Tests/Interfaces/Stack/0h.crow
index 9e31f04a..170bbed4 100755
--- a/Tests/Interfaces/Stack/0h.crow
+++ b/Tests/Interfaces/Stack/0h.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
-<HorizontalStack MinimumSize="50;50" Background="Onyx" Margin="10" Width="90%" Height="90%">
+<?xml version="1.0"?>
+<HorizontalStack MinimumSize="50,50" Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</HorizontalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/1.crow b/Tests/Interfaces/Stack/1.crow
index f8b28779..a0ac28c9 100755
--- a/Tests/Interfaces/Stack/1.crow
+++ b/Tests/Interfaces/Stack/1.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<VerticalStack Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="60%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/1h.crow b/Tests/Interfaces/Stack/1h.crow
index b86b77ac..7d97bd2c 100755
--- a/Tests/Interfaces/Stack/1h.crow
+++ b/Tests/Interfaces/Stack/1h.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<HorizontalStack Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="10" Width="Stretched" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="60%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="20%" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</HorizontalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/2.crow b/Tests/Interfaces/Stack/2.crow
index ebf1d1e9..6d8c9ad6 100755
--- a/Tests/Interfaces/Stack/2.crow
+++ b/Tests/Interfaces/Stack/2.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<VerticalStack Background="Onyx" Margin="10" Width="90%" Height="100%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/2h.crow b/Tests/Interfaces/Stack/2h.crow
index dc05fc0c..de1c36fe 100755
--- a/Tests/Interfaces/Stack/2h.crow
+++ b/Tests/Interfaces/Stack/2h.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<HorizontalStack Background="Onyx" Margin="10" Width="90%" Height="100%">
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
<GraphicObject Margin="10" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="10;10"/>
+ MinimumSize="10,10"/>
</HorizontalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/3.crow b/Tests/Interfaces/Stack/3.crow
index a5ec06ad..e46a5fff 100755
--- a/Tests/Interfaces/Stack/3.crow
+++ b/Tests/Interfaces/Stack/3.crow
@@ -1,45 +1,45 @@
<?xml version="1.0"?>
<VerticalStack Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
</VerticalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/Stack/3h.crow b/Tests/Interfaces/Stack/3h.crow
index a675876e..3a1d77dc 100755
--- a/Tests/Interfaces/Stack/3h.crow
+++ b/Tests/Interfaces/Stack/3h.crow
@@ -1,45 +1,45 @@
<?xml version="1.0"?>
<HorizontalStack Background="Onyx" Margin="10" Width="90%" Height="90%">
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Stretched" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
<GraphicObject Margin="1" Width="Stretched" Height="Fit" Background="Mantis"
- MinimumSize="2;2"/>
+ MinimumSize="2,2"/>
</HorizontalStack> \ No newline at end of file
diff --git a/Tests/Interfaces/basicTests/0.crow b/Tests/Interfaces/basicTests/0.crow
index 486399b8..b5c153ef 100755
--- a/Tests/Interfaces/basicTests/0.crow
+++ b/Tests/Interfaces/basicTests/0.crow
@@ -1,6 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Label Margin="50" Width="50%" Height="50%" TextAlignment="BottomRight" Background="Mantis"/>
<!--<Container Background="Green" Margin="10" Width="Fit" Height="Fit">
<GraphicObject Margin="10" Width="{../WidthPolicy}" Height="{../HeightPolicy}" Background="Red"
- MinimumSize="50;50"/>
+ MinimumSize="50,50"/>
</Container>--> \ No newline at end of file
diff --git a/Tests/OpenTKGameWindow.cs b/Tests/OpenTKGameWindow.cs
index 381f86c8..2b3bdb24 100644
--- a/Tests/OpenTKGameWindow.cs
+++ b/Tests/OpenTKGameWindow.cs
@@ -107,6 +107,8 @@ namespace Crow
void interfaceThread()
{
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
CrowInterface.Quit += Quit;
CrowInterface.MouseCursorChanged += CrowInterface_MouseCursorChanged;
while (CrowInterface.ClientRectangle.Size.Width == 0)
@@ -314,12 +316,12 @@ namespace Crow
#region keyboard Handling
void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e)
{
- //if (!CrowInterface.ProcessKeyDown((int)otk_e.Key))
+ if (!CrowInterface.ProcessKeyDown((int)otk_e.Key))
KeyboardKeyDown.Raise (this, otk_e);
}
void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e)
{
- //if (!CrowInterface.ProcessKeyUp((int)otk_e.Key))
+ if (!CrowInterface.ProcessKeyUp((int)otk_e.Key))
KeyboardKeyUp.Raise (this, otk_e);
}
void OpenTKGameWindow_KeyPress (object sender, OpenTK.KeyPressEventArgs e)
diff --git a/Tests/ui/LabelButton.style b/Tests/ui/LabelButton.style
index d376121f..617cfb8e 100644
--- a/Tests/ui/LabelButton.style
+++ b/Tests/ui/LabelButton.style
@@ -1,8 +1,8 @@
-MouseEnter = {Background = Gray;Foreground = White}
-Fit = true
-MouseLeave = {Background=Transparent;Foreground=Gray}
-MouseDown = {Background=Red;Foreground=White}
-MouseUp = {Background=Gray;Foreground=White}
-Foreground=Gray
-Margin=5
-CornerRadius=5
+MouseEnter = {Background = Gray;Foreground = White;}
+Fit = true;
+MouseLeave = {Background=Transparent;Foreground=Gray;}
+MouseDown = {Background=Red;Foreground=White;}
+MouseUp = {Background=Gray;Foreground=White;}
+Foreground=Gray;
+Margin=5;
+CornerRadius=5;
diff --git a/Tests/ui/MenuItem.style b/Tests/ui/MenuItem.style
index 8011ebcc..bce8e730 100644
--- a/Tests/ui/MenuItem.style
+++ b/Tests/ui/MenuItem.style
@@ -1,11 +1,11 @@
-Height = Fit
-Width = Stretched
-MinimumSize=60;10
-Margin=2
-CornerRadius=0
-TextAlignment=Left
-Foreground=Gray
-MouseEnter = {Background=SeaGreen;Foreground=White}
-MouseLeave = {Background=Transparent;Foreground=Gray}
-MouseDown = {Background=White;Foreground=DimGray}
-MouseUp = {Background=SeaGreen;Foreground=White}
+Height = Fit;
+Width = Stretched;
+MinimumSize=60;10;
+Margin=2;
+CornerRadius=0;
+TextAlignment=Left;
+Foreground=Gray;
+MouseEnter = {Background=SeaGreen;Foreground=White;}
+MouseLeave = {Background=Transparent;Foreground=Gray;}
+MouseDown = {Background=White;Foreground=DimGray;}
+MouseUp = {Background=SeaGreen;Foreground=White;}
diff --git a/Tests/ui/test.crow b/Tests/ui/test.crow
index d293a65e..da776371 100755
--- a/Tests/ui/test.crow
+++ b/Tests/ui/test.crow
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Window Font="droid bold, 10" Title="Open GL" HorizontalAlignment="Left" Width="30%" Height="90%">
<VerticalStack>
<HorizontalStack Background="Jet" Height="Fit" Width="Stretched" Margin="2">
@@ -18,8 +18,8 @@
</HorizontalStack>
<GroupBox Caption="Object Rotation" Margin="10" Width="70%" Height="Fit" >
<VerticalStack Spacing="10">
- <Spinner Width="50%" Maximum="1,0" SmallIncrement="0,01" Value="{²RotationSpeed}"/>
- <Slider Height="10" Width="50%" Maximum="1,0" SmallIncrement="0,01" Value="{²RotationSpeed}"/>
+ <Spinner Width="50%" Maximum="1,0" SmallIncrement="0.01" Value="{²RotationSpeed}"/>
+ <Slider Height="10" Width="50%" Maximum="1,0" SmallIncrement="0.01" Value="{²RotationSpeed}"/>
<CheckBox IsChecked="{²ClockWiseRotation}" Caption="Clockwise Rotation"/>
<GroupBox Caption="Rotation Axis" Height="Fit" >
<VerticalStack>
diff --git a/Tests/ui/tmpWindow.crow b/Tests/ui/tmpWindow.crow
index 08a7d58a..824ad704 100755
--- a/Tests/ui/tmpWindow.crow
+++ b/Tests/ui/tmpWindow.crow
@@ -1,9 +1,9 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Border BorderWidth="1" Foreground="White" CornerRadius="15"
Height="{../HeightPolicy}" Width="{../WidthPolicy}"
MouseEnter="../onBorderMouseEnter"
MouseLeave="../onBorderMouseLeave"
- Background="vgradient|0:0,6;0,6;0,6;0,9|1:0,4;0,4;0,4;0,6">
+ 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}">
<Label Margin="2" Font="{../../../../Font}" Text="{../../../../Title}" Width="Stretched"/>
diff --git a/src/Colors.cs b/src/Colors.cs
index 269d7ae6..e928f377 100644
--- a/src/Colors.cs
+++ b/src/Colors.cs
@@ -53,7 +53,7 @@ namespace Crow
if (string.IsNullOrEmpty(s))
return White;
- string[] c = s.Split(new char[] { ';' });
+ string[] c = s.Split(new char[] { ',' });
if (c.Length == 1)
{
@@ -1012,7 +1012,7 @@ namespace Crow
#region IXmlSerializable
public void ReadXml(System.Xml.XmlReader reader)
{
- string[] c = reader["Color"].Split(new char[] { ';' });
+ string[] c = reader["Color"].Split(new char[] { ',' });
R = double.Parse(c[0]);
G = double.Parse(c[1]);
B = double.Parse(c[2]);
@@ -1061,7 +1061,7 @@ namespace Crow
}
}
- return string.Format("{0};{1};{2};{3}", R, G, B, A);
+ return string.Format("{0},{1},{2},{3}", R, G, B, A);
}
public static object Parse(string s)
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs
index 1fff4e7d..4a85c442 100644
--- a/src/CompilerServices/CompilerServices.cs
+++ b/src/CompilerServices/CompilerServices.cs
@@ -56,6 +56,7 @@ namespace Crow
if (!b.FindTarget ())
continue;
+ //group Bindings by target instanceq
List<Binding> bindings = null;
if (!resolved.TryGetValue (b.Target.Instance, out bindings)) {
bindings = new List<Binding> ();
diff --git a/src/Configuration.cs b/src/Configuration.cs
index c3e20201..775b4c4e 100644
--- a/src/Configuration.cs
+++ b/src/Configuration.cs
@@ -41,21 +41,8 @@ namespace Crow
Assembly a = Assembly.GetEntryAssembly ();
string appName = a.GetName().Name;
- OperatingSystem os = Environment.OSVersion;
- switch (os.Platform) {
- case PlatformID.Win32S:
- case PlatformID.Win32Windows:
- case PlatformID.Win32NT:
- case PlatformID.WinCE:
- break;
- case PlatformID.Unix:
- configPath = Path.Combine (configRoot, appName);
- break;
- case PlatformID.Xbox:
- break;
- case PlatformID.MacOSX:
- break;
- }
+ configPath = Path.Combine (configRoot, appName);
+
if (!Directory.Exists(configPath))
Directory.CreateDirectory (configPath);
load ();
diff --git a/src/ExtensionsMethods.cs b/src/ExtensionsMethods.cs
index 10aaf20a..8985c929 100644
--- a/src/ExtensionsMethods.cs
+++ b/src/ExtensionsMethods.cs
@@ -65,6 +65,10 @@ namespace Crow
var ret = Run.DynamicInvoke(data);
return ret;
}
+ public static bool IsWhiteSpaceOrNewLine (this char c)
+ {
+ return c == '\t' || c == '\r' || c == '\n' || char.IsWhiteSpace (c);
+ }
}
}
diff --git a/src/GraphicObjects/Button.cs b/src/GraphicObjects/Button.cs
index 3dd10606..92238e69 100644
--- a/src/GraphicObjects/Button.cs
+++ b/src/GraphicObjects/Button.cs
@@ -12,7 +12,6 @@ using System.ComponentModel;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Button.style")]
[DefaultTemplate("#Crow.Templates.Button.crow")]
public class Button : TemplatedContainer
{
diff --git a/src/GraphicObjects/CheckBox.cs b/src/GraphicObjects/CheckBox.cs
index 71e686f9..f8193e24 100644
--- a/src/GraphicObjects/CheckBox.cs
+++ b/src/GraphicObjects/CheckBox.cs
@@ -1,10 +1,30 @@
-using System;
+//
+// CheckBox.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.ComponentModel;
using System.Xml.Serialization;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.CheckBox.style")]
[DefaultTemplate("#Crow.Templates.CheckBox.goml")]
public class CheckBox : TemplatedControl
{
diff --git a/src/GraphicObjects/ComboBox.cs b/src/GraphicObjects/ComboBox.cs
index 8888696d..e45d20df 100644
--- a/src/GraphicObjects/ComboBox.cs
+++ b/src/GraphicObjects/ComboBox.cs
@@ -1,9 +1,29 @@
-using System;
+//
+// ComboBox.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.ComboBox.style")]
[DefaultTemplate("#Crow.Templates.ComboBox.goml")]
public class ComboBox : ListBox
{
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs
index af8b5640..d21936e8 100644
--- a/src/GraphicObjects/Expandable.cs
+++ b/src/GraphicObjects/Expandable.cs
@@ -1,10 +1,30 @@
-using System;
+//
+// Expandable.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.ComponentModel;
using System.Xml.Serialization;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Expandable.style")]
[DefaultTemplate("#Crow.Templates.Expandable.goml")]
public class Expandable : TemplatedContainer
{
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index e72a2caf..c181c9ac 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -45,17 +45,14 @@ namespace Crow
uid = currentUid;
currentUid++;
- if (Interface.XmlSerializerInit)
+ if (Interface.CurrentInterface.XmlLoading)
return;
-
- loadDefaultValues ();
}
public GraphicObject (Rectangle _bounds)
{
- if (Interface.XmlSerializerInit)
- return;
-
- loadDefaultValues ();
+ if (!Interface.CurrentInterface.XmlLoading)
+ loadDefaultValues ();
+
Left = _bounds.Left;
Top = _bounds.Top;
Width = _bounds.Width;
@@ -82,8 +79,8 @@ namespace Crow
protected bool _isVisible = true;
VerticalAlignment _verticalAlignment = VerticalAlignment.Center;
HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Center;
- Size _maximumSize = "0;0";
- Size _minimumSize = "0;0";
+ Size _maximumSize = "0,0";
+ Size _minimumSize = "0,0";
bool cacheEnabled = false;
object dataSource;
string style;
@@ -419,7 +416,7 @@ namespace Crow
NotifyValueChanged ("Visible", _isVisible);
}
}
- [XmlAttributeAttribute()][DefaultValue("1;1")]
+ [XmlAttributeAttribute()][DefaultValue("1,1")]
public virtual Size MinimumSize {
get { return _minimumSize; }
set {
@@ -432,7 +429,7 @@ namespace Crow
RegisterForLayouting (LayoutingType.Sizing);
}
}
- [XmlAttributeAttribute()][DefaultValue("0;0")]
+ [XmlAttributeAttribute()][DefaultValue("0,0")]
public virtual Size MaximumSize {
get { return _maximumSize; }
set {
@@ -493,12 +490,50 @@ namespace Crow
#endif
Type thisType = this.GetType ();
- if (Interface.DefaultValuesLoader.ContainsKey(thisType.FullName)) {
- Interface.DefaultValuesLoader[thisType.FullName] (this);
- applyStyle ();
+
+ if (!string.IsNullOrEmpty (Style)) {
+ if (Interface.DefaultValuesLoader.ContainsKey (Style)) {
+ Interface.DefaultValuesLoader [Style] (this);
+ return;
+ }
+ }
+ if (Interface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
+ Interface.DefaultValuesLoader [thisType.FullName] (this);
return;
}
+ if (Interface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
+ Interface.DefaultValuesLoader [thisType.Name] (this);
+ return;
+ }
+
+ List<Dictionary<string, object>> styling = new List<Dictionary<string, object>>();
+
+ //Search for a style mathing :
+ //1: Full class name, with full namespace
+ //2: class name
+ //3: style may have been registered with their ressource ID minus .style extention
+ // those files being placed in a Styles folder
+ string styleKey = Style;
+ if (!string.IsNullOrEmpty (Style)) {
+ if (Interface.CurrentInterface.Styling.ContainsKey (Style)) {
+ styling.Add (Interface.CurrentInterface.Styling [Style]);
+ }
+ }
+ if (Interface.CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
+ styling.Add (Interface.CurrentInterface.Styling [thisType.FullName]);
+ if (string.IsNullOrEmpty (styleKey))
+ styleKey = thisType.FullName;
+ }
+ if (Interface.CurrentInterface.Styling.ContainsKey (thisType.Name)) {
+ styling.Add (Interface.CurrentInterface.Styling [thisType.Name]);
+ if (string.IsNullOrEmpty (styleKey))
+ styleKey = thisType.Name;
+ }
+ if (string.IsNullOrEmpty (styleKey))
+ styleKey = thisType.FullName;
+
+
//Reflexion being very slow compared to dyn method or delegates,
//I compile the initial values coded in the CustomAttribs of the class,
//all other instance of this type would not longer use reflexion to init properly
@@ -535,13 +570,20 @@ namespace Crow
else
name = xaa.AttributeName;
}
- if (name == "Style"){
- //retrieve default value from class attribute
- DefaultStyle defStyle = thisType.GetCustomAttribute<DefaultStyle>();
- if (defStyle != null)
- defaultValue = defStyle.Path;
- }else{
- DefaultValueAttribute dv = (DefaultValueAttribute)pi.GetCustomAttribute (typeof(DefaultValueAttribute));
+
+ int styleIndex = -1;
+ if (styling.Count > 0){
+ for (int i = 0; i < styling.Count; i++) {
+ if (styling[i].ContainsKey (name)){
+ styleIndex = i;
+ break;
+ }
+ }
+ }
+ if (styleIndex >= 0){
+ defaultValue = styling[styleIndex] [name];
+ }else {
+ DefaultValueAttribute dv = (DefaultValueAttribute)pi.GetCustomAttribute (typeof (DefaultValueAttribute));
if (dv == null)
continue;
defaultValue = dv.Value;
@@ -621,10 +663,12 @@ namespace Crow
//surely a class or struct
if (dvType != typeof(string))
throw new Exception ("Expecting String in default values for: " + pi.Name);
- if (pi.PropertyType == typeof(string))
+ if (pi.PropertyType == typeof (string))
il.Emit (OpCodes.Ldstr, Convert.ToString (defaultValue));
else {
- MethodInfo miParse = pi.PropertyType.GetMethod ("Parse", BindingFlags.Static | BindingFlags.Public);
+ MethodInfo miParse = pi.PropertyType.GetMethod
+ ("Parse", BindingFlags.Static | BindingFlags.Public,
+ Type.DefaultBinder, new Type [] {typeof (string)},null);
if (miParse == null)
throw new Exception ("no Parse method found for: " + pi.PropertyType.FullName);
@@ -640,9 +684,8 @@ namespace Crow
il.Emit(OpCodes.Ret);
#endregion
- Interface.DefaultValuesLoader[thisType.FullName] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
- Interface.DefaultValuesLoader[thisType.FullName] (this);
- applyStyle ();
+ Interface.DefaultValuesLoader[styleKey] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
+ Interface.DefaultValuesLoader[styleKey] (this);
}
public virtual GraphicObject FindByName(string nameToFind){
@@ -682,7 +725,7 @@ namespace Crow
protected Size contentSize;
/// <summary> return size of content + margins </summary>
protected virtual int measureRawSize (LayoutingType lt) {
- return lt == LayoutingType.Width ?
+ return lt == LayoutingType.Width ?
contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin;
}
/// <summary> By default in groups, LayoutingType.ArrangeChildren is reset </summary>
@@ -808,7 +851,7 @@ namespace Crow
}
} else
Slot.Y = Top;
-
+
if (LastSlots.Y == Slot.Y)
break;
@@ -880,7 +923,7 @@ namespace Crow
}
} else
Slot.Height = 0;
-
+
if (LastSlots.Height == Slot.Height)
break;
@@ -888,7 +931,7 @@ namespace Crow
OnLayoutChanges (layoutType);
- LastSlots.Height = Slot.Height;
+ LastSlots.Height = Slot.Height;
break;
}
@@ -1200,7 +1243,7 @@ namespace Crow
MemberInfo mi = thisType.GetMember (name).FirstOrDefault();
if (mi == null) {
- Debug.WriteLine ("GOML: Unknown attribute in " + thisType.ToString() + " : " + name);
+ Debug.WriteLine ("XML: Unknown attribute in " + thisType.ToString() + " : " + name);
return;
}
if (mi.MemberType == MemberTypes.Event) {
@@ -1223,7 +1266,7 @@ namespace Crow
if (value.StartsWith("{",StringComparison.Ordinal)) {
//binding
if (!value.EndsWith("}", StringComparison.Ordinal))
- throw new Exception (string.Format("GOML:Malformed binding: {0}", value));
+ throw new Exception (string.Format("XML:Malformed binding: {0}", value));
this.Bindings.Add (new Binding (new MemberReference(this, pi), value.Substring (1, value.Length - 2)));
return;
@@ -1246,51 +1289,23 @@ namespace Crow
}
}
}
- void applyStyle(){
- //The first place searched for a style is in the style propery of this instance
- //this field may contains the path to a Style file for the object.
- if (string.IsNullOrEmpty (style))
- return;
- Stream s = Interface.GetStreamFromPath (style);
- if (s == null)
- throw new Exception ("Style Path not found: " + style);
-
- #if DEBUG_LOAD
- Debug.WriteLine ("ApplyStyle for " + this.ToString ());
- #endif
- using (StreamReader sr = new StreamReader (s)) {
- while (!sr.EndOfStream) {
- string tmp = sr.ReadLine ();
- if (string.IsNullOrWhiteSpace (tmp))
- continue;
- int i = tmp.IndexOf ('=');
- if (i < 0)
- continue;
- string name = tmp.Substring (0, i).Trim();
- string value = tmp.Substring (i + 1).Trim ();
-
- affectMember (name, value);
- }
- }
- }
public virtual void ReadXml (System.Xml.XmlReader reader)
{
- if (!reader.HasAttributes)
- return;
+ if (reader.HasAttributes) {
- string stylePath = reader.GetAttribute ("Style");
+ style = reader.GetAttribute ("Style");
- if (!string.IsNullOrEmpty (style)) {
- Style = stylePath;
- applyStyle ();
- }
- while (reader.MoveToNextAttribute ()) {
- if (reader.Name == "Style")
- continue;
+ loadDefaultValues ();
- affectMember (reader.Name, reader.Value);
- }
- reader.MoveToElement();
+ while (reader.MoveToNextAttribute ()) {
+ if (reader.Name == "Style")
+ continue;
+
+ affectMember (reader.Name, reader.Value);
+ }
+ reader.MoveToElement ();
+ }else
+ loadDefaultValues ();
}
public virtual void WriteXml (System.Xml.XmlWriter writer)
{
diff --git a/src/GraphicObjects/GroupBox.cs b/src/GraphicObjects/GroupBox.cs
index 86c659d0..886e7964 100644
--- a/src/GraphicObjects/GroupBox.cs
+++ b/src/GraphicObjects/GroupBox.cs
@@ -1,10 +1,30 @@
-using System;
+//
+// GroupBox.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.ComponentModel;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.GroupBox.style")]
[DefaultTemplate("#Crow.Templates.GroupBox.goml")]
public class GroupBox : TemplatedContainer
{
@@ -32,7 +52,7 @@ namespace Crow
}
#endregion
- [XmlAttributeAttribute()][DefaultValue("Groupbox")]
+ [XmlAttributeAttribute][DefaultValue("Groupbox")]
public string Caption {
get { return caption; }
set {
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 6831a9cc..505bd69e 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -1,7 +1,27 @@
-using System;
+//
+// Label.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Diagnostics;
using Cairo;
using System.Text.RegularExpressions;
@@ -10,7 +30,6 @@ using System.ComponentModel;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Label.style")]
public class Label : GraphicObject
{
#region CTOR
@@ -52,7 +71,7 @@ namespace Crow
protected TextExtents te;
#endregion
- [XmlAttributeAttribute()][DefaultValue("SteelBlue")]
+ [XmlAttributeAttribute][DefaultValue("SteelBlue")]
public virtual Color SelectionBackground {
get { return selColor; }
set {
@@ -63,7 +82,7 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue("White")]
+ [XmlAttributeAttribute][DefaultValue("White")]
public virtual Color SelectionForeground {
get { return selFontColor; }
set {
@@ -74,7 +93,7 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue(Alignment.Left)]
+ [XmlAttributeAttribute][DefaultValue(Alignment.Left)]
public Alignment TextAlignment
{
get { return _textAlignment; }
@@ -87,7 +106,7 @@ namespace Crow
NotifyValueChanged ("TextAlignment", _textAlignment);
}
}
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute][DefaultValue(false)]
public virtual bool HorizontalStretch {
get { return horizontalStretch; }
set {
@@ -98,7 +117,7 @@ namespace Crow
NotifyValueChanged ("HorizontalStretch", horizontalStretch);
}
}
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute][DefaultValue(false)]
public virtual bool VerticalStretch {
get { return verticalStretch; }
set {
@@ -109,7 +128,7 @@ namespace Crow
}
}
- [XmlAttributeAttribute()][DefaultValue("label")]
+ [XmlAttributeAttribute][DefaultValue("label")]
public string Text
{
get {
@@ -133,7 +152,7 @@ namespace Crow
NotifyValueChanged ("Text", _text);
}
}
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute][DefaultValue(false)]
public bool Multiline
{
get { return _multiline; }
@@ -146,7 +165,7 @@ namespace Crow
RegisterForGraphicUpdate();
}
}
- [XmlAttributeAttribute()][DefaultValue(0)]
+ [XmlAttributeAttribute][DefaultValue(0)]
public int CurrentColumn{
get { return _currentCol; }
set {
@@ -161,7 +180,7 @@ namespace Crow
NotifyValueChanged ("CurrentColumn", _currentCol);
}
}
- [XmlAttributeAttribute()][DefaultValue(0)]
+ [XmlAttributeAttribute][DefaultValue(0)]
public int CurrentLine{
get { return _currentLine; }
set {
@@ -181,7 +200,7 @@ namespace Crow
}
}
//TODO:using HasFocus for drawing selection cause SelBegin and Release binding not to work
- [XmlAttributeAttribute()][DefaultValue("-1")]
+ [XmlAttributeAttribute][DefaultValue("-1")]
public Point SelBegin {
get {
return _selBegin;
@@ -194,7 +213,7 @@ namespace Crow
NotifyValueChanged ("SelectedText", SelectedText);
}
}
- [XmlAttributeAttribute()][DefaultValue("-1")]
+ [XmlAttributeAttribute][DefaultValue("-1")]
public Point SelRelease {
get {
return _selRelease;
diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs
index 2114262e..550f5b72 100644
--- a/src/GraphicObjects/MessageBox.cs
+++ b/src/GraphicObjects/MessageBox.cs
@@ -23,7 +23,6 @@ using System.ComponentModel;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.MessageBox.style")]
[DefaultTemplate("#Crow.Templates.MessageBox.goml")]
public class MessageBox : Window
{
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 5e5541fe..14e7ec7a 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -1,11 +1,31 @@
-using System;
+//
+// Popper.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.ComponentModel;
using OpenTK.Input;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Popper.style")]
[DefaultTemplate("#Crow.Templates.Popper.goml")]
public class Popper : TemplatedContainer
{
diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs
index a6248706..ffd5ba27 100644
--- a/src/GraphicObjects/RadioButton.cs
+++ b/src/GraphicObjects/RadioButton.cs
@@ -1,10 +1,30 @@
-using System;
+//
+// RadioButton.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.ComponentModel;
using System.Xml.Serialization;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.RadioButton.style")]
[DefaultTemplate("#Crow.Templates.RadioButton.goml")]
public class RadioButton : TemplatedControl
{
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index 3b2cebf4..bce74971 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -1,7 +1,25 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+//
+// Slider.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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 Cairo;
using System.Xml.Serialization;
using System.ComponentModel;
@@ -9,7 +27,6 @@ using System.Diagnostics;
namespace Crow
{
- [DefaultStyle ("#Crow.Styles.Slider.style")]
public class Slider : NumericControl
{
#region CTOR
diff --git a/src/GraphicObjects/Spinner.cs b/src/GraphicObjects/Spinner.cs
index 9447f205..1a8674d0 100644
--- a/src/GraphicObjects/Spinner.cs
+++ b/src/GraphicObjects/Spinner.cs
@@ -22,7 +22,6 @@ using System;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Spinner.style")]
[DefaultTemplate("#Crow.Templates.Spinner.goml")]
public class Spinner : NumericControl
{
diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs
index 248863b5..f3321065 100644
--- a/src/GraphicObjects/Splitter.cs
+++ b/src/GraphicObjects/Splitter.cs
@@ -24,7 +24,6 @@ using System.ComponentModel;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Splitter.style")]
public class Splitter : GraphicObject
{
#region CTOR
@@ -33,7 +32,7 @@ namespace Crow
int thickness;
- [XmlAttributeAttribute()][DefaultValue(1)]
+ [XmlAttributeAttribute][DefaultValue(1)]
public virtual int Thickness {
get { return thickness; }
set {
diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs
index 38d56c5d..2d2ba453 100644
--- a/src/GraphicObjects/TabItem.cs
+++ b/src/GraphicObjects/TabItem.cs
@@ -25,7 +25,6 @@ using System.Diagnostics;
namespace Crow
{
- [DefaultStyle ("#Crow.Styles.TabItem.style")]
[DefaultTemplate("#Crow.Templates.TabItem.crow")]
public class TabItem : TemplatedContainer
{
@@ -67,7 +66,7 @@ namespace Crow
internal GraphicObject TabTitle { get { return _tabTitle; }}
#endregion
- [XmlAttributeAttribute()][DefaultValue(0)]
+ [XmlAttributeAttribute][DefaultValue(0)]
public virtual int TabOffset {
get { return tabOffset; }
set {
@@ -80,7 +79,7 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue("TabItem")]
+ [XmlAttributeAttribute][DefaultValue("TabItem")]
public string Caption {
get { return caption; }
set {
@@ -91,7 +90,7 @@ namespace Crow
}
}
bool isSelected;
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute][DefaultValue(false)]
public virtual bool IsSelected {
get { return isSelected; }
set {
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs
index c8ec2d9e..12c2b81f 100644
--- a/src/GraphicObjects/TemplatedControl.cs
+++ b/src/GraphicObjects/TemplatedControl.cs
@@ -37,11 +37,7 @@ namespace Crow
Path = path;
}
}
- [AttributeUsage(AttributeTargets.Class)]
- public class DefaultStyle : TemplateAttribute
- {
- public DefaultStyle(string path) : base(path){}
- }
+
[AttributeUsage(AttributeTargets.Class)]
public class DefaultTemplate : TemplateAttribute
{
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index 7d61d5ab..fc02f0d6 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -1,17 +1,31 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+//
+// TextBox.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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 Cairo;
using System.Diagnostics;
using System.Xml.Serialization;
-using System.Globalization;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.TextBox.style")]
public class TextBox : Label
{
#region CTOR
diff --git a/src/GraphicObjects/TextRun.cs b/src/GraphicObjects/TextRun.cs
index 6af22025..35b46f18 100644
--- a/src/GraphicObjects/TextRun.cs
+++ b/src/GraphicObjects/TextRun.cs
@@ -10,32 +10,30 @@ using System.ComponentModel;
namespace Crow
{
- [Serializable]
- [DefaultStyle("#Crow.Styles.TextRun.style")]
- public class TextRun : GraphicObject
- {
+ public class TextRun : GraphicObject
+ {
#region CTOR
- public TextRun()
- {
+ public TextRun ()
+ {
}
- public TextRun(string _text)
- : base()
+ public TextRun (string _text)
+ : base ()
{
Text = _text;
}
#endregion
- //TODO:change protected to private
-
+ //TODO:change protected to private
+
#region private and protected fields
protected string _text = "label";
- Alignment _textAlignment = Alignment.Left;
+ Alignment _textAlignment = Alignment.Left;
bool horizontalStretch = false;
bool verticalStretch = false;
bool _multiline;
bool wordWrap;
- protected Rectangle rText;
+ protected Rectangle rText;
protected float widthRatio = 1f;
protected float heightRatio = 1f;
protected FontExtents fe;
@@ -43,69 +41,70 @@ namespace Crow
#endregion
- [XmlAttributeAttribute()][DefaultValue(Alignment.Left)]
- public Alignment TextAlignment
- {
- get { return _textAlignment; }
- set { _textAlignment = value; }
- }
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute ()]
+ [DefaultValue (Alignment.Left)]
+ public Alignment TextAlignment {
+ get { return _textAlignment; }
+ set { _textAlignment = value; }
+ }
+ [XmlAttributeAttribute ()]
+ [DefaultValue (false)]
public virtual bool HorizontalStretch {
get { return horizontalStretch; }
set {
if (horizontalStretch == value)
return;
- horizontalStretch = value;
+ horizontalStretch = value;
RegisterForGraphicUpdate ();
NotifyValueChanged ("HorizontalStretch", horizontalStretch);
}
}
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute ()]
+ [DefaultValue (false)]
public virtual bool VerticalStretch {
get { return verticalStretch; }
set {
if (verticalStretch == value)
return;
- verticalStretch = value;
+ verticalStretch = value;
NotifyValueChanged ("VerticalStretch", verticalStretch);
}
- }
- [XmlAttributeAttribute()][DefaultValue("label")]
- public string Text
- {
- get {
- return lines == null ?
- _text : lines.Aggregate((i, j) => i + Interface.LineBreak + j);
+ }
+ [XmlAttributeAttribute ()]
+ [DefaultValue ("label")]
+ public string Text {
+ get {
+ return lines == null ?
+ _text : lines.Aggregate ((i, j) => i + Interface.LineBreak + j);
}
- set
- {
- if (_text == value)
- return;
-
- RegisterForGraphicUpdate();
+ set {
+ if (_text == value)
+ return;
+
+ RegisterForGraphicUpdate ();
this.RegisterForLayouting (LayoutingType.Sizing);
- _text = value;
+ _text = value;
- if (string.IsNullOrEmpty(_text))
+ if (string.IsNullOrEmpty (_text))
_text = "";
lines = getLines;
- }
- }
- [XmlAttributeAttribute()][DefaultValue(false)]
- public bool Multiline
- {
+ }
+ }
+ [XmlAttributeAttribute ()]
+ [DefaultValue (false)]
+ public bool Multiline {
get { return _multiline; }
- set
- {
+ set {
_multiline = value;
- RegisterForGraphicUpdate();
+ RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue(false)]
+ [XmlAttributeAttribute ()]
+ [DefaultValue (false)]
public bool WordWrap {
get {
return wordWrap;
@@ -114,22 +113,22 @@ namespace Crow
if (wordWrap == value)
return;
wordWrap = value;
- RegisterForGraphicUpdate();
+ RegisterForGraphicUpdate ();
}
}
List<string> lines;
List<string> getLines {
- get {
+ get {
return _multiline ?
- Regex.Split (_text, "\r\n|\r|\n").ToList() :
- new List<string>(new string[] { _text });
+ Regex.Split (_text, "\r\n|\r|\n").ToList () :
+ new List<string> (new string [] { _text });
}
}
#region GraphicObject overrides
- protected override int measureRawSize(LayoutingType lt)
- {
+ protected override int measureRawSize (LayoutingType lt)
+ {
if (lines == null)
lines = getLines;
@@ -142,13 +141,13 @@ namespace Crow
fe = gr.FontExtents;
- te = new TextExtents();
+ te = new TextExtents ();
- if (lt == LayoutingType.Height){
+ if (lt == LayoutingType.Height) {
int lc = lines.Count;
//ensure minimal height = text line height
if (lc == 0)
- lc = 1;
+ lc = 1;
return (int)(fe.Height * lc) + Margin * 2;
}
@@ -173,8 +172,8 @@ namespace Crow
gr.Antialias = Antialias.Subpixel;
- rText = new Rectangle(new Size(
- measureRawSize(LayoutingType.Width), measureRawSize(LayoutingType.Height)));
+ rText = new Rectangle (new Size (
+ measureRawSize (LayoutingType.Width), measureRawSize (LayoutingType.Height)));
rText.Width -= 2 * Margin;
rText.Height -= 2 * Margin;
@@ -185,16 +184,16 @@ namespace Crow
//ignore text alignment if size to content = true
//or if text size is larger than client bounds
- if (Width < 0 || Height < 0 || rText.Width > cb.Width)
- {
+ if (Width < 0 || Height < 0 || rText.Width > cb.Width) {
rText.X = cb.X;
rText.Y = cb.Y;
- }else {
+ } else {
if (horizontalStretch) {
widthRatio = (float)cb.Width / rText.Width;
if (!verticalStretch)
heightRatio = widthRatio;
- }if (verticalStretch) {
+ }
+ if (verticalStretch) {
heightRatio = (float)cb.Height / rText.Height;
if (!horizontalStretch)
widthRatio = heightRatio;
@@ -203,8 +202,7 @@ namespace Crow
rText.Width = (int)(widthRatio * cb.Width);
rText.Height = (int)(heightRatio * cb.Height);
- switch (TextAlignment)
- {
+ switch (TextAlignment) {
case Alignment.TopLeft: //ok
rText.X = cb.X;
rText.Y = cb.Y;
@@ -244,11 +242,11 @@ namespace Crow
}
}
- gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
+ gr.FontMatrix = new Matrix (widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
int curLineCount = 0;
- for (int i = 0;i < lines.Count;i++) {
+ for (int i = 0; i < lines.Count; i++) {
string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));
List<string> wl = new List<string> ();
int lineLength = (int)gr.TextExtents (l).XAdvance;
@@ -272,14 +270,14 @@ namespace Crow
foreach (string ll in wl) {
lineLength = (int)gr.TextExtents (ll).XAdvance;
-
+
if (string.IsNullOrWhiteSpace (ll)) {
curLineCount++;
continue;
}
- Foreground.SetAsSource (gr);
+ Foreground.SetAsSource (gr);
gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * curLineCount);
gr.ShowText (ll);
@@ -287,8 +285,8 @@ namespace Crow
curLineCount++;
}
- }
+ }
}
#endregion
- }
+ }
}
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs
index afb4f4f2..cbdbbb2c 100644
--- a/src/GraphicObjects/Window.cs
+++ b/src/GraphicObjects/Window.cs
@@ -1,11 +1,31 @@
-using System;
+//
+// Window.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.ComponentModel;
using System.Diagnostics;
namespace Crow
{
- [DefaultStyle("#Crow.Styles.Window.style")]
[DefaultTemplate("#Crow.Templates.Window.goml")]
public class Window : TemplatedContainer
{
diff --git a/src/Interface.cs b/src/Interface.cs
index 30fa4b74..02b6efaf 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -22,6 +22,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+using System.Linq;
using System.Reflection;
using System.Threading;
using System.Xml;
@@ -33,7 +34,7 @@ namespace Crow
/// <summary>
/// The Interface Class is the top container of the application.
/// It provides the Dirty bitmap and zone of the interface to be drawn on screen
- ///
+ ///
/// The Interface contains :
/// - rendering and layouting queues and logic.
/// - helpers to load XML interfaces files
@@ -52,14 +53,13 @@ namespace Crow
FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb;
}
public Interface(){
- LayoutingQueue = new Queue<LayoutingQueueItem>();
Interface.CurrentInterface = this;
+ LoadStyling ();
}
#endregion
#region Static and constants
- /// <summary> Used to prevent spurious loading of templates </summary>
- internal static bool XmlSerializerInit = false;
+ internal bool XmlLoading = false;
/// <summary> keep ressource path for debug msg </summary>
internal static string CurrentGOMLPath = "";
//used in templatedControl
@@ -87,11 +87,9 @@ namespace Crow
public static FontOptions FontRenderingOptions;
#endregion
- /// <summary>
- /// The layouting queue contains layouting commands
- /// </summary>
- public Queue<LayoutingQueueItem> LayoutingQueue;
+ public Queue<LayoutingQueueItem> LayoutingQueue = new Queue<LayoutingQueueItem> ();
public Queue<GraphicObject> GraphicUpdateQueue = new Queue<GraphicObject>();
+ public Dictionary<string, Dictionary<string, object>> Styling;
public string Clipboard;
public static void RegisterForGraphicUpdate(GraphicObject g)
{
@@ -202,6 +200,9 @@ namespace Crow
}
public static GraphicObject Load (string path, object hostClass = null)
{
+ System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
Interface.XmlLoaderCount ++;
CurrentGOMLPath = path;
GraphicObject tmp = null;
@@ -209,9 +210,12 @@ namespace Crow
tmp = Load(stream, GetTopContainerOfGOMLStream(stream), hostClass);
}
Interface.XmlLoaderCount --;
+
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+
return tmp;
}
- public static GraphicObject Load (Stream stream, Type type, object hostClass = null)
+ internal static GraphicObject Load (Stream stream, Type type, object hostClass = null)
{
#if DEBUG_LOAD
Stopwatch loadingTime = new Stopwatch ();
@@ -220,16 +224,16 @@ namespace Crow
GraphicObject result;
+ CurrentInterface.XmlLoading = true;
XmlSerializerNamespaces xn = new XmlSerializerNamespaces ();
xn.Add ("", "");
- XmlSerializerInit = true;
XmlSerializer xs = new XmlSerializer (type);
- XmlSerializerInit = false;
result = (GraphicObject)xs.Deserialize (stream);
//result.DataSource = hostClass;
+ CurrentInterface.XmlLoading = false;
#if DEBUG_LOAD
FileStream fs = stream as FileStream;
@@ -245,11 +249,6 @@ namespace Crow
return result;
}
- public void InterfaceLoad(string path){
- GraphicObject tmp = Interface.Load (path, this);
- AddWidget (tmp);
- }
-
public GraphicObject LoadInterface (string path)
{
lock (UpdateMutex) {
@@ -260,6 +259,29 @@ namespace Crow
}
}
+ public void LoadStyling() {
+ System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
+ Styling = new Dictionary<string, Dictionary<string, object>> ();
+
+ //fetch styling info in this order, if member styling is alreadey referenced in previous
+ //assembly, it's ignored.
+ loadStylingFromAssembly (Assembly.GetEntryAssembly ());
+ loadStylingFromAssembly (Assembly.GetExecutingAssembly ());
+
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+ }
+
+ void loadStylingFromAssembly (Assembly assembly) {
+ foreach (string s in assembly
+ .GetManifestResourceNames ()
+ .Where (r => r.EndsWith (".style", StringComparison.OrdinalIgnoreCase))) {
+
+ StyleReader sr = new StyleReader (assembly, s);
+ sr.Dispose ();
+ }
+ }
#endregion
#if MEASURE_TIME
@@ -712,7 +734,7 @@ namespace Crow
#endregion
#region Keyboard
- public bool ProcessKeyDown(int Key){
+ public bool ProcessKeyDown(int Key){
if (_focusedWidget == null)
return false;
KeyboardKeyEventArgs e = new KeyboardKeyEventArgs((Crow.Key)Key, false, Keyboard);
diff --git a/src/Point.cs b/src/Point.cs
index 76beaa99..ba0103e3 100644
--- a/src/Point.cs
+++ b/src/Point.cs
@@ -130,7 +130,7 @@ namespace Crow
public override string ToString()
{
- return string.Format("({0};{1})", X, Y);
+ return string.Format("({0},{1})", X, Y);
}
public override bool Equals(object obj)
@@ -145,7 +145,7 @@ namespace Crow
{
if (string.IsNullOrEmpty (s))
return default(Point);
- string[] d = s.Trim().Split(';');
+ string[] d = s.Trim().Split(',');
if (d.Length == 2)
return new Point (int.Parse (d [0]), int.Parse (d [1]));
else if (d.Length == 1) {
diff --git a/src/Rectangle.cs b/src/Rectangle.cs
index e9445224..9a4ef396 100644
--- a/src/Rectangle.cs
+++ b/src/Rectangle.cs
@@ -236,11 +236,11 @@ namespace Crow
}
public override string ToString()
{
- return string.Format("{0};{1};{2};{3}", X, Y, Width, Height);
+ return string.Format("{0},{1},{2},{3}", X, Y, Width, Height);
}
public static Rectangle Parse(string s)
{
- string[] d = s.Split(new char[] { ';' });
+ string[] d = s.Split(new char[] { ',' });
return new Rectangle(
int.Parse(d[0]),
int.Parse(d[1]),
diff --git a/src/Size.cs b/src/Size.cs
index 21ddb539..5059d31a 100644
--- a/src/Size.cs
+++ b/src/Size.cs
@@ -153,7 +153,7 @@ namespace Crow
}
public static Size Parse(string s)
{
- string[] d = s.Split(new char[] { ';' });
+ string[] d = s.Split(new char[] { ',' });
return d.Length == 1 ? new Size(int.Parse(d[0])) : new Size(
int.Parse(d[0]),
int.Parse(d[1]));
diff --git a/src/StyleReader.cs b/src/StyleReader.cs
new file mode 100644
index 00000000..0c4ce2bc
--- /dev/null
+++ b/src/StyleReader.cs
@@ -0,0 +1,134 @@
+//
+// StyleReader.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 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.Collections.Generic;
+using System.IO;
+using System.Reflection;
+
+namespace Crow
+{
+ public class StyleReader : StreamReader
+ {
+ enum readerState { classNames, propertyName, expression }
+ readerState state = readerState.classNames;
+
+
+ public StyleReader (Assembly assembly, string resId)
+ : base(assembly.GetManifestResourceStream (resId))
+ {
+ Interface iface = Interface.CurrentInterface;
+ string classNameFromResId = resId.Substring (0, resId.Length - 6);
+ string token = "";
+ List<string> targetsClasses = new List<string> ();
+ string currentProperty = "";
+
+ int curlyBracketCount = 0;
+
+ while (!EndOfStream) {
+ char c = (Char)Read ();
+
+ switch (state) {
+ case readerState.classNames:
+ if (c.IsWhiteSpaceOrNewLine () || c == ',' || c == '{') {
+ if (!string.IsNullOrEmpty (token))
+ targetsClasses.Add (token);
+ if (c == '{')
+ state = readerState.propertyName;
+ token = "";
+ }else if (c=='='){
+ //this file contains only properties,
+ //resource Id (minus .style extention) will determine the single target class
+ if (targetsClasses.Count > 1)
+ throw new Exception ("Unexpected token '='");
+ else if (targetsClasses.Count == 1) {
+ if (!string.IsNullOrEmpty (token))
+ throw new Exception ("Unexpected token '='");
+ currentProperty = targetsClasses [0];
+ targetsClasses [0] = classNameFromResId;
+ }else{
+ if (string.IsNullOrEmpty (token))
+ throw new Exception ("Unexpected token '='");
+ targetsClasses.Add (classNameFromResId);
+ currentProperty = token;
+ token = "";
+ }
+ state = readerState.expression;
+ }else
+ token += c;
+ break;
+ case readerState.propertyName:
+ if (c.IsWhiteSpaceOrNewLine () || c == '=') {
+ if (!string.IsNullOrEmpty (token))
+ currentProperty = token;
+ if (c == '=')
+ state = readerState.expression;
+
+ token = "";
+ }else if (c == '}'){
+ if (!string.IsNullOrEmpty (token))
+ throw new Exception ("Unexpected token '" + c + "'");
+ targetsClasses = new List<string> ();
+ currentProperty = "";
+ state = readerState.classNames;
+ } else
+ token += c;
+ break;
+ case readerState.expression:
+ if (curlyBracketCount == 0) {
+ if (c == '{'){
+ if (string.IsNullOrEmpty(token))
+ throw new Exception ("Unexpected token '{'");
+ curlyBracketCount++;
+ token = "{";
+ }else if (c == '}')
+ throw new Exception ("Unexpected token '{'");
+ else if (c == ';') {
+ if (!string.IsNullOrEmpty (token)) {
+ string expression = token.Trim ();
+
+ foreach (string tc in targetsClasses) {
+ if (!iface.Styling.ContainsKey (tc))
+ iface.Styling [tc] = new Dictionary<string, object> ();
+ else if (iface.Styling [tc].ContainsKey (currentProperty))
+ continue;
+ iface.Styling [tc] [currentProperty] = expression;
+ }
+ token = "";
+ }
+ state = readerState.propertyName;
+ } else
+ token += c;
+ } else {
+ if (c == '{')
+ curlyBracketCount++;
+ else if (c == '}')
+ curlyBracketCount--;
+ token += c;
+ }
+ break;
+ }
+ }
+
+ if (curlyBracketCount > 0)
+ throw new Exception ("Unexpected end of file");
+ }
+ }
+}