From ea355fe15d538b1d1dca230aa816a99556013924 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Sat, 23 Apr 2016 14:16:33 +0200 Subject: [PATCH] update test before changes --- Crow.csproj | 8 +- OTKCrow/OpenTKGameWindow.cs | 6 +- Templates/ComboBox.goml | 6 +- Templates/Window.goml | 7 +- Tests/GOLIBTestsOTK.cs | 69 +---- Tests/Interfaces/2.crow | 2 +- Tests/Interfaces/Container/0.crow | 5 + Tests/Interfaces/Container/1.crow | 5 + Tests/Interfaces/Container/2.crow | 5 + Tests/Interfaces/GraphicObject/0.crow | 3 + Tests/Interfaces/GraphicObject/1.crow | 3 + Tests/Interfaces/GraphicObject/2.crow | 3 + Tests/Interfaces/GraphicObject/4.crow | 377 ++++++++++++++++++++++++++ Tests/Interfaces/GraphicObject/5.crow | 10 + Tests/Interfaces/GraphicObject/6.crow | 6 + Tests/Interfaces/GraphicObject/7.crow | 46 ++++ Tests/Interfaces/Stack/0.crow | 9 + Tests/Interfaces/Stack/1.crow | 9 + Tests/Interfaces/Stack/2.crow | 9 + Tests/Interfaces/Stack/3.crow | 9 + Tests/Interfaces/basicTests/5.1.crow | 10 + Tests/Interfaces/basicTests/6.crow | 2 +- Tests/Interfaces/colorItem.crow | 2 +- Tests/Interfaces/testCombobox.goml | 6 +- Tests/Interfaces/testImage.crow | 10 +- Tests/Tests.csproj | 37 ++- src/GraphicObjects/GenericStack.cs | 2 + src/GraphicObjects/GraphicObject.cs | 89 +++--- 28 files changed, 632 insertions(+), 123 deletions(-) create mode 100755 Tests/Interfaces/Container/0.crow create mode 100755 Tests/Interfaces/Container/1.crow create mode 100755 Tests/Interfaces/Container/2.crow create mode 100755 Tests/Interfaces/GraphicObject/0.crow create mode 100755 Tests/Interfaces/GraphicObject/1.crow create mode 100755 Tests/Interfaces/GraphicObject/2.crow create mode 100755 Tests/Interfaces/GraphicObject/4.crow create mode 100755 Tests/Interfaces/GraphicObject/5.crow create mode 100755 Tests/Interfaces/GraphicObject/6.crow create mode 100755 Tests/Interfaces/GraphicObject/7.crow create mode 100755 Tests/Interfaces/Stack/0.crow create mode 100755 Tests/Interfaces/Stack/1.crow create mode 100755 Tests/Interfaces/Stack/2.crow create mode 100755 Tests/Interfaces/Stack/3.crow create mode 100755 Tests/Interfaces/basicTests/5.1.crow diff --git a/Crow.csproj b/Crow.csproj index a9a61f18..28e935da 100644 --- a/Crow.csproj +++ b/Crow.csproj @@ -23,18 +23,24 @@ Crow project description 4194304 0.4 + 8.0.30703 + 2.0 true full true - DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 + DEBUG_FOCUS0;DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0 false + $(SolutionDir)\build\obj\$(Configuration) + $(SolutionDir)\build\$(Configuration) True None __linux__;MEASURE_TIME + $(SolutionDir)\build\obj\$(Configuration) + $(SolutionDir)\build\$(Configuration) diff --git a/OTKCrow/OpenTKGameWindow.cs b/OTKCrow/OpenTKGameWindow.cs index efe0d941..0b5c8543 100644 --- a/OTKCrow/OpenTKGameWindow.cs +++ b/OTKCrow/OpenTKGameWindow.cs @@ -190,6 +190,7 @@ namespace Crow GL.Disable (EnableCap.DepthTest); shader.Enable (); + GL.ActiveTexture (TextureUnit.Texture0); GL.BindTexture (TextureTarget.Texture2D, texID); lock (CrowInterface.RenderMutex) { if (CrowInterface.IsDirty) { @@ -284,6 +285,7 @@ namespace Crow this.ClientRectangle.Width, this.ClientRectangle.Height)); createContext (); + GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height); } #endregion @@ -319,12 +321,12 @@ namespace Crow #region keyboard Handling void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e) { - if (!CrowInterface.ProcessKeyDown((int)otk_e.Key)) + //if (!CrowInterface.ProcessKeyDown((int)otk_e.Key)) KeyboardKeyDown.Raise (this, otk_e); } void Keyboard_KeyUp(object sender, OpenTK.Input.KeyboardKeyEventArgs otk_e) { - if (!CrowInterface.ProcessKeyUp((int)otk_e.Key)) + //if (!CrowInterface.ProcessKeyUp((int)otk_e.Key)) KeyboardKeyUp.Raise (this, otk_e); } void OpenTKGameWindow_KeyPress (object sender, OpenTK.KeyPressEventArgs e) diff --git a/Templates/ComboBox.goml b/Templates/ComboBox.goml index a114bed8..d7b2cab5 100755 --- a/Templates/ComboBox.goml +++ b/Templates/ComboBox.goml @@ -16,12 +16,12 @@ diff --git a/Templates/Window.goml b/Templates/Window.goml index 6de66383..3acb51ab 100755 --- a/Templates/Window.goml +++ b/Templates/Window.goml @@ -1,9 +1,12 @@  - + - + - + \ No newline at end of file diff --git a/Tests/Interfaces/Container/0.crow b/Tests/Interfaces/Container/0.crow new file mode 100755 index 00000000..eec3a76f --- /dev/null +++ b/Tests/Interfaces/Container/0.crow @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/Tests/Interfaces/Container/1.crow b/Tests/Interfaces/Container/1.crow new file mode 100755 index 00000000..274d9063 --- /dev/null +++ b/Tests/Interfaces/Container/1.crow @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/Tests/Interfaces/Container/2.crow b/Tests/Interfaces/Container/2.crow new file mode 100755 index 00000000..c619cb73 --- /dev/null +++ b/Tests/Interfaces/Container/2.crow @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/Tests/Interfaces/GraphicObject/0.crow b/Tests/Interfaces/GraphicObject/0.crow new file mode 100755 index 00000000..6185bd71 --- /dev/null +++ b/Tests/Interfaces/GraphicObject/0.crow @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/Tests/Interfaces/GraphicObject/1.crow b/Tests/Interfaces/GraphicObject/1.crow new file mode 100755 index 00000000..262fc24e --- /dev/null +++ b/Tests/Interfaces/GraphicObject/1.crow @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/Tests/Interfaces/GraphicObject/2.crow b/Tests/Interfaces/GraphicObject/2.crow new file mode 100755 index 00000000..dfd10ab7 --- /dev/null +++ b/Tests/Interfaces/GraphicObject/2.crow @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/Tests/Interfaces/GraphicObject/4.crow b/Tests/Interfaces/GraphicObject/4.crow new file mode 100755 index 00000000..f696a9ec --- /dev/null +++ b/Tests/Interfaces/GraphicObject/4.crow @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/GraphicObject/5.crow b/Tests/Interfaces/GraphicObject/5.crow new file mode 100755 index 00000000..4922474a --- /dev/null +++ b/Tests/Interfaces/GraphicObject/5.crow @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Tests/Interfaces/GraphicObject/6.crow b/Tests/Interfaces/GraphicObject/6.crow new file mode 100755 index 00000000..c37ca360 --- /dev/null +++ b/Tests/Interfaces/GraphicObject/6.crow @@ -0,0 +1,6 @@ + + + + diff --git a/Tests/Interfaces/GraphicObject/7.crow b/Tests/Interfaces/GraphicObject/7.crow new file mode 100755 index 00000000..d8e9cd38 --- /dev/null +++ b/Tests/Interfaces/GraphicObject/7.crow @@ -0,0 +1,46 @@ + + + diff --git a/Tests/Interfaces/Stack/0.crow b/Tests/Interfaces/Stack/0.crow new file mode 100755 index 00000000..a178d8cc --- /dev/null +++ b/Tests/Interfaces/Stack/0.crow @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/Stack/1.crow b/Tests/Interfaces/Stack/1.crow new file mode 100755 index 00000000..c2423ef1 --- /dev/null +++ b/Tests/Interfaces/Stack/1.crow @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/Stack/2.crow b/Tests/Interfaces/Stack/2.crow new file mode 100755 index 00000000..5f23a7d4 --- /dev/null +++ b/Tests/Interfaces/Stack/2.crow @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/Stack/3.crow b/Tests/Interfaces/Stack/3.crow new file mode 100755 index 00000000..0c3987fa --- /dev/null +++ b/Tests/Interfaces/Stack/3.crow @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/basicTests/5.1.crow b/Tests/Interfaces/basicTests/5.1.crow new file mode 100755 index 00000000..7a862758 --- /dev/null +++ b/Tests/Interfaces/basicTests/5.1.crow @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Tests/Interfaces/basicTests/6.crow b/Tests/Interfaces/basicTests/6.crow index 829c39f4..c37ca360 100755 --- a/Tests/Interfaces/basicTests/6.crow +++ b/Tests/Interfaces/basicTests/6.crow @@ -1,6 +1,6 @@  - diff --git a/Tests/Interfaces/colorItem.crow b/Tests/Interfaces/colorItem.crow index c096e77a..3c30a052 100755 --- a/Tests/Interfaces/colorItem.crow +++ b/Tests/Interfaces/colorItem.crow @@ -1,7 +1,7 @@  diff --git a/Tests/Interfaces/testCombobox.goml b/Tests/Interfaces/testCombobox.goml index a87b10f3..0c72cf0e 100755 --- a/Tests/Interfaces/testCombobox.goml +++ b/Tests/Interfaces/testCombobox.goml @@ -1,5 +1,5 @@  - - + - \ No newline at end of file + \ No newline at end of file diff --git a/Tests/Interfaces/testImage.crow b/Tests/Interfaces/testImage.crow index 83d9de6a..46ffdcb6 100755 --- a/Tests/Interfaces/testImage.crow +++ b/Tests/Interfaces/testImage.crow @@ -2,8 +2,8 @@ - + \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 3f808727..143f80be 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -62,12 +62,6 @@ - - Interfaces\testContainer.goml.cs - - - Interfaces\test_stack.goml.cs - @@ -283,11 +277,42 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 455ed928..dd385201 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -218,6 +218,8 @@ namespace Crow { base.OnChildLayoutChanges (sender, arg); + GraphicObject go = sender as GraphicObject; + switch (arg.LayoutType) { case LayoutingType.Width: if (Orientation == Orientation.Horizontal) { diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 4e230d4f..e4d17351 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -747,7 +747,7 @@ namespace Crow if (Left == 0) { if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Width) || - RegisteredLayoutings.HasFlag (LayoutingType.Width)) + RegisteredLayoutings.HasFlag (LayoutingType.Width)) return false; switch (HorizontalAlignment) { @@ -763,21 +763,12 @@ namespace Crow } } else Slot.X = Left; - - if (LastSlots.X == Slot.X) - break; - - bmp = null; - - OnLayoutChanges (layoutType); - - LastSlots.X = Slot.X; break; case LayoutingType.Y: if (Top == 0) { if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Height) || - RegisteredLayoutings.HasFlag (LayoutingType.Height)) + RegisteredLayoutings.HasFlag (LayoutingType.Height)) return false; switch (VerticalAlignment) { @@ -791,17 +782,8 @@ namespace Crow Slot.Y = Parent.ClientRectangle.Height / 2 - Slot.Height / 2; break; } - }else + } else Slot.Y = Top; - - if (LastSlots.Y == Slot.Y) - break; - - bmp = null; - - OnLayoutChanges (layoutType); - - LastSlots.Y = Slot.Y; break; case LayoutingType.Width: if (Width.IsFixed) @@ -813,7 +795,7 @@ namespace Crow else if (Width == Measure.Stretched) Slot.Width = Parent.ClientRectangle.Width; else - Slot.Width = (int)Math.Round((double)(Parent.ClientRectangle.Width * Width) / 100.0); + Slot.Width = (int)Math.Round ((double)(Parent.ClientRectangle.Width * Width) / 100.0); if (Slot.Width < 0) return false; @@ -826,15 +808,6 @@ namespace Crow Slot.Width = MaximumSize.Width; NotifyValueChanged ("WidthPolicy", Measure.Stretched); } - - if (LastSlots.Width == Slot.Width) - break; - - bmp = null; - - OnLayoutChanges (layoutType); - - LastSlots.Width = Slot.Width; break; case LayoutingType.Height: if (Height.IsFixed) @@ -846,7 +819,7 @@ namespace Crow else if (Height == Measure.Stretched) Slot.Height = Parent.ClientRectangle.Height; else - Slot.Height = (int)Math.Round((double)(Parent.ClientRectangle.Height * Height) / 100.0); + Slot.Height = (int)Math.Round ((double)(Parent.ClientRectangle.Height * Height) / 100.0); if (Slot.Height < 0) return false; @@ -859,23 +832,61 @@ namespace Crow Slot.Height = MaximumSize.Height; NotifyValueChanged ("HeightPolicy", Measure.Stretched); } + break; + } - if (LastSlots.Height == Slot.Height) + updateSlot (layoutType); + + //if no layouting remains in queue for item, registre for redraw + if (this.registeredLayoutings == LayoutingType.None && bmp == null) + this.AddToRedrawList (); + + return true; + } + protected void updateSlot(LayoutingType layoutType) + { + switch (layoutType) { + case LayoutingType.X: + if (LastSlots.X == Slot.X) break; bmp = null; OnLayoutChanges (layoutType); - LastSlots.Height = Slot.Height; + LastSlots.X = Slot.X; break; - } + case LayoutingType.Y: + if (LastSlots.Y == Slot.Y) + break; - //if no layouting remains in queue for item, registre for redraw - if (this.registeredLayoutings == LayoutingType.None && bmp == null) - this.AddToRedrawList (); + bmp = null; - return true; + OnLayoutChanges (layoutType); + + LastSlots.Y = Slot.Y; + break; + case LayoutingType.Width: + if (LastSlots.Width == Slot.Width) + break; + + bmp = null; + + OnLayoutChanges (layoutType); + + LastSlots.Width = Slot.Width; + break; + case LayoutingType.Height: + if (LastSlots.Height == Slot.Height) + break; + + bmp = null; + + OnLayoutChanges (layoutType); + + LastSlots.Height = Slot.Height; + break; + } } #endregion -- 2.47.3