From: Jean-Philippe Bruyère Date: Tue, 30 Jan 2018 15:25:41 +0000 (+0100) Subject: test appveyor X-Git-Tag: v0.9.5-beta~193 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=eed1c7a49ada2b8146083b14ad2b568d503291af;p=jp%2Fcrow.git test appveyor --- diff --git a/appveyor.yml b/appveyor.yml index 358d2b61..42519fab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ branches: clone_depth: 1 before_build: -- cmd: nuget restore +- cmd: nuget restore Crow.sln build_script: - set path=%path%;C:\Program Files (x86)\Mono\bin diff --git a/src/GraphicObjects/WrappedWidgetGroup.cs b/src/GraphicObjects/WrappedWidgetGroup.cs deleted file mode 100755 index fa033b5e..00000000 --- a/src/GraphicObjects/WrappedWidgetGroup.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; -using OpenTK.Graphics.OpenGL; -using System.Diagnostics; - -namespace go -{ - public class WrappedWidgetGroup : Group - { - - public int widgetSpacing = 2; - - public Orientation Orientation = Orientation.Horizontal; - - - public WrappedWidgetGroup() - : base() - { - BorderWidth = 0; - } - - int currentXForWidget = 0; - int currentYForWidget = 0; - - int highestWidget = 0; - int largestWidget = 0; - - - public override void UpdateLayout() - { - //while (!layoutIsValid) - //{ - //if (!(sizeIsValid && positionIsValid)) - base.UpdateLayout(); - - //if (!base.layoutIsValid) - // return; - - currentXForWidget = ClientRectangle.X; - currentYForWidget = ClientRectangle.Y; - - highestWidget = 0; - largestWidget = 0; - - Rectangle contentBounds = Rectangle.Zero; - - GraphicObject[] widgets = new GraphicObject[Children.Count]; - Children.CopyTo(widgets); - foreach (GraphicObject w in widgets) - { - if (w.renderBounds.Width > largestWidget) - largestWidget = w.renderBounds.Width; - if (w.renderBounds.Height > highestWidget) - highestWidget = w.renderBounds.Height; - - if (!enoughtSpaceForWidget(w)) - advance(w); - - if (enoughtSpaceForWidget(w)) - { - w.renderBounds.X = currentXForWidget; - w.renderBounds.Y = currentYForWidget; - - w.positionIsValid = true; - - contentBounds += w.renderBounds; - - advance(w); - } - else - break; - } - - contentBounds.Width += BorderWidth + Margin; - contentBounds.Height += BorderWidth + Margin; - - if (SizeToContent) - renderBounds.Size = contentBounds.Size; - else if (VerticalScrolling) - renderBounds.Size = new Size(renderBounds.Size.Width, contentBounds.Size.Height); - else if (HorizontalScrolling) - renderBounds.Size = new Size(contentBounds.Size.Width, renderBounds.Size.Height); - - if (layoutIsValid) - registerForRedraw(); - } - - - bool enoughtSpaceForWidget(GraphicObject w) - { - int nextXForWidget = 0; - int nextYForWidget = 0; - - if (Orientation == Orientation.Horizontal) - nextXForWidget = currentXForWidget + w.renderBounds.Width; - else - nextYForWidget = nextYForWidget + w.renderBounds.Height; - - if (!SizeToContent) - { - if (nextXForWidget > ClientRectangle.Right && !HorizontalScrolling) - return false; - if (currentYForWidget > ClientRectangle.Bottom && !VerticalScrolling) - return false; - } - return true; - } - void advance(GraphicObject w) - { - if (Orientation == Orientation.Horizontal) - { - //if (w is LabelWidget) - // Debugger.Break(); - currentXForWidget = currentXForWidget + widgetSpacing + w.renderBounds.Width; - } - else - currentYForWidget = currentYForWidget + widgetSpacing + w.renderBounds.Height; - - if (!SizeToContent) - { - if (currentXForWidget > ClientRectangle.Right && !HorizontalScrolling) - { - if (Orientation == Orientation.Vertical) - { - //not scrolling - } - else - { - currentXForWidget = ClientRectangle.X; - currentYForWidget += widgetSpacing + highestWidget; - highestWidget = 0; - } - } - if (currentYForWidget > ClientRectangle.Bottom && !VerticalScrolling) - { - if (Orientation == Orientation.Horizontal) - { - //not scrolling - } - else - { - currentXForWidget += widgetSpacing + largestWidget; - currentYForWidget = ClientRectangle.Y; - largestWidget = 0; - } - - } - } - } - } -}