]> O.S.I.I.S - jp/crow.git/commitdiff
debug
authorjpbruyere <jp.bruyere@hotmail.com>
Thu, 25 Feb 2016 13:51:07 +0000 (14:51 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 25 Feb 2016 13:51:07 +0000 (14:51 +0100)
12 files changed:
Crow.csproj
Styles/Expandable.style
Styles/GroupBox.style
Styles/Label.style [new file with mode: 0644]
Templates/GroupBox.goml
Tests/GOLIBTests.cs
Tests/Interfaces/6.crow [new file with mode: 0755]
Tests/Interfaces/testGroupBox.goml
Tests/Tests.csproj
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/Label.cs

index fb12b57d748757d2b7c8b1d09bbe4af996eecd6b..146ffd1ae465954aae25a305c4de6fe9db46a72f 100644 (file)
     <EmbeddedResource Include="Styles\Expandable.style" />
     <EmbeddedResource Include="Styles\GroupBox.style" />
     <EmbeddedResource Include="Styles\ComboBox.style" />
+    <EmbeddedResource Include="Styles\Label.style" />
   </ItemGroup>
   <ItemGroup>
     <None Include="README.md" />
index 536e13dd0dd8bbecd4c14d3c698d03231a20ac09..a5be8e2a0071c89d7d05cba2f73d664875362b71 100644 (file)
@@ -1,2 +1,2 @@
 Focusable = true
-Background = DimGray
+Height = -1
index 536e13dd0dd8bbecd4c14d3c698d03231a20ac09..c65238fb38a1938a8e8c4396432f1092cc79e8f1 100644 (file)
@@ -1,2 +1,2 @@
-Focusable = true
-Background = DimGray
+
+
diff --git a/Styles/Label.style b/Styles/Label.style
new file mode 100644 (file)
index 0000000..d5b4138
--- /dev/null
@@ -0,0 +1 @@
+Fit = true
index 5b0424297c30acb8d52fe447f02a04974697c416..b00af82d6cea709cf14c91f35f48129880ede915 100755 (executable)
@@ -2,7 +2,7 @@
 <Group Height="{../HeightPolicy}" Width="{../WidthPolicy}">
        <Border CornerRadius="5" BorderWidth="1" Margin="6" Foreground="{../../Foreground}"
                Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
-               <Container Name="Content" Margin="10"
+               <Container Name="Content" Margin="10" MinimumSize="70;10"
                                Height="{../../../HeightPolicy}" Width="{../../../WidthPolicy}"/>
        </Border>
        <Label Text="{../../Caption}" VerticalAlignment="Top" Left="15"
index b46bcd7bcb6379c23d3c08a051e685cf7e0c92ef..2395b12d7ad7172d1696e07dad86b31d0fbb1033 100644 (file)
@@ -37,6 +37,8 @@ namespace test
                int frameCpt = 0;
                int idx = 0;
                string[] testFiles = {
+                       "6.crow",
+                       "testGroupBox.goml",
                        "1.crow",
                        "5.crow",
                        "testCheckbox.goml",
@@ -57,11 +59,9 @@ namespace test
                        "testPopper.goml",
                        "testTextBox.crow",
                        "testColorList.crow",
-
                        "4.crow",
                        "testSpinner.goml",
                        "testScrollbar.goml",
-                       "testGroupBox.goml",
                        "testGrid.goml",
                        "testButton.crow",
                        "testBorder.goml",
diff --git a/Tests/Interfaces/6.crow b/Tests/Interfaces/6.crow
new file mode 100755 (executable)
index 0000000..829c39f
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<VerticalStack Fit="true" Background="DimGray" Margin="5">
+<!--   <RadioButton/>-->
+       <Label Text="a" Width="0" Background="Red"/>
+       <Label Text="{fps}" HorizontalAlignment="Right" Background="LimeGreen"/>
+</VerticalStack>
index 6b14f829a04e46834a9b4e3cdca851f4a8a24d62..416bb217ea978d62db269340609dbd428deaa070 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
-<Container Background="vgradient|0:DarkGray|1:DimGray">
-       <GroupBox Width="200" Height="150" Background="vgradient|0:SteelBlue|1:Transparent"
-               Foreground="ogradient|0:White|1:Black">
-       <!--    <Label/>-->
+<!--<Container Background="vgradient|0:DarkGray|1:DimGray">-->
+       <GroupBox Fit="true" Background="vgradient|0:SteelBlue|1:Transparent"
+               Foreground="White">
+<!--           <Label/>-->
        </GroupBox>
-</Container>
+<!--</Container>-->
index 91ebc43a9e8bd3f9637da7153c27742e3126b0b3..a01a92af4bc38be4e4b775bcfc40fcaa9aa39f1f 100644 (file)
     <None Include="Interfaces\testTabView.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\6.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
index e8453937751a9e3dc880df0849d43af891fd7fae..be2bf0e77e680bdcfa72e7500fb133ca1f39cd03 100644 (file)
@@ -790,10 +790,7 @@ namespace Crow
                                if (Width > 0)
                                        Slot.Width = Width;
                                else if (Width < 0) {
-                                       int tmp = measureRawSize (LayoutingType.Width);
-                                       if (tmp < 0)
-                                               return false;
-                                       Slot.Width = tmp;
+                                       Slot.Width = measureRawSize (LayoutingType.Width);
                                }else if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Width))
                                        return false;
                                else
@@ -818,10 +815,7 @@ namespace Crow
                                if (Height > 0)
                                        Slot.Height = Height;
                                else if (Height < 0){
-                                       int tmp = measureRawSize (LayoutingType.Height);
-                                       if (tmp < 0)
-                                               return false;
-                                       Slot.Height = tmp;
+                                       Slot.Height = measureRawSize (LayoutingType.Height);
                                }else if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Height))
                                        return false;
                                else
index 6e2417a978f5c1b758e34897384a7cb2f9343253..887d9e22add9e31aac443b6254da6f6c3d6afa55 100644 (file)
@@ -4,6 +4,7 @@ using System.ComponentModel;
 using System.Xml.Serialization;
 using Cairo;
 using OpenTK.Input;
+using System.Diagnostics;
 
 
 namespace Crow
@@ -217,6 +218,9 @@ namespace Crow
                        maxChildrenHeight = 0;
                }
                void searchLargestChild(){
+                       #if DEBUG_LAYOUTING
+                       Debug.WriteLine("\tSearch largest child");
+                       #endif
                        largestChild = null;
                        maxChildrenWidth = 0;
                        for (int i = 0; i < Children.Count; i++) {
@@ -231,6 +235,9 @@ namespace Crow
                        }
                }
                void searchTallestChild(){
+                       #if DEBUG_LAYOUTING
+                       Debug.WriteLine("\tSearch tallest child");
+                       #endif
                        tallestChild = null;
                        maxChildrenHeight = 0;
                        for (int i = 0; i < Children.Count; i++) {
index ad6549a1852ec0b0d14e4ef2f5916eb539950a93..6782e259a24ef3498189695de7f6b42f9e646e42 100644 (file)
@@ -12,6 +12,7 @@ using OpenTK.Input;
 namespace Crow
 {
     [Serializable]
+       [DefaultStyle("#Crow.Styles.Label.style")]
     public class Label : GraphicObject
     {
                #region CTOR
@@ -308,17 +309,6 @@ namespace Crow
                        NotifyValueChanged ("Text", Text);
                }
                #region GraphicObject overrides
-               [XmlAttributeAttribute()][DefaultValue(-1)]
-               public override int Width {
-                       get { return base.Width; }
-                       set { base.Width = value; }
-               }
-               [XmlAttributeAttribute()][DefaultValue(-1)]
-               public override int Height {
-                       get { return base.Height; }
-                       set { base.Height = value; }
-               }
-
                protected override int measureRawSize(LayoutingType lt)
         {                      
                        if (lines == null)