]> O.S.I.I.S - jp/crow.git/commitdiff
messagebox + test + changes to default window template
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 13 Sep 2015 22:40:42 +0000 (00:40 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 13 Sep 2015 22:40:42 +0000 (00:40 +0200)
GOLib.csproj
Images/Icons/iconInfo.svg
Templates/MessageBox.goml
Templates/Window.goml
Tests/GOLIBTests.cs
Tests/Interfaces/test6.goml
Tests/Interfaces/testHStack.goml
Tests/Interfaces/testMsgBox.goml
Tests/Tests.csproj
src/GraphicObjects/MessageBox.cs

index e785acac0807dfd740f4350f4930ce4bc38c2385..4fac6677a44c9ea1e01f7f372557a9091b3b54c9 100644 (file)
     <Compile Include="src\XCursor.cs" />\r
     <Compile Include="src\GraphicObjects\Grid.cs" />\r
     <Compile Include="src\GraphicObjects\TextRun.cs" />\r
+    <Compile Include="src\GraphicObjects\MessageBox.cs" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
     <EmbeddedResource Include="Images\Icons\Cursors\sb_h_double_arrow" />\r
     <EmbeddedResource Include="Images\Icons\Cursors\sb_v_double_arrow" />\r
     <EmbeddedResource Include="Images\button.svg" />\r
+    <EmbeddedResource Include="Templates\MessageBox.goml" />\r
+    <EmbeddedResource Include="Images\Icons\iconInfo.svg" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="Images\Icons\Cursors\hand" />\r
index f09168a757ee5e4ef07176c58f5c7445b89e4469..82345509cb1418a1a9848bce06b0e0f919622323 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 62 62" width="620" height="620" version="1.0">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 62 62" width="62" height="62" version="1.0">
        <defs>
                <linearGradient id="fieldGradient" gradientUnits="userSpaceOnUse" x1="42.9863" y1="7.01270" x2="22.0144" y2="51.9871">
                        <stop offset="0.0" stop-color="#BCD6FE"/>
index e02abfc9b0e17c18f0c365f044cc760d3b961f4a..7f48fa65f599bc239cfa57146fb952d09ba44056 100644 (file)
@@ -1 +1,31 @@
-
+<?xml version="1.0"?>
+<Border Height="-1" BorderWidth="1" BorderColor="White" CornerRadius="10" >
+       <VerticalStack Height="-1" Background="0,4;0,4;0,4;0,4">
+               <Border BorderWidth="1" BorderColor="White"  Height="18" Background="0,1;0,5;1,0;0,5">
+                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" >
+                               <GraphicObject Width="5"/>
+                               <Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
+                               <Label Foreground="White" Width="0" Text="{Title}" Margin="1" TextAlignment="Center" />
+                               <Border CornerRadius="6" BorderWidth="1" Margin="0" BorderColor="Transparent"  Height="12" Width="12"
+                                       MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
+                                       <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"
+                                                MouseClick="butQuitPress"/>
+                               </Border>
+                               <GraphicObject Width="5"/>
+                       </HorizontalStack>
+               </Border>
+<!--           <Container Name="Content"/>-->
+               <HorizontalStack Spacing="10">
+                       <GraphicObject Width="20"/>
+                       <Image Name="Image" Width="32" Height="32"
+                               Path="#go.Images.Icons.iconInfo.svg" />
+                       <TextRun Font="serif, 12" Width="0" Height="80" Text="{Message}"
+                               Multiline="true" WordWrap="true"/>              
+               </HorizontalStack>
+               <HorizontalStack Height="-1" Margin="5">
+                       <GraphicObject/>
+                       <Button Text="Ok"/>
+                       <Button Text="Cancel"/>
+               </HorizontalStack>
+       </VerticalStack>
+</Border>
index cf72c6bf11a4c81840e845aadfc80de7b49f77b0..55c85f3dc7d87cc73d2a5cfe83a5aebd89194a96 100755 (executable)
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="White" Margin="0" CornerRadius="20">\r
-       <VerticalStack Height="0" Width="0" Margin="0">\r
-               <Border BorderWidth="1" BorderColor="White"  Height="-1" Width="0" Background="0,1;0,5;1,0;0,5">\r
-                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" Width="0" Focusable="false" >\r
-                               <GraphicObject Width="5" Height="0"/>\r
+<Border BorderWidth="1" BorderColor="White" CornerRadius="20">\r
+       <VerticalStack Height="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" >\r
+                               <GraphicObject Width="5"/>\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
@@ -11,9 +11,9 @@
                                        <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
+                               <GraphicObject Width="5"/>\r
                        </HorizontalStack>\r
                </Border>\r
-               <Container Name="Content" Margin="0" Width="0" Height="0"/>\r
+               <Container Name="Content"/>\r
        </VerticalStack>\r
 </Border>
\ No newline at end of file
index 5a8dd181dcf29e944281b99feafd36b23e4c606c..d11ab959e2c60566ac613ae330a5de9dbd2e28da 100644 (file)
@@ -31,6 +31,9 @@ namespace test
                int frameCpt = 0;\r
                int idx = 0;\r
                string[] testFiles = {\r
+                       "test6.goml",\r
+                       "testHStack.goml",\r
+                       "testMsgBox.goml",\r
                        "testLabel.goml",\r
                        "testGrid.goml",\r
                        "test1.goml",\r
@@ -40,7 +43,6 @@ namespace test
                        "test2.goml",\r
                        "testContainer.goml",\r
                        "test_stack.goml",\r
-                       "testHStack.goml",\r
                        "testScrollbar.goml",\r
                        "testSpinner.goml",\r
                        "testExpandable.goml",\r
index b3b629b91a1a63f4005b0dcc4bdd3635ad1546ca..d9edd5654b5c54cc505d60a350003087aec05730 100755 (executable)
@@ -1,18 +1,32 @@
 <?xml version="1.0"?>
-<!--<GraphicObject
-                       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 BorderWidth="1" BorderColor="White" CornerRadius="10" Width="500" Height="300">
+       <VerticalStack Height="0" Background="0,4;0,4;0,4;0,4">
+               <Border BorderWidth="1" BorderColor="White"  Height="20" Background="0,1;0,5;1,0;0,5">
+                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" >
+                               <GraphicObject Width="5"/>
+                               <Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
+                               <Label Foreground="White" Width="0" Name="Title" Margin="1" TextAlignment="Center" />
+                               <Border CornerRadius="6" BorderWidth="1" Margin="0" BorderColor="Transparent"  Height="12" Width="12"
+                                       MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
+                                       <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" 
+                                       Path="#go.Images.Icons.exit2.svg"/>
+                               </Border>
+                               <GraphicObject Width="5"/>
+                       </HorizontalStack>
+               </Border>
+<!--           <Container Name="Content"/>-->
+               <HorizontalStack Spacing="10">
+                       <GraphicObject Width="30"/>
+                       <Image Name="Image" Width="40" Height="40" Background="Red"
+                               Path="#go.Images.Icons.iconInfo.svg" />
+                       <Label Font="serif, 12" Width="0" Height="0" Text="MessageBox"
+                               Multiline="true" WordWrap="true"/>
+                       <GraphicObject Width="30"/>
+               </HorizontalStack>
+               <HorizontalStack Height="-1" Margin="5">
+                       <GraphicObject/>
+                       <Button Text="Ok"/>
+                       <Button Text="Cancel"/>
+               </HorizontalStack>
+       </VerticalStack>
 </Border>
\ No newline at end of file
index ac03eac9ee70b30c931edfa94fb95c65ab73015f..7ac4cb5575600e2f6653c0b0eb3a359584435c5a 100755 (executable)
@@ -1,11 +1,19 @@
 <?xml version="1.0"?>\r
-<!--<HorizontalStack Background="Gray" Margin="1">-->\r
-<Group  Background="Gray" Margin="5" Height="200" Width="300">\r
-       <VerticalStack Background="Green" Margin="1">\r
-               <HorizontalStack Width="0" Height="0" Margin="5" Background="Red">\r
-                       <Checkbox Height="-1" Width="100" Background="Blue"/>\r
-       <!--            <Checkbox Height="-1" Width="-1"/>-->\r
+<Window Width="600" Height="500">\r
+<Border BorderWidth="5" Margin="10">\r
+       <VerticalStack Margin="10">\r
+               <GraphicObject Height="20" Width="50" Background="Blue"/>\r
+               <HorizontalStack Spacing="5" Margin="5" Background="Red">\r
+                       <GraphicObject Height="20" Width="50" Background="Blue"/>\r
+                       <GraphicObject Height="20" Width="50" Background="Blue"/>\r
+                       <Image Name="Image" Width="40" Height="40" Background="Red"\r
+                                       Path="#go.Images.Icons.iconInfo.svg" />\r
+                       <Label Font="serif, 12" Width="0" Height="0" Text="MessageBox"\r
+                               Multiline="true" WordWrap="true"/>\r
+                       <GraphicObject Height="20" Width="50" Background="Blue"/>\r
+                       <GraphicObject Height="20" Width="50" Background="Blue"/>\r
+                       <GraphicObject Height="20" Width="50" Background="Blue"/>\r
                </HorizontalStack>\r
        </VerticalStack>\r
-</Group>\r
-<!--</HorizontalStack>-->
\ No newline at end of file
+</Border>\r
+</Window>\r
index b3b629b91a1a63f4005b0dcc4bdd3635ad1546ca..c1beef527ee12ad8ecb0b2fbdb389ab39d94e980 100755 (executable)
@@ -1,18 +1,2 @@
 <?xml version="1.0"?>
-<!--<GraphicObject
-                       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
+<MessageBox/>
\ No newline at end of file
index db5b7b472ce46e6d38f67af08a4475d3f1bf3552..c72a81351f1919eb4108b4c78e386628199f5a58 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>test.GOLIBTest_Listbox</StartupObject>
+    <StartupObject>test.GOLIBTests</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <OutputPath>..\bin\$(configuration)</OutputPath>
     <IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
     <None Include="Interfaces\testGrid.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\testMsgBox.goml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="Interfaces\test6.goml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
index a5ce6910082aea044f8fea34e5a86b9dbf9430c6..d750dee598c96091fadcabcf8096d0ef6c821357 100644 (file)
@@ -7,26 +7,76 @@
 //  Copyright (c) 2015 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
+//  it under the terms of the GNU Generaltitlec 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
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURtitle See the
+//  GNU General Putitleicense for more details.
+//titleou 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.Xml.Serialization;
+using System.ComponentModel;
 
 namespace go
 {
-       public class MessageBox
+       [DefaultTemplate("#go.Templates.MessageBox.goml")]
+       public class MessageBox : Window
        {
-               public MessageBox ()
+               public MessageBox ():base(){}
+
+               string title;
+               string message;
+
+               [XmlAttributeAttribute][DefaultValue("Message box")]
+               public virtual string Title
+               {
+                       get { return title; }
+                       set {
+                               if (title == value)
+                                       return;
+                               title = value;
+                               NotifyValueChanged ("Title", title);
+                       }
+               }
+               [XmlAttributeAttribute][DefaultValue("Informations")]
+               public virtual string Message
+               {
+                       get { return message; }
+                       set {
+                               if (message == value)
+                                       return;
+                               message = value;
+                               NotifyValueChanged ("Message", message);
+                       }
+               }
+               #region GraphicObject overrides
+               [XmlAttributeAttribute][DefaultValue(350)]
+               public override int Width {
+                       get { return base.Width; }
+                       set { base.Width = value; }
+               }
+               [XmlAttributeAttribute][DefaultValue(150)]
+               public override int Height {
+                       get { return base.Height; }
+                       set { base.Height = value; }
+               }
+               [XmlAttributeAttribute()][DefaultValue(true)]
+               public override bool Focusable
+               {
+                       get { return base.Focusable; }
+                       set { base.Focusable = value; }
+               }
+               [XmlAttributeAttribute()][DefaultValue("150;80")]
+               public override Size MinimumSize
                {
+                       get { return base.MinimumSize; }
+                       set { base.MinimumSize = value; }
                }
+               #endregion
        }
 }