ui/wpf/UIcore/Container.cs

changeset 136
1df2fb3d079c
parent 135
b9dc9cdfa23a
child 138
d781436e2490
equal deleted inserted replaced
135:b9dc9cdfa23a 136:1df2fb3d079c
19 { 19 {
20 public bool? Fill { get; set; } 20 public bool? Fill { get; set; }
21 public bool Hexpand { get; set; } 21 public bool Hexpand { get; set; }
22 public bool Vexpand { get; set; } 22 public bool Vexpand { get; set; }
23 public bool NewLine { get; set; } 23 public bool NewLine { get; set; }
24 public int GridWidth { get; set; }
24 25
25 public Layout() 26 public Layout()
26 { 27 {
27 Reset(); 28 Reset();
28 } 29 }
41 { 42 {
42 Fill = null; 43 Fill = null;
43 Hexpand = false; 44 Hexpand = false;
44 Vexpand = false; 45 Vexpand = false;
45 NewLine = false; 46 NewLine = false;
47 GridWidth = 1;
46 } 48 }
47 } 49 }
48 50
49 public enum BoxOrientation 51 public enum BoxOrientation
50 { 52 {
238 if(Layout.Vexpand) 240 if(Layout.Vexpand)
239 { 241 {
240 row.Height = new GridLength(1, GridUnitType.Star); 242 row.Height = new GridLength(1, GridUnitType.Star);
241 } 243 }
242 244
245 int gridwidth = Layout.GridWidth;
246 if(gridwidth > 1)
247 {
248 gridwidth++;
249 }
250
243 Grid.SetColumn(control, X); 251 Grid.SetColumn(control, X);
244 Grid.SetRow(control, Y); 252 Grid.SetRow(control, Y);
253 Grid.SetColumnSpan(control, gridwidth);
245 Children.Add(control); 254 Children.Add(control);
246 255
247 Layout.Reset(); 256 Layout.Reset();
248 X++; 257 X += gridwidth;
249 } 258 }
250 } 259 }
251 } 260 }

mercurial