]> O.S.I.I.S - jp/crow.git/commitdiff
* Crow.csproj, Default.style, button.svg, buttest.svg, buttest2.svg, buttest4.svg...
authorjpbruyere <jp.bruyere@hotmail.com>
Fri, 12 Aug 2016 01:37:29 +0000 (03:37 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Fri, 12 Aug 2016 01:37:29 +0000 (03:37 +0200)
  test and divers

* DirectoryView.cs:
  SelectedItem property

* GraphicObject.cs:
  Style class, EventInfo in styles

* Group.cs:
  lock children

* Popper.cs:
  alignment = top left, simple unpop on mouse leave, no additional tests

* Spinner.cs:
  ctor order

* TabView.cs:
  code clean

* Window.cs:
  movable

* Style.cs, Interface.cs:
  Style class

* StyleReader.cs:
  parser exception, debug expression parsing

* Button.crow, Popper.goml, TabItem.crow, CheckBox.goml, Expandable.goml, MessageBox.goml, RadioButton.goml, ScrollingListBox.goml:
  templating

* TreeView.crow:
  scrollbar

* 1.crow:
  showcase

* test.style, Tests.csproj, CheckBox2.imlt:
  tests

30 files changed:
Crow.csproj
Default.style
Images/Icons/buttest.svg [deleted file]
Images/Icons/buttest2.svg [deleted file]
Images/Icons/buttest4.svg [deleted file]
Images/Icons/button.svg [deleted file]
Style.cs [new file with mode: 0644]
Templates/Button.crow
Templates/CheckBox.goml
Templates/Expandable.goml
Templates/MessageBox.goml
Templates/Popper.goml
Templates/RadioButton.goml
Templates/ScrollingListBox.goml
Templates/TabItem.crow
Templates/TreeView.crow
Tests/Interfaces/CheckBox2.imlt [new file with mode: 0644]
Tests/Interfaces/basicTests/0.crow
Tests/Interfaces/basicTests/1.crow
Tests/Tests.csproj
Tests/test.style
src/GraphicObjects/DirectoryView.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/Spinner.cs
src/GraphicObjects/TabView.cs
src/GraphicObjects/Window.cs
src/Interface.cs
src/StyleReader.cs

index 07879eebaa691c2cf130559576645ca5af89c389..45f60ec946a3df981cd5697d00629fb2eaf216a8 100644 (file)
     <Compile Include="src\Instantiator.cs" />
     <Compile Include="src\IMLReader.cs" />
     <Compile Include="src\ItemTemplate.cs" />
+    <Compile Include="Style.cs" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
   <ItemGroup>
     <EmbeddedResource Include="Images\Icons\updown.svg" />
     <EmbeddedResource Include="Images\Icons\IconAlerte.svg" />
-    <EmbeddedResource Include="Images\Icons\button.svg" />
     <EmbeddedResource Include="Images\Icons\buttonB.svg" />
-    <EmbeddedResource Include="Images\Icons\buttest.svg" />
-    <EmbeddedResource Include="Images\Icons\buttest2.svg" />
-    <EmbeddedResource Include="Images\Icons\buttest4.svg" />
     <EmbeddedResource Include="Images\Icons\checkbox.svg" />
     <EmbeddedResource Include="Images\Icons\radiobutton.svg" />
     <EmbeddedResource Include="Templates\RadioButton.goml" />
index b21bd5777c0dd31a7e6313613a2ee53d8b69b099..12f5110e437112c8337140cae95afc41c0e27ae2 100644 (file)
@@ -25,6 +25,9 @@ Splitter {
        Focusable = true;
        Background = DimGray;
 }
+TabView {
+       CacheEnabled = false;
+}
 TabItem {
        Focusable = true;
        CacheEnabled = false;
@@ -33,6 +36,7 @@ TextBox {
        Background = White;
        Foreground = Black;
        Selectable = True;
+       Text = TextBox;
 }
 Window {
        Focusable = true;
@@ -41,8 +45,17 @@ Window {
        Height = 150;
 }
 Border {
-       Foreground = White;
+       Foreground = Gray;
 }
 ProgressBar {
        Foreground = vgradient|0:BlueCrayola|0.5:SkyBlue|1:BlueCrayola;
+}
+Icon {
+       Margin=1;
+       Width=12;
+       Height=12; 
+}
+Control {
+       Margin=0;
+       Spacing=3;
 }
\ No newline at end of file
diff --git a/Images/Icons/buttest.svg b/Images/Icons/buttest.svg
deleted file mode 100644 (file)
index 97c6155..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="64"
-   height="64"
-   viewBox="0 0 64.000003 64.000002"
-   id="svg4460"
-   version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="buttest.svg">
-  <defs
-     id="defs4462">
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient5028">
-      <stop
-         style="stop-color:#000b61;stop-opacity:1"
-         offset="0"
-         id="stop5030" />
-      <stop
-         id="stop5040"
-         offset="0.13136131"
-         style="stop-color:#001dff;stop-opacity:1" />
-      <stop
-         style="stop-color:#1e39ff;stop-opacity:1"
-         offset="0.85384595"
-         id="stop5042" />
-      <stop
-         style="stop-color:#c4cbff;stop-opacity:1"
-         offset="1"
-         id="stop5032" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5028"
-       id="linearGradient5034"
-       x1="30.357145"
-       y1="64.321434"
-       x2="30.607143"
-       y2="0.21428518"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5028"
-       id="linearGradient5034-7"
-       x1="30.357145"
-       y1="64.321434"
-       x2="30.607143"
-       y2="0.21428518"
-       gradientUnits="userSpaceOnUse" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="2.8"
-     inkscape:cx="42.157776"
-     inkscape:cy="30.146419"
-     inkscape:document-units="px"
-     inkscape:current-layer="svg4460"
-     showgrid="false"
-     fit-margin-top="0"
-     fit-margin-left="0"
-     fit-margin-right="0"
-     fit-margin-bottom="0"
-     inkscape:window-width="1280"
-     inkscape:window-height="984"
-     inkscape:window-x="0"
-     inkscape:window-y="16"
-     inkscape:window-maximized="1"
-     units="px" />
-  <metadata
-     id="metadata4465">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="normal"
-     style="opacity:0.5">
-    <rect
-       ry="10.1399"
-       y="0"
-       x="0"
-       height="64"
-       width="64"
-       id="rect5026"
-       style="opacity:1;fill:url(#linearGradient5034);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-    <path
-       id="rect5008-9"
-       d="M 53.6875,64 C 59.400625,64 64,59.400625 64,53.6875 l 0,-43.375 C 64,4.5993748 59.400625,-2.3151643e-7 53.6875,-2.3151643e-7 l -0.898438,0 C 58.406543,-2.3151643e-7 62.927734,4.5231438 62.927734,10.140625 l 0,42.648437 c 0,5.617482 -4.521191,10.138673 -10.138672,10.138673 l -42.648437,0 C 4.5231438,62.927735 -2.3151643e-7,58.406544 -2.3151643e-7,52.789062 l 0,0.898438 C -2.3151643e-7,59.400625 4.5993748,64 10.3125,64 l 43.375,0 z"
-       style="opacity:1;fill:#353535;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-    <path
-       id="rect5008"
-       d="M 10.3125,0 C 4.599375,0 0,4.599375 0,10.3125 l 0,43.375 C 0,59.400625 4.599375,64 10.3125,64 l 0.898438,0 C 5.5934566,64 1.0722656,59.476856 1.0722656,53.859375 l 0,-42.648437 c 0,-5.6174814 4.521191,-10.1386724 10.1386724,-10.1386724 l 42.648437,0 C 59.476856,1.0722656 64,5.5934566 64,11.210938 L 64,10.3125 C 64,4.599375 59.400625,0 53.6875,0 l -43.375,0 z"
-       style="opacity:1;fill:#8e8e8e;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-  </g>
-  <g
-     id="pressed"
-     style="opacity:0.5">
-    <rect
-       ry="10.1399"
-       y="0"
-       x="0"
-       height="64"
-       width="64"
-       id="rect5026-6"
-       style="opacity:1;fill:url(#linearGradient5034-7);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-    <path
-       id="rect5008-3"
-       d="M 53.6875,64 C 59.400625,64 64,59.400625 64,53.6875 l 0,-43.375 C 64,4.599375 59.400625,0 53.6875,0 l -0.898438,0 c 5.617481,0 10.138672,4.523144 10.138672,10.140625 l 0,42.648437 c 0,5.617481 -4.521191,10.138672 -10.138672,10.138672 l -42.648437,0 C 4.523144,62.927734 0,58.406543 0,52.789062 L 0,53.6875 C 0,59.400625 4.599375,64 10.3125,64 l 43.375,0 z"
-       style="opacity:1;fill:#747474;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-    <path
-       id="rect5008-9-3"
-       d="M 10.3125,-2.3151644e-7 C 4.5993748,-2.3151644e-7 -2.3151644e-7,4.5993748 -2.3151644e-7,10.3125 l 0,43.375 C -2.3151644e-7,59.400625 4.5993748,64 10.3125,64 l 0.898438,0 C 5.5934568,64 1.0722658,59.476856 1.0722658,53.859375 l 0,-42.648437 c 0,-5.6174822 4.521191,-10.1386732 10.1386722,-10.1386732 l 42.648437,0 C 59.476856,1.0722648 64,5.5934558 64,11.210938 L 64,10.3125 C 64,4.5993748 59.400625,-2.3151644e-7 53.6875,-2.3151644e-7 l -43.375,0 z"
-       style="opacity:1;fill:#353535;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-  </g>
-</svg>
diff --git a/Images/Icons/buttest2.svg b/Images/Icons/buttest2.svg
deleted file mode 100644 (file)
index 0323295..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="64"
-   height="64"
-   viewBox="0 0 64.000003 64.000002"
-   id="svg4460"
-   version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="buttest2.svg">
-  <defs
-     id="defs4462">
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient5028">
-      <stop
-         style="stop-color:#939393;stop-opacity:1"
-         offset="0"
-         id="stop5030" />
-      <stop
-         id="stop5040"
-         offset="0.13136131"
-         style="stop-color:#c5c5c5;stop-opacity:1" />
-      <stop
-         style="stop-color:#c0c0c0;stop-opacity:1"
-         offset="0.85384595"
-         id="stop5042" />
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1"
-         offset="1"
-         id="stop5032" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5028"
-       id="linearGradient5034"
-       x1="30.357145"
-       y1="64.321434"
-       x2="30.607143"
-       y2="0.21428518"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5028"
-       id="linearGradient5805"
-       gradientUnits="userSpaceOnUse"
-       x1="30.357145"
-       y1="64.321434"
-       x2="30.607143"
-       y2="0.21428518" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="2.8"
-     inkscape:cx="42.157776"
-     inkscape:cy="30.146419"
-     inkscape:document-units="px"
-     inkscape:current-layer="svg4460"
-     showgrid="false"
-     fit-margin-top="0"
-     fit-margin-left="0"
-     fit-margin-right="0"
-     fit-margin-bottom="0"
-     inkscape:window-width="1280"
-     inkscape:window-height="984"
-     inkscape:window-x="0"
-     inkscape:window-y="16"
-     inkscape:window-maximized="1"
-     units="px" />
-  <metadata
-     id="metadata4465">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="normal"
-     style="opacity:1">
-    <rect
-       ry="10.1399"
-       y="0"
-       x="0"
-       height="64"
-       width="64"
-       id="rect5026"
-       style="opacity:1;fill:url(#linearGradient5034);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-    <path
-       id="rect5008-9"
-       d="M 53.6875,64 C 59.400625,64 64,59.400625 64,53.6875 l 0,-43.375 C 64,4.5993748 59.400625,-2.3151643e-7 53.6875,-2.3151643e-7 l -0.898438,0 C 58.406543,-2.3151643e-7 62.927734,4.5231438 62.927734,10.140625 l 0,42.648437 c 0,5.617482 -4.521191,10.138673 -10.138672,10.138673 l -42.648437,0 C 4.5231438,62.927735 -2.3151643e-7,58.406544 -2.3151643e-7,52.789062 l 0,0.898438 C -2.3151643e-7,59.400625 4.5993748,64 10.3125,64 l 43.375,0 z"
-       style="opacity:1;fill:#353535;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-    <path
-       id="rect5008"
-       d="M 10.3125,0 C 4.599375,0 0,4.599375 0,10.3125 l 0,43.375 C 0,59.400625 4.599375,64 10.3125,64 l 0.898438,0 C 5.5934566,64 1.0722656,59.476856 1.0722656,53.859375 l 0,-42.648437 c 0,-5.6174814 4.521191,-10.1386724 10.1386724,-10.1386724 l 42.648437,0 C 59.476856,1.0722656 64,5.5934566 64,11.210938 L 64,10.3125 C 64,4.599375 59.400625,0 53.6875,0 l -43.375,0 z"
-       style="opacity:1;fill:#efefef;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-  </g>
-  <g
-     id="pressed"
-     style="opacity:1">
-    <rect
-       ry="10.1399"
-       y="0"
-       x="0"
-       height="64"
-       width="64"
-       id="rect5026-9"
-       style="opacity:1;fill:url(#linearGradient5805);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-    <path
-       id="rect5008-7"
-       d="M 53.6875,64 C 59.400625,64 64,59.400625 64,53.6875 l 0,-43.375 C 64,4.599375 59.400625,0 53.6875,0 l -0.898438,0 c 5.617481,0 10.138672,4.523144 10.138672,10.140625 l 0,42.648437 c 0,5.617481 -4.521191,10.138672 -10.138672,10.138672 l -42.648437,0 C 4.523144,62.927734 0,58.406543 0,52.789062 L 0,53.6875 C 0,59.400625 4.599375,64 10.3125,64 l 43.375,0 z"
-       style="opacity:1;fill:#efefef;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-    <path
-       id="rect5008-9-0"
-       d="M 10.3125,-2.3151642e-7 C 4.5993748,-2.3151642e-7 -2.3151642e-7,4.5993748 -2.3151642e-7,10.3125 l 0,43.375 C -2.3151642e-7,59.400625 4.5993748,64 10.3125,64 l 0.898438,0 C 5.5934568,64 1.0722658,59.476856 1.0722658,53.859375 l 0,-42.648437 c 0,-5.6174822 4.521191,-10.1386732 10.1386722,-10.1386732 l 42.648437,0 C 59.476856,1.0722648 64,5.5934558 64,11.210938 L 64,10.3125 C 64,4.5993748 59.400625,-2.3151642e-7 53.6875,-2.3151642e-7 l -43.375,0 z"
-       style="opacity:1;fill:#353535;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       inkscape:connector-curvature="0" />
-  </g>
-</svg>
diff --git a/Images/Icons/buttest4.svg b/Images/Icons/buttest4.svg
deleted file mode 100644 (file)
index 5bb1f0b..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="241.42857"
-   height="87.85714"
-   viewBox="0 0 241.42858 87.857136"
-   id="svg6194"
-   version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="buttest4.svg">
-  <defs
-     id="defs6196">
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient5895">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1"
-         offset="0"
-         id="stop4179" />
-      <stop
-         style="stop-color:#a9a9a9;stop-opacity:1"
-         offset="1"
-         id="stop4181" />
-    </linearGradient>
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5938"
-       id="radialGradient5944"
-       cx="-98.622185"
-       cy="192.01556"
-       fx="-98.622185"
-       fy="192.01556"
-       r="120.71429"
-       gradientTransform="matrix(1.640154,0.00509028,-0.00183136,0.59008493,63.485033,79.212097)"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient5938">
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1"
-         offset="0"
-         id="stop5940" />
-      <stop
-         style="stop-color:#000000;stop-opacity:1"
-         offset="1"
-         id="stop5942" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5895"
-       id="linearGradient5901"
-       x1="-94.577568"
-       y1="155.6501"
-       x2="-94.577568"
-       y2="239.49275"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(216.17265,-155.05841)" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient5895"
-       id="linearGradient4185"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="translate(216.17265,-155.05841)"
-       x1="-94.577568"
-       y1="155.6501"
-       x2="-94.577568"
-       y2="239.49275" />
-  </defs>
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="1.979899"
-     inkscape:cx="34.707974"
-     inkscape:cy="28.122813"
-     inkscape:document-units="px"
-     inkscape:current-layer="svg6194"
-     showgrid="false"
-     fit-margin-top="0"
-     fit-margin-left="0"
-     fit-margin-right="0"
-     fit-margin-bottom="0"
-     inkscape:window-width="1280"
-     inkscape:window-height="984"
-     inkscape:window-x="0"
-     inkscape:window-y="16"
-     inkscape:window-maximized="1"
-     units="px" />
-  <metadata
-     id="metadata6199">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="normal">
-    <rect
-       ry="20.854177"
-       y="5"
-       x="0"
-       height="82.85714"
-       width="241.42857"
-       id="rect5893-7"
-       style="opacity:1;fill:url(#radialGradient5944);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-    <rect
-       ry="20.854177"
-       y="0"
-       x="0"
-       height="82.85714"
-       width="241.42857"
-       id="rect5893"
-       style="opacity:1;fill:url(#linearGradient5901);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-  </g>
-  <g
-     id="pressed">
-    <rect
-       style="opacity:1;fill:#616161;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       id="rect4159"
-       width="241.42857"
-       height="82.85714"
-       x="0"
-       y="0"
-       ry="20.854177" />
-    <rect
-       style="opacity:1;fill:url(#linearGradient4185);fill-opacity:1.0;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       id="rect4161"
-       width="241.42857"
-       height="82.85714"
-       x="0"
-       y="2"
-       ry="20.854177" />
-  </g>
-</svg>
diff --git a/Images/Icons/button.svg b/Images/Icons/button.svg
deleted file mode 100644 (file)
index 7c8a994..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   viewBox="0 0 65.480012 51.479989"
-   height="51.479988"
-   width="65.480011"
-   id="svg2"
-   version="1.1"
-   inkscape:version="0.91 r13725"
-   sodipodi:docname="button.svg">
-  <metadata
-     id="metadata13">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <sodipodi:namedview
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1"
-     objecttolerance="10"
-     gridtolerance="10"
-     guidetolerance="10"
-     inkscape:pageopacity="0"
-     inkscape:pageshadow="2"
-     inkscape:window-width="1280"
-     inkscape:window-height="984"
-     id="namedview11"
-     showgrid="false"
-     inkscape:zoom="3.2415936"
-     inkscape:cx="-10.014146"
-     inkscape:cy="-4.9619855"
-     inkscape:window-x="0"
-     inkscape:window-y="16"
-     inkscape:window-maximized="1"
-     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>
-    <filter
-       inkscape:label="Button"
-       inkscape:menu="Bevels"
-       inkscape:menu-tooltip="Soft bevel, slightly depressed middle"
-       style="color-interpolation-filters:sRGB;"
-       id="filter4179">
-      <feGaussianBlur
-         stdDeviation="2.3"
-         in="SourceAlpha"
-         result="result0"
-         id="feGaussianBlur4181" />
-      <feMorphology
-         in="SourceAlpha"
-         radius="6.6"
-         result="result1"
-         id="feMorphology4183" />
-      <feGaussianBlur
-         stdDeviation="8.9"
-         in="result1"
-         id="feGaussianBlur4185" />
-      <feColorMatrix
-         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.3 0"
-         result="result91"
-         id="feColorMatrix4187" />
-      <feComposite
-         in="result0"
-         operator="out"
-         result="result2"
-         in2="result91"
-         id="feComposite4189" />
-      <feGaussianBlur
-         stdDeviation="1.7"
-         result="result4"
-         id="feGaussianBlur4191" />
-      <feDiffuseLighting
-         surfaceScale="10"
-         id="feDiffuseLighting4193">
-        <feDistantLight
-           azimuth="225"
-           elevation="45"
-           id="feDistantLight4195" />
-      </feDiffuseLighting>
-      <feBlend
-         in2="SourceGraphic"
-         mode="multiply"
-         id="feBlend4197" />
-      <feComposite
-         in2="SourceAlpha"
-         operator="in"
-         result="result3"
-         id="feComposite4199" />
-      <feSpecularLighting
-         in="result4"
-         surfaceScale="5"
-         specularExponent="17.9"
-         id="feSpecularLighting4201">
-        <feDistantLight
-           azimuth="225"
-           elevation="45"
-           id="feDistantLight4203" />
-      </feSpecularLighting>
-      <feComposite
-         in2="result3"
-         operator="atop"
-         id="feComposite4205" />
-    </filter>
-  </defs>
-  <rect
-     style="opacity:0.88700005;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4179)"
-     id="rect4177"
-     width="64.165955"
-     height="51.209366"
-     x="1.2339609"
-     y="0.27060935"
-     ry="11.72263"
-     rx="0" />
-  <g
-     id="down" />
-</svg>
diff --git a/Style.cs b/Style.cs
new file mode 100644 (file)
index 0000000..5824e73
--- /dev/null
+++ b/Style.cs
@@ -0,0 +1,34 @@
+//
+//  Style.cs
+//
+//  Author:
+//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
+//
+//  Copyright (c) 2016 jp
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+using System;
+using System.Collections.Generic;
+
+namespace Crow
+{
+       public class Style : Dictionary<string, object>
+       {
+               public Dictionary<string, Style> SubStyles;
+               public Style () : base()
+               {
+               }
+       }
+}
+
index f7c376c789da975c5d27092cfac6f6df71ea7711..959ad8ccbc466d6eac6db89ba38aba360468cc0f 100755 (executable)
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <Border Background="{./Background}" MinimumSize="50,20" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
-               Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1" 
+               Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1"
        MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black;caption.Foreground=White}"
        MouseLeave="{Foreground=Transparent;caption.Foreground=LightGray}"
        MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
        MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"                  
        >
 <!--   <Image Height="0" Width="0" Margin="0" Path="{./Image}" SvgSub="{./SvgSub}"/>-->
-       <Label Font="{./Font}" Name="caption" Margin="5" Foreground="LightGray" Text="{./Caption}"/>
+       <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGray" Text="{./Caption}"/>
 </Border>
\ No newline at end of file
index 818e10c1ef7ffef49dd950f4bc2ddc216802c3e8..a3c0f23d3a3093cf757910c70859d99f1d07403b 100755 (executable)
@@ -1,6 +1,6 @@
 ï»¿<?xml version="1.0"?>
-<HorizontalStack Background="{./Background}" Margin="1" Spacing="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-       <Image Margin="2" Width="14"  Height="14" Path="#Crow.Images.Icons.checkbox.svg"
+<HorizontalStack Style="Control" Background="{./Background}" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+       <Image Style="Icon" Path="#Crow.Images.Icons.checkbox.svg"
                SvgSub="{./IsChecked}"/>
        <Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
 </HorizontalStack>
\ No newline at end of file
index b544fd07f4c3a0673ee319b80e7b5102f16b7d58..3d75afaffa869fe4acf7708ed806a29011598f42 100755 (executable)
@@ -3,7 +3,7 @@
                Height="{./HeightPolicy}" Width="{./WidthPolicy}">
        <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
                <HorizontalStack Spacing="1" Height="-1" Width="{./WidthPolicy}">
-                       <Image Margin="2" Width="12" Height="12"
+                       <Image Style="Icon" Margin="2"
                                Visible="{./HasContent}"
                                Path="{./Image}" 
                                SvgSub="{./IsExpanded}"/>
index 2468b7fc3b1c220f4b36e1066397df5efe57261a..f40b5640d06b1fd4d7954cf64e5d52064801a1d5 100644 (file)
@@ -1,33 +1,32 @@
 <?xml version="1.0"?>
-<Border Height="{./HeightPolicy}" Width="{./WidthPolicy}" BorderWidth="1" Foreground="White" CornerRadius="10"
+<Border Height="{./HeightPolicy}" Width="{./WidthPolicy}" CornerRadius="0"
                                MouseEnter="./onBorderMouseEnter"
                                MouseLeave="./onBorderMouseLeave">
-       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}" Background="0.4,0.4,0.4,0.4">
-               <Border BorderWidth="1" Foreground="White" Width="{./WidthPolicy}" Height="-1
-                               Background="0.1,0.5,1,0,0.5">
-                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{./WidthPolicy}" Height="Fit" >
+       <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}" Background="{./Background}">
+               <Border BorderWidth="0" Foreground="White" Width="{./WidthPolicy}" Height="Fit
+                               Background="vgradient|0:0.4,0.6,0.0,0.5|1:0.0,0.8,0.8,0.9">
+                       <HorizontalStack Name="hs" Margin="2" Spacing="1" Width="{./WidthPolicy}" Height="Fit" >
                                <GraphicObject Width="5" Height="5"/>
                                <Image Margin="1" Width="12" Height="12" Path="{./Icon}"/>
                                <Label Foreground="White" Width="{./WidthPolicy}" Margin="1" TextAlignment="Center" Text="{./Title}" />
                                <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
                                        MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
-                                       <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#Crow.Images.Icons.exit2.svg"
+                                       <Image Focusable="true" Name="Image" Path="#Crow.Images.Icons.exit2.svg"
                                                 MouseClick="./butQuitPress"/>
                                </Border>
                                <GraphicObject Width="5" Height="5"/>
                        </HorizontalStack>
                </Border>
-               <HorizontalStack Spacing="3" Margin="3" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-                       <Image Name="Image" Width="24" Height="24"
-                               Path="#Crow.Images.Icons.iconInfo.svg" />
-                       <Label Font="serif, 12" Height="{./HeightPolicy}" Width="{./WidthPolicy}" Text="{./Message}"
+               <HorizontalStack Margin="5" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+                       <Image Name="Image" Width="20%" Height="20" Path="#Crow.Images.Icons.iconInfo.svg" />
+                       <Label Margin="5" Font="serif, 10" Height="{./HeightPolicy}" Width="80%" Text="{./Message}"
                                TextAlignment="Left"
                                Multiline="true" />             
                </HorizontalStack>
-               <HorizontalStack Height="-1" Width="{./WidthPolicy}" Margin="3">
-                       <GraphicObject Height="5"/>
-                       <Button Caption="Ok" MouseClick="./onOkButtonClick" Background="Gray"/>
-                       <Button Caption="Cancel" MouseClick="./onCancelButtonClick" Background="Gray"/>
+               <HorizontalStack Margin="1"  Height="Fit" Width="60%" HorizontalAlignment="Right">
+                       <Button Width="48%" Caption="Ok" MouseClick="./onOkButtonClick" />
+                       <GraphicObject Width="4%" Height="5"/>
+                       <Button Width="48%" Caption="Cancel" MouseClick="./onCancelButtonClick" />
                </HorizontalStack>
        </VerticalStack>
 </Border>
index c4093b19627ec413e0ccc410de06408bf9d8b9a2..a36daaee367c465ceeb0a5ef4c79e36022ce1e0f 100755 (executable)
@@ -1,7 +1,7 @@
 ï»¿<?xml version="1.0"?>
 <Border Background="{./Background}" BorderWidth="1" Foreground="{./Foreground}" Height="Fit" Width="{./WidthPolicy}">
-       <HorizontalStack Spacing="1" Height="-1"  Width="{./WidthPolicy}">
-               <Image Margin="2" Width="12" Height="12"
+       <HorizontalStack Spacing="1" Height="Fit"  Width="{./WidthPolicy}">
+               <Image Style="Icon" Margin="2"
                                Path="#Crow.Images.Icons.expandable.svg" SvgSub="{./IsPopped}"/>
                <Label Text="{./Caption}"  Width="{./WidthPolicy}"/>
        </HorizontalStack>
index d8a7babccc2d814ed08c8e785b5bee75d0c53eb9..6d2e9de46f7a325ff99503e612f2aa23979431ea 100755 (executable)
@@ -1,6 +1,6 @@
 ï»¿<?xml version="1.0"?>
-<HorizontalStack Background="{./Background}" Spacing="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
-       <Image Margin="2" Width="14" Height="14" Path="#Crow.Images.Icons.radiobutton.svg"
+<HorizontalStack Style="Control" Background="{./Background}" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+       <Image Style="Icon" Path="#Crow.Images.Icons.radiobutton.svg"
                SvgSub="{./IsChecked}"/>
        <Label Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"/>
 </HorizontalStack>
\ No newline at end of file
index 0822da7cafee387785c68f68f526752dd326072a..a746cb652f4ea114c1062190184388834d40efd4 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<Border BorderWidth="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+<Border BorderWidth="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}" Background="{./Background}">
        <HorizontalStack Margin="1" Height="{./HeightPolicy}" Width="{./WidthPolicy}" >
                <Scroller Name="scroller1" Height="{./HeightPolicy}" Width="{./WidthPolicy}" 
                                Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
index 654b42c3b1d950ec0597cbedcb28299f4f863aad..c58521423099ed650aa454063948d1e6d2776538 100644 (file)
@@ -1,15 +1,15 @@
 ï»¿<?xml version="1.0" encoding="UTF-8" ?>
 <GenericStack Orientation="Vertical" Spacing="0"
-               Width="{../../WidthPolicy}" Height="{../../HeightPolicy}"
-               Background="vgradient|0:DimGray|1:Black"
-               MouseEnter="{Background=vgradient|0:Gray|1:Black}"
-               MouseLeave="{Background=vgradient|0:DimGray|1:Black}">
-       <HorizontalStack Margin="2" Left="{../../TabOffset}"
+               Width="{./WidthPolicy}" Height="{./HeightPolicy}"
+               Background="Onyx"
+               MouseEnter="{caption.Foreground=White}"
+               MouseLeave="{caption.Foreground=Gray}">
+       <HorizontalStack Margin="2" Left="{./TabOffset}"
                Name="TabTitle"
                HorizontalAlignment="Left"
                Height="{../../../TabThickness}"
                Width="Fit">
-               <Label Text="{../../../Caption}"/>
+               <Label Name="caption" Text="{./Caption}" Foreground="Gray"/>
                <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
                                        MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
                        <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
@@ -17,6 +17,6 @@
                </Border>
        </HorizontalStack>
        <Container
-               Name="Content" Width="{../../../WidthPolicy}" Height="{../../../HeightPolicy}"/>
+               Name="Content" Width="{./WidthPolicy}" Height="{./HeightPolicy}"/>
 </GenericStack>
 
index fe083072e547a14db106c304058d13f59e784fed..1dc291fcf059b352b7608e8db83c4bce81dffa8c 100644 (file)
@@ -1,7 +1,15 @@
-<Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"
-       Background="{./Background}"
-       Height="{./HeightPolicy}" Width="{./WidthPolicy}"
-       ValueChanged="./_scroller_ValueChanged">
-       <VerticalStack LayoutChanged="./_list_LayoutChanged"
-               Height="Fit" Width="{./WidthPolicy}" Name="List" Margin="0" VerticalAlignment="Top"/>
-</Scroller>
+<HorizontalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}">
+       <Scroller  Name="scroller1" Margin="1" VerticalScrolling="true"
+               Background="{./Background}"
+               Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+               ScrollY="{../scrollbar1.Value}"
+               ValueChanged="./_scroller_ValueChanged">
+               <VerticalStack LayoutChanged="./_list_LayoutChanged"
+                       Height="Fit" Width="{./WidthPolicy}" Name="List" Margin="0" VerticalAlignment="Top"/>
+       </Scroller>
+       <ScrollBar
+               Name="scrollbar1"
+               Value="{../scroller1.ScrollY}"
+               Maximum="{../scroller1.MaximumScroll}"
+               Width="14" Orientation="Vertical"/>
+</HorizontalStack>
diff --git a/Tests/Interfaces/CheckBox2.imlt b/Tests/Interfaces/CheckBox2.imlt
new file mode 100644 (file)
index 0000000..4cb7f5f
--- /dev/null
@@ -0,0 +1,7 @@
+<Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+       Margin="3"
+       Background="{./Background}"
+       Foreground="DimGray"
+       TextAlignment="Center"
+       MouseEnter="{Foreground=White}"
+       MouseLeave="{Foreground=DimGray}"/>
\ No newline at end of file
index 9d3948af6a922327f6206f3b392612c2241f584d..d180fa821a6dfc7be3ce32748128d61e052daee0 100755 (executable)
@@ -1,2 +1,2 @@
-<?xml version="1.0"?>
-<CheckBox/>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" ?>
+<MessageBox/>
index 7d3701899239b771d14259eb2d7c6c01261cf9a9..8df18346eea3ac1f45150f1cdd5614e40b01a3d7 100755 (executable)
@@ -1,4 +1,144 @@
 ï»¿<?xml version="1.0"?>
-<Container Background="Green" Margin="0">
-       <GraphicObject Margin="0" Width="50" Height="50" Background="Red"/>
-</Container>
\ No newline at end of file
+<Window Title="Showcase" Height="90%" Width="90%">
+       <HorizontalStack >
+               <VerticalStack Width="33%" Margin="5">
+                       <GroupBox Caption="Performance" Height="Fit">
+                               <VerticalStack Width="90%" Height="Fit" Spacing="2" >
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Fps:" Style="FpsLabel"/>
+                                               <Label Text="{fps}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Min:" Style="FpsLabel"/>
+                                               <Label Text="{fpsMin}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Max:" Style="FpsLabel"/>
+                                               <Label Text="{fpsMax}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Update:" Style="FpsLabel"/>
+                                               <Label Text="{update}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Layouting:" Style="FpsLabel"/>
+                                               <Label Text="{layouting}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Clipping:" Style="FpsLabel"/>
+                                               <Label Text="{clipping}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                                       <HorizontalStack Height="Fit">
+                                               <Label Text="Drawing:" Style="FpsLabel"/>
+                                               <Label Text="{drawing}" Style="FpsDisp"/>
+                                       </HorizontalStack>
+                               </VerticalStack>
+                       </GroupBox>
+                       <Label Width="Stretched" Margin="3" Background="Onyx"/>
+                       <TextBox Text="TextBox" Multiline="true" Margin="3"/>
+                       <HorizontalStack Height="Fit" Margin="5" Background="Onyx" CornerRadius="10">
+                               <VerticalStack Spacing="5" Width="50%">
+                                       <CheckBox Fit="true"/>
+                                       <CheckBox Fit="true"/>
+                                       <CheckBox Fit="true"/>
+                                       <CheckBox Fit="true"/>
+                               </VerticalStack>
+                               <VerticalStack Spacing="5" Width="50%">
+                                       <RadioButton Fit="true"/>
+                                       <RadioButton Fit="true"/>
+                                       <RadioButton Fit="true"/>
+                                       <RadioButton Fit="true"/>
+                               </VerticalStack>
+                       </HorizontalStack>
+                       <HorizontalStack Height="Fit" Margin="5">
+                               <Label Text="MouseEvents" Width="50%" Margin="3"
+                                       Background="Onyx"
+                                       Foreground="DimGray"
+                                       TextAlignment="Center"
+                                       MouseEnter="{Foreground=White}"
+                                       MouseLeave="{Foreground=DimGray}"
+                                       MouseDown="{Background=DarkRed}"
+                                       MouseUp="{Background=Onyx}"/>
+                               <Label Text="MouseEvents" Width="50%" Margin="3"
+                                       Background="Onyx"
+                                       Foreground="DimGray"
+                                       TextAlignment="Center"
+                                       MouseEnter="{Foreground=White}"
+                                       MouseLeave="{Foreground=DimGray}"
+                                       MouseDown="{Background=Mantis}"
+                                       MouseUp="{Background=Onyx}"/>
+                       </HorizontalStack>
+                       <GroupBox Caption="Templated controls" Height="Fit" Margin="5">
+                               <HorizontalStack Height="Fit">
+                                       <VerticalStack Width="50%">
+                                               <CheckBox Template="#Tests.Interfaces.CheckBox2.imlt" Style="CheckBox2"/>
+                                               <CheckBox  Template="#Tests.Interfaces.CheckBox2.imlt" Style="CheckBox2"/>
+                                               <CheckBox  Template="#Tests.Interfaces.CheckBox2.imlt" Style="CheckBox2"/>
+                                               <CheckBox  Template="#Tests.Interfaces.CheckBox2.imlt" Style="CheckBox2"/>
+                                       </VerticalStack>
+                                       <Splitter/>
+                                       <VerticalStack Width="50%">
+                                               <RadioButton  Template="#Tests.Interfaces.CheckBox2.imlt" Style="RadioButton2"/>
+                                               <RadioButton  Template="#Tests.Interfaces.CheckBox2.imlt" Style="RadioButton2"/>
+                                               <RadioButton  Template="#Tests.Interfaces.CheckBox2.imlt" Style="RadioButton2"/>
+                                               <RadioButton  Template="#Tests.Interfaces.CheckBox2.imlt" Style="RadioButton2"/>
+                                       </VerticalStack>
+                               </HorizontalStack>
+                       </GroupBox>
+                       <Spinner Fit="true"/>
+               </VerticalStack>
+               <VerticalStack Width="33%" Margin="5" Spacing="5">
+                       <Expandable Background="DimGray">
+                               <Image Path="#Crow.Images.Icons.crow.svg"/>
+                       </Expandable>
+                       <Popper Background="DimGray" PopDirection="Bottom">
+                               <Border Fit="True" Background="DimGray" CornerRadius="0" BorderWidth="1">
+                                       <Image Path="#Crow.Images.Icons.crow.svg" Width="100" Height="100" Margin="10"
+                                               MouseEnter="{Background=LightGray}"
+                                               MouseLeave="{Background=Transparent}"/>
+                               </Border>
+                       </Popper>
+                       <Slider Height="10" Width="90%"/>
+                       <Container Height="Fit" Background="Onyx" Margin="2" CornerRadius="5">
+                               <ProgressBar Background="DimGray" Height="10" Value="50"/>
+                       </Container>
+                       <Image Path="#Crow.Images.Icons.crow.svg" Width="60" Height="60" Background="LightGray" />
+                       <TabView Name="tabview1"
+                               Height="120" Orientation="Horizontal" Spacing="15">
+                               <TabItem Name="TabItem1" Caption="Tab 1" Margin="0">
+                                       <VerticalStack Fit="true">
+                                               <CheckBox/>
+                                               <CheckBox/>
+                                               <CheckBox/>
+                                               <CheckBox/>
+                                       </VerticalStack>
+                               </TabItem>
+                               <TabItem Name="TabItem2" Caption="Tab 2" Background="Gray">
+                                       <VerticalStack Fit="true">
+                                               <RadioButton/>
+                                               <RadioButton/>
+                                               <RadioButton/>
+                                               <RadioButton/>
+                                       </VerticalStack>
+                               </TabItem>
+                               <TabItem Name="TabItem2" Caption="Tab 3" Background="Gray">
+                                       <Container Margin="5" CornerRadius="2">
+                                               <TextBox Height="Stretched" Margin="5" Multiline="true" TextAlignment="TopLeft"/>
+                                       </Container>
+                               </TabItem>
+                       </TabView>
+                       <MessageBox Movable="false"/>
+               </VerticalStack>
+               <VerticalStack Width="33%" Margin="5">
+                       <Border Margin="5" Background="Onyx" Height="Fit">
+                               <Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/>
+                       </Border>
+                       <Border Margin="5" Background="Onyx" Height="50%">
+                               <DirectoryView Name="dv" Root="./" Margin="1"/>
+                       </Border>
+                       <ListBox Data="{TestList}" Background="Onyx" Margin="5"
+                                        ItemTemplate="#Tests.Interfaces.colorItem.crow"
+                                        Template="#Crow.Templates.ScrollingListBox.goml"/>
+               </VerticalStack>
+       </HorizontalStack>
+</Window>
\ No newline at end of file
index 944b293252d080e8dde41e07ab6cbf283b988c01..5cf3d6aa789cead6157e18eb93191d488f55b554 100644 (file)
     <EmbeddedResource Include="ui\MenuItem.style" />
     <EmbeddedResource Include="test.style" />
     <EmbeddedResource Include="Interfaces\treeList.crow" />
+    <EmbeddedResource Include="Interfaces\CheckBox2.imlt" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Crow.csproj">
index a05c930d76f01a4e058b53ffd47c19b04907a721..6c8857a8ab95f162bc447b200ec10c7b844140ba 100644 (file)
@@ -3,7 +3,7 @@
        Font = droid, 10;
        Margin = 1;
        TextAlignment = Center;
-       Background = Jet;
+       Background = Onyx;
 }
 FpsDisp {
        Font = droid , 12;
@@ -11,3 +11,13 @@ FpsDisp {
        TextAlignment = Center;
        Background = Teal;
 }
+CheckBox2 {
+       Background = Onyx;
+       Checked={Background=Mantis;Font=droid bold, 10};
+       Unchecked = {Background=Onyx;Font=droid,10};
+}
+RadioButton2 {
+       Background = Onyx;
+       Checked = {Background=Mantis;Font=droid bold, 10};
+       Unchecked = {Background=Onyx;Font=droid,10};
+}
index e9a9ef9ba7024589f9af73a6767bd5d7ded0d688..ac53ee8b67cd866ff4761a825930c882610e176a 100644 (file)
@@ -41,6 +41,18 @@ namespace Crow
                string _root = "/";
                bool _showFiles;
 
+               object _selectedItem;
+               [XmlIgnore]public object SelectedItem {
+                       get {
+                               return _selectedItem;
+                       }
+                       set { 
+                               if (value == _selectedItem)
+                                       return;
+                               _selectedItem = value;
+                               NotifyValueChanged ("SelectedItem", _selectedItem);
+                       }
+               }
                [XmlAttributeAttribute()][DefaultValue(true)]
                public virtual bool ShowFiles {
                        get { return _showFiles; }
@@ -66,6 +78,7 @@ namespace Crow
                        get { return new DirectoryInfo (Root).GetFileSystemInfos (); }
                }
                public void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){
+                       SelectedItem = e.NewValue;
                        SelectedItemChanged.Raise (this, e);
                }
        }
index 88166fe6ea2a760d965c4ae773fe4f30fc5c2d5b..925f69df0b8c015c5243304e42a53ef2d3b920fa 100644 (file)
@@ -538,7 +538,7 @@ namespace Crow
                                }
                        }
 
-                       List<Dictionary<string, object>> styling = new List<Dictionary<string, object>>();
+                       List<Style> styling = new List<Style>();
 
                        //Search for a style mathing :
                        //1: Full class name, with full namespace
@@ -587,7 +587,14 @@ namespace Crow
                        il.Emit (OpCodes.Ldarg_0);
                        il.Emit (OpCodes.Stloc_0);
 
-                       foreach (PropertyInfo pi in thisType.GetProperties(BindingFlags.Public | BindingFlags.Instance)) {                              
+                       foreach (EventInfo ei in thisType.GetEvents(BindingFlags.Public | BindingFlags.Instance)) {
+                               string expression;
+                               if (!getDefaultEvent(ei, styling, out expression))
+                                       continue;
+                               CompilerServices.emitBindingCreation (il, ei.Name, expression);
+                       }
+
+                       foreach (PropertyInfo pi in thisType.GetProperties(BindingFlags.Public | BindingFlags.Instance)) {
                                if (pi.GetSetMethod () == null)
                                        continue;
                                object defaultValue;
@@ -606,7 +613,20 @@ namespace Crow
                                throw new Exception ("Error applying style <" + styleKey + ">:", ex);
                        }
                }
-               bool getDefaultValue(PropertyInfo pi, List<Dictionary<string, object>> styling,
+               bool getDefaultEvent(EventInfo ei, List<Style> styling,
+                       out string expression){
+                       expression = "";
+                       if (styling.Count > 0){
+                               for (int i = 0; i < styling.Count; i++) {
+                                       if (styling[i].ContainsKey (ei.Name)){
+                                               expression = (string)styling[i] [ei.Name];
+                                               return true;
+                                       }
+                               }
+                       }
+                       return false;
+               }
+               bool getDefaultValue(PropertyInfo pi, List<Style> styling,
                        out object defaultValue){
                        defaultValue = null;
                        string name = "";
index 4c8d0537899ddd5d2c2b3fc326caa8c851f0cc9d..e87ca41c112634022c324bd231d2b73773fec458 100644 (file)
@@ -39,7 +39,8 @@ namespace Crow
             set { _multiSelect = value; }
         }
                public virtual void AddChild(GraphicObject g){
-                       Children.Add(g);
+                       lock (children)
+                               Children.Add(g);
                        g.Parent = this;
                        g.ResolveBindings ();
                        g.RegisteredLayoutings = LayoutingType.None;
@@ -51,7 +52,8 @@ namespace Crow
                        child.LayoutChanged -= OnChildLayoutChanges;
                        child.ClearBinding ();
                        //child.Parent = null;
-            Children.Remove(child);
+                       lock (children)
+               Children.Remove(child);
 
                        if (child == largestChild && Width == Measure.Fit)
                                searchLargestChild ();
@@ -241,9 +243,10 @@ namespace Crow
                        //clip to client zone
                        CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
                        gr.Clip ();
-
-                       foreach (GraphicObject g in Children) {
-                               g.Paint (ref gr);
+                       lock (children) {
+                               foreach (GraphicObject g in Children) {
+                                       g.Paint (ref gr);
+                               }
                        }
                        gr.Restore ();
                }
index 0a013ae15815aec7858aa48ff3b45d5f55f4c5e2..ea11435a0a124bcb3988e09bb9c8b9f421bd46a7 100644 (file)
@@ -100,6 +100,8 @@ namespace Crow
                                        return;
 
                                _content.LogicalParent = this;
+                               _content.HorizontalAlignment = HorizontalAlignment.Left;
+                               _content.VerticalAlignment = VerticalAlignment.Top;
                                _content.LayoutChanged += _content_LayoutChanged;
                                _content.MouseLeave += onMouseLeave;
                        }
@@ -187,14 +189,6 @@ namespace Crow
                public override void onMouseLeave (object sender, MouseMoveEventArgs e)
                {
                        base.onMouseLeave (sender, e);
-                       if (MouseIsIn (e.Position))
-                               return;
-                       if (_content == null)
-                               return;
-                       try {
-                               if (_content.MouseIsIn (e.Position))
-                                       return;
-                       } catch {}
                        IsPopped = false;
                }
                #endregion
index 1a8674d076511c0ba0d0cfa9cc5a5b803c46b4a3..0806d4d3a42aada38c9ec4b0e398c12858c9bde5 100644 (file)
@@ -25,14 +25,16 @@ namespace Crow
        [DefaultTemplate("#Crow.Templates.Spinner.goml")]
        public class Spinner : NumericControl
        {
+               #region CTOR
+               public Spinner () : base()
+               {
+               }
                public Spinner (double minimum, double maximum, double step) : 
                base (minimum, maximum, step)
                {
 
                }
-               public Spinner () : base()
-               {
-               }
+               #endregion
 
                void onUp (object sender, MouseButtonEventArgs e)
                {
index 015f5f4f66ad0344d4f8adab101899c062aa22e3..e140191b099a2818314e4ab35d04a44fd92d1e8d 100644 (file)
@@ -39,6 +39,7 @@ namespace Crow
                {
                }
 
+               #region public properties
                [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]
                public virtual Orientation Orientation
                {
@@ -54,7 +55,7 @@ namespace Crow
                                        NotifyValueChanged ("TabOrientation", Orientation.Horizontal);
                        }
                }
-               [XmlAttributeAttribute()][DefaultValue(2)]
+               [XmlAttributeAttribute()][DefaultValue(20)]
                public int Spacing
                {
                        get { return _spacing; }
@@ -81,7 +82,7 @@ namespace Crow
                                RegisterForRedraw ();
                        }
                }
-               [XmlAttributeAttribute()][DefaultValue(22)]
+               [XmlAttributeAttribute()][DefaultValue("15")]
                public virtual Measure TabThickness {
                        get { return tabThickness; }
                        set {
@@ -92,13 +93,7 @@ namespace Crow
                                RegisterForGraphicUpdate ();
                        }
                }
-
-               //prevent caching, because drawing order is different depending on selected tab
-               [XmlAttributeAttribute()][DefaultValue(false)]
-               public override bool CacheEnabled {
-                       get {return false;}
-                       set { }
-               }
+               #endregion
 
                public override void AddChild (GraphicObject child)
                {
index cbdbbb2c2faebfb00d9871d20d4d00e908a469d4..be482e431b595b359bed5122dae1c24d03bf7c0d 100644 (file)
@@ -45,6 +45,7 @@ namespace Crow
                string _title;
                string _icon;
                bool _resizable;
+               bool _movable;
                bool hoverBorder = false;
 
                Container _contentContainer;
@@ -100,7 +101,16 @@ namespace Crow
                                NotifyValueChanged ("Resizable", _resizable);
                        }
                }
-
+               [XmlAttributeAttribute()][DefaultValue(true)]
+               public bool Movable {
+                       get {
+                               return _movable;
+                       }
+                       set {
+                               _movable = value;
+                               NotifyValueChanged ("Movable", _movable);
+                       }
+               }
                #region GraphicObject Overrides
                public override void ResolveBindings ()
                {
@@ -120,7 +130,7 @@ namespace Crow
                                return;
                        }
 
-                       if (this.HasFocus) {
+                       if (this.HasFocus && _movable) {
                                if (e.Mouse.IsButtonDown (MouseButton.Left)) {
                                        int currentLeft = this.Left;
                                        int currentTop = this.Top;
index ba9769b14384ea37f8ada50ef14487a9fdfabcf0..6997f6ba63f3baade60b95e5e68ca2e861290627 100644 (file)
@@ -119,13 +119,13 @@ namespace Crow
                /// The compilation is done on the first object instancing, and is also done for custom widgets
                public delegate void LoaderInvoker(object instance);
                public static Dictionary<String, LoaderInvoker> DefaultValuesLoader = new Dictionary<string, LoaderInvoker>();
-               public static Dictionary<string, Dictionary<string, object>> Styling;
+               public static Dictionary<string, Style> Styling;
                /// <summary> parse all styling data's and build global Styling Dictionary </summary>
                static void LoadStyling() {
                        System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
                        Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
 
-                       Styling = new Dictionary<string, Dictionary<string, object>> ();
+                       Styling = new Dictionary<string, Style> ();
 
                        //fetch styling info in this order, if member styling is alreadey referenced in previous
                        //assembly, it's ignored.
index 92b24e2de5442ad830e97f84ca04774252aad047..27b3f4b59bd5913736436b47965b9a30acc7a898 100644 (file)
@@ -29,11 +29,14 @@ namespace Crow
        {
                enum readerState { classNames, propertyName, expression }
                readerState state = readerState.classNames;
-
+               string resourceId;
+               int column = 1;
+               int line = 1;
 
                public StyleReader (Assembly assembly, string resId)
                        : base(assembly.GetManifestResourceStream (resId))
                {
+                       resourceId = resId;
                        string styleKey = resId.Substring (0, resId.Length - 6);
                        string token = "";
                        List<string> targetsClasses = new List<string> ();
@@ -56,15 +59,15 @@ namespace Crow
                                                //this file contains only properties,
                                                //resource Id (minus .style extention) will determine the single target class
                                                if (targetsClasses.Count > 1)
-                                                       throw new Exception ("Unexpected token '='");
+                                                       throwParserException ("Unexpected token '='");
                                                else if (targetsClasses.Count == 1) {
                                                        if (!string.IsNullOrEmpty (token))
-                                                               throw new Exception ("Unexpected token '='");
+                                                               throwParserException ("Unexpected token '='");
                                                        currentProperty = targetsClasses [0];
                                                        targetsClasses [0] = styleKey;
                                                }else{
                                                        if (string.IsNullOrEmpty (token))
-                                                               throw new Exception ("Unexpected token '='");
+                                                               throwParserException ("Unexpected token '='");
                                                        targetsClasses.Add (styleKey);
                                                        currentProperty = token;
                                                        token = "";
@@ -83,7 +86,7 @@ namespace Crow
                                                token = "";
                                        }else if (c == '}'){
                                                if (!string.IsNullOrEmpty (token))
-                                                       throw new Exception ("Unexpected token '" + c + "'");
+                                                       throwParserException ("Unexpected token '" + c + "'");
                                                targetsClasses = new List<string> ();
                                                currentProperty = "";
                                                state = readerState.classNames;
@@ -91,43 +94,78 @@ namespace Crow
                                                token += c;
                                        break;
                                case readerState.expression:
+                                       bool expressionIsFinished = false;
                                        if (curlyBracketCount == 0) {
                                                if (c == '{'){
-                                                       if (string.IsNullOrEmpty(token))
-                                                               throw new Exception ("Unexpected token '{'");
+                                                       if (!string.IsNullOrEmpty(token.Trim()))
+                                                               throwParserException ("Unexpected token '{'");
                                                        curlyBracketCount++;
                                                        token = "{";
                                                }else if (c == '}')
-                                                       throw new Exception ("Unexpected token '{'");
+                                                       throwParserException ("Unexpected token '{'");
                                                else if (c == ';') {
-                                                       if (!string.IsNullOrEmpty (token)) {
-                                                               string expression = token.Trim ();
-
-                                                               foreach (string tc in targetsClasses) {
-                                                                       if (!Interface.Styling.ContainsKey (tc))
-                                                                               Interface.Styling [tc] = new Dictionary<string, object> ();
-                                                                       else if (Interface.Styling [tc].ContainsKey (currentProperty))
-                                                                               continue;
-                                                                       Interface.Styling [tc] [currentProperty] = expression;
-                                                               }
-                                                               token = "";
-                                                       }
-                                                       state = readerState.propertyName;
+                                                       expressionIsFinished = true;
                                                } else
                                                        token += c;
                                        } else {
                                                if (c == '{')
                                                        curlyBracketCount++;
-                                               else if (c == '}')
+                                               else if (c == '}') {
                                                        curlyBracketCount--;
+                                                       if (curlyBracketCount == 0)
+                                                               expressionIsFinished = true;
+                                               }
                                                token += c;
                                        }
+                                       if (expressionIsFinished) {
+                                               if (!string.IsNullOrEmpty (token)) {
+                                                       string expression = token.Trim ();
+
+                                                       foreach (string tc in targetsClasses) {
+                                                               if (!Interface.Styling.ContainsKey (tc))
+                                                                       Interface.Styling [tc] = new Style ();
+                                                               else if (Interface.Styling [tc].ContainsKey (currentProperty))
+                                                                       continue;
+                                                               Interface.Styling [tc] [currentProperty] = expression;
+                                                       }
+                                                       token = "";
+                                               }
+                                               //allow omiting ';' if curly bracket close expression
+                                               while (!EndOfStream) {
+                                                       if (Char.IsWhiteSpace((char)Peek()))
+                                                               Read();
+                                                       else
+                                                               break;
+                                               }
+                                               if (this.Peek () == ';')
+                                                       this.Read ();
+                                               state = readerState.propertyName;                                                       
+                                       }
                                        break;
                                }
                        }
 
                        if (curlyBracketCount > 0)
-                               throw new Exception ("Unexpected end of file");
+                               throwParserException ("Unexpected end of file");
+               }
+
+               public override int Read ()
+               {                       
+                       int tmp = base.Read ();
+                       char c = (char)tmp;
+                       if (c == '\n') {
+                               line++;
+                               column = 1;
+                       } else if (c == '\t')
+                               column += Interface.TabSize;
+                       else if (c != '\r')
+                               column++;
+                       return tmp;
+               }
+
+               void throwParserException(string message){
+                       throw new Exception (string.Format ("Style Reader Exception ({0},{1}): {2} in {3}.",
+                               line, column, message, resourceId));
                }
        }
 }