]> O.S.I.I.S - jp/crow.git/commitdiff
-window, icons
authorjpbruyere <jp.bruyere@hotmail.com>
Sat, 13 Jun 2015 13:48:05 +0000 (15:48 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Sat, 13 Jun 2015 13:48:05 +0000 (15:48 +0200)
12 files changed:
GOLib.csproj
Images/Icons/exit.svg [new file with mode: 0644]
Images/Icons/tetra.png [new file with mode: 0644]
README.md
Templates/Window.goml
Tests/GOLIBTest_Window.cs
Tests/Interfaces/testWindow.goml
Tests/Tests.csproj
screenshot1.png [new file with mode: 0644]
src/GraphicObjects/IGOLibHost.cs
src/GraphicObjects/Window.cs
src/OpenTKGameWindow.cs

index 77bce975a115f4f6abea8bb8ddecdf5e466cce57..ddf23415d7bc3c781a21a07251fda9dca0c2ee2a 100644 (file)
     <EmbeddedResource Include="Templates\Checkbox2.goml" />\r
     <EmbeddedResource Include="Templates\Popper.goml" />\r
     <EmbeddedResource Include="Templates\Window.goml" />\r
+    <EmbeddedResource Include="Images\Icons\tetra.png" />\r
+    <EmbeddedResource Include="Images\Icons\exit.svg" />\r
   </ItemGroup>\r
 </Project>\r
diff --git a/Images/Icons/exit.svg b/Images/Icons/exit.svg
new file mode 100644 (file)
index 0000000..3d688cc
--- /dev/null
@@ -0,0 +1,72 @@
+<?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: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 64.000002"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="exit.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.6992188"
+     inkscape:cx="-13.949137"
+     inkscape:cy="63.946457"
+     inkscape:document-units="px"
+     inkscape:current-layer="svg2"
+     showgrid="false"
+     units="px"
+     inkscape:window-width="1280"
+     inkscape:window-height="984"
+     inkscape:window-x="0"
+     inkscape:window-y="16"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <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>
+  <rect
+     style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:8.89073467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1"
+     id="rect4136"
+     width="55.122551"
+     height="55.122551"
+     x="4.4468598"
+     y="4.3914709"
+     ry="8.8907347" />
+  <path
+     style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:9;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+     d="m 13.884262,15.143117 c 24.231966,13.49131 34.18672,34.186719 34.18672,34.186719"
+     id="path4175"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cc" />
+  <path
+     sodipodi:nodetypes="cc"
+     inkscape:connector-curvature="0"
+     id="path4177"
+     d="M 50.43178,15.408178 C 20.436536,37.282439 16.245061,49.594898 16.245061,49.594898"
+     style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:9;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+</svg>
diff --git a/Images/Icons/tetra.png b/Images/Icons/tetra.png
new file mode 100644 (file)
index 0000000..b0c855a
Binary files /dev/null and b/Images/Icons/tetra.png differ
index 096b579c9f7be2111be3cdc7a15bf845cb8184ef..4dcf1202a15bb9dd8a7a59972f4ce30336a4635b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -11,14 +11,16 @@ Graphic Object Library: custom widget library c# version.
 
 #####GOLib in action
 
+![GOLib in action](/screenshot1.png?raw=true "golib")
+
 ![GOLib in action](/screenshot2.png?raw=true "golib")
 
 ![GOLib in action](/magic3d.png?raw=true "Magic3d")
 
 RoadMap:
 
-       - TreeView, templated of course...
-         Menu, Popper, Combobox, PangoLayouting controls, Improved editor
+       - TreeView (templated)
+         Menu, Combobox, PangoLayouting controls, Improved editor
        - Monodevelop addin
        - improve inline delegates to handle all conversion and graphic tree parsing with directory navigation syntax
        - Make an easyly compilable example of complete application (3d mesh editor for example)
index c7c48b8097fe7be0b1809077ab56953f4d96b2f5..5964d0239eb04ea710870abcd7f59990a85e4002 100755 (executable)
@@ -3,9 +3,11 @@
        <VerticalStack MouseClick="onMouseClick" Height="0" Width="0" Margin="0" Focusable="true">\r
                <Border BorderWidth="1" BorderColor="LightGray"  Height="-1" Width="0" MouseClick="onMouseClick"  Background="BlueCrayola" Focusable="true"\r
                        MouseMove="Window_MouseMove">\r
-                       <HorizontalStack Margin="0" Spacing="1" Height="-1" Width="0" Focusable="true" MouseMove="Window_MouseMove">\r
-                               <Image Name="Image" Margin="3" Width="16" Height="16" Path="#go.Images.Icons.expandable.svg"/>\r
-                               <Label Focusable="true" Name="Title" MouseMove="Window_MouseMove"/>\r
+                       <HorizontalStack Margin="1" Spacing="1" Height="-1" Width="0" Focusable="true" MouseMove="Window_MouseMove">\r
+                               <Image Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.tetra.png"/>\r
+                               <Label Width="0" Focusable="true" Name="Title" MouseMove="Window_MouseMove"/>\r
+                               <Image Focusable="true" Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.exit.svg"\r
+                                       MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}" MouseClick="butQuitPress"/>\r
                        </HorizontalStack>\r
                </Border>\r
                <Container Name="Content" Margin="1"/>\r
index 542b36069e0621f6a4decf4082cb605c868a9525..cb9daa497711a4cfdcc74d8ef11cf84b9eb96732 100644 (file)
@@ -76,6 +76,11 @@ namespace test
                {\r
                        base.OnLoad (e);\r
                        LoadInterface("Interfaces/testWindow.goml", out g);\r
+                       LoadInterface("Interfaces/testWindow.goml", out g);\r
+                       LoadInterface("Interfaces/testWindow.goml", out g);\r
+                       LoadInterface("Interfaces/testWindow.goml", out g);\r
+                       LoadInterface("Interfaces/testWindow.goml", out g);\r
+                       LoadInterface("Interfaces/testWindow.goml", out g);\r
 \r
                }\r
                protected override void OnRenderFrame (FrameEventArgs e)\r
index 524ff06c0f75cdf8d5a093b58d518465fcd85361..68759d9eee9a1aef0c03694a521c176f5e6a83ca 100755 (executable)
@@ -1,11 +1,19 @@
 <?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,5" >\r
+<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,5" >\r
        <VerticalStack Height="0" Width="0">\r
                <Label Text="{fps}"  Background="DarkRed"/>\r
-               <Label/>\r
-               <Label/>\r
-               <Label/>\r
+               <Label Text="{fpsMin}"  />\r
+               <Label Text="{fpsMax}"  />\r
+               <Checkbox Height="-1" Width="-1"/>\r
+               <GroupBox Title="test"  Height="-1" Width="-1" Margin="5">\r
+                       <VerticalStack Width="100">\r
+                               <RadioButton  Height="-1" Width="-1"/>\r
+                               <RadioButton  Height="-1" Width="-1"/>\r
+                               <RadioButton  Height="-1" Width="-1"/>\r
+                       </VerticalStack>\r
+               </GroupBox>\r
+\r
        </VerticalStack>\r
 </Window>\r
 <!--</Group>-->\r
index 57e19ad4f408d183e7abd9684da91b4e066c4973..9ca28ed0081afcef48325075e70cc5562920b834 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>test.GOLIBTest_4</StartupObject>
+    <StartupObject>test.GOLIBTest_Window</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <OutputPath>..\bin\$(configuration)</OutputPath>
     <IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
diff --git a/screenshot1.png b/screenshot1.png
new file mode 100644 (file)
index 0000000..0fe4cab
Binary files /dev/null and b/screenshot1.png differ
index 7a4228771947c590fc193b83fe881b81e9a92740..a76500c7e0aead37d28c794f6925e9ce0487d66c 100644 (file)
@@ -12,6 +12,7 @@ namespace go
                GraphicObject FocusedWidget { get; set; }
                void AddWidget (GraphicObject g);
                void DeleteWidget(GraphicObject g);
+               void Quit ();
        }
 }
 
index 61d6fd1fa93f6cbcc8adc02d3366f07b1bdb8308..aae75a5405d82c0767df4ffd5602204c9727a381 100644 (file)
@@ -47,12 +47,16 @@ namespace go
                protected override void loadTemplate(GraphicObject template = null)
                {
                        base.loadTemplate (template);
-
                        _contentContainer = this.child.FindByName ("Content") as Container;
                        _title = this.child.FindByName ("Title") as Label;
                        _icon = this.child.FindByName ("Icon") as Image;
                }
 
+               void butQuitPress (object sender, MouseButtonEventArgs e)
+               {
+                       TopContainer.Quit ();
+               }
+
 
        }
 }
index 7299e8588bffd058ccc9e4756d0d61d0aa206807..38d230f7401fcb978fa2b8c017d3a047309f13eb 100755 (executable)
@@ -87,6 +87,11 @@ namespace go
                        GraphicObjects.Remove (g);\r
                }\r
 \r
+               public void Quit ()\r
+               {\r
+                       this.Exit ();\r
+               }\r
+\r
                #region Events\r
                //those events are raised only if mouse isn't in a graphic object\r
                public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;\r
@@ -97,7 +102,6 @@ namespace go
                #endregion\r
 \r
                #region focus\r
-\r
                GraphicObject _activeWidget;    //button is pressed on widget \r
                GraphicObject _hoverWidget;             //mouse is over\r
                GraphicObject _focusedWidget;   //has keyboard (or other perif) focus \r
@@ -246,7 +250,7 @@ namespace go
                        lock (redrawClip) {\r
                                if (redrawClip.count > 0) {                                     \r
 //                                     #if DEBUG_CLIP_RECTANGLE\r
-                                       redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));\r
+//                                     redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));\r
 //                                     #endif\r
                                        redrawClip.clearAndClip (ctx);//rajouté après, tester si utile        \r
 \r