aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-06-13 15:48:05 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-06-13 15:48:05 +0200
commit746f5cfb60c9a798825e31c2e362cfc817e59d44 (patch)
treeb6bb8ffb83f06fecff3d7805a64d095f3ec35740
parent78e040f5f6f3af0f4e66b84523f77fdfb819b8af (diff)
-window, icons
-rw-r--r--GOLib.csproj2
-rw-r--r--Images/Icons/exit.svg72
-rw-r--r--Images/Icons/tetra.pngbin0 -> 10133 bytes
-rw-r--r--README.md6
-rwxr-xr-xTemplates/Window.goml8
-rw-r--r--Tests/GOLIBTest_Window.cs5
-rwxr-xr-xTests/Interfaces/testWindow.goml16
-rw-r--r--Tests/Tests.csproj2
-rw-r--r--screenshot1.pngbin0 -> 58533 bytes
-rw-r--r--src/GraphicObjects/IGOLibHost.cs1
-rw-r--r--src/GraphicObjects/Window.cs6
-rwxr-xr-xsrc/OpenTKGameWindow.cs8
12 files changed, 113 insertions, 13 deletions
diff --git a/GOLib.csproj b/GOLib.csproj
index 77bce975..ddf23415 100644
--- a/GOLib.csproj
+++ b/GOLib.csproj
@@ -173,5 +173,7 @@
<EmbeddedResource Include="Templates\Checkbox2.goml" />
<EmbeddedResource Include="Templates\Popper.goml" />
<EmbeddedResource Include="Templates\Window.goml" />
+ <EmbeddedResource Include="Images\Icons\tetra.png" />
+ <EmbeddedResource Include="Images\Icons\exit.svg" />
</ItemGroup>
</Project>
diff --git a/Images/Icons/exit.svg b/Images/Icons/exit.svg
new file mode 100644
index 00000000..3d688cc7
--- /dev/null
+++ b/Images/Icons/exit.svg
@@ -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
index 00000000..b0c855aa
--- /dev/null
+++ b/Images/Icons/tetra.png
Binary files differ
diff --git a/README.md b/README.md
index 096b579c..4dcf1202 100644
--- 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)
diff --git a/Templates/Window.goml b/Templates/Window.goml
index c7c48b80..5964d023 100755
--- a/Templates/Window.goml
+++ b/Templates/Window.goml
@@ -3,9 +3,11 @@
<VerticalStack MouseClick="onMouseClick" Height="0" Width="0" Margin="0" Focusable="true">
<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="0" MouseClick="onMouseClick" Background="BlueCrayola" Focusable="true"
MouseMove="Window_MouseMove">
- <HorizontalStack Margin="0" Spacing="1" Height="-1" Width="0" Focusable="true" MouseMove="Window_MouseMove">
- <Image Name="Image" Margin="3" Width="16" Height="16" Path="#go.Images.Icons.expandable.svg"/>
- <Label Focusable="true" Name="Title" MouseMove="Window_MouseMove"/>
+ <HorizontalStack Margin="1" Spacing="1" Height="-1" Width="0" Focusable="true" MouseMove="Window_MouseMove">
+ <Image Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.tetra.png"/>
+ <Label Width="0" Focusable="true" Name="Title" MouseMove="Window_MouseMove"/>
+ <Image Focusable="true" Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.exit.svg"
+ MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}" MouseClick="butQuitPress"/>
</HorizontalStack>
</Border>
<Container Name="Content" Margin="1"/>
diff --git a/Tests/GOLIBTest_Window.cs b/Tests/GOLIBTest_Window.cs
index 542b3606..cb9daa49 100644
--- a/Tests/GOLIBTest_Window.cs
+++ b/Tests/GOLIBTest_Window.cs
@@ -76,6 +76,11 @@ namespace test
{
base.OnLoad (e);
LoadInterface("Interfaces/testWindow.goml", out g);
+ LoadInterface("Interfaces/testWindow.goml", out g);
+ LoadInterface("Interfaces/testWindow.goml", out g);
+ LoadInterface("Interfaces/testWindow.goml", out g);
+ LoadInterface("Interfaces/testWindow.goml", out g);
+ LoadInterface("Interfaces/testWindow.goml", out g);
}
protected override void OnRenderFrame (FrameEventArgs e)
diff --git a/Tests/Interfaces/testWindow.goml b/Tests/Interfaces/testWindow.goml
index 524ff06c..68759d9e 100755
--- a/Tests/Interfaces/testWindow.goml
+++ b/Tests/Interfaces/testWindow.goml
@@ -1,11 +1,19 @@
<?xml version="1.0"?>
<!--<Group>-->
-<Window Name="window1" Left="10" Top="10" Title="test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,5" >
+<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,5" >
<VerticalStack Height="0" Width="0">
<Label Text="{fps}" Background="DarkRed"/>
- <Label/>
- <Label/>
- <Label/>
+ <Label Text="{fpsMin}" />
+ <Label Text="{fpsMax}" />
+ <Checkbox Height="-1" Width="-1"/>
+ <GroupBox Title="test" Height="-1" Width="-1" Margin="5">
+ <VerticalStack Width="100">
+ <RadioButton Height="-1" Width="-1"/>
+ <RadioButton Height="-1" Width="-1"/>
+ <RadioButton Height="-1" Width="-1"/>
+ </VerticalStack>
+ </GroupBox>
+
</VerticalStack>
</Window>
<!--</Group>-->
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 57e19ad4..9ca28ed0 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -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
index 00000000..0fe4cabb
--- /dev/null
+++ b/screenshot1.png
Binary files differ
diff --git a/src/GraphicObjects/IGOLibHost.cs b/src/GraphicObjects/IGOLibHost.cs
index 7a422877..a76500c7 100644
--- a/src/GraphicObjects/IGOLibHost.cs
+++ b/src/GraphicObjects/IGOLibHost.cs
@@ -12,6 +12,7 @@ namespace go
GraphicObject FocusedWidget { get; set; }
void AddWidget (GraphicObject g);
void DeleteWidget(GraphicObject g);
+ void Quit ();
}
}
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs
index 61d6fd1f..aae75a54 100644
--- a/src/GraphicObjects/Window.cs
+++ b/src/GraphicObjects/Window.cs
@@ -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 ();
+ }
+
}
}
diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs
index 7299e858..38d230f7 100755
--- a/src/OpenTKGameWindow.cs
+++ b/src/OpenTKGameWindow.cs
@@ -87,6 +87,11 @@ namespace go
GraphicObjects.Remove (g);
}
+ public void Quit ()
+ {
+ this.Exit ();
+ }
+
#region Events
//those events are raised only if mouse isn't in a graphic object
public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
@@ -97,7 +102,6 @@ namespace go
#endregion
#region focus
-
GraphicObject _activeWidget; //button is pressed on widget
GraphicObject _hoverWidget; //mouse is over
GraphicObject _focusedWidget; //has keyboard (or other perif) focus
@@ -246,7 +250,7 @@ namespace go
lock (redrawClip) {
if (redrawClip.count > 0) {
// #if DEBUG_CLIP_RECTANGLE
- redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));
+// redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));
// #endif
redrawClip.clearAndClip (ctx);//rajouté après, tester si utile