]> O.S.I.I.S - jp/crow.git/commitdiff
* Tests.csproj:
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Jun 2015 09:08:14 +0000 (11:08 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Jun 2015 09:08:15 +0000 (11:08 +0200)
* GOLIBTest_2.cs:
* GOLIBTest_Spinner.cs:
* test2.goml:
* test4.goml:
* testSpinner.goml: tests

* GOLib.csproj: divers

* OpenTK:

* BmpPicture.cs: center image when keepProportions is on

* Group.cs: Align children in group even if group size is FIT

* Label.cs: - text selectable or not

* Spinner.cs: clean

GOLib.csproj
Tests/GOLIBTest_2.cs
Tests/GOLIBTest_Spinner.cs [new file with mode: 0644]
Tests/Interfaces/test2.goml
Tests/Interfaces/test4.goml
Tests/Interfaces/testSpinner.goml [new file with mode: 0755]
Tests/Tests.csproj
src/BmpPicture.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/Spinner.cs

index c281a642d49ea2d67ca3fe3fabbb4311a79482aa..15e126f0ef414da82aa87945bca4db80b1c33ba2 100644 (file)
     <PlatformTarget>anycpu</PlatformTarget>\r
   </PropertyGroup>-->\r
   <ItemGroup>\r
-    <Compile Include="src\Colors.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Point.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="Properties\AssemblyInfo.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Rectangle.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Rectangles.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Size.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\OpenTKGameWindow.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\GraphicObject.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Container.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Group.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\GroupBox.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\HorizontalStack.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Image.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Label.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\TextBox.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\ProgressBar.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\VerticalStack.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Cairo\CairoHelpers.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\win32\Win32.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\win32\winApi.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Button.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\GraduatedSlider.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Slider.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\ValueChangeEventArgs.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\NumericControl.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Scroller.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\ILayoutable.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Enums.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\GenericStack.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\CompilerServices\CompilerServices.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\AnalogMeter.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Border.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Font.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\TextChangeEventArgs.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\OpenGL\QuadVAO.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\OpenGL\Shader.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\OpenGL\TexturedShader.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\OpenGL\VertexArrayObject.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Window.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\IGOLibHost.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\ListBox.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\ExtensionsMethods.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Interface.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\LayoutingQueueItem.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\LayoutingQueue.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Spinner.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\DynAttribute.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\IValueChange.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\Picture.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\SvgPicture.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\BmpPicture.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\TemplatedControl.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\Checkbox.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
-    <Compile Include="src\GraphicObjects\RadioButton.cs">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Compile>\r
+    <Compile Include="src\Colors.cs" />\r
+    <Compile Include="src\Point.cs" />\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="src\Rectangle.cs" />\r
+    <Compile Include="src\Rectangles.cs" />\r
+    <Compile Include="src\Size.cs" />\r
+    <Compile Include="src\OpenTKGameWindow.cs" />\r
+    <Compile Include="src\GraphicObjects\GraphicObject.cs" />\r
+    <Compile Include="src\GraphicObjects\Container.cs" />\r
+    <Compile Include="src\GraphicObjects\Group.cs" />\r
+    <Compile Include="src\GraphicObjects\GroupBox.cs" />\r
+    <Compile Include="src\GraphicObjects\HorizontalStack.cs" />\r
+    <Compile Include="src\GraphicObjects\Image.cs" />\r
+    <Compile Include="src\GraphicObjects\Label.cs" />\r
+    <Compile Include="src\GraphicObjects\TextBox.cs" />\r
+    <Compile Include="src\GraphicObjects\ProgressBar.cs" />\r
+    <Compile Include="src\GraphicObjects\VerticalStack.cs" />\r
+    <Compile Include="src\Cairo\CairoHelpers.cs" />\r
+    <Compile Include="src\win32\Win32.cs" />\r
+    <Compile Include="src\win32\winApi.cs" />\r
+    <Compile Include="src\GraphicObjects\Button.cs" />\r
+    <Compile Include="src\GraphicObjects\GraduatedSlider.cs" />\r
+    <Compile Include="src\GraphicObjects\Slider.cs" />\r
+    <Compile Include="src\ValueChangeEventArgs.cs" />\r
+    <Compile Include="src\GraphicObjects\NumericControl.cs" />\r
+    <Compile Include="src\GraphicObjects\Scroller.cs" />\r
+    <Compile Include="src\GraphicObjects\ILayoutable.cs" />\r
+    <Compile Include="src\Enums.cs" />\r
+    <Compile Include="src\GraphicObjects\GenericStack.cs" />\r
+    <Compile Include="src\CompilerServices\CompilerServices.cs" />\r
+    <Compile Include="src\GraphicObjects\AnalogMeter.cs" />\r
+    <Compile Include="src\GraphicObjects\Border.cs" />\r
+    <Compile Include="src\Font.cs" />\r
+    <Compile Include="src\TextChangeEventArgs.cs" />\r
+    <Compile Include="src\OpenGL\QuadVAO.cs" />\r
+    <Compile Include="src\OpenGL\Shader.cs" />\r
+    <Compile Include="src\OpenGL\TexturedShader.cs" />\r
+    <Compile Include="src\OpenGL\VertexArrayObject.cs" />\r
+    <Compile Include="src\GraphicObjects\Window.cs" />\r
+    <Compile Include="src\GraphicObjects\IGOLibHost.cs" />\r
+    <Compile Include="src\GraphicObjects\ListBox.cs" />\r
+    <Compile Include="src\ExtensionsMethods.cs" />\r
+    <Compile Include="src\Interface.cs" />\r
+    <Compile Include="src\LayoutingQueueItem.cs" />\r
+    <Compile Include="src\LayoutingQueue.cs" />\r
+    <Compile Include="src\GraphicObjects\Spinner.cs" />\r
+    <Compile Include="src\DynAttribute.cs" />\r
+    <Compile Include="src\GraphicObjects\IValueChange.cs" />\r
+    <Compile Include="src\Picture.cs" />\r
+    <Compile Include="src\SvgPicture.cs" />\r
+    <Compile Include="src\BmpPicture.cs" />\r
+    <Compile Include="src\GraphicObjects\TemplatedControl.cs" />\r
+    <Compile Include="src\GraphicObjects\Checkbox.cs" />\r
+    <Compile Include="src\GraphicObjects\RadioButton.cs" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
   -->\r
   <ItemGroup />\r
   <ItemGroup>\r
-    <Folder Include="src\GraphicObjects\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
-    <Folder Include="src\Cairo\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
-    <Folder Include="src\win32\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
-    <Folder Include="Images\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
-    <Folder Include="Images\Icons\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
-    <Folder Include="src\CompilerServices\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
-    <Folder Include="src\OpenGL\">\r
-      <LogicalName>\r
-      </LogicalName>\r
-    </Folder>\r
+    <Folder Include="src\GraphicObjects\" />\r
+    <Folder Include="src\Cairo\" />\r
+    <Folder Include="src\win32\" />\r
+    <Folder Include="Images\" />\r
+    <Folder Include="Images\Icons\" />\r
+    <Folder Include="src\CompilerServices\" />\r
+    <Folder Include="src\OpenGL\" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <EmbeddedResource Include="Images\Icons\updown.svg" />\r
index 6b9f832aa43cf5cc6bbeadf692b7242620683e6f..4af5436748359987f81b73d9654f11a1f6de10ac 100644 (file)
@@ -22,7 +22,7 @@ namespace test
                        : base(1024, 600,"test")\r
                {}\r
 \r
-               Container g;\r
+               Group g;\r
 \r
                protected override void OnLoad (EventArgs e)\r
                {\r
diff --git a/Tests/GOLIBTest_Spinner.cs b/Tests/GOLIBTest_Spinner.cs
new file mode 100644 (file)
index 0000000..c3b36f0
--- /dev/null
@@ -0,0 +1,55 @@
+#define MONO_CAIRO_DEBUG_DISPOSE\r
+\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using OpenTK;\r
+using OpenTK.Graphics.OpenGL;\r
+using OpenTK.Input;\r
+\r
+using System.Diagnostics;\r
+\r
+//using GGL;\r
+using go;\r
+using System.Threading;\r
+\r
+\r
+namespace test\r
+{\r
+       class GOLIBTest_Spinner : OpenTKGameWindow\r
+       {\r
+               public GOLIBTest_Spinner ()\r
+                       : base(1024, 600,"test")\r
+               {}\r
+\r
+               Container g;\r
+\r
+               protected override void OnLoad (EventArgs e)\r
+               {\r
+                       base.OnLoad (e);\r
+                       LoadInterface("Interfaces/testSpinner.goml", out g);\r
+\r
+               }\r
+               protected override void OnRenderFrame (FrameEventArgs e)\r
+               {\r
+                       GL.Clear (ClearBufferMask.ColorBufferBit);\r
+                       base.OnRenderFrame (e);\r
+                       SwapBuffers ();\r
+               }\r
+\r
+               protected override void OnUpdateFrame (FrameEventArgs e)\r
+               {\r
+                       base.OnUpdateFrame (e);\r
+               }\r
+\r
+               [STAThread]\r
+               static void Main ()\r
+               {\r
+                       Console.WriteLine ("starting example");\r
+\r
+                       using (GOLIBTest_Spinner win = new GOLIBTest_Spinner( )) {\r
+                               win.Run (30.0);\r
+                       }\r
+               }\r
+       }\r
+}
\ No newline at end of file
index 69ac77ec6991973f6513b0a2246d3eaf0cc0a0cd..05cecda3f3ecdfab69d0a2a7618d3be6ed639fa7 100755 (executable)
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>\r
-<Container     HorizontalAlignment="Center" VerticalAlignment="Bottom"\r
-       Margin="10" Focusable="True" Fit="True" Background="Green">\r
-       <Group Fit="True">\r
-               <GraphicObject Width="400" Height="40" Background="Blue"/>\r
-               <GraphicObject Width="40" Height="40" Background="Red"\r
+<!--<Container HorizontalAlignment="Center" VerticalAlignment="Bottom"\r
+       Margin="10" Focusable="True" Fit="True" Background="Green">-->\r
+       <Group Fit="true">\r
+               <GraphicObject Name="g1" Width="400" Height="40" Background="Blue"/>\r
+               <GraphicObject Name="g2" Width="40" Height="40" Background="Red"\r
                        HorizontalAlignment="Right"/>   \r
        </Group>\r
-</Container>
\ No newline at end of file
+<!--</Container>-->
\ No newline at end of file
index 37bc8f37749d89599b73238c0c308b2e74c7a4c0..914bce008879ef78610b633892952b3e680cfe34 100755 (executable)
@@ -72,7 +72,7 @@
                        </VerticalStack>\r
                        <VerticalStack Width="-1" Height="-1" BorderWidth="1" Margin="5" WidgetSpacing="4">\r
                                <Button  Margin="1" Width="150" Height="40">\r
-                                       <Image Path="#Tests.image.tetra.png"/>\r
+                                       <Image  Path="#Tests.image.tetra.png"/>\r
                                </Button>\r
                                <HorizontalStack>\r
                                        <Label Text="Update" FontColor="White" VerticalAlignment="Center" />\r
diff --git a/Tests/Interfaces/testSpinner.goml b/Tests/Interfaces/testSpinner.goml
new file mode 100755 (executable)
index 0000000..12a7299
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>\r
+<Container Name="TopContainer" Width="400" Height="350"\r
+       Margin="20" Focusable="True" Background="DarkGray">\r
+\r
+       <Spinner Width="50"></Spinner>\r
+</Container>
\ No newline at end of file
index fc1ad786e965929cee7bfd73760f58dcdd09765c..4d2046bba099a716b0a0940b5b08c3bae1517a27 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>test.GOLIBTest_4</StartupObject>
+    <StartupObject>test.GOLIBTest_Spinner</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <OutputPath>..\bin\$(configuration)</OutputPath>
     <IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="GOLIBTest_5.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_0.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_4.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_3.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_1.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_2.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_1.1.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_1.2.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_4.1.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_fps.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
-    <Compile Include="GOLIBTest_Listbox.cs">
-      <LogicalName>
-      </LogicalName>
-    </Compile>
+    <Compile Include="GOLIBTest_5.cs" />
+    <Compile Include="GOLIBTest_0.cs" />
+    <Compile Include="GOLIBTest_4.cs" />
+    <Compile Include="GOLIBTest_3.cs" />
+    <Compile Include="GOLIBTest_1.cs" />
+    <Compile Include="GOLIBTest_2.cs" />
+    <Compile Include="GOLIBTest_1.1.cs" />
+    <Compile Include="GOLIBTest_1.2.cs" />
+    <Compile Include="GOLIBTest_4.1.cs" />
+    <Compile Include="GOLIBTest_fps.cs" />
+    <Compile Include="GOLIBTest_Listbox.cs" />
+    <Compile Include="GOLIBTest_Spinner.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="image\u.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test1.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test3.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test4.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test5.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test0.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test2.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test1.1.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test1.2.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test4.1.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\test1.3.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
     </None>
     <None Include="Interfaces\fps.goml">
-      <LogicalName>
-      </LogicalName>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\log.xml">
-      <LogicalName>
-      </LogicalName>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="Interfaces\test_Listbox.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName>
-      </LogicalName>
+    </None>
+    <None Include="Interfaces\testSpinner.goml">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
   <ItemGroup>
-    <Folder Include="Interfaces\">
-      <LogicalName>
-      </LogicalName>
-    </Folder>
-    <Folder Include="image\">
-      <LogicalName>
-      </LogicalName>
-    </Folder>
+    <Folder Include="Interfaces\" />
+    <Folder Include="image\" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\GOLib.csproj">
index 6e8d1e5297280e4e23c99be6daad808977f00a77..053c8fbf5d9a050345be02989a0d854230c058ce 100644 (file)
@@ -85,12 +85,18 @@ namespace go
                        float heightRatio = (float)rect.Height / Dimensions.Height;
                        float ratio = Math.Min (widthRatio, heightRatio);
 
+//                     if (KeepProportions)
+//                             widthRatio = heightRatio = ratio;
+
                        Rectangle rImg = rect;
                        gr.Save ();
 
-                       if (KeepProportions)
+                       if (KeepProportions) {
+                               gr.Translate ((rect.Width - (float)Dimensions.Width * ratio)/2f, 
+                                       (rect.Height - (float)Dimensions.Height * ratio)/2f);
                                gr.Scale (ratio, ratio);
-                       else
+                                       
+                       }else
                                gr.Scale (widthRatio, heightRatio);
                        
                        using (ImageSurface imgSurf = new ImageSurface (image, Format.Argb32, 
index a2a04e0b37a8dfc39917ad6a9a1ed0e8d73ea3ec..42da7983016d6c64e90bd3deea98baa317e27d82 100644 (file)
@@ -119,10 +119,28 @@ namespace go
 \r
                        return tmp;\r
                }\r
-\r
-               public override void RegisterForLayouting (int layoutType)\r
+                       \r
+               protected override void OnLayoutChanges (LayoutingType layoutType)\r
                {\r
-                       base.RegisterForLayouting (layoutType);\r
+                       base.OnLayoutChanges (layoutType);\r
+\r
+                       //position smaller objects in group when group size is fit\r
+                       switch (layoutType) {\r
+                       case LayoutingType.Width:                               \r
+                               if (Width < 0) {\r
+                                       int crw = ClientRectangle.Width;\r
+                                       foreach (GraphicObject c in Children.Where(ch => ch.Slot.Width != crw))\r
+                                               c.RegisterForLayouting ((int)LayoutingType.X);                                          \r
+                               }\r
+                               break;\r
+                       case LayoutingType.Height:\r
+                               if (Height < 0) {\r
+                                       int crh = ClientRectangle.Height;\r
+                                       foreach (GraphicObject c in Children.Where(ch => ch.Slot.Height != crh))\r
+                                               c.RegisterForLayouting ((int)LayoutingType.Y);                                          \r
+                               }\r
+                               break;\r
+                       }\r
                }\r
 \r
                public override Rectangle ContextCoordinates(Rectangle r){\r
index 1e5332cad8576636d708523f202dc800a08068d8..27a766d2d25550a165fe1953d636fde76fb65a4b 100755 (executable)
@@ -35,6 +35,7 @@ namespace go
                bool _multiline = false;\r
                Color selColor;\r
                Color selFontColor;\r
+               bool _selectable;\r
                Point mouseLocalPos;    //mouse coord in widget space, filled only when clicked        \r
                int _currentCol;        //0 based cursor position in string\r
                int _currentLine;\r
@@ -66,6 +67,11 @@ namespace go
                                registerForGraphicUpdate ();\r
                        }\r
                }\r
+               [XmlAttributeAttribute()][DefaultValue(false)]\r
+               public virtual bool Selectable {\r
+                       get { return _selectable; }\r
+                       set { _selectable = value; }\r
+               }\r
 \r
         [XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]\r
                public Alignment TextAlignment\r
@@ -259,10 +265,15 @@ namespace go
                                                        te = tmp;\r
                                        }\r
                                        fe = gr.FontExtents;\r
-                                       size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lines.Count) + Margin*2);\r
+                                       int lc = lines.Count;\r
+                                       //ensure minimal height = text line height\r
+                                       if (lc == 0)\r
+                                               lc = 1; \r
+                                       size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lc) + Margin*2);\r
                                }\r
                        }\r
-            return size;// +borderWidth;\r
+\r
+            return size;;\r
         }\r
                protected override void onDraw (Context gr)\r
                {\r
@@ -402,7 +413,7 @@ namespace go
                        else\r
                                computeTextCursorPosition(gr);\r
 \r
-                       if (HasFocus)\r
+                       if (HasFocus && Selectable)\r
                        {\r
                                //TODO:\r
                                gr.Color = Foreground;\r
@@ -502,14 +513,16 @@ namespace go
                        if ((sender as OpenTKGameWindow).activeWidget != this)\r
                                return;\r
 \r
+                       if (!Selectable)\r
+                               return;\r
+                       \r
                        SelectionInProgress = true;\r
                        mouseLocalPos = e.Position - ScreenCoordinates(ClientRectangle).TopLeft;\r
                        registerForGraphicUpdate();\r
-\r
                }\r
                public override void onMouseButtonDown (object sender, MouseButtonEventArgs e)\r
                {\r
-                       if (this.HasFocus){\r
+                       if (this.HasFocus && Selectable){\r
                                mouseLocalPos = e.Position - ScreenCoordinates(ClientRectangle).TopLeft;\r
                                selBegin = -1;\r
                                selRelease = -1;\r
index 4696196667c46266c01355ce939f40fca123df02..4706effe42fceee7e2041b34e8dca0c41cefb230 100644 (file)
@@ -32,8 +32,7 @@ namespace go
                public Spinner (double minimum, double maximum, double step) : 
                base (minimum, maximum, step)
                {
-//                     butUp = new Button ();
-//                     butUp.setChild (new Image ("go.Image.Icons.updown.svg"));
+
                }
                public Spinner () : base()
                {