]> O.S.I.I.S - jp/crow.git/commitdiff
Removed Sizing coherence check in RegisterForLayouting, check occuring during templat...
authorjpbruyere <jp.bruyere@hotmail.com>
Thu, 24 Dec 2015 12:37:55 +0000 (13:37 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 24 Dec 2015 12:37:55 +0000 (13:37 +0100)
debug

12 files changed:
GOLib.csproj
Templates/Scrollbar.goml
Tests/GOLIBTests.cs
Tests/Interfaces/testScrollbar.goml
Tests/Interfaces/testWindow2.goml
Tests/Interfaces/testWindow3.goml
Tests/Interfaces/test_Listbox.goml
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/ListBox.cs
src/GraphicObjects/Scrollbar.cs
src/GraphicObjects/Scroller.cs
src/GraphicObjects/TemplatedControl.cs

index 35bd69dc7dcbf736511cadc60126aa4df157e5a3..647e8782e7a0d014b9cfcee7342c047c4fdb9e9d 100644 (file)
@@ -46,7 +46,7 @@
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <OutputPath>bin\Debug</OutputPath>\r
-    <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME;DEBUG_LAYOUTING</DefineConstants>\r
+    <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING;DEBUG_BINDING</DefineConstants>\r
   </PropertyGroup>\r
   <!--  <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">\r
     <DefineConstants>__linux__</DefineConstants>\r
index 08d33a95e339bb07e956534722ea171908d37d18..f8d7c5bab8e8bc65e463a2d1ce4dbd1622567882 100755 (executable)
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray">\r
-       <GenericStack Orientation="{../../Orientation}" Width="0" Height="0">\r
+<Border BorderWidth="1" BorderColor="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">\r
+       <GenericStack Orientation="{../../Orientation}" Width="{../../TemplatedWidth}" Height="{../../TemplatedHeight}">\r
                <Button Width="12" Height="12" MouseClick="../../../onScrollBack">\r
                        <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>\r
                </Button>\r
                <Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}" \r
-                       Width="{../../../Width}" Height="{../../../Height}" Orientation="{../../../Orientation}"\r
+                       Width="{../../../TemplatedWidth}" Height="{../../../TemplatedHeight}" Orientation="{../../../Orientation}"\r
                        ValueChanged="../../../onSliderValueChange"/>\r
                <Button Width="12" Height="12" MouseClick="../../../onScrollForth">\r
                        <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
index 794811cb42904a895927a7100d89aa31fc562a8e..36bec18df742e8754792d4e591d6a9818b3b0e29 100644 (file)
@@ -36,6 +36,7 @@ namespace test
                int frameCpt = 0;\r
                int idx = 0;\r
                string[] testFiles = {\r
+//                     "testCombobox.goml",\r
                        "testWindow3.goml",\r
                        "testExpandable.goml",\r
                        "testPopper.goml",\r
@@ -46,7 +47,6 @@ namespace test
                        "testWindow.goml",\r
                        "testWindow2.goml",\r
 //                     "testSpinner.goml",\r
-//                     "test_Listbox.goml",\r
                        "test4.goml",\r
                        "testRadioButton2.goml",\r
                        "testContainer.goml",\r
@@ -57,7 +57,8 @@ namespace test
                        "testMsgBox.goml",\r
                        "testGrid.goml",\r
                        "testMeter.goml",\r
-//                     "testCombobox.goml",\r
+                       "testScrollbar.goml",\r
+                       "test_Listbox.goml",\r
                };\r
 \r
                #region FPS\r
index aa70255dffad12c3e78a3eb01b035441086254b9..b0390f1061d5cdd2c27aaee1c40dd341d0eb3f29 100755 (executable)
@@ -2,5 +2,5 @@
 <Group Name="TopContainer" Width="400" Height="400"\r
        Focusable="True" Background="Gray">\r
 \r
-       <Scrollbar Orientation="Vertical" Width="16"></Scrollbar>\r
+       <Scrollbar Height="0" Orientation="Vertical" Width="16"/>\r
 </Group>
\ No newline at end of file
index b336a9dc0648100d5e57be6406f62929ae09b49c..999c68e46590113e08aeaffdaead3bea5f1ca778 100755 (executable)
@@ -1,45 +1,26 @@
 <?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,8" \r
        Focusable="True"  CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">\r
        <Template>\r
-               <Border BorderWidth="1" BorderColor="White" Margin="0" CornerRadius="20">\r
-                       <VerticalStack Margin="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" Focusable="false" >\r
-                                               <GraphicObject Width="5" Height="0"/>\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
+               <Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+                       <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
+                               <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1" \r
+                                               Background="0,1;0,5;1,0;0,5">\r
+                                       <HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >\r
+                                               <GraphicObject Width="5"/>\r
+                                               <Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>\r
+                                               <Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />\r
+                                               <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent"  Height="12" Width="12"\r
                                                        MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
                                                        <Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#go.Images.Icons.exit2.svg"\r
-                                                                MouseClick="butQuitPress"/>\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" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
                        </VerticalStack>\r
                </Border>\r
        </Template>\r
-       <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">\r
-               <Slider Name="slider" Height="10" Width="0"/>\r
-\r
-               <HorizontalStack Width="-1" Height="-1" Margin="0" Background="Red">\r
-                       <Checkbox Height="-1" Width="100"/>\r
-                       <Checkbox Height="-1" Width="100"/>\r
-               </HorizontalStack>\r
-               <GroupBox Title="test"  Height="-1" Width="-1" Margin="5">\r
-                       <VerticalStack  Height="-1" Width="-1">\r
-                               <RadioButton  Caption="Radio 1"/>\r
-                               <RadioButton  Caption="Radio 2" IsChecked="true"/>\r
-                               <RadioButton  Caption="Radio 3"/>\r
-                       </VerticalStack>\r
-               </GroupBox>\r
-<!--           <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
-       </VerticalStack>\r
+       <GraphicObject Height="50" Width="50" Background="Green"/>\r
 </Window>\r
-<!--</Group>-->\r
-<!--           <Label Text="{fps}"  Background="DarkRed"/>\r
-               <Label Text="{fpsMin}"  />\r
-               <Label Text="{fpsMax}"  />-->
\ No newline at end of file
index 13495b1ba4e0ca8562b86da0257170473ee54d6b..0c846b153d4ebd637b31856edb6f4e49747f7457 100755 (executable)
@@ -1,11 +1,11 @@
 <?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,8" \r
        Focusable="True"  CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">\r
        <Template>\r
                <Container Margin="20" Name="Content" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
        </Template>\r
        <Group Background="Green">\r
-               <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>     \r
+<!--           <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>-->\r
+               <Scrollbar Orientation="Vertical" Height="0" Width="10" Background="Blue" Margin="0" HorizontalAlignment="Right"/>\r
        </Group>\r
 </Window>\r
index 33380cb902e720f96cb7a40c749bd552d3375cf2..b77ffcecab740adfca4d1bdcd1255f1265d62124 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>\r
 <!--<ListBox Data="{TestList}" Focusable="true"/>-->\r
 <ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"\r
-                        HorizontalAlignment="Left" Width="0" Height="0" Margin="5">\r
+                        HorizontalAlignment="Center" Width="-1" Height="150" Margin="5">\r
        <Template>\r
                <Border BorderWidth="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
                        <HorizontalStack Margin="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
index 4c68236d21211427b3f0948a91d144ea95d0e15f..5f919e64f0cb4e59b6d8a072049b25d0cba641be 100644 (file)
@@ -503,8 +503,8 @@ namespace go
 \r
                                        //force sizing to fit if parent is sizing on children and \r
                                        //this object has stretched size\r
-                                       if (Parent.getBounds ().Width < 0 && Width == 0)\r
-                                               Width = -1;\r
+//                                     if (Parent.getBounds ().Width < 0 && Width == 0)\r
+//                                             Width = -1;\r
                                \r
                                        if (Bounds.Width == 0) //stretch in parent\r
                                                Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
@@ -517,8 +517,8 @@ namespace go
                                if ((layoutType & (int)LayoutingType.Height) > 0) {\r
 \r
                                        //force sizing to fit if parent is sizing on children\r
-                                       if (Parent.getBounds ().Height < 0 && Height == 0)\r
-                                               Height = -1;\r
+//                                     if (Parent.getBounds ().Height < 0 && Height == 0)\r
+//                                             Height = -1;\r
 \r
                                        if (Bounds.Height == 0) //stretch in parent\r
                                                Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
@@ -594,7 +594,7 @@ namespace go
                /// <summary> Update layout component, this is where the computation of alignement\r
                /// and size take place </summary>\r
                public virtual void UpdateLayout (LayoutingType layoutType)\r
-               {                       \r
+               {               \r
                        switch (layoutType) {\r
                        case LayoutingType.X:\r
                                if (Bounds.X == 0) {\r
@@ -646,7 +646,7 @@ namespace go
 \r
                                LastSlots.Y = Slot.Y;\r
                                break;\r
-                       case LayoutingType.Width:                               \r
+                       case LayoutingType.Width:\r
                                if (Width > 0)\r
                                        Slot.Width = Width;\r
                                else if (Width < 0)\r
@@ -848,6 +848,9 @@ namespace go
                #region Binding\r
                public virtual void ResolveBindings()\r
                {\r
+                       #if DEBUG_BINDING\r
+                       Debug.WriteLine ("ResolveBinding => " + this.ToString ());\r
+                       #endif\r
                        List<Binding> resolved = new List<Binding> ();\r
                        foreach (Binding b in Bindings) {\r
                                if (!string.IsNullOrEmpty (b.DynMethodId))\r
index 1778e3403991de993d0ac1acfa726f33739f0259..ee9fb49d5ed52ca7be870d32fe432dd12665c9d4 100644 (file)
@@ -70,7 +70,7 @@ namespace go
                public object SelectedItem{
                        get { return data == null ? null : data[_selectedIndex]; }
                }
-               [XmlAttributeAttribute][DefaultValue(null)]
+               [XmlAttributeAttribute]//[DefaultValue(null)]
                public IList Data {
                        get {
                                return data;
index cb9e2aa8b8b8771bd00dd849b7a84d185060c80f..8e3b2db5c277f49cfb07b3e3b2c442bd77d71027 100644 (file)
@@ -90,5 +90,10 @@ namespace go
                        Scroll = Convert.ToDouble(e.NewValue);\r
                }\r
 \r
+               public override void OnLayoutChanges (LayoutingType layoutType)\r
+               {\r
+                       OpenTKGameWindow.currentWindow.CursorVisible = true;\r
+                       base.OnLayoutChanges (layoutType);\r
+               }\r
        }\r
 }\r
index 3f78b598db93298af52dfa7fe1fc05e9bd509c67..29c3b5061994dac68a197012e2e21e644a3bf7ea 100644 (file)
@@ -156,9 +156,9 @@ namespace go
                #region Mouse handling\r
                public override bool MouseIsIn (Point m)\r
                {                       \r
-                       Debug.WriteLine ("Mouse in scroller: {0} scr coord:{1} mouse:{2}",\r
-                               base.ScreenCoordinates (Slot).ContainsOrIsEqual (m),\r
-                               base.ScreenCoordinates (Slot), m);\r
+//                     Debug.WriteLine ("Mouse in scroller: {0} scr coord:{1} mouse:{2}",\r
+//                             base.ScreenCoordinates (Slot).ContainsOrIsEqual (m),\r
+//                             base.ScreenCoordinates (Slot), m);\r
 \r
                        return Visible ? base.ScreenCoordinates(Slot).ContainsOrIsEqual (m) : false; \r
                }\r
index fc1a61f2f4e7b36c22ce5efd951f7c039d57e9f3..32c75a5cf242d74d39c9ca303f9dc96d4452d117 100644 (file)
@@ -95,9 +95,7 @@ namespace go
                }
 
                protected override void loadDefaultValues ()
-               {
-//                     if (child == null)//trigger loading of default template if child is empty
-//                             loadTemplate ();
+               {                       
                        base.loadDefaultValues ();
                }
                public override GraphicObject FindByName (string nameToFind)