diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-12 14:10:03 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-12 14:10:03 +0100 |
| commit | a3e324b2dfda42df320791b1efff1bf5217b7747 (patch) | |
| tree | f339ba7492f3b51dbfea683204348d42dd2a9b33 | |
| parent | 46bad7bb53e7f9c23f4dac4fb81716272cb71515 (diff) | |
new clipping system nearly nickel
| -rw-r--r-- | Tests/GOLIBTests.cs | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/clip2.crow | 4 | ||||
| -rwxr-xr-x | Tests/Interfaces/clip3.crow | 34 | ||||
| -rwxr-xr-x | Tests/Interfaces/clip4.crow | 30 | ||||
| -rw-r--r-- | Tests/Tests.csproj | 6 | ||||
| -rw-r--r-- | src/GraphicObjects/Border.cs | 3 | ||||
| -rw-r--r-- | src/GraphicObjects/Label.cs | 3 | ||||
| -rw-r--r-- | src/GraphicObjects/RadioButton.cs | 3 |
8 files changed, 81 insertions, 4 deletions
diff --git a/Tests/GOLIBTests.cs b/Tests/GOLIBTests.cs index 622d1ce7..1fb98c18 100644 --- a/Tests/GOLIBTests.cs +++ b/Tests/GOLIBTests.cs @@ -37,6 +37,8 @@ namespace test int frameCpt = 0; int idx = 0; string[] testFiles = { + "clip4.crow", + "clip3.crow", "clip2.crow", "clip0.crow", "clip1.crow", diff --git a/Tests/Interfaces/clip2.crow b/Tests/Interfaces/clip2.crow index 8ab66910..4f95bf90 100755 --- a/Tests/Interfaces/clip2.crow +++ b/Tests/Interfaces/clip2.crow @@ -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 index 00000000..b08216c0 --- /dev/null +++ b/Tests/Interfaces/clip3.crow @@ -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 index 00000000..c38e95ac --- /dev/null +++ b/Tests/Interfaces/clip4.crow @@ -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 diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index d1e17109..091b535c 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -233,6 +233,12 @@ <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\" /> diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs index 58ccff33..c8e4a7bb 100644 --- a/src/GraphicObjects/Border.cs +++ b/src/GraphicObjects/Border.cs @@ -62,6 +62,9 @@ namespace Crow CairoHelpers.CairoRectangle(gr, rBack, CornerRadius); gr.Stroke (); } + + if (child != null) + child.Paint (ref gr); } #endregion } diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index 1ce9409b..4c7e7006 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -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) { diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs index 141a9887..297b4c2b 100644 --- a/src/GraphicObjects/RadioButton.cs +++ b/src/GraphicObjects/RadioButton.cs @@ -71,6 +71,9 @@ namespace Crow get { return isChecked; } set { + if (isChecked == value) + return; + isChecked = value; NotifyValueChanged ("IsChecked", value); |