]> O.S.I.I.S - jp/crow.git/commitdiff
new clipping system nearly nickel
authorjpbruyere <jp.bruyere@hotmail.com>
Fri, 12 Feb 2016 13:10:03 +0000 (14:10 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Fri, 12 Feb 2016 13:10:03 +0000 (14:10 +0100)
Tests/GOLIBTests.cs
Tests/Interfaces/clip2.crow
Tests/Interfaces/clip3.crow [new file with mode: 0755]
Tests/Interfaces/clip4.crow [new file with mode: 0755]
Tests/Tests.csproj
src/GraphicObjects/Border.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/RadioButton.cs

index 622d1ce70ad36b8a002ea391fa74747d7305cf43..1fb98c18e21ba59a5e6b500cdcc611f5e3ddbca6 100644 (file)
@@ -37,6 +37,8 @@ namespace test
                int frameCpt = 0;
                int idx = 0;
                string[] testFiles = {
+                       "clip4.crow",
+                       "clip3.crow",
                        "clip2.crow",
                        "clip0.crow",
                        "clip1.crow",
index 8ab66910c34c8af1e3dac4de2fee3a976c55f4c0..4f95bf90459654456501217b3f5d0917ed24b993 100755 (executable)
@@ -3,11 +3,11 @@
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                MouseEnter="{Background=DimGray}"
                MouseLeave="{Background=Yellow}">
-<Group Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
+<Group Width="300" Height="200" Margin="50" Background="LimeGreen" CacheEnabled="false"
                HorizontalAlignment="Right" VerticalAlignment="Bottom"
                MouseEnter="{Background=Gray}"
                MouseLeave="{Background=LimeGreen}">
-       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+       <Label Left="10" HorizontalAlignment="Right" VerticalAlignment="Center" CacheEnabled="true"
                MouseEnter="{Background=DimGray}" Width="100"
                MouseLeave="{Background=BlueCrayola}"
                Margin="10" Text="{drawing}" Background="BlueCrayola"/>
diff --git a/Tests/Interfaces/clip3.crow b/Tests/Interfaces/clip3.crow
new file mode 100755 (executable)
index 0000000..b08216c
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<Group Fit="true" Margin="50" Background="Yellow" CacheEnabled="true"
+               HorizontalAlignment="Right" VerticalAlignment="Bottom"
+               MouseEnter="{Background=DimGray}"
+               MouseLeave="{Background=Yellow}">
+       <HorizontalStack Fit="true">
+               <VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
+                               HorizontalAlignment="Right" VerticalAlignment="Bottom"
+                               MouseEnter="{Background=Gray}"
+                               MouseLeave="{Background=LimeGreen}">
+                       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+                               MouseEnter="{Background=DimGray}" Width="100"
+                               MouseLeave="{Background=BlueCrayola}"
+                               Margin="10" Text="{fps}" Background="BlueCrayola"/>
+                       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+                               MouseEnter="{Background=DimGray}" Width="100"
+                               MouseLeave="{Background=BlueCrayola}"
+                               Margin="10" Text="{drawing}" Background="BlueCrayola"/>
+                </VerticalStack>
+               <VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
+                               HorizontalAlignment="Right" VerticalAlignment="Bottom"
+                               MouseEnter="{Background=Gray}"
+                               MouseLeave="{Background=LimeGreen}">
+                       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+                               MouseEnter="{Background=DimGray}" Width="100"
+                               MouseLeave="{Background=BlueCrayola}"
+                               Margin="10" Text="{fpsMax}" Background="BlueCrayola"/>
+                       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+                               MouseEnter="{Background=DimGray}" Width="100"
+                               MouseLeave="{Background=BlueCrayola}"
+                               Margin="10" Text="{fpsMin}" Background="BlueCrayola"/>
+                </VerticalStack>
+       </HorizontalStack>
+ </Group>
\ No newline at end of file
diff --git a/Tests/Interfaces/clip4.crow b/Tests/Interfaces/clip4.crow
new file mode 100755 (executable)
index 0000000..c38e95a
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<Border Fit="true" Margin="50" Background="DimGray" CornerRadius="20">
+       <Label Margin="50" Text="fpsklhlkjh" Background="BlueCrayola"/> 
+</Border>
+<!--<VerticalStack Fit="true" Margin="50" Background="LimeGreen" CacheEnabled="false"
+               HorizontalAlignment="Right" VerticalAlignment="Bottom"
+               MouseEnter="{Background=Gray}"
+               MouseLeave="{Background=LimeGreen}">
+
+               <CheckBox Margin="20" Background="BlueCrayola"/>
+               <CheckBox/>
+               <CheckBox/>
+               <CheckBox/>
+               <CheckBox/>
+               <RadioButton/>
+               <RadioButton/>
+               <RadioButton/>
+               <RadioButton/>
+               <RadioButton/>
+               <CheckBox/>
+
+       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+               MouseEnter="{Background=DimGray}" Width="100"
+               MouseLeave="{Background=BlueCrayola}"
+               Margin="10" Text="{fps}" Background="BlueCrayola"/>
+       <Label HorizontalAlignment="Center" VerticalAlignment="Center" CacheEnabled="true"
+               MouseEnter="{Background=DimGray}" Width="100"
+               MouseLeave="{Background=BlueCrayola}"
+               Margin="10" Text="{drawing}" Background="BlueCrayola"/>
+ </VerticalStack>-->
\ No newline at end of file
index d1e171091f0e9da3c130f4ff75a53de55be27e79..091b535c1a53adfc0dc65d3bcb14350706426917 100644 (file)
     <None Include="Interfaces\clip2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\clip3.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\clip4.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
index 58ccff33f6c1af870182cac47efdd339cc13ae50..c8e4a7bb5ee33ab74d127edddc3209bf30059192 100644 (file)
@@ -62,6 +62,9 @@ namespace Crow
                                CairoHelpers.CairoRectangle(gr, rBack, CornerRadius);
                                gr.Stroke ();
                        }
+
+                       if (child != null)
+                               child.Paint (ref gr);
                }               
                #endregion
        }
index 1ce9409b872bc747010d0c8a7774df0e2e9e2352..4c7e700692ba7d1010c78b688de7046a81286765 100644 (file)
@@ -597,12 +597,11 @@ namespace Crow
                                SelBegin = -1;
                                SelRelease = -1;
                                SelectionInProgress = true;
+                               registerForGraphicUpdate();//TODO:should put it in properties
                        }          
 
                        //done at the end to set 'hasFocus' value after testing it
                        base.onMouseDown (sender, e);
-
-                       registerForGraphicUpdate();
                }
                public override void onMouseUp (object sender, MouseButtonEventArgs e)
                {
index 141a9887aab8b2ecd07e5292021b4e4ad936f40d..297b4c2b453aec37c70121ae3555ebff0366d716 100644 (file)
@@ -71,6 +71,9 @@ namespace Crow
                        get { return isChecked; }
             set
             {
+                               if (isChecked == value)
+                                       return;
+                               
                                isChecked = value;
 
                                NotifyValueChanged ("IsChecked", value);