]> O.S.I.I.S - jp/crow.git/commitdiff
Color.Clear to make it possible transparency with GroupBox Title
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 14 Sep 2015 21:15:31 +0000 (23:15 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 14 Sep 2015 21:15:31 +0000 (23:15 +0200)
without the border over the text
test0 to test the concept

Tests/GOLIBTests.cs
Tests/Interfaces/test0.goml
Tests/Interfaces/testWindow2.goml [new file with mode: 0755]
src/Colors.cs
src/GraphicObjects/GraphicObject.cs

index 2f8eb036a6a471427f53d79c3f8304a517f86d87..38eaf8691a011d830ba24ef8099eff3ba4c4fbc1 100644 (file)
@@ -31,6 +31,8 @@ namespace test
                int frameCpt = 0;\r
                int idx = 0;\r
                string[] testFiles = {\r
+                       "testWindow.goml",\r
+                       "test0.goml",\r
                        "test1.goml",\r
                        "test1.1.goml",\r
                        "test1.2.goml",\r
@@ -41,7 +43,6 @@ namespace test
                        "testSpinner.goml",\r
                        "testPopper.goml",\r
                        "testExpandable.goml",\r
-                       "testWindow.goml",\r
                        "testMsgBox.goml",\r
                        "testGrid.goml",\r
                        "fps.goml",\r
index b3b629b91a1a63f4005b0dcc4bdd3635ad1546ca..fb23bbcdefca80c63170e261aa774354d5ca0782 100755 (executable)
@@ -3,16 +3,15 @@
                        Width="100" Height="100"
                        Top="200" Left="200" 
                        Margin="10" Background="Green"/>-->
-<Border CornerRadius="5" Margin="1" BorderWidth="1" Fit="True" Background="SteelBlue">
-       <HorizontalStack Name="hstack" Margin="0" Spacing="5">
-               <Label Name="labCpt" Text="55"/>
-               <VerticalStack Spacing="1" Name="vstack">
-                       <Button Width="10" Height="8" MouseClick="onUp">
-                               <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>
-                       </Button>
-                       <Button Width="10" Height="8"  MouseClick="onDown">
-                               <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>
-                       </Button>
-               </VerticalStack>
-       </HorizontalStack>
-</Border>
\ No newline at end of file
+
+<Container Width="0" Height="0" Background="Transparent">
+       <Group  >
+               <Border CornerRadius="5" BorderWidth="1" Margin="5"/>
+               <HorizontalStack  Fit="true" Background="Clear" 
+                       VerticalAlignment="Top" Left="10">
+                       <GraphicObject Width="5"/>
+                       <Label Text="GroupBox"/>
+                       <GraphicObject Width="5"/>
+               </HorizontalStack>
+       </Group>
+</Container>
diff --git a/Tests/Interfaces/testWindow2.goml b/Tests/Interfaces/testWindow2.goml
new file mode 100755 (executable)
index 0000000..b336a9d
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>\r
+<!--<Group>-->\r
+<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8" \r
+       Focusable="True"  CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">\r
+       <Template>\r
+               <Border BorderWidth="1" BorderColor="White" Margin="0" CornerRadius="20">\r
+                       <VerticalStack Margin="0">\r
+                               <Border BorderWidth="1" BorderColor="White"  Height="-1" Background="0,1;0,5;1,0;0,5">\r
+                                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" Focusable="false" >\r
+                                               <GraphicObject Width="5" Height="0"/>\r
+                                               <Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>\r
+                                               <Label Foreground="White" Width="0" Name="Title" Margin="1" TextAlignment="Center" />\r
+                                               <Border CornerRadius="6" BorderWidth="1" Margin="0" BorderColor="Transparent"  Height="12" Width="12"\r
+                                                       MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
+                                                       <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"\r
+                                                                MouseClick="butQuitPress"/>\r
+                                               </Border>\r
+                                               <GraphicObject Width="5" Height="0"/>\r
+                                       </HorizontalStack>\r
+                               </Border>\r
+                               <Container Name="Content" Margin="0" Width="0" Height="0"/>\r
+                       </VerticalStack>\r
+               </Border>\r
+       </Template>\r
+       <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">\r
+               <Slider Name="slider" Height="10" Width="0"/>\r
+\r
+               <HorizontalStack Width="-1" Height="-1" Margin="0" Background="Red">\r
+                       <Checkbox Height="-1" Width="100"/>\r
+                       <Checkbox Height="-1" Width="100"/>\r
+               </HorizontalStack>\r
+               <GroupBox Title="test"  Height="-1" Width="-1" Margin="5">\r
+                       <VerticalStack  Height="-1" Width="-1">\r
+                               <RadioButton  Caption="Radio 1"/>\r
+                               <RadioButton  Caption="Radio 2" IsChecked="true"/>\r
+                               <RadioButton  Caption="Radio 3"/>\r
+                       </VerticalStack>\r
+               </GroupBox>\r
+<!--           <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
+       </VerticalStack>\r
+</Window>\r
+<!--</Group>-->\r
+<!--           <Label Text="{fps}"  Background="DarkRed"/>\r
+               <Label Text="{fpsMin}"  />\r
+               <Label Text="{fpsMax}"  />-->
\ No newline at end of file
index 96d17f2a86bc90b6e9cceeb98f7e2676d14e9c20..82f1dfb0a25f06a0153de3952d00adea81752c81 100755 (executable)
@@ -150,6 +150,7 @@ namespace go
 \r
                #region Predefined colors\r
         public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");\r
+               public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear");\r
                public static readonly Color Green = new Color(0, 1.0, 0, 1.0, "Green");\r
                public static readonly Color AirForceBlueRaf = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"AirForceBlueRaf");\r
                public static readonly Color AirForceBlueUsaf = new Color(0,0.188235294117647,0.56078431372549,1.0,"AirForceBlueUsaf");\r
index c3c22e7b6b25c7b4e2a5ecb0b33a8837cec3a176..6a146c649b3ff3243fbf9de9e13b0168b233b527 100644 (file)
@@ -664,6 +664,13 @@ namespace go
                        Rectangle rb = Parent.ContextCoordinates(Slot);\r
 \r
                        using (ImageSurface source = new ImageSurface(bmp, Format.Argb32, rb.Width, rb.Height, 4 * Slot.Width)) {\r
+                               if (this.Background == Color.Clear) {\r
+                                       ctx.Save ();\r
+                                       ctx.Operator = Operator.Clear;\r
+                                       ctx.Rectangle(rb);\r
+                                       ctx.Fill ();\r
+                                       ctx.Restore ();\r
+                               }\r
                                ctx.SetSourceSurface (source, rb.X, rb.Y);\r
                                ctx.Paint ();\r
                        }\r