diff -r 6a6718269c22 -r 3efe0210e27e ui/wpf/UIcore/Container.cs --- a/ui/wpf/UIcore/Container.cs Wed Jan 20 17:37:52 2016 +0100 +++ b/ui/wpf/UIcore/Container.cs Thu Jan 21 20:40:14 2016 +0100 @@ -161,10 +161,17 @@ private int CurrentWidth = 0; private int CurrentHeight = 0; + private int ColSpacing; + private int RowSpacing; + public GridContainer(Container parent, int margin, int colspacing, int rowspacing) : base() { Layout = new Layout(); + Margin = new Thickness(margin); + ColSpacing = colspacing; + RowSpacing = rowspacing; + parent.Add(this, true); } @@ -178,20 +185,47 @@ ColumnDefinition col; RowDefinition row; + bool getcol = false; if(X >= CurrentWidth) { + if (ColSpacing > 0 && X != 0) + { + ColumnDefinition spaceCol = new ColumnDefinition(); + spaceCol.Width = new GridLength(ColSpacing, GridUnitType.Pixel); + ColumnDefinitions.Add(spaceCol); + X++; + } + col = new ColumnDefinition(); col.Width = GridLength.Auto; ColumnDefinitions.Add(col); + CurrentWidth = X + 1; } else { + if (ColSpacing > 0 && X % 2 > 0) + { + X++; + } + col = ColumnDefinitions.ElementAt(X); + } + + if(getcol) + { col = ColumnDefinitions.ElementAt(X); } if (Y >= CurrentHeight) { + if (RowSpacing > 0 && Y != 0) + { + RowDefinition spaceRow = new RowDefinition(); + spaceRow.Height = new GridLength(RowSpacing, GridUnitType.Pixel); + RowDefinitions.Add(spaceRow); + Y++; + } + row = new RowDefinition(); row.Height = GridLength.Auto; RowDefinitions.Add(row);