]> O.S.I.I.S - jp/crow.git/commitdiff
NUnit try, renaming, debugging and uniformizating
authorjpbruyere <jp.bruyere@hotmail.com>
Sat, 30 Jan 2016 08:42:37 +0000 (09:42 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sat, 30 Jan 2016 08:42:37 +0000 (09:42 +0100)
60 files changed:
Crow.csproj
Crow.sln
Crow.userprefs
Images/Icons/updown.svg
Templates/CheckBox.goml [new file with mode: 0755]
Templates/Checkbox.goml [deleted file]
Templates/ComboBox.goml [new file with mode: 0755]
Templates/ComboBoxOverlay.goml [new file with mode: 0755]
Templates/Combobox.goml [deleted file]
Templates/ComboboxOverlay.goml [deleted file]
Templates/Expandable.goml
Templates/GroupBox.goml [new file with mode: 0755]
Templates/Groupbox.goml [deleted file]
Templates/ListBox.goml [new file with mode: 0755]
Templates/Listbox.goml [deleted file]
Templates/MessageBox.goml
Templates/Popper.goml
Templates/ScrollBar.goml [new file with mode: 0755]
Templates/Scrollbar.goml [deleted file]
Templates/Spinner.goml
Tests/GOLIBTests.cs
Tests/Interfaces/1.crow [new file with mode: 0755]
Tests/Interfaces/2.crow [new file with mode: 0755]
Tests/Interfaces/test1.goml
Tests/Interfaces/test4.goml
Tests/Interfaces/testAll.goml
Tests/Interfaces/testCheckbox.goml
Tests/Interfaces/testCombobox.goml
Tests/Interfaces/testExpandable.goml
Tests/Interfaces/testGroupBox.goml
Tests/Interfaces/testPopper.goml
Tests/Interfaces/testScrollbar.goml
Tests/Interfaces/testWindow.goml
Tests/Interfaces/test_Listbox.goml
Tests/Tests.csproj
UnitTest/ExpectedOutputs/0.png [new file with mode: 0644]
UnitTest/ExpectedOutputs/1.png [new file with mode: 0644]
UnitTest/Interfaces/0.crow [new file with mode: 0755]
UnitTest/Interfaces/1.crow [new file with mode: 0755]
UnitTest/Interfaces/2.crow [new file with mode: 0755]
UnitTest/NUnitCrowWindow.cs [new file with mode: 0644]
UnitTest/Test.cs [new file with mode: 0644]
UnitTest/UnitTest.csproj [new file with mode: 0644]
UnitTest/packages.config [new file with mode: 0644]
src/GraphicObjects/Button.cs
src/GraphicObjects/CheckBox.cs [new file with mode: 0644]
src/GraphicObjects/Checkbox.cs [deleted file]
src/GraphicObjects/ComboBox.cs [new file with mode: 0644]
src/GraphicObjects/Combobox.cs [deleted file]
src/GraphicObjects/Expandable.cs
src/GraphicObjects/GroupBox.cs [new file with mode: 0644]
src/GraphicObjects/Groupbox.cs [deleted file]
src/GraphicObjects/ListBox.cs
src/GraphicObjects/MessageBox.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/ScrollBar.cs [new file with mode: 0644]
src/GraphicObjects/Scrollbar.cs [deleted file]
src/GraphicObjects/Slider.cs
src/GraphicObjects/TextBox.cs
src/Interface.cs

index 10a3514c182940d231c7011ade92b17959d78a3a..b65f3170785effe442a433afacffa829c1206eb5 100644 (file)
     <Compile Include="src\SvgPicture.cs" />\r
     <Compile Include="src\BmpPicture.cs" />\r
     <Compile Include="src\GraphicObjects\TemplatedControl.cs" />\r
-    <Compile Include="src\GraphicObjects\Checkbox.cs" />\r
     <Compile Include="src\GraphicObjects\RadioButton.cs" />\r
     <Compile Include="src\GraphicObjects\Expandable.cs" />\r
     <Compile Include="src\GraphicObjects\PrivateContainer.cs" />\r
     <Compile Include="src\GraphicObjects\TemplatedContainer.cs" />\r
     <Compile Include="src\GraphicObjects\Popper.cs" />\r
-    <Compile Include="src\GraphicObjects\Scrollbar.cs" />\r
     <Compile Include="src\TextChangeEventArgs.cs" />\r
     <Compile Include="src\LayoutChangeEventArgs.cs" />\r
     <Compile Include="src\ReflexionExtensions.cs" />\r
     <Compile Include="src\GraphicObjects\Grid.cs" />\r
     <Compile Include="src\GraphicObjects\TextRun.cs" />\r
     <Compile Include="src\GraphicObjects\MessageBox.cs" />\r
-    <Compile Include="src\GraphicObjects\Groupbox.cs" />\r
-    <Compile Include="src\GraphicObjects\Combobox.cs" />\r
     <Compile Include="src\SelectionChangeEventArgs.cs" />\r
     <Compile Include="src\ValueChangeEventArgs.cs" />\r
     <Compile Include="src\GraphicObjects\FileDialog.cs" />\r
+    <Compile Include="src\GraphicObjects\CheckBox.cs" />\r
+    <Compile Include="src\GraphicObjects\ComboBox.cs" />\r
+    <Compile Include="src\GraphicObjects\GroupBox.cs" />\r
+    <Compile Include="src\GraphicObjects\ScrollBar.cs" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
     <EmbeddedResource Include="Images\Icons\buttest2.svg" />\r
     <EmbeddedResource Include="Images\Icons\buttest4.svg" />\r
     <EmbeddedResource Include="Images\Icons\checkbox.svg" />\r
-    <EmbeddedResource Include="Templates\Checkbox.goml" />\r
     <EmbeddedResource Include="Images\Icons\radiobutton.svg" />\r
     <EmbeddedResource Include="Templates\RadioButton.goml" />\r
-    <EmbeddedResource Include="Templates\Listbox.goml" />\r
     <EmbeddedResource Include="Templates\Slider.goml" />\r
     <EmbeddedResource Include="Templates\Spinner.goml" />\r
     <EmbeddedResource Include="Templates\Spinner %28copier%29.goml" />\r
     <EmbeddedResource Include="Templates\Window.goml" />\r
     <EmbeddedResource Include="Images\Icons\tetra.png" />\r
     <EmbeddedResource Include="Images\Icons\exit.svg" />\r
-    <EmbeddedResource Include="Templates\Scrollbar.goml" />\r
     <EmbeddedResource Include="Templates\AnalogMeter0.goml" />\r
     <EmbeddedResource Include="Images\meter.svg" />\r
     <EmbeddedResource Include="Images\Icons\member.svg" />\r
     <EmbeddedResource Include="Images\button.svg" />\r
     <EmbeddedResource Include="Templates\MessageBox.goml" />\r
     <EmbeddedResource Include="Images\Icons\iconInfo.svg" />\r
-    <EmbeddedResource Include="Templates\Groupbox.goml" />\r
-    <EmbeddedResource Include="Templates\Combobox.goml" />\r
-    <EmbeddedResource Include="Templates\ComboboxOverlay.goml" />\r
     <EmbeddedResource Include="Templates\FileDialog.goml" />\r
     <EmbeddedResource Include="Templates\tmpDirItem.goml" />\r
     <EmbeddedResource Include="Templates\ScrollingListBox.goml" />\r
     <EmbeddedResource Include="Images\Icons\Cursors\hand" />\r
     <EmbeddedResource Include="Images\Icons\Cursors\help" />\r
     <EmbeddedResource Include="Images\Icons\Cursors\move" />\r
+    <EmbeddedResource Include="Templates\CheckBox.goml" />\r
+    <EmbeddedResource Include="Templates\ComboBox.goml" />\r
+    <EmbeddedResource Include="Templates\ComboBoxOverlay.goml" />\r
+    <EmbeddedResource Include="Templates\GroupBox.goml" />\r
+    <EmbeddedResource Include="Templates\ListBox.goml" />\r
+    <EmbeddedResource Include="Templates\ScrollBar.goml" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="README.md" />\r
index c396e5dc59432251142bc8f51729ea6f5d9552a7..17b8e4a7da65a3175cb189cd2f5b4877b7f826ef 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GOLib", "MonoDe
 EndProject\r
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Diagram", "..\MonoDevelop.Diagram\MonoDevelop.Diagram.csproj", "{232716B4-D19D-4FD7-B310-94A98FD926F0}"\r
 EndProject\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "UnitTest\UnitTest.csproj", "{7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Linux_x86 = Debug|Linux_x86\r
@@ -21,6 +23,10 @@ Global
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.Build.0 = Release|Any CPU\r
+               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
+               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
+               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
+               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.Build.0 = Release|Any CPU\r
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
index 21fdf1d4dface9e38fda071e251c57a4ebb09903..b554ec856d61e2ab1b78c4293429d230751b378d 100644 (file)
@@ -1,23 +1,15 @@
 <Properties GitUserInfo="UsingGIT" StartupItem="Tests/Tests.csproj">
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|Linux_x86" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="Images/Icons/button.svg">
+  <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/TemplatedControl.cs">
     <Files>
-      <File FileName="src/GraphicObjects/ListBox.cs" Line="36" Column="43" />
-      <File FileName="Tests/Interfaces/test_Listbox.goml" Line="25" Column="60" />
-      <File FileName="Tests/GOLIBTest_Listbox.cs" Line="98" Column="1" />
-      <File FileName="src/GraphicObjects/TemplatedControl.cs" Line="151" Column="39" />
-      <File FileName="src/GraphicObjects/Scrollbar.cs" Line="49" Column="1" />
-      <File FileName="src/GraphicObjects/GenericStack.cs" Line="96" Column="8" />
-      <File FileName="src/GraphicObjects/GraphicObject.cs" Line="22" Column="15" />
-      <File FileName="src/OpenTKGameWindow.cs" Line="27" Column="71" />
-      <File FileName="src/OpenGL/Shader.cs" Line="1" Column="1" />
-      <File FileName="src/OpenGL/TexturedShader.cs" Line="1" Column="1" />
-      <File FileName="src/OpenGL/QuadVAO.cs" Line="1" Column="1" />
-      <File FileName="src/Interface.cs" Line="119" Column="1" />
-      <File FileName="bin/Debug/Interfaces/test4.goml.cs" Line="97" Column="35" />
-      <File FileName="src/GraphicObjects/Group.cs" Line="308" Column="42" />
-      <File FileName="Tests/GOLIBTest_TypeViewer.cs" Line="37" Column="4" />
-      <File FileName="Images/Icons/button.svg" Line="1" Column="1" />
+      <File FileName="src/GraphicObjects/GraphicObject.cs" Line="848" Column="39" />
+      <File FileName="Tests/GOLIBTests.cs" Line="41" Column="1" />
+      <File FileName="Tests/Interfaces/testWindow3.goml" Line="10" Column="6" />
+      <File FileName="src/GraphicObjects/TemplatedControl.cs" Line="114" Column="1" />
+      <File FileName="src/GraphicObjects/Window.cs" Line="214" Column="1" />
+      <File FileName="src/GraphicObjects/TemplatedContainer.cs" Line="80" Column="19" />
+      <File FileName="src/GraphicObjects/Container.cs" Line="31" Column="1" />
+      <File FileName="src/GraphicObjects/PrivateContainer.cs" Line="67" Column="1" />
     </Files>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
index a4d5fcb4f2e61118e8aefc11856d9e17d7461ba1..ce0452451f6b023d14e1623d0d8c6012a9f88759 100644 (file)
@@ -14,7 +14,7 @@
    version="1.1"
    inkscape:version="0.91 r13725"
    sodipodi:docname="updown.svg">
-  <metadata
+<!--  <metadata
      id="metadata13">
     <rdf:RDF>
       <cc:Work
      inkscape:window-x="0"
      inkscape:window-y="16"
      inkscape:window-maximized="0"
-     inkscape:current-layer="svg2" />
-  <defs
-     id="defs4">
-    <filter
-       height="1.4299999"
-       y="-0.215"
-       width="1.3096"
-       x="-0.1548"
-       id="filter4391"
-       style="color-interpolation-filters:sRGB">
-      <feGaussianBlur
-         id="feGaussianBlur4393"
-         stdDeviation="3.225" />
-    </filter>
-    <filter
-       height="1.4299999"
-       y="-0.215"
-       width="1.3096"
-       x="-0.1548"
-       id="filter4391-5"
-       style="color-interpolation-filters:sRGB">
-      <feGaussianBlur
-         id="feGaussianBlur4393-0"
-         stdDeviation="3.225" />
-    </filter>
-  </defs>
+     inkscape:current-layer="svg2" />-->
   <g
      id="up"
      transform="matrix(0.88780545,0,0,0.79362094,4.0529638,4.3893292)">
     <path
-       style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4391)"
+       style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        d="M 32,9 7,44 57,44 Z"
        id="path4144"
        inkscape:connector-curvature="0"
@@ -85,7 +60,7 @@
      id="down"
      transform="matrix(0.88780545,0,0,0.79362094,4.0529638,4.3893292)">
     <path
-       style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4391-5)"
+       style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
        d="M 7,9 57,9 32,44 Z"
        id="path4144-0"
        inkscape:connector-curvature="0"
diff --git a/Templates/CheckBox.goml b/Templates/CheckBox.goml
new file mode 100755 (executable)
index 0000000..80ec112
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>\r
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">\r
+       <Image Margin="2" Width="14" Height="14" Path="{../../Image}"  SvgSub="{../../SvgSub}"/>\r
+       <Label Text="{../../Caption}" Height="80" Width="200"/>\r
+</HorizontalStack>-->\r
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+       <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+       <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
+</HorizontalStack>
\ No newline at end of file
diff --git a/Templates/Checkbox.goml b/Templates/Checkbox.goml
deleted file mode 100755 (executable)
index 80ec112..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>\r
-<!--<HorizontalStack Spacing="1" Height="100" Width="300">\r
-       <Image Margin="2" Width="14" Height="14" Path="{../../Image}"  SvgSub="{../../SvgSub}"/>\r
-       <Label Text="{../../Caption}" Height="80" Width="200"/>\r
-</HorizontalStack>-->\r
-<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
-       <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
-       <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
-</HorizontalStack>
\ No newline at end of file
diff --git a/Templates/ComboBox.goml b/Templates/ComboBox.goml
new file mode 100755 (executable)
index 0000000..f60b1a1
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>\r
+<Border CornerRadius="0" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+       <HorizontalStack Margin="1" Spacing="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <Label Margin="1" Foreground="Black" Background="White" Text="{../../../Caption}" \r
+                       Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
+               <Button Width="14" Height="14" >\r
+                       <Image Margin="0"  Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>\r
+               </Button>\r
+       </HorizontalStack>\r
+</Border>
\ No newline at end of file
diff --git a/Templates/ComboBoxOverlay.goml b/Templates/ComboBoxOverlay.goml
new file mode 100755 (executable)
index 0000000..cab4953
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>\r
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
+<!--   <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
+               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">-->\r
+               <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+<!--   </Scroller>-->\r
+</Border>
\ No newline at end of file
diff --git a/Templates/Combobox.goml b/Templates/Combobox.goml
deleted file mode 100755 (executable)
index 9abd636..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>\r
-<Border CornerRadius="0" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
-       <HorizontalStack Margin="1" Spacing="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
-               <Label Margin="1" Foreground="Black" Background="White" Text="{../../../Text}" \r
-                       Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
-               <Button Width="14" Height="14" >\r
-                       <Image Margin="0"  Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
-               </Button>\r
-       </HorizontalStack>\r
-</Border>
\ No newline at end of file
diff --git a/Templates/ComboboxOverlay.goml b/Templates/ComboboxOverlay.goml
deleted file mode 100755 (executable)
index cab4953..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
-<!--   <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
-               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">-->\r
-               <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
-<!--   </Scroller>-->\r
-</Border>
\ No newline at end of file
index 4e9a85407e4134db01c9a45b522f2c47dc198f8c..740200caa419fa97cca6d0051704d4576802e278 100755 (executable)
@@ -4,7 +4,7 @@
        <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
                <HorizontalStack Spacing="1" Height="-1" Width="{../../../TemplatedWidth}">\r
                        <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../SvgSub}"/>\r
-                       <Label Text="{../../../../Title}" Width="{../../../../TemplatedWidth}"/>\r
+                       <Label Text="{../../../../Caption}" Width="{../../../../TemplatedWidth}"/>\r
                </HorizontalStack>\r
                <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
        </VerticalStack>\r
diff --git a/Templates/GroupBox.goml b/Templates/GroupBox.goml
new file mode 100755 (executable)
index 0000000..4f6035a
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+       <Border CornerRadius="5" BorderWidth="1" Margin="6"
+               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+               <Container Name="Content" Margin="10"
+                               Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+       </Border>
+       <Label Text="{../../Caption}" VerticalAlignment="Top" Left="15"
+               Background="Clear" Margin="1"/>
+</Group>
\ No newline at end of file
diff --git a/Templates/Groupbox.goml b/Templates/Groupbox.goml
deleted file mode 100755 (executable)
index 789cd60..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
-       <Border CornerRadius="5" BorderWidth="1" Margin="6"
-               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
-               <Container Name="Content" Margin="10"
-                               Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
-       </Border>
-       <Label Text="{../../Title}" VerticalAlignment="Top" Left="15"
-               Background="Clear" Margin="1"/>
-</Group>
\ No newline at end of file
diff --git a/Templates/ListBox.goml b/Templates/ListBox.goml
new file mode 100755 (executable)
index 0000000..28241e2
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>\r
+<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
+       <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
+</Border>-->\r
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
+       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
+               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+               <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
+       </Scroller>\r
+</Border>
\ No newline at end of file
diff --git a/Templates/Listbox.goml b/Templates/Listbox.goml
deleted file mode 100755 (executable)
index 28241e2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>\r
-<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
-       <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
-</Border>-->\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
-       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"\r
-               Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
-               <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
-       </Scroller>\r
-</Border>
\ No newline at end of file
index e2eccd717e33a512d0ae599ad0a6752d26ee7b59..d6e474c00404a7c65a27d323caae56f943edc858 100644 (file)
@@ -9,19 +9,19 @@
                                <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />
                                <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent"  Height="12" Width="12"
                                        MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
-                                       <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"
+                                       <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#Crow.Images.Icons.exit2.svg"
                                                 MouseClick="../../../../../../butQuitPress"/>
                                </Border>
                                <GraphicObject Width="5" Height="5"/>
                        </HorizontalStack>
                </Border>
-               <HorizontalStack Spacing="10" Margin="10" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}">
-                       <Image Name="Image" Width="32" Height="32"
-                               Path="#go.Images.Icons.iconInfo.svg" />
+               <HorizontalStack Spacing="3" Margin="3" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}">
+                       <Image Name="Image" Width="24" Height="24"
+                               Path="#Crow.Images.Icons.iconInfo.svg" />
                        <TextRun Font="serif, 12" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Text="{../../../../Message}"
                                Multiline="true" WordWrap="true"/>              
                </HorizontalStack>
-               <HorizontalStack Height="-1" Width="{../../../TemplatedWidth}" Margin="5">
+               <HorizontalStack Height="-1" Width="{../../../TemplatedWidth}" Margin="3">
                        <GraphicObject Height="5"/>
                        <Button Text="Ok"/>
                        <Button Text="Cancel"/>
index 472fe1833468fa4f3ac093467135503fca5b835b..f819e351108197efd9c426052c0bbe2e6c55dfc5 100755 (executable)
@@ -2,6 +2,6 @@
 <Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">\r
        <HorizontalStack Spacing="1" Height="-1"  Width="{../../TemplatedWidth}">\r
                <Image Margin="2" Width="12" Height="12" Path="{../../../Image}" SvgSub="{../../../SvgSub}"/>\r
-               <Label Text="{../../../Title}"  Width="{../../../TemplatedWidth}"/>\r
+               <Label Text="{../../../Caption}"  Width="{../../../TemplatedWidth}"/>\r
        </HorizontalStack>\r
 </Border>
\ No newline at end of file
diff --git a/Templates/ScrollBar.goml b/Templates/ScrollBar.goml
new file mode 100755 (executable)
index 0000000..b14c90d
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>\r
+<Border BorderWidth="1" BorderColor="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">\r
+       <GenericStack Orientation="{../../Orientation}" Width="{../../TemplatedWidth}" Height="{../../TemplatedHeight}">\r
+               <Button Width="12" Height="12" MouseClick="../../../onScrollBack">\r
+                       <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>\r
+               </Button>\r
+               <Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}" \r
+                       Width="{../../../TemplatedWidth}" Height="{../../../TemplatedHeight}" Orientation="{../../../Orientation}"\r
+                       ValueChanged="../../../onSliderValueChange"/>\r
+               <Button Width="12" Height="12" MouseClick="../../../onScrollForth">\r
+                       <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>\r
+               </Button>\r
+       </GenericStack>\r
+</Border>
\ No newline at end of file
diff --git a/Templates/Scrollbar.goml b/Templates/Scrollbar.goml
deleted file mode 100755 (executable)
index b14c90d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">\r
-       <GenericStack Orientation="{../../Orientation}" Width="{../../TemplatedWidth}" Height="{../../TemplatedHeight}">\r
-               <Button Width="12" Height="12" MouseClick="../../../onScrollBack">\r
-                       <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>\r
-               </Button>\r
-               <Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}" \r
-                       Width="{../../../TemplatedWidth}" Height="{../../../TemplatedHeight}" Orientation="{../../../Orientation}"\r
-                       ValueChanged="../../../onSliderValueChange"/>\r
-               <Button Width="12" Height="12" MouseClick="../../../onScrollForth">\r
-                       <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>\r
-               </Button>\r
-       </GenericStack>\r
-</Border>
\ No newline at end of file
index cbdde9e4e301f502eb170c8db36372fc9f57be2f..059456f707caa5a630b7db40aa2b7f74f2229635 100755 (executable)
@@ -8,7 +8,7 @@
                                <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>
                        </Button>
                        <Button Width="12" Height="8" MouseClick="../../../../onDown">
-                               <Image Margin="1" Path="#Crow .Images.Icons.updown.svg" SvgSub="down"/>
+                               <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
                        </Button>
                </VerticalStack>
        </HorizontalStack>
index 1e6c79be2f85c0d104a8b1b26e86607baad242b3..23de6cf00964c91637383eacd1e00017367e5d5a 100644 (file)
@@ -36,6 +36,10 @@ namespace test
                int frameCpt = 0;\r
                int idx = 0;\r
                string[] testFiles = {\r
+                       "test4.goml",\r
+                       "testScrollbar.goml",\r
+                       "2.crow",\r
+                       "test1.goml",\r
                        "testWindow2.goml",\r
 //                     "testCombobox.goml",\r
                        "testWindow3.goml",\r
@@ -48,7 +52,6 @@ namespace test
                        "testLabel.goml",\r
                        "testAll.goml",\r
 //                     "testSpinner.goml",\r
-                       "test4.goml",\r
                        "testRadioButton2.goml",\r
                        "testContainer.goml",\r
                        "testBorder.goml",\r
@@ -57,7 +60,6 @@ namespace test
                        "testMsgBox.goml",\r
                        "testGrid.goml",\r
                        "testMeter.goml",\r
-                       "testScrollbar.goml",\r
                        "test_Listbox.goml",\r
                };\r
 \r
diff --git a/Tests/Interfaces/1.crow b/Tests/Interfaces/1.crow
new file mode 100755 (executable)
index 0000000..72a0e06
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<ComboBox/>
\ No newline at end of file
diff --git a/Tests/Interfaces/2.crow b/Tests/Interfaces/2.crow
new file mode 100755 (executable)
index 0000000..2e8c766
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<VerticalStack Fit="true">
+       <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"/>
+               <Label Text="top right" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopRight"/>
+               <Label Text="right center" Width="80" Height="30" Background="DarkBlue" TextAlignment="RightCenter"/>
+               <Label Text="bottom left" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomLeft"/>
+               <Label Text="bottom center" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomCenter"/>
+               <Label Text="bottom right" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomRight"/>
+       </HorizontalStack>
+       <HorizontalStack Fit="true">
+               <Label Text="label1" Foreground="LightBlue" Margin="5" Background="DarkRed"/>
+               <TextRun Text="textrun1" Width="0"/>
+               <Button Text="Click Me"/>
+               <CheckBox/>
+               <GroupBox Caption="choice">
+                       <VerticalStack>
+                               <RadioButton Caption="Choice 1" IsChecked="true"/>
+                               <RadioButton Caption="Choice 2"/>
+                               <RadioButton Caption="Choice 3"/>
+                       </VerticalStack>
+               </GroupBox>
+               <Expandable Caption="expand me">
+                       <Label Text="this is a test"/>
+               </Expandable>
+               <Popper Caption="pop me">
+                       <Label Background="Red"/>
+               </Popper>
+<!--           <ComboBox/>-->
+       </HorizontalStack>
+       <MessageBox></MessageBox>
+       <Window><Label/></Window>
+</VerticalStack>
\ No newline at end of file
index 2177065e681c2358c7707c47ed7bd7cee4c1fc2f..5aa1d7f31140247299fee7e0951066eae9c4831a 100755 (executable)
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>\r
 <Container Name="TopContainer" Width="400" Height="350"\r
        Margin="20" Focusable="True" Background="Yellow">\r
-\r
        <Container Name="MiddleContainer" Width="0" Height="0"\r
                Margin="20" Focusable="True" Background="Green">\r
                        <Image VerticalAlignment="Bottom"                       \r
index bdb6656c8a9110f61fc3d1afa5f27a657d3bbd7c..0e7bfda212199a8ef3ac32929e962b612b63dafa 100755 (executable)
@@ -28,8 +28,8 @@
                                                </HorizontalStack>\r
                                        </VerticalStack>\r
                                        <VerticalStack Fit="true">                                      \r
-                                               <Checkbox Name="chk1"/>\r
-                                               <Checkbox Name="chk2" IsChecked="true"/>\r
+                                               <CheckBox Name="chk1"/>\r
+                                               <CheckBox Name="chk2" IsChecked="true"/>\r
 \r
                                        </VerticalStack>\r
                                        <VerticalStack Fit="true">\r
                                                <Button MouseClick="onButClick"/>\r
                                        </VerticalStack>\r
                                </HorizontalStack>\r
-                               <TextBoxWidget Name="textbox1" TextAlignment="LeftCenter" Font="droid,14"                                               \r
+                               <TextBox Name="textbox1" TextAlignment="LeftCenter" Font="droid,14"                                             \r
                                                                Width="200" Height="-1" Margin="2" Background="White"\r
                                                                Forground="Black"\r
                                                                BorderColor="DimGray" BorderWidth="1"\r
                                                                Text="editable text"/>\r
+                               <Popper Width="100">\r
+                                       <Border Fit="True" Background="ArmyGreen">\r
+                                               <Image Margin="10" Fit="true" Path="#Crow.Images.Icons.tetra.png"/>\r
+                                       </Border>\r
+                               </Popper>\r
+\r
                        </VerticalStack>\r
                        <VerticalStack Fit="true"  Margin="0" WidgetSpacing="1">\r
                                <Button  Margin="1" Width="150" Height="100">\r
                                        <Image Path="#Tests.image.tetra.png"/>\r
                                </Button>\r
                                <Popper Width="100">\r
-                                       <Border Margin="10" Fit="True" Background="ArmyGreen">\r
-                                               <Image Fit="true" Path="#Crow.Images.Icons.tetra.png"/>\r
+                                       <Border Fit="True" Background="ArmyGreen">\r
+                                               <Image Margin="10" Fit="true" Path="#Crow.Images.Icons.tetra.png"/>\r
                                        </Border>\r
                                </Popper>\r
                                <Expandable Name="expander" Width="150" Height="-1">\r
                                        <VerticalStack Name="vsExpanded" Width="100">\r
-                                               <Checkbox Name="chk1"/>\r
-                                               <Checkbox Name="chk2" IsChecked="true"/>\r
-                                               <Checkbox Name="chk3"/>\r
-                                               <Checkbox Name="chk4"/>\r
+                                               <CheckBox Name="chk1"/>\r
+                                               <CheckBox Name="chk2" IsChecked="true"/>\r
+                                               <CheckBox Name="chk3"/>\r
+                                               <CheckBox Name="chk4"/>\r
                                        </VerticalStack>                \r
                                </Expandable>\r
                                <Expandable Name="expander2" Width="150" Height="-1">\r
                                        <VerticalStack Name="vsExpanded" Width="100">\r
-                                               <Checkbox Name="chk1"/>\r
-                                               <Checkbox Name="chk2" IsChecked="true"/>\r
+                                               <CheckBox Name="chk1"/>\r
+                                               <CheckBox Name="chk2" IsChecked="true"/>\r
                                        </VerticalStack>                \r
                                </Expandable>\r
                                <Expandable Name="expander3" Width="150" Height="-1">\r
                                        <VerticalStack Name="vsExpanded" Width="100">\r
-                                               <Checkbox Name="chk1" IsChecked="true"/>\r
-                                               <Checkbox Name="chk2"/>\r
+                                               <CheckBox Name="chk1" IsChecked="true"/>\r
+                                               <CheckBox Name="chk2"/>\r
                                        </VerticalStack>                \r
                                </Expandable>\r
                                <HorizontalStack>\r
                                                        BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>                                                                                            -->\r
                                        </VerticalStack>\r
                                </Scroller>\r
-                               <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
+                               <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
                                        Orientation="Vertical" Width="10" Height="0"/>\r
                        </HorizontalStack>\r
                </HorizontalStack>\r
index b2766e6d2cc5923c09046bcdca0edc64f492ea20..56016bfb8565d60f59b574790a0c7cef2276dc59 100755 (executable)
@@ -12,7 +12,7 @@
                        <TextRun Text="text run test"/>\r
                </VerticalStack>\r
        </Groupbox>-->\r
-       <Groupbox  Background="DarkGreen">              \r
+       <GroupBox  Background="DarkGreen">              \r
 <!--           <Template>\r
                        <Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
                                <Border CornerRadius="5" BorderWidth="1" Margin="0"\r
@@ -29,7 +29,7 @@
                        <TextRun Text="text run test" />\r
                        <TextRun Text="text run test"/>\r
                </VerticalStack>\r
-       </Groupbox>\r
+       </GroupBox>\r
 <!--   <Group Fit="true">\r
                <Border CornerRadius="5" BorderWidth="1" Margin="6" Fit="true">\r
                        <Container Name="Content" Margin="10" Fit="true">\r
index 422435f7c88be9760bc347b4df01764ad436de65..58a3c07c2bbb3ea3726ff8ea42f4fbe18a46f340 100755 (executable)
@@ -1,3 +1,3 @@
 <?xml version="1.0"?>\r
-<Checkbox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>\r
+<CheckBox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>\r
 \r
index ddd92aa5029b70bb3be3593274236fa0e4a17d22..545fdb876a4bcaade11a8c0f56794bcfe59708c5 100755 (executable)
@@ -1,2 +1,2 @@
 <?xml version="1.0"?>\r
-<Combobox Height="-1" Data="{TestList}" SelectedIndex="0"/>
\ No newline at end of file
+<ComboBox Height="-1" Data="{TestList}" SelectedIndex="0"/>
\ No newline at end of file
index a4c5013f7036cb91ff9c0a4473a6fa61c63ebfc2..3a542b8f74b8d0d3437dbf5fc40a215f1c980256 100755 (executable)
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>\r
-<Expandable Title="Test expandable" Background="DimGray">\r
+<Expandable Caption="Test expandable" Background="DimGray">\r
                <VerticalStack Width="-1" Height="-1">\r
-                       <Checkbox Name="chk1" Background="Red"/>\r
-                       <Checkbox Name="chk2" IsChecked="true"/>\r
-                       <Checkbox Name="chk3"/>\r
-                       <Checkbox Name="chk4"/>\r
+                       <CheckBox Name="chk1" Background="Red"/>\r
+                       <CheckBox Name="chk2" IsChecked="true"/>\r
+                       <CheckBox Name="chk3"/>\r
+                       <CheckBox Name="chk4"/>\r
                        <HorizontalStack Fit="true" Margin="2" Background="Blue">\r
                                <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="RightCenter"/>\r
                                <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="-1" TextAlignment="Center" Background="AoEnglish"/>\r
index b00295a05746c0ef7d4cd2df52ae17f6b403c0f3..bf5e9a75f060fb228995a91722992a88c90a446b 100755 (executable)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>\r
-<Groupbox Width="-1" Height="-1" Background="Red">\r
+<GroupBox Width="-1" Height="-1" Background="Red">\r
 <Label/>\r
-</Groupbox>\r
+</GroupBox>\r
index b5c9b6067e36c5b2902ea09f414fd3bffcad733b..eb6683eac298401794a184b08ea64fe2e424edc2 100755 (executable)
@@ -1,12 +1,12 @@
 <?xml version="1.0"?>\r
-<Popper Title="TestPopper" Width="100" Background="DimGray">\r
+<Popper Caption="TestPopper" Width="100" Background="DimGray">\r
        <Border Fit="True" Background="ArmyGreen">\r
 <!--           <Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/>-->\r
                <VerticalStack Fit="true" Margin="10" Background="CornflowerBlue">\r
-                       <Checkbox Name="chk1" Background="Red"/>\r
-                       <Checkbox Name="chk2" IsChecked="true"/>\r
-                       <Checkbox Name="chk3"/>\r
-                       <Checkbox Name="chk4"/>\r
+                       <CheckBox Name="chk1" Background="Red"/>\r
+                       <CheckBox Name="chk2" IsChecked="true"/>\r
+                       <CheckBox Name="chk3"/>\r
+                       <CheckBox Name="chk4"/>\r
                        <HorizontalStack Fit="true" Margin="20">\r
                                <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>\r
                                <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
index b0390f1061d5cdd2c27aaee1c40dd341d0eb3f29..27c8865006f90ab68648eff9a6fa2fdd2f49fcad 100755 (executable)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>\r
 <Group Name="TopContainer" Width="400" Height="400"\r
        Focusable="True" Background="Gray">\r
-\r
-       <Scrollbar Height="0" Orientation="Vertical" Width="16"/>\r
+       <ScrollBar Height="0" Orientation="Vertical" Width="16" MaximumScroll="100"/>\r
 </Group>
\ No newline at end of file
index b2dd8a1a2ba19a6f8c2d9238941509f63b7b108f..4e497fff0e862a14dcb7f9f68993c40d9fe05b6c 100755 (executable)
@@ -3,17 +3,17 @@
                Width="250" Height="300" >\r
        <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">\r
                <Slider Name="slider" Height="10" Width="0"/>\r
-               <Groupbox Text="test"  Height="-1" Width="-1" Margin="5">\r
+               <GroupBox Caption="test"  Height="-1" Width="-1" Margin="5">\r
                        <VerticalStack  Height="-1" Width="0" >\r
                                <RadioButton  Caption="Radio 1" Background="Red" />\r
                                <RadioButton  Caption="Radio 2" IsChecked="true" />\r
                                <RadioButton  Caption="Radio 3" />\r
                        </VerticalStack>\r
-               </Groupbox>\r
+               </GroupBox>\r
                <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">\r
-                       <Checkbox Height="-1" Width="80"/>\r
+                       <CheckBox Height="-1" Width="80"/>\r
                        <GraphicObject Width="0"/>\r
-                       <Checkbox Height="-1" Width="80" IsChecked="true"/>\r
+                       <CheckBox Height="-1" Width="80" IsChecked="true"/>\r
                </HorizontalStack>\r
 \r
 <!--           <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
index fa4b730caaa030c88c8ab93730a44646aad14f47..4348439d46bc238c7ec345356cbf974c5d150652 100755 (executable)
@@ -15,7 +15,7 @@
                                                        <VerticalStack Width="{../../../../TemplatedWidth}" Height="-1" MinimumSize="100;100"\r
                                                                Name="List" Margin="0" VerticalAlignment="Top" />\r
                                                </Scroller>\r
-                                               <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" \r
+                                               <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" \r
                                                        MaximumScroll="{../scroller1.MaximumScroll}" Orientation="Vertical" \r
                                                        Width="10" Height="{../../../TemplatedHeight}" />\r
                                        </HorizontalStack>\r
index 1e63ae8edcd6aa7ce2acca69696bb54413c51643..e2b21afeb231a3c878a9a3d188cead77dcb8e060 100644 (file)
     <None Include="Interfaces\testWindow3.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\2.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\1.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
diff --git a/UnitTest/ExpectedOutputs/0.png b/UnitTest/ExpectedOutputs/0.png
new file mode 100644 (file)
index 0000000..acf96fa
Binary files /dev/null and b/UnitTest/ExpectedOutputs/0.png differ
diff --git a/UnitTest/ExpectedOutputs/1.png b/UnitTest/ExpectedOutputs/1.png
new file mode 100644 (file)
index 0000000..f792986
Binary files /dev/null and b/UnitTest/ExpectedOutputs/1.png differ
diff --git a/UnitTest/Interfaces/0.crow b/UnitTest/Interfaces/0.crow
new file mode 100755 (executable)
index 0000000..64d6db6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<GraphicObject Width="100" Height="100" Background="Green">
diff --git a/UnitTest/Interfaces/1.crow b/UnitTest/Interfaces/1.crow
new file mode 100755 (executable)
index 0000000..142d072
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<Container Width="300" Height="300" Margin="20" Background="Yellow">
+       <Container Width="0" Height="0" Margin="20" Background="Green">
+               <GraphicObject VerticalAlignment="Bottom" Width="50" Height="50"
+                       Background="Red"/>
+       </Container>
+</Container>
\ No newline at end of file
diff --git a/UnitTest/Interfaces/2.crow b/UnitTest/Interfaces/2.crow
new file mode 100755 (executable)
index 0000000..dcccba0
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<VerticalStack Fit="true">
+       <HorizontalStack Fit="true">
+               <Label Text="label1"/>
+               <TextRun Text="textrun1"/>
+       </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
diff --git a/UnitTest/NUnitCrowWindow.cs b/UnitTest/NUnitCrowWindow.cs
new file mode 100644 (file)
index 0000000..0c73b8e
--- /dev/null
@@ -0,0 +1,456 @@
+#define MONO_CAIRO_DEBUG_DISPOSE\r
+\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using OpenTK;\r
+using OpenTK.Graphics.OpenGL;\r
+using OpenTK.Input;\r
+\r
+using System.Diagnostics;\r
+\r
+//using GGL;\r
+using System.Threading;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using Cairo;\r
+\r
+\r
+namespace Crow\r
+{\r
+       class NUnitCrowWindow :  IValueChange, ILayoutable, IGOLibHost\r
+       {\r
+               #region IValueChange implementation\r
+               public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
+               public virtual void NotifyValueChanged(string MemberName, object _value)\r
+               {\r
+                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));                 \r
+               }\r
+               #endregion\r
+\r
+               public Rectangle ClientRectangle = new Rectangle(0,0,800,600);\r
+               public List<GraphicObject> GraphicObjects = new List<GraphicObject>();\r
+               public Color Background = Color.Transparent;\r
+\r
+               Rectangles _redrawClip = new Rectangles();//should find another way to access it from child\r
+               List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();\r
+\r
+               #region IGOLibHost implementation\r
+               public Rectangles redrawClip {\r
+                       get {\r
+                               return _redrawClip;\r
+                       }\r
+                       set {\r
+                               _redrawClip = value;\r
+                       }\r
+               }\r
+\r
+               public List<GraphicObject> gobjsToRedraw {\r
+                       get {\r
+                               return _gobjsToRedraw;\r
+                       }\r
+                       set {\r
+                               _gobjsToRedraw = value;\r
+                       }\r
+               }\r
+               public void AddWidget(GraphicObject g)\r
+               {\r
+                       g.Parent = this;\r
+                       GraphicObjects.Insert (0, g);\r
+\r
+                       g.RegisterForLayouting ((int)LayoutingType.Sizing);\r
+               }\r
+               public void DeleteWidget(GraphicObject g)\r
+               {\r
+                       g.Visible = false;//trick to ensure clip is added to refresh zone\r
+                       g.ClearBinding();\r
+                       GraphicObjects.Remove (g);\r
+               }\r
+               public void PutOnTop(GraphicObject g)\r
+               {\r
+                       if (GraphicObjects.IndexOf(g) > 0)\r
+                       {\r
+                               GraphicObjects.Remove(g);\r
+                               GraphicObjects.Insert(0, g);\r
+                               g.registerClipRect ();\r
+                       }\r
+               }\r
+               public void Quit ()\r
+               {\r
+               }\r
+\r
+               #region focus\r
+               GraphicObject _activeWidget;    //button is pressed on widget \r
+               GraphicObject _hoverWidget;             //mouse is over\r
+               GraphicObject _focusedWidget;   //has keyboard (or other perif) focus \r
+\r
+               public GraphicObject activeWidget\r
+               {\r
+                       get { return _activeWidget; }\r
+                       set \r
+                       {\r
+                               if (_activeWidget == value)\r
+                                       return;\r
+                               _activeWidget = value;\r
+                       }\r
+               }\r
+               public GraphicObject hoverWidget\r
+               {\r
+                       get { return _hoverWidget; }\r
+                       set { _hoverWidget = value; }\r
+               }\r
+               public GraphicObject FocusedWidget {\r
+                       get { return _focusedWidget; }\r
+                       set {\r
+                               if (_focusedWidget == value)\r
+                                       return;\r
+                               if (_focusedWidget != null)\r
+                                       _focusedWidget.onUnfocused (this, null);\r
+                               _focusedWidget = value;\r
+                               if (_focusedWidget != null)\r
+                                       _focusedWidget.onFocused (this, null);\r
+                       }\r
+               }\r
+               #endregion\r
+\r
+               #endregion\r
+\r
+               #region Events\r
+               //those events are raised only if mouse isn't in a graphic object\r
+               public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;\r
+               public event EventHandler<MouseButtonEventArgs> MouseButtonUp;\r
+               public event EventHandler<MouseButtonEventArgs> MouseButtonDown;\r
+               public event EventHandler<MouseButtonEventArgs> MouseClick;\r
+               public event EventHandler<MouseMoveEventArgs> MouseMove;\r
+               #endregion\r
+\r
+               #region graphic contexte\r
+               Context ctx;\r
+               public Surface surf;\r
+               string testId;\r
+               #endregion\r
+\r
+               #region update\r
+               public Stopwatch updateTime = new Stopwatch ();\r
+               public Stopwatch layoutTime = new Stopwatch ();\r
+               public Stopwatch guTime = new Stopwatch ();\r
+               public Stopwatch drawingTime = new Stopwatch ();\r
+\r
+               public void Update ()\r
+               {\r
+                       guTime.Reset ();\r
+                       updateTime.Restart ();\r
+                       layoutTime.Restart ();\r
+\r
+                       ctx = new Context(surf);\r
+\r
+                       GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];\r
+                       GraphicObjects.CopyTo (invGOList,0);\r
+                       invGOList = invGOList.Reverse ().ToArray ();\r
+\r
+                       //Debug.WriteLine ("======= Layouting queue start =======");\r
+                       lock (Interface.LayoutingQueue) {                               \r
+                               while (Interface.LayoutingQueue.Count > 0) {\r
+                                       //                                      Stopwatch lqiProcTime = new Stopwatch ();\r
+                                       //                                      lqiProcTime.Start ();\r
+                                       LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();\r
+                                       lqi.ProcessLayouting ();\r
+                                       //                                      lqiProcTime.Stop ();\r
+                                       //                                      if (lqiProcTime.ElapsedMilliseconds > 10) {\r
+                                       //                                              Debug.WriteLine("lqi {2}: {0} ticks \t, {1} ms",\r
+                                       //                                                      updateTime.ElapsedTicks,\r
+                                       //                                                      updateTime.ElapsedMilliseconds, lqi.ToString());\r
+                                       //                                      }\r
+                               }\r
+                       }\r
+\r
+                       //final redraw clips should be added only when layout is completed among parents,\r
+                       //that's why it take place in a second pass\r
+                       GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];\r
+                       gobjsToRedraw.CopyTo (gotr);\r
+                       gobjsToRedraw.Clear ();\r
+                       foreach (GraphicObject p in gotr) {\r
+                               p.registerClipRect ();\r
+                       }\r
+\r
+                       layoutTime.Stop ();\r
+                       guTime.Start ();\r
+\r
+                       lock (redrawClip) {\r
+                               if (redrawClip.count > 0) {                                     \r
+                                       //                                      #if DEBUG_CLIP_RECTANGLE\r
+                                       //                                      redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));\r
+                                       //                                      #endif\r
+                                       redrawClip.clearAndClip (ctx);//rajouté après, tester si utile        \r
+\r
+                                       //Link.draw (ctx);\r
+                                       foreach (GraphicObject p in invGOList) {\r
+                                               if (p.Visible) {\r
+                                                       drawingTime.Start ();\r
+\r
+                                                       ctx.Save ();\r
+                                                       if (redrawClip.count > 0) {\r
+                                                               Rectangles clip = redrawClip.intersectingRects (p.Slot);\r
+\r
+                                                               if (clip.count > 0)\r
+                                                                       p.Paint (ref ctx, clip);\r
+                                                       }\r
+                                                       ctx.Restore ();\r
+\r
+                                                       drawingTime.Stop ();\r
+                                               }\r
+                                       }\r
+                                       ctx.ResetClip ();\r
+                                       //                                      #if DEBUG_CLIP_RECTANGLE\r
+                                       //                                      redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));\r
+                                       //                                      #endif\r
+                                       redrawClip.Reset ();\r
+                               }\r
+                       }\r
+                       guTime.Stop ();\r
+                       updateTime.Stop ();\r
+                       ctx.Dispose ();\r
+                       Console.WriteLine("{3} => layout:{0,8} t\tdraw:{1,8} t\tupdate:{2,8} t",\r
+                           layoutTime.ElapsedTicks,\r
+                           guTime.ElapsedTicks,\r
+                           updateTime.ElapsedTicks,\r
+                               testId);\r
+//                     Console.WriteLine("{3} => layout:{0}ms\tdraw{1}ms\tupdate:{2}ms",\r
+//                             layoutTime.ElapsedMilliseconds,\r
+//                             guTime.ElapsedMilliseconds,\r
+//                             updateTime.ElapsedMilliseconds,\r
+//                             testId);\r
+                       surf.WriteToPng (@"ExpectedOutputs/" + testId + ".png");\r
+                       surf.WriteToPng (@"tmp.png");\r
+               }                                               \r
+               #endregion\r
+\r
+               #region loading\r
+               public GraphicObject LoadTest (string id)\r
+               {\r
+                       testId = id;\r
+                       GraphicObject tmp = Interface.Load ("Interfaces/" + testId + ".crow", this);\r
+                       AddWidget (tmp);\r
+                       return tmp;\r
+               }\r
+               /// <summary> Remove all Graphic objects from top container </summary>\r
+               public void ClearInterface()\r
+               {\r
+                       int i = 0;\r
+                       while (GraphicObjects.Count>0) {\r
+                               GraphicObject g = GraphicObjects [i];\r
+                               g.Visible = false;\r
+                               g.ClearBinding ();\r
+                               GraphicObjects.RemoveAt (0);\r
+                       }\r
+               }\r
+               #endregion\r
+\r
+               public NUnitCrowWindow (int width, int height)\r
+               {\r
+                       ClientRectangle.Width = width;\r
+                       ClientRectangle.Height = height;\r
+\r
+                       surf = new ImageSurface(Format.Argb32, ClientRectangle.Width, ClientRectangle.Height);\r
+               }\r
+\r
+               int frameCpt = 0;\r
+               int idx = 0;\r
+\r
+\r
+               #region FPS\r
+               int _fps = 0;\r
+\r
+               public int fps {\r
+                       get { return _fps; }\r
+                       set {\r
+                               if (_fps == value)\r
+                                       return;\r
+\r
+                               _fps = value;\r
+\r
+                               if (_fps > fpsMax) {\r
+                                       fpsMax = _fps;\r
+                                       ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));\r
+                               } else if (_fps < fpsMin) {\r
+                                       fpsMin = _fps;\r
+                                       ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));\r
+                               }\r
+\r
+                               ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));\r
+                               ValueChanged.Raise (this, new ValueChangeEventArgs ("update",\r
+                                       this.updateTime.ElapsedMilliseconds.ToString () + " ms"));\r
+                       }\r
+               }\r
+\r
+               public int fpsMin = int.MaxValue;\r
+               public int fpsMax = 0;\r
+\r
+               void resetFps ()\r
+               {\r
+                       fpsMin = int.MaxValue;\r
+                       fpsMax = 0;\r
+                       _fps = 0;\r
+               }\r
+               //public string update = "";\r
+               #endregion\r
+\r
+\r
+               #region Mouse Handling\r
+               void Mouse_Move(object sender, MouseMoveEventArgs e)\r
+               {\r
+                       if (_activeWidget != null) {\r
+                               //first, ensure object is still in the graphic tree\r
+                               if (_activeWidget.TopContainer == null) {\r
+                                       activeWidget = null;\r
+                               } else {\r
+\r
+                                       //send move evt even if mouse move outside bounds\r
+                                       _activeWidget.onMouseMove (_activeWidget, e);\r
+                                       return;\r
+                               }\r
+                       }\r
+\r
+                       if (_hoverWidget != null) {\r
+                               //first, ensure object is still in the graphic tree\r
+                               if (_hoverWidget.TopContainer == null) {\r
+                                       hoverWidget = null;\r
+                               } else {\r
+                                       //check topmost graphicobject first\r
+                                       GraphicObject tmp = _hoverWidget;\r
+                                       GraphicObject topc = null;\r
+                                       while (tmp is GraphicObject) {\r
+                                               topc = tmp;\r
+                                               tmp = tmp.Parent as GraphicObject;\r
+                                       }\r
+                                       int idxhw = GraphicObjects.IndexOf (topc);\r
+                                       if (idxhw != 0) {\r
+                                               int i = 0;\r
+                                               while (i < idxhw) {\r
+                                                       if (GraphicObjects [i].MouseIsIn (e.Position)) {\r
+                                                               _hoverWidget.onMouseLeave (this, e);\r
+                                                               GraphicObjects [i].checkHoverWidget (e);\r
+                                                               return;\r
+                                                       }\r
+                                                       i++;\r
+                                               }\r
+                                       }\r
+\r
+\r
+                                       if (_hoverWidget.MouseIsIn (e.Position)) {\r
+                                               _hoverWidget.checkHoverWidget (e);\r
+                                               return;\r
+                                       } else {\r
+                                               _hoverWidget.onMouseLeave (this, e);\r
+                                               //seek upward from last focused graph obj's\r
+                                               while (_hoverWidget.Parent as GraphicObject != null) {\r
+                                                       _hoverWidget = _hoverWidget.Parent as GraphicObject;\r
+                                                       if (_hoverWidget.MouseIsIn (e.Position)) {\r
+                                                               _hoverWidget.checkHoverWidget (e);\r
+                                                               return;\r
+                                                       } else\r
+                                                               _hoverWidget.onMouseLeave (this, e);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       //top level graphic obj's parsing\r
+                       for (int i = 0; i < GraphicObjects.Count; i++) {\r
+                               GraphicObject g = GraphicObjects[i];\r
+                               if (g.MouseIsIn (e.Position)) {\r
+                                       g.checkHoverWidget (e);\r
+                                       PutOnTop (g);\r
+                                       return;\r
+                               }\r
+                       }\r
+                       _hoverWidget = null;\r
+                       MouseMove.Raise (this, e);\r
+               }\r
+               void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)\r
+               {\r
+                       if (_activeWidget == null) {\r
+                               MouseButtonUp.Raise (this, e);\r
+                               return;\r
+                       }\r
+\r
+                       _activeWidget.onMouseButtonUp (this, e);\r
+                       _activeWidget = null;\r
+               }\r
+               void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)\r
+               {\r
+                       if (_hoverWidget == null) {\r
+                               MouseButtonDown.Raise (this, e);\r
+                               return;\r
+                       }\r
+\r
+                       GraphicObject g = _hoverWidget;\r
+                       while (!g.Focusable) {                          \r
+                               g = g.Parent as GraphicObject;\r
+                               if (g == null) {                                        \r
+                                       return;\r
+                               }\r
+                       }\r
+\r
+                       _activeWidget = g;\r
+                       _activeWidget.onMouseButtonDown (this, e);\r
+               }\r
+\r
+               void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)\r
+               {\r
+                       if (_hoverWidget == null) {\r
+                               MouseWheelChanged.Raise (this, e);\r
+                               return;\r
+                       }\r
+                       _hoverWidget.onMouseWheel (this, e);\r
+               }        \r
+               #endregion\r
+\r
+               #region keyboard Handling\r
+               void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)\r
+               {                       \r
+                       if (_focusedWidget == null)\r
+                               return;\r
+                       _focusedWidget.onKeyDown (sender, e);\r
+               }\r
+               #endregion\r
+\r
+               #region ILayoutable implementation\r
+\r
+               public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }\r
+               public void UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }\r
+               public Rectangle ContextCoordinates (Rectangle r)\r
+               {\r
+                       return r;\r
+               }\r
+               public Rectangle ScreenCoordinates (Rectangle r)\r
+               {\r
+                       return r;\r
+               }\r
+\r
+               public ILayoutable Parent {\r
+                       get {\r
+                               return null;\r
+                       }\r
+                       set {\r
+                               throw new NotImplementedException ();\r
+                       }\r
+               }\r
+               Rectangle ILayoutable.ClientRectangle {\r
+                       get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }\r
+               }\r
+               public IGOLibHost TopContainer {\r
+                       get { return this; }\r
+               }\r
+\r
+               public Rectangle getSlot ()\r
+               {\r
+                       return ClientRectangle;\r
+               }\r
+               public Rectangle getBounds ()//redundant but fill ILayoutable implementation\r
+               {\r
+                       return ClientRectangle;\r
+               }                       \r
+               #endregion      \r
+       }\r
+}
\ No newline at end of file
diff --git a/UnitTest/Test.cs b/UnitTest/Test.cs
new file mode 100644 (file)
index 0000000..1155569
--- /dev/null
@@ -0,0 +1,64 @@
+//
+//  Test.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 NUnit.Framework;
+using System;
+using Crow;
+using System.IO;
+
+namespace UnitTest
+{
+       [TestFixture ()]
+       public class Test
+       {
+               NUnitCrowWindow win;
+
+               [SetUp]
+               public void Init()
+               {
+                       win = new NUnitCrowWindow (400,400);
+               }
+
+               [Test ()]
+               [Category("Alignment")]
+               public void GraphicObject ()
+               {
+                       string[] tests = new string[] { "0","1" };
+
+                       foreach (string s in tests) {
+                               win.LoadTest (s);
+                               win.Update ();
+                               win.Update ();
+                               byte[] model = File.ReadAllBytes("ExpectedOutputs/" + s + ".png");
+                               byte[] result = File.ReadAllBytes(@"tmp.png");
+
+                               CollectionAssert.AreEqual (model, result);
+
+                               win.ClearInterface ();
+                       }                               
+               }
+
+               void testAlignment(GraphicObject g){
+                       g.HorizontalAlignment = HorizontalAlignment.Left;
+
+               }
+       }
+}
+
diff --git a/UnitTest/UnitTest.csproj b/UnitTest/UnitTest.csproj
new file mode 100644 (file)
index 0000000..ddd53b6
--- /dev/null
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>UnitTest</RootNamespace>
+    <AssemblyName>UnitTest</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="Mono.Cairo" />
+    <Reference Include="OpenTK">
+      <HintPath>..\..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+    <Reference Include="nunit.framework, Version=2.6.4.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+      <Package>nunit</Package>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Test.cs" />
+    <Compile Include="NUnitCrowWindow.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <None Include="packages.config" />
+    <None Include="Interfaces\0.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="ExpectedOutputs\0.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\1.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="ExpectedOutputs\1.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\2.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Crow.csproj">
+      <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
+      <Name>Crow</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Interfaces\" />
+    <Folder Include="ExpectedOutputs\" />
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/UnitTest/packages.config b/UnitTest/packages.config
new file mode 100644 (file)
index 0000000..b183023
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="NUnit" version="3.0.1" targetFramework="net45" />
+</packages>
\ No newline at end of file
index c598c3e31dc6b3be63f65ae3f16f13a42616ed0a..5d3e81ca93ac85d071e023f086aaf703e13092c4 100644 (file)
@@ -26,12 +26,12 @@ namespace Crow
                #endregion\r
 \r
                #region GraphicObject Overrides\r
-               [XmlAttributeAttribute()][DefaultValue(60)]\r
+               [XmlAttributeAttribute()][DefaultValue(50)]\r
                public override int Width {\r
                        get { return base.Width; }\r
                        set { base.Width = value; }\r
                }\r
-               [XmlAttributeAttribute()][DefaultValue(30)]\r
+               [XmlAttributeAttribute()][DefaultValue(20)]\r
                public override int Height {\r
                        get { return base.Height; }\r
                        set { base.Height = value; }\r
diff --git a/src/GraphicObjects/CheckBox.cs b/src/GraphicObjects/CheckBox.cs
new file mode 100644 (file)
index 0000000..a08f9fd
--- /dev/null
@@ -0,0 +1,94 @@
+using System;\r
+\r
+\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+//using OpenTK.Graphics.OpenGL;\r
+\r
+using Cairo;\r
+\r
+using winColors = System.Drawing.Color;\r
+using System.Diagnostics;\r
+using System.Xml.Serialization;\r
+using OpenTK.Input;\r
+using System.ComponentModel;\r
+\r
+namespace Crow\r
+{\r
+       [DefaultTemplate("#Crow.Templates.CheckBox.goml")]\r
+    public class CheckBox : TemplatedControl\r
+    {                  \r
+               string caption;\r
+               string image;\r
+               bool isChecked;\r
+\r
+               #region CTOR\r
+               public CheckBox() : base()\r
+               {                       \r
+               }                                                       \r
+               #endregion\r
+\r
+               public event EventHandler Checked;\r
+               public event EventHandler Unchecked;\r
+\r
+               #region GraphicObject overrides\r
+//             [XmlAttributeAttribute()][DefaultValue(-1)]\r
+//             public override int Height {\r
+//                     get { return base.Height; }\r
+//                     set { base.Height = value; }\r
+//             }\r
+               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
+               public override bool Focusable\r
+               {\r
+                       get { return base.Focusable; }\r
+                       set { base.Focusable = value; }\r
+               }\r
+               #endregion\r
+\r
+               [XmlAttributeAttribute()][DefaultValue("Checkbox")]\r
+               public string Caption {\r
+                       get { return caption; } \r
+                       set {\r
+                               if (caption == value)\r
+                                       return;\r
+                               caption = value; \r
+                               NotifyValueChanged ("Caption", caption);\r
+                       }\r
+               }        \r
+               [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.checkbox.svg")]\r
+               public string Image {\r
+                       get { return image; } \r
+                       set {\r
+                               if (image == value)\r
+                                       return;\r
+                               image = value; \r
+                               NotifyValueChanged ("Image", image);\r
+                       }\r
+               } \r
+\r
+               [XmlAttributeAttribute()][DefaultValue(false)]\r
+               public bool IsChecked\r
+               {\r
+                       get { return isChecked; }\r
+                       set\r
+                       {\r
+                               isChecked = value;\r
+\r
+                               NotifyValueChanged ("IsChecked", value);\r
+                               if (isChecked) {\r
+                                       NotifyValueChanged ("SvgSub", "checked");\r
+                                       Checked.Raise (this, null);\r
+                               } else {\r
+                                       NotifyValueChanged ("SvgSub", "unchecked");\r
+                                       Unchecked.Raise (this, null);\r
+                               }\r
+                       }\r
+               }\r
+               public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
+               {\r
+                       IsChecked = !IsChecked;\r
+                       base.onMouseClick (sender, e);\r
+               }\r
+       }\r
+}\r
diff --git a/src/GraphicObjects/Checkbox.cs b/src/GraphicObjects/Checkbox.cs
deleted file mode 100644 (file)
index 3618160..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
-       [DefaultTemplate("#Crow.Templates.Checkbox.goml")]\r
-    public class Checkbox : TemplatedControl\r
-    {                  \r
-               string caption;\r
-               string image;\r
-               bool isChecked;\r
-\r
-               #region CTOR\r
-               public Checkbox() : base()\r
-               {                       \r
-               }                                                       \r
-               #endregion\r
-\r
-               public event EventHandler Checked;\r
-               public event EventHandler Unchecked;\r
-\r
-               #region GraphicObject overrides\r
-//             [XmlAttributeAttribute()][DefaultValue(-1)]\r
-//             public override int Height {\r
-//                     get { return base.Height; }\r
-//                     set { base.Height = value; }\r
-//             }\r
-               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
-               public override bool Focusable\r
-               {\r
-                       get { return base.Focusable; }\r
-                       set { base.Focusable = value; }\r
-               }\r
-               #endregion\r
-\r
-               [XmlAttributeAttribute()][DefaultValue("Checkbox")]\r
-               public string Caption {\r
-                       get { return caption; } \r
-                       set {\r
-                               if (caption == value)\r
-                                       return;\r
-                               caption = value; \r
-                               NotifyValueChanged ("Caption", caption);\r
-                       }\r
-               }        \r
-               [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.checkbox.svg")]\r
-               public string Image {\r
-                       get { return image; } \r
-                       set {\r
-                               if (image == value)\r
-                                       return;\r
-                               image = value; \r
-                               NotifyValueChanged ("Image", image);\r
-                       }\r
-               } \r
-\r
-               [XmlAttributeAttribute()][DefaultValue(false)]\r
-               public bool IsChecked\r
-               {\r
-                       get { return isChecked; }\r
-                       set\r
-                       {\r
-                               isChecked = value;\r
-\r
-                               NotifyValueChanged ("IsChecked", value);\r
-                               if (isChecked) {\r
-                                       NotifyValueChanged ("SvgSub", "checked");\r
-                                       Checked.Raise (this, null);\r
-                               } else {\r
-                                       NotifyValueChanged ("SvgSub", "unchecked");\r
-                                       Unchecked.Raise (this, null);\r
-                               }\r
-                       }\r
-               }\r
-               public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
-               {\r
-                       IsChecked = !IsChecked;\r
-                       base.onMouseClick (sender, e);\r
-               }\r
-       }\r
-}\r
diff --git a/src/GraphicObjects/ComboBox.cs b/src/GraphicObjects/ComboBox.cs
new file mode 100644 (file)
index 0000000..5d9c8e9
--- /dev/null
@@ -0,0 +1,365 @@
+using System;\r
+\r
+\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+//using OpenTK.Graphics.OpenGL;\r
+\r
+using Cairo;\r
+\r
+using winColors = System.Drawing.Color;\r
+using System.Diagnostics;\r
+using System.Xml.Serialization;\r
+using OpenTK.Input;\r
+using System.ComponentModel;\r
+using System.Xml;\r
+using System.IO;\r
+using System.Collections;\r
+using System.Threading;\r
+\r
+namespace Crow\r
+{\r
+       [DefaultTemplate("#Crow.Templates.ComboBox.goml")]\r
+       [DefaultOverlayTemplate("#Crow.Templates.ComboBoxOverlay.goml")]\r
+       public class ComboBox : TemplatedContainer\r
+    {          \r
+               #region CTOR\r
+               public ComboBox() : base(){     }       \r
+               #endregion\r
+\r
+               bool _isPopped;\r
+               string caption;\r
+               GraphicObject _overlay;\r
+               Group _list;\r
+               IList data;\r
+               int _selectedIndex;\r
+               object _selectedItem;\r
+               string _itemTemplate;\r
+               string _overlayTemplate;\r
+\r
+               public event EventHandler Pop;\r
+               public event EventHandler Unpop;\r
+               public event EventHandler<SelectionChangeEventArgs> SelectedItemChanged;\r
+\r
+               #region implemented abstract members of TemplatedControl\r
+               protected override void loadTemplate (GraphicObject template)\r
+               {\r
+                       base.loadTemplate (template);\r
+                       loadOverlayTemplate (null);\r
+               }\r
+               public override GraphicObject Content {\r
+                       get {\r
+                               throw new NotImplementedException ();\r
+                       }\r
+                       set {\r
+                               throw new NotImplementedException ();\r
+                       }\r
+               }\r
+               #endregion\r
+\r
+               protected virtual void loadOverlayTemplate(GraphicObject overlayTemplate)\r
+               {\r
+                       if (overlayTemplate == null) {\r
+                               DefaultOverlayTemplate dt = (DefaultOverlayTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultOverlayTemplate), true).FirstOrDefault ();\r
+                               Overlay = Interface.Load (dt.Path);\r
+                               Overlay.ResolveBindings ();\r
+                       } else\r
+                               Overlay = overlayTemplate;\r
+                       _list = Overlay.FindByName ("List") as Group;\r
+               }\r
+\r
+               [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ItemTemplate.goml")]\r
+               public string ItemTemplate {\r
+                       get { return _itemTemplate; }\r
+                       set { \r
+                               //TODO:reload list with new template?\r
+                               _itemTemplate = value; \r
+                       }\r
+               }\r
+               [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ComboBoxOverlay.goml")]\r
+               public string OverlayTemplate {\r
+                       get { return _overlayTemplate; }\r
+                       set { \r
+                               //TODO:reload list with new template?\r
+                               _overlayTemplate = value; \r
+\r
+                               Overlay = Interface.Load (_overlayTemplate);\r
+                               Overlay.ResolveBindings ();\r
+                               _list = Overlay.FindByName ("List") as Group;\r
+                       }\r
+               }\r
+               [XmlAttributeAttribute][DefaultValue(-1)]\r
+               public int SelectedIndex{\r
+                       get { return _selectedIndex; }\r
+                       set { \r
+                               //store value event if data is null, because in xml parsing selindex is always\r
+                               //before data, so it's impossible without that trick to set a default index in goml\r
+                               _selectedIndex = value; \r
+       \r
+                               if (data == null)                                       \r
+                                       return;\r
+       \r
+                               if (_selectedIndex > data.Count - 1 || _selectedIndex < 0)\r
+                                       throw new Exception ("Combobox SelectedIndex out of range");\r
+\r
+\r
+                               _selectedItem = data [_selectedIndex];\r
+                               NotifyValueChanged ("SelectedIndex", SelectedIndex);\r
+                               SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));\r
+\r
+                               if (SelectedItem == null)\r
+                                       Caption = "";\r
+                               else\r
+                                       Caption = _selectedItem.ToString ();\r
+                               }\r
+               }\r
+               public object SelectedItem{\r
+                       set {\r
+                               if (_selectedItem == value)\r
+                                       return;\r
+\r
+                               _selectedItem = value;\r
+                               _selectedIndex = data.IndexOf (_selectedItem);\r
+                               NotifyValueChanged ("SelectedIndex", _selectedIndex);\r
+                               SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));\r
+\r
+                               if (SelectedItem == null)\r
+                                       Caption = "";\r
+                               else\r
+                                       Caption = _selectedItem.ToString ();\r
+                       }\r
+\r
+                       get { return _selectedItem; }\r
+               }\r
+               [XmlAttributeAttribute][DefaultValue(null)]\r
+               public IList Data {\r
+                       get {\r
+                               return data;\r
+                       }\r
+                       set {                           \r
+                               data = value;\r
+                               if (_list == null)\r
+                                       return;\r
+\r
+                               foreach (GraphicObject c in _list.Children) {\r
+                                       c.ClearBinding ();\r
+                               }\r
+                               _list.Children.Clear ();\r
+                               _list.registerForGraphicUpdate ();\r
+                               if (data == null)\r
+                                       return;\r
+                               if (SelectedIndex < 0)\r
+                                       return;\r
+\r
+                               //force raise of changes\r
+                               SelectedIndex = SelectedIndex;\r
+\r
+                               pendingChildrenAddition = new Queue<GraphicObject> ();\r
+                               threadedLoadingFinished = false;\r
+\r
+                               Thread t = new Thread (loadingThread);\r
+                               t.Start ();\r
+                               t.Join ();\r
+\r
+                       }\r
+               }\r
+               public override void UpdateLayout (LayoutingType layoutType)\r
+               {\r
+                       CheckPendingChildrenAddition ();\r
+                       base.UpdateLayout (layoutType);\r
+               }\r
+               internal void CheckPendingChildrenAddition()\r
+               {\r
+                       if (pendingChildrenAddition == null)\r
+                               return;\r
+                       lock (pendingChildrenAddition) {\r
+                               if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)\r
+                                       return;\r
+                               while (pendingChildrenAddition.Count > 0) {\r
+                                       _list.addChild (pendingChildrenAddition.Dequeue ());\r
+                               }\r
+                       }\r
+               }\r
+\r
+               volatile Queue<GraphicObject> pendingChildrenAddition;\r
+               volatile bool threadedLoadingFinished = false;\r
+\r
+               void loadingThread()\r
+               {\r
+                       #if DEBUG_LOAD_TIME\r
+                       Stopwatch loadingTime = new Stopwatch ();\r
+                       loadingTime.Start ();\r
+                       #endif\r
+\r
+                       MemoryStream ms = new MemoryStream ();\r
+                       lock (ItemTemplate) {\r
+                               using (Stream stream = Interface.GetStreamFromPath (ItemTemplate))\r
+                                       stream.CopyTo (ms);\r
+                       }\r
+\r
+                       Type t = Interface.GetTopContainerOfGOMLStream (ms);\r
+\r
+                       foreach (var item in data) {\r
+                               ms.Seek(0,SeekOrigin.Begin);\r
+                               GraphicObject g = Interface.Load (ms, t);\r
+                               g.DataSource = item;\r
+                               g.MouseClick += itemClick;\r
+\r
+                               lock (pendingChildrenAddition) {\r
+                                       pendingChildrenAddition.Enqueue (g);\r
+                               }\r
+                       }\r
+\r
+                       ms.Dispose ();                  \r
+\r
+                       threadedLoadingFinished = true;\r
+\r
+                       #if DEBUG_LOAD_TIME\r
+                       loadingTime.Stop ();\r
+                       Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",\r
+                       loadingTime.ElapsedTicks,\r
+                       loadingTime.ElapsedMilliseconds, this.ToString());\r
+                       #endif\r
+               }\r
+               public GraphicObject Overlay {\r
+                       get { return _overlay; }\r
+                       set { \r
+                               if (_overlay != null) {\r
+                                       _overlay.LayoutChanged -= _overlay_LayoutChanged;\r
+                                       _overlay.MouseLeave -= _overlay_MouseLeave;\r
+                                       _overlay.LogicalParent = null;\r
+                               }\r
+\r
+                               _overlay = value; \r
+\r
+                               if (_overlay == null)\r
+                                       return;\r
+\r
+                               _overlay.LogicalParent = this;\r
+                               _overlay.Focusable = true;\r
+                               _overlay.LayoutChanged += _overlay_LayoutChanged;\r
+                               _overlay.MouseLeave += _overlay_MouseLeave;\r
+                       }\r
+               }\r
+               [XmlAttributeAttribute()][DefaultValue("Combobox")]\r
+               public string Caption {\r
+                       get { return caption; } \r
+                       set {\r
+                               if (caption == value)\r
+                                       return;\r
+                               caption = value; \r
+                               NotifyValueChanged ("Caption", caption);\r
+                       }\r
+               }        \r
+               [XmlAttributeAttribute()][DefaultValue(false)]\r
+               public bool IsPopped\r
+               {\r
+                       get { return _isPopped; }\r
+                       set\r
+                       {\r
+                               _isPopped = value;\r
+\r
+                               if (_isPopped) {\r
+                                       onPop (this, null);\r
+                                       NotifyValueChanged ("SvgSub", "expanded");\r
+                                       return;\r
+                               }\r
+\r
+                               onUnpop (this, null);\r
+                               NotifyValueChanged ("SvgSub", "collapsed");\r
+                       }\r
+               }\r
+\r
+               void itemClick(object sender, OpenTK.Input.MouseButtonEventArgs e){\r
+                       object datasource = (sender as GraphicObject).DataSource;\r
+                       SelectedItem = datasource;\r
+                       IsPopped = false;\r
+                       //Debug.WriteLine ((sender as GraphicObject).DataSource);\r
+               }\r
+               void _overlay_MouseLeave (object sender, MouseMoveEventArgs e)\r
+               {\r
+                       IsPopped = false;\r
+               }\r
+               void _overlay_LayoutChanged (object sender, LayoutChangeEventArgs e)\r
+               {\r
+                       ILayoutable tc = Overlay.Parent as ILayoutable;\r
+                       if (tc == null)\r
+                               return;\r
+                       Rectangle r = this.ScreenCoordinates (this.Slot);\r
+                       if (e.LayoutType == LayoutingType.Width) {\r
+                               if (Overlay.Slot.Width < tc.ClientRectangle.Width) {\r
+                                       if (r.Left + Overlay.Slot.Width > tc.ClientRectangle.Right)\r
+                                               Overlay.Left = tc.ClientRectangle.Right - Overlay.Slot.Width;\r
+                                       else\r
+                                               Overlay.Left = r.Left;\r
+                               }else\r
+                                       Overlay.Left = 0;\r
+                       }else if (e.LayoutType == LayoutingType.Height) {\r
+                               if (Overlay.Slot.Height < tc.ClientRectangle.Height) {\r
+                                       if (r.Bottom + Overlay.Slot.Height > tc.ClientRectangle.Bottom)\r
+                                               Overlay.Top = r.Top - Overlay.Slot.Height;\r
+                                       else\r
+                                               Overlay.Top = r.Bottom;\r
+                               }else\r
+                                       Overlay.Top = 0;\r
+                       }\r
+               }\r
+\r
+               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
+               public override bool Focusable\r
+               {\r
+                       get { return base.Focusable; }\r
+                       set { base.Focusable = value; }\r
+               }\r
+\r
+                       \r
+               public virtual void onPop(object sender, EventArgs e)\r
+               {\r
+                       IGOLibHost tc = TopContainer;\r
+                       if (tc == null)\r
+                               return;\r
+                       if (Overlay != null) {\r
+                               Overlay.Visible = true;\r
+                               if (Overlay.Parent == null)\r
+                                       tc.AddWidget (Overlay);\r
+                               (tc as OpenTKGameWindow).PutOnTop (Overlay);\r
+                       }\r
+                       Pop.Raise (this, e);\r
+               }\r
+               public virtual void onUnpop(object sender, EventArgs e)\r
+               {\r
+                       IGOLibHost tc = TopContainer;\r
+                       if (tc == null)\r
+                               return;\r
+                       Overlay.Visible = false;\r
+                       Unpop.Raise (this, e);\r
+               }\r
+                       \r
+               public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
+               {\r
+                       IsPopped = !IsPopped;\r
+                       base.onMouseClick (sender, e);\r
+               }\r
+\r
+               public override void ClearBinding ()\r
+               {\r
+                       //ensure popped window is cleared\r
+                       if (Overlay != null) {\r
+                               if (Overlay.Parent != null) {\r
+                                       IGOLibHost tc = Overlay.Parent as IGOLibHost;\r
+                                       if (tc != null)\r
+                                               tc.DeleteWidget (Overlay);\r
+                               }\r
+                       }\r
+                       base.ClearBinding ();\r
+\r
+               }\r
+               public override void ResolveBindings ()\r
+               {\r
+                       base.ResolveBindings ();\r
+                       if (Overlay != null)\r
+                               Overlay.ResolveBindings ();\r
+               }\r
+       }\r
+}\r
diff --git a/src/GraphicObjects/Combobox.cs b/src/GraphicObjects/Combobox.cs
deleted file mode 100644 (file)
index 473c10f..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.IO;\r
-using System.Collections;\r
-using System.Threading;\r
-\r
-namespace Crow\r
-{\r
-       [DefaultTemplate("#Crow.Templates.Combobox.goml")]\r
-       [DefaultOverlayTemplate("#Crow.Templates.ComboboxOverlay.goml")]\r
-       public class Combobox : TemplatedContainer\r
-    {          \r
-               #region CTOR\r
-               public Combobox() : base(){     }       \r
-               #endregion\r
-\r
-               bool _isPopped;\r
-               string text;\r
-               GraphicObject _overlay;\r
-               Group _list;\r
-               IList data;\r
-               int _selectedIndex;\r
-               object _selectedItem;\r
-               string _itemTemplate;\r
-               string _overlayTemplate;\r
-\r
-               public event EventHandler Pop;\r
-               public event EventHandler Unpop;\r
-               public event EventHandler<SelectionChangeEventArgs> SelectedItemChanged;\r
-\r
-               #region implemented abstract members of TemplatedControl\r
-               protected override void loadTemplate (GraphicObject template)\r
-               {\r
-                       base.loadTemplate (template);\r
-                       loadOverlayTemplate (null);\r
-               }\r
-               public override GraphicObject Content {\r
-                       get {\r
-                               throw new NotImplementedException ();\r
-                       }\r
-                       set {\r
-                               throw new NotImplementedException ();\r
-                       }\r
-               }\r
-               #endregion\r
-\r
-               protected virtual void loadOverlayTemplate(GraphicObject overlayTemplate)\r
-               {\r
-                       if (overlayTemplate == null) {\r
-                               DefaultOverlayTemplate dt = (DefaultOverlayTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultOverlayTemplate), true).FirstOrDefault ();\r
-                               Overlay = Interface.Load (dt.Path);\r
-                               Overlay.ResolveBindings ();\r
-                       } else\r
-                               Overlay = overlayTemplate;\r
-                       _list = Overlay.FindByName ("List") as Group;\r
-               }\r
-\r
-               [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ItemTemplate.goml")]\r
-               public string ItemTemplate {\r
-                       get { return _itemTemplate; }\r
-                       set { \r
-                               //TODO:reload list with new template?\r
-                               _itemTemplate = value; \r
-                       }\r
-               }\r
-               [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ComboboxOverlay.goml")]\r
-               public string OverlayTemplate {\r
-                       get { return _overlayTemplate; }\r
-                       set { \r
-                               //TODO:reload list with new template?\r
-                               _overlayTemplate = value; \r
-\r
-                               Overlay = Interface.Load (_overlayTemplate);\r
-                               Overlay.ResolveBindings ();\r
-                               _list = Overlay.FindByName ("List") as Group;\r
-                       }\r
-               }\r
-               [XmlAttributeAttribute][DefaultValue(-1)]\r
-               public int SelectedIndex{\r
-                       get { return _selectedIndex; }\r
-                       set { \r
-                               //store value event if data is null, because in xml parsing selindex is always\r
-                               //before data, so it's impossible without that trick to set a default index in goml\r
-                               _selectedIndex = value; \r
-       \r
-                               if (data == null)                                       \r
-                                       return;\r
-       \r
-                               if (_selectedIndex > data.Count - 1 || _selectedIndex < 0)\r
-                                       throw new Exception ("Combobox SelectedIndex out of range");\r
-\r
-\r
-                               _selectedItem = data [_selectedIndex];\r
-                               NotifyValueChanged ("SelectedIndex", SelectedIndex);\r
-                               SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));\r
-\r
-                               if (SelectedItem == null)\r
-                                       Text = "";\r
-                               else\r
-                                       Text = _selectedItem.ToString ();\r
-                               }\r
-               }\r
-               public object SelectedItem{\r
-                       set {\r
-                               if (_selectedItem == value)\r
-                                       return;\r
-\r
-                               _selectedItem = value;\r
-                               _selectedIndex = data.IndexOf (_selectedItem);\r
-                               NotifyValueChanged ("SelectedIndex", _selectedIndex);\r
-                               SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));\r
-\r
-                               if (SelectedItem == null)\r
-                                       Text = "";\r
-                               else\r
-                                       Text = _selectedItem.ToString ();\r
-                       }\r
-\r
-                       get { return _selectedItem; }\r
-               }\r
-               [XmlAttributeAttribute][DefaultValue(null)]\r
-               public IList Data {\r
-                       get {\r
-                               return data;\r
-                       }\r
-                       set {                           \r
-                               data = value;\r
-                               if (_list == null)\r
-                                       return;\r
-\r
-                               foreach (GraphicObject c in _list.Children) {\r
-                                       c.ClearBinding ();\r
-                               }\r
-                               _list.Children.Clear ();\r
-                               _list.registerForGraphicUpdate ();\r
-                               if (data == null)\r
-                                       return;\r
-                               if (SelectedIndex < 0)\r
-                                       return;\r
-\r
-                               //force raise of changes\r
-                               SelectedIndex = SelectedIndex;\r
-\r
-                               pendingChildrenAddition = new Queue<GraphicObject> ();\r
-                               threadedLoadingFinished = false;\r
-\r
-                               Thread t = new Thread (loadingThread);\r
-                               t.Start ();\r
-                               t.Join ();\r
-\r
-                       }\r
-               }\r
-               public override void UpdateLayout (LayoutingType layoutType)\r
-               {\r
-                       CheckPendingChildrenAddition ();\r
-                       base.UpdateLayout (layoutType);\r
-               }\r
-               internal void CheckPendingChildrenAddition()\r
-               {\r
-                       if (pendingChildrenAddition == null)\r
-                               return;\r
-                       lock (pendingChildrenAddition) {\r
-                               if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)\r
-                                       return;\r
-                               while (pendingChildrenAddition.Count > 0) {\r
-                                       _list.addChild (pendingChildrenAddition.Dequeue ());\r
-                               }\r
-                       }\r
-               }\r
-\r
-               volatile Queue<GraphicObject> pendingChildrenAddition;\r
-               volatile bool threadedLoadingFinished = false;\r
-\r
-               void loadingThread()\r
-               {\r
-                       #if DEBUG_LOAD_TIME\r
-                       Stopwatch loadingTime = new Stopwatch ();\r
-                       loadingTime.Start ();\r
-                       #endif\r
-\r
-                       MemoryStream ms = new MemoryStream ();\r
-                       lock (ItemTemplate) {\r
-                               using (Stream stream = Interface.GetStreamFromPath (ItemTemplate))\r
-                                       stream.CopyTo (ms);\r
-                       }\r
-\r
-                       Type t = Interface.GetTopContainerOfGOMLStream (ms);\r
-\r
-                       foreach (var item in data) {\r
-                               ms.Seek(0,SeekOrigin.Begin);\r
-                               GraphicObject g = Interface.Load (ms, t);\r
-                               g.DataSource = item;\r
-                               g.MouseClick += itemClick;\r
-\r
-                               lock (pendingChildrenAddition) {\r
-                                       pendingChildrenAddition.Enqueue (g);\r
-                               }\r
-                       }\r
-\r
-                       ms.Dispose ();                  \r
-\r
-                       threadedLoadingFinished = true;\r
-\r
-                       #if DEBUG_LOAD_TIME\r
-                       loadingTime.Stop ();\r
-                       Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",\r
-                       loadingTime.ElapsedTicks,\r
-                       loadingTime.ElapsedMilliseconds, this.ToString());\r
-                       #endif\r
-               }\r
-               public GraphicObject Overlay {\r
-                       get { return _overlay; }\r
-                       set { \r
-                               if (_overlay != null) {\r
-                                       _overlay.LayoutChanged -= _overlay_LayoutChanged;\r
-                                       _overlay.MouseLeave -= _overlay_MouseLeave;\r
-                                       _overlay.LogicalParent = null;\r
-                               }\r
-\r
-                               _overlay = value; \r
-\r
-                               if (_overlay == null)\r
-                                       return;\r
-\r
-                               _overlay.LogicalParent = this;\r
-                               _overlay.Focusable = true;\r
-                               _overlay.LayoutChanged += _overlay_LayoutChanged;\r
-                               _overlay.MouseLeave += _overlay_MouseLeave;\r
-                       }\r
-               }\r
-               [XmlAttributeAttribute()][DefaultValue("Combobox")]\r
-               public string Text {\r
-                       get { return text; } \r
-                       set {\r
-                               if (text == value)\r
-                                       return;\r
-                               text = value; \r
-                               NotifyValueChanged ("Text", text);\r
-                       }\r
-               }        \r
-               [XmlAttributeAttribute()][DefaultValue(false)]\r
-               public bool IsPopped\r
-               {\r
-                       get { return _isPopped; }\r
-                       set\r
-                       {\r
-                               _isPopped = value;\r
-\r
-                               if (_isPopped) {\r
-                                       onPop (this, null);\r
-                                       NotifyValueChanged ("SvgSub", "expanded");\r
-                                       return;\r
-                               }\r
-\r
-                               onUnpop (this, null);\r
-                               NotifyValueChanged ("SvgSub", "collapsed");\r
-                       }\r
-               }\r
-\r
-               void itemClick(object sender, OpenTK.Input.MouseButtonEventArgs e){\r
-                       object datasource = (sender as GraphicObject).DataSource;\r
-                       SelectedItem = datasource;\r
-                       IsPopped = false;\r
-                       //Debug.WriteLine ((sender as GraphicObject).DataSource);\r
-               }\r
-               void _overlay_MouseLeave (object sender, MouseMoveEventArgs e)\r
-               {\r
-                       IsPopped = false;\r
-               }\r
-               void _overlay_LayoutChanged (object sender, LayoutChangeEventArgs e)\r
-               {\r
-                       ILayoutable tc = Overlay.Parent as ILayoutable;\r
-                       if (tc == null)\r
-                               return;\r
-                       Rectangle r = this.ScreenCoordinates (this.Slot);\r
-                       if (e.LayoutType == LayoutingType.Width) {\r
-                               if (Overlay.Slot.Width < tc.ClientRectangle.Width) {\r
-                                       if (r.Left + Overlay.Slot.Width > tc.ClientRectangle.Right)\r
-                                               Overlay.Left = tc.ClientRectangle.Right - Overlay.Slot.Width;\r
-                                       else\r
-                                               Overlay.Left = r.Left;\r
-                               }else\r
-                                       Overlay.Left = 0;\r
-                       }else if (e.LayoutType == LayoutingType.Height) {\r
-                               if (Overlay.Slot.Height < tc.ClientRectangle.Height) {\r
-                                       if (r.Bottom + Overlay.Slot.Height > tc.ClientRectangle.Bottom)\r
-                                               Overlay.Top = r.Top - Overlay.Slot.Height;\r
-                                       else\r
-                                               Overlay.Top = r.Bottom;\r
-                               }else\r
-                                       Overlay.Top = 0;\r
-                       }\r
-               }\r
-\r
-               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
-               public override bool Focusable\r
-               {\r
-                       get { return base.Focusable; }\r
-                       set { base.Focusable = value; }\r
-               }\r
-\r
-                       \r
-               public virtual void onPop(object sender, EventArgs e)\r
-               {\r
-                       IGOLibHost tc = TopContainer;\r
-                       if (tc == null)\r
-                               return;\r
-                       if (Overlay != null) {\r
-                               Overlay.Visible = true;\r
-                               if (Overlay.Parent == null)\r
-                                       tc.AddWidget (Overlay);\r
-                               (tc as OpenTKGameWindow).PutOnTop (Overlay);\r
-                       }\r
-                       Pop.Raise (this, e);\r
-               }\r
-               public virtual void onUnpop(object sender, EventArgs e)\r
-               {\r
-                       IGOLibHost tc = TopContainer;\r
-                       if (tc == null)\r
-                               return;\r
-                       Overlay.Visible = false;\r
-                       Unpop.Raise (this, e);\r
-               }\r
-                       \r
-               public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
-               {\r
-                       IsPopped = !IsPopped;\r
-                       base.onMouseClick (sender, e);\r
-               }\r
-\r
-               public override void ClearBinding ()\r
-               {\r
-                       //ensure popped window is cleared\r
-                       if (Overlay != null) {\r
-                               if (Overlay.Parent != null) {\r
-                                       IGOLibHost tc = Overlay.Parent as IGOLibHost;\r
-                                       if (tc != null)\r
-                                               tc.DeleteWidget (Overlay);\r
-                               }\r
-                       }\r
-                       base.ClearBinding ();\r
-\r
-               }\r
-               public override void ResolveBindings ()\r
-               {\r
-                       base.ResolveBindings ();\r
-                       if (Overlay != null)\r
-                               Overlay.ResolveBindings ();\r
-               }\r
-       }\r
-}\r
index 172406c2baa41567e4b18e44cbe3cbb036a75e73..f1e2bdeb8a40f904cf05cfaf72936be987cd96fe 100644 (file)
@@ -22,7 +22,7 @@ namespace Crow
     public class Expandable : TemplatedContainer\r
     {          \r
                bool _isExpanded;\r
-               string title;\r
+               string caption;\r
                string image;\r
                Container _contentContainer;\r
 \r
@@ -62,13 +62,13 @@ namespace Crow
                }\r
 \r
                [XmlAttributeAttribute()][DefaultValue("Expandable")]\r
-               public string Title {\r
-                       get { return title; } \r
+               public string Caption {\r
+                       get { return caption; } \r
                        set {\r
-                               if (title == value)\r
+                               if (caption == value)\r
                                        return;\r
-                               title = value; \r
-                               NotifyValueChanged ("Title", title);\r
+                               caption = value; \r
+                               NotifyValueChanged ("Caption", caption);\r
                        }\r
                }        \r
                [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]\r
diff --git a/src/GraphicObjects/GroupBox.cs b/src/GraphicObjects/GroupBox.cs
new file mode 100644 (file)
index 0000000..81bac11
--- /dev/null
@@ -0,0 +1,68 @@
+using System;\r
+\r
+\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+//using OpenTK.Graphics.OpenGL;\r
+\r
+using Cairo;\r
+\r
+using winColors = System.Drawing.Color;\r
+using System.Diagnostics;\r
+using System.Xml.Serialization;\r
+using OpenTK.Input;\r
+using System.ComponentModel;\r
+using System.Xml;\r
+using System.IO;\r
+\r
+namespace Crow\r
+{\r
+       [DefaultTemplate("#Crow.Templates.GroupBox.goml")]\r
+    public class GroupBox : TemplatedContainer\r
+    {          \r
+               string caption;\r
+               Container _contentContainer;\r
+\r
+               #region CTOR\r
+               public GroupBox() : base(){}    \r
+               #endregion\r
+\r
+               #region Template overrides\r
+               public override GraphicObject Content {\r
+                       get {\r
+                               return _contentContainer == null ? null : _contentContainer.Child;\r
+                       }\r
+                       set {\r
+                               _contentContainer.SetChild(value);\r
+                       }\r
+               }\r
+               protected override void loadTemplate(GraphicObject template = null)\r
+               {\r
+                       base.loadTemplate (template);\r
+\r
+                       _contentContainer = this.child.FindByName ("Content") as Container;\r
+               }\r
+               #endregion\r
+\r
+               #region GraphicObject overrides\r
+               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
+               public override bool Focusable\r
+               {\r
+                       get { return base.Focusable; }\r
+                       set { base.Focusable = value; }\r
+               }\r
+               #endregion\r
+\r
+               [XmlAttributeAttribute()][DefaultValue("Groupbox")]\r
+               public string Caption {\r
+                       get { return caption; } \r
+                       set {\r
+                               if (caption == value)\r
+                                       return;\r
+                               caption = value; \r
+                               NotifyValueChanged ("Caption", caption);\r
+                       }\r
+               }        \r
+       }\r
+}\r
diff --git a/src/GraphicObjects/Groupbox.cs b/src/GraphicObjects/Groupbox.cs
deleted file mode 100644 (file)
index e1f33d8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.IO;\r
-\r
-namespace Crow\r
-{\r
-       [DefaultTemplate("#Crow.Templates.Groupbox.goml")]\r
-    public class Groupbox : TemplatedContainer\r
-    {          \r
-               string title;\r
-               Container _contentContainer;\r
-\r
-               #region CTOR\r
-               public Groupbox() : base(){}    \r
-               #endregion\r
-\r
-               #region Template overrides\r
-               public override GraphicObject Content {\r
-                       get {\r
-                               return _contentContainer == null ? null : _contentContainer.Child;\r
-                       }\r
-                       set {\r
-                               _contentContainer.SetChild(value);\r
-                       }\r
-               }\r
-               protected override void loadTemplate(GraphicObject template = null)\r
-               {\r
-                       base.loadTemplate (template);\r
-\r
-                       _contentContainer = this.child.FindByName ("Content") as Container;\r
-               }\r
-               #endregion\r
-\r
-               #region GraphicObject overrides\r
-               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
-               public override bool Focusable\r
-               {\r
-                       get { return base.Focusable; }\r
-                       set { base.Focusable = value; }\r
-               }\r
-               #endregion\r
-\r
-               [XmlAttributeAttribute()][DefaultValue("Groupbox")]\r
-               public string Title {\r
-                       get { return title; } \r
-                       set {\r
-                               if (title == value)\r
-                                       return;\r
-                               title = value; \r
-                               NotifyValueChanged ("Title", title);\r
-                       }\r
-               }        \r
-       }\r
-}\r
index 8d9880adc484fef4c689267ae81659b04ead9584..a0ab540e2e150cc045e7643a5680fecb715f586e 100644 (file)
@@ -31,7 +31,7 @@ using System.Threading;
 
 namespace Crow
 {
-       [DefaultTemplate("#Crow.Templates.Listbox.goml")]
+       [DefaultTemplate("#Crow.Templates.ListBox.goml")]
        //[DefaultTemplate("#Crow.Templates.ItemTemplate.goml")]
        public class ListBox : TemplatedControl//, IXmlSerializable
        {
index 40f48e4a87cba675cb493986f2fda01bf7c38ac6..18c4afb3a89013588486a1c599c50d873decbdbe 100644 (file)
@@ -54,16 +54,16 @@ namespace Crow
                        }
                }
                #region GraphicObject overrides
-               [XmlAttributeAttribute][DefaultValue(350)]
+               [XmlAttributeAttribute][DefaultValue(250)]
                public override int Width {
                        get { return base.Width; }
                        set { base.Width = value; }
                }
-               [XmlAttributeAttribute][DefaultValue(150)]
-               public override int Height {
-                       get { return base.Height; }
-                       set { base.Height = value; }
-               }
+//             [XmlAttributeAttribute][DefaultValue(80)]
+//             public override int Height {
+//                     get { return base.Height; }
+//                     set { base.Height = value; }
+//             }
                [XmlAttributeAttribute()][DefaultValue(true)]
                public override bool Focusable
                {
index 5842faf87ffc9b19df87691e40afd699ae4d50bc..15a209ce47015b4aa55df70ed9b3e8887f36fe8f 100644 (file)
@@ -27,7 +27,7 @@ namespace Crow
                }       \r
                #endregion\r
                bool _isPopped;\r
-               string title;\r
+               string caption;\r
                string image;\r
                GraphicObject _content;\r
 \r
@@ -66,15 +66,16 @@ namespace Crow
                        if (tc == null)\r
                                return;\r
                        Rectangle r = this.ScreenCoordinates (this.Slot);\r
-                       if (e.LayoutType == LayoutingType.Width) {\r
+                       if (((int)e.LayoutType & (int)LayoutingType.Width) > 0) {\r
                                if (Content.Slot.Width < tc.ClientRectangle.Width) {\r
                                        if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right)\r
                                                Content.Left = tc.ClientRectangle.Right - Content.Slot.Width;\r
                                        else\r
                                                Content.Left = r.Left;\r
-                               }else\r
+                               } else\r
                                        Content.Left = 0;\r
-                       }else if (e.LayoutType == LayoutingType.Height) {\r
+                       }\r
+                       if (((int)e.LayoutType & (int)LayoutingType.Height) > 0) {\r
                                if (Content.Slot.Height < tc.ClientRectangle.Height) {\r
                                        if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom)\r
                                                Content.Top = r.Top - Content.Slot.Height;\r
@@ -116,13 +117,13 @@ namespace Crow
                }\r
 \r
                [XmlAttributeAttribute()][DefaultValue("Popper")]\r
-               public string Title {\r
-                       get { return title; } \r
+               public string Caption {\r
+                       get { return caption; } \r
                        set {\r
-                               if (title == value)\r
+                               if (caption == value)\r
                                        return;\r
-                               title = value; \r
-                               NotifyValueChanged ("Title", title);\r
+                               caption = value; \r
+                               NotifyValueChanged ("Caption", caption);\r
                        }\r
                }        \r
                [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]\r
@@ -165,6 +166,7 @@ namespace Crow
                                if (Content.Parent == null)\r
                                        tc.AddWidget (Content);\r
                                tc.PutOnTop (Content);\r
+                               _content_LayoutChanged (this, new LayoutChangeEventArgs (LayoutingType.Sizing));\r
                        }\r
                        Pop.Raise (this, e);\r
                }\r
@@ -182,6 +184,5 @@ namespace Crow
                        IsPopped = !IsPopped;\r
                        base.onMouseClick (sender, e);\r
                }\r
-\r
        }\r
 }\r
diff --git a/src/GraphicObjects/ScrollBar.cs b/src/GraphicObjects/ScrollBar.cs
new file mode 100644 (file)
index 0000000..905efc5
--- /dev/null
@@ -0,0 +1,101 @@
+using System;\r
+\r
+\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+//using OpenTK.Graphics.OpenGL;\r
+\r
+using Cairo;\r
+\r
+using winColors = System.Drawing.Color;\r
+using System.Diagnostics;\r
+using System.Xml.Serialization;\r
+using OpenTK.Input;\r
+using System.ComponentModel;\r
+\r
+namespace Crow\r
+{\r
+       [DefaultTemplate("#Crow.Templates.ScrollBar.goml")]\r
+       public class ScrollBar : TemplatedControl, IValueChange\r
+       {\r
+               #region IValueChange implementation\r
+               public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
+               #endregion\r
+\r
+               Orientation _orientation;\r
+               Slider _slider;\r
+               double _maximumScroll;\r
+               double _scroll;\r
+\r
+               public ScrollBar() : base()\r
+               {\r
+               }       \r
+\r
+               protected override void loadTemplate(GraphicObject template = null)\r
+               {                       \r
+                       base.loadTemplate (template);\r
+                       _slider = this.child.FindByName ("Slider") as Slider;\r
+               }\r
+\r
+               [XmlAttributeAttribute()][DefaultValue(0.0)]\r
+               public virtual double MaximumScroll\r
+               {\r
+                       get { return _maximumScroll; }\r
+                       set {\r
+                               if (_maximumScroll == value)\r
+                                       return;\r
+                               _maximumScroll = value;\r
+                               registerForGraphicUpdate ();\r
+                               ValueChanged.Raise(this, new ValueChangeEventArgs ("MaximumScroll", _maximumScroll));\r
+                       }\r
+               }\r
+               [XmlAttributeAttribute()][DefaultValue(0.0)]\r
+               public virtual double Scroll\r
+               {\r
+                       get { return _scroll; }\r
+                       set {\r
+                               if (_scroll == value)\r
+                                       return;\r
+                               _scroll = value;\r
+                               if (_scroll < 0.0)\r
+                                       _scroll = 0.0;\r
+                               else if (_scroll > _maximumScroll)\r
+                                       _scroll = _maximumScroll;\r
+                               registerForGraphicUpdate ();\r
+                               ValueChanged.Raise(this, new ValueChangeEventArgs ("Scroll", _scroll));\r
+                       }\r
+               }\r
+               [XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]\r
+               public virtual Orientation Orientation\r
+               {\r
+                       get { return _orientation; }\r
+                       set {                           \r
+                               if (_orientation == value)\r
+                                       return;\r
+                               _orientation = value;\r
+                               ValueChanged.Raise(this, new ValueChangeEventArgs ("Orientation", _orientation));\r
+                               registerForGraphicUpdate ();\r
+                       }\r
+               }\r
+               public void onScrollBack (object sender, MouseButtonEventArgs e)\r
+               {\r
+                       Scroll -= _slider.LargeIncrement;\r
+               }\r
+               public void onScrollForth (object sender, MouseButtonEventArgs e)\r
+               {\r
+                       Scroll += _slider.LargeIncrement;\r
+\r
+               }\r
+\r
+               public void onSliderValueChange(object sender, ValueChangeEventArgs e){\r
+                       Scroll = Convert.ToDouble(e.NewValue);\r
+               }\r
+\r
+               public override void OnLayoutChanges (LayoutingType layoutType)\r
+               {\r
+                       OpenTKGameWindow.currentWindow.CursorVisible = true;\r
+                       base.OnLayoutChanges (layoutType);\r
+               }\r
+       }\r
+}\r
diff --git a/src/GraphicObjects/Scrollbar.cs b/src/GraphicObjects/Scrollbar.cs
deleted file mode 100644 (file)
index f68bdb7..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
-       [DefaultTemplate("#Crow.Templates.Scrollbar.goml")]\r
-       public class Scrollbar : TemplatedControl, IValueChange\r
-       {\r
-               #region IValueChange implementation\r
-               public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
-               #endregion\r
-\r
-               Orientation _orientation;\r
-               Slider _slider;\r
-               double _maximumScroll;\r
-               double _scroll;\r
-\r
-               public Scrollbar() : base()\r
-               {\r
-               }       \r
-\r
-               protected override void loadTemplate(GraphicObject template = null)\r
-               {                       \r
-                       base.loadTemplate (template);\r
-                       _slider = this.child.FindByName ("Slider") as Slider;\r
-               }\r
-\r
-               [XmlAttributeAttribute()][DefaultValue(0.0)]\r
-               public virtual double MaximumScroll\r
-               {\r
-                       get { return _maximumScroll; }\r
-                       set {\r
-                               if (_maximumScroll == value)\r
-                                       return;\r
-                               _maximumScroll = value;\r
-                               registerForGraphicUpdate ();\r
-                               ValueChanged.Raise(this, new ValueChangeEventArgs ("MaximumScroll", _maximumScroll));\r
-                       }\r
-               }\r
-               [XmlAttributeAttribute()][DefaultValue(0.0)]\r
-               public virtual double Scroll\r
-               {\r
-                       get { return _scroll; }\r
-                       set {\r
-                               if (_scroll == value)\r
-                                       return;\r
-                               _scroll = value;\r
-                               if (_scroll < 0.0)\r
-                                       _scroll = 0.0;\r
-                               else if (_scroll > _maximumScroll)\r
-                                       _scroll = _maximumScroll;\r
-                               registerForGraphicUpdate ();\r
-                               ValueChanged.Raise(this, new ValueChangeEventArgs ("Scroll", _scroll));\r
-                       }\r
-               }\r
-               [XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]\r
-               public virtual Orientation Orientation\r
-               {\r
-                       get { return _orientation; }\r
-                       set {                           \r
-                               if (_orientation == value)\r
-                                       return;\r
-                               _orientation = value;\r
-                               ValueChanged.Raise(this, new ValueChangeEventArgs ("Orientation", _orientation));\r
-                               registerForGraphicUpdate ();\r
-                       }\r
-               }\r
-               public void onScrollBack (object sender, MouseButtonEventArgs e)\r
-               {\r
-                       Scroll -= _slider.LargeIncrement;\r
-               }\r
-               public void onScrollForth (object sender, MouseButtonEventArgs e)\r
-               {\r
-                       Scroll += _slider.LargeIncrement;\r
-\r
-               }\r
-\r
-               public void onSliderValueChange(object sender, ValueChangeEventArgs e){\r
-                       Scroll = Convert.ToDouble(e.NewValue);\r
-               }\r
-\r
-               public override void OnLayoutChanges (LayoutingType layoutType)\r
-               {\r
-                       OpenTKGameWindow.currentWindow.CursorVisible = true;\r
-                       base.OnLayoutChanges (layoutType);\r
-               }\r
-       }\r
-}\r
index 97bc177f2c481df51527176a8fdfe325ad6d7533..7b44a93e950671738b806907aa0533573c69117f 100644 (file)
@@ -154,6 +154,7 @@ namespace Crow
                                cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2),\r
                                        r.Top + (int)(Value * unity));                          \r
                        }\r
+                       cursor.Inflate (-1);\r
         }\r
         \r
                #region mouse handling\r
index 097ecaa1b1d7121620e87572031e83847131ab53..9fca2feaf36b10a8511790502bbfa0c6f4b3e84e 100644 (file)
@@ -12,16 +12,16 @@ using System.Runtime.InteropServices;
 \r
 namespace Crow\r
 {\r
-    public class TextBoxWidget : Label\r
+    public class TextBox : Label\r
     {\r
                #region CTOR\r
-               public TextBoxWidget(string _initialValue)\r
+               public TextBox(string _initialValue)\r
                        : base(_initialValue)\r
                {\r
 \r
                }\r
 \r
-               public TextBoxWidget()\r
+               public TextBox()\r
                { }\r
                #endregion\r
 \r
index c1713838bca95dad4930258693e71cafed597eb1..b6e5b3f1c861c9b3642fa45e9075c3e47500496c 100644 (file)
@@ -112,8 +112,11 @@ namespace Crow
 
                        if (path.StartsWith ("#")) {
                                string resId = path.Substring (1);
-                               stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId);
-                               if (stream == null)//try to find ressource in golib assembly                            
+                               //try/catch added to prevent nunit error
+                               try {
+                                       stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId);
+                               } catch (Exception ex) {}
+                               if (stream == null)//try to find ressource in Crow assembly                             
                                        stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId);
                                if (stream == null)
                                        throw new Exception ("Resource not found: " + path);