Mercurial > projects > dwt-addons
comparison dwtx/ui/forms/widgets/TableWrapLayout.d @ 85:56fea7e5f0f9
Fix some runtime errors
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 20 Jun 2008 14:48:17 +0200 |
parents | 5d489b9f966c |
children | 04b47443bb01 |
comparison
equal
deleted
inserted
replaced
83:028aedd523ad | 85:56fea7e5f0f9 |
---|---|
337 td.compWidth = cwidth; | 337 td.compWidth = cwidth; |
338 if (td.heightHint !is DWT.DEFAULT) { | 338 if (td.heightHint !is DWT.DEFAULT) { |
339 size = new Point(size.x, td.heightHint); | 339 size = new Point(size.x, td.heightHint); |
340 } | 340 } |
341 td.compSize = size; | 341 td.compSize = size; |
342 RowSpan rowspan = cast(RowSpan) rowspans.get(child); | 342 RowSpan rowspan = rowspans.containsKey(child) ? cast(RowSpan) rowspans.get(child) : null; |
343 if (rowspan is null) { | 343 if (rowspan is null) { |
344 rowHeights[i] = Math.max(rowHeights[i], size.y); | 344 rowHeights[i] = Math.max(rowHeights[i], size.y); |
345 } else | 345 } else |
346 rowspan.height = size.y; | 346 rowspan.height = size.y; |
347 } | 347 } |
429 int height = td.compSize.y; | 429 int height = td.compSize.y; |
430 int colWidth = td.compWidth - td.indent; | 430 int colWidth = td.compWidth - td.indent; |
431 int width = td.compSize.x-td.indent; | 431 int width = td.compSize.x-td.indent; |
432 width = Math.min(width, colWidth); | 432 width = Math.min(width, colWidth); |
433 int slotHeight = rowHeights[row]; | 433 int slotHeight = rowHeights[row]; |
434 RowSpan rowspan = cast(RowSpan) rowspans.get(control); | 434 RowSpan rowspan = rowspans.containsKey(control) ? cast(RowSpan) rowspans.get(control) : null; |
435 if (rowspan !is null) { | 435 if (rowspan !is null) { |
436 slotHeight = 0; | 436 slotHeight = 0; |
437 for (int i = row; i < row + td.rowspan; i++) { | 437 for (int i = row; i < row + td.rowspan; i++) { |
438 if (i > row) | 438 if (i > row) |
439 slotHeight += verticalSpacing; | 439 slotHeight += verticalSpacing; |
685 int cy = td.heightHint; | 685 int cy = td.heightHint; |
686 if (cy is DWT.DEFAULT) { | 686 if (cy is DWT.DEFAULT) { |
687 Point size = computeSize(td.childIndex, cwidth, td.indent, td.maxWidth, td.maxHeight); | 687 Point size = computeSize(td.childIndex, cwidth, td.indent, td.maxWidth, td.maxHeight); |
688 cy = size.y; | 688 cy = size.y; |
689 } | 689 } |
690 RowSpan rowspan = cast(RowSpan) rowspans.get(child); | 690 RowSpan rowspan = rowspans.containsKey(child) ? cast(RowSpan) rowspans.get(child) : null; |
691 if (rowspan !is null) { | 691 if (rowspan !is null) { |
692 // don't take the height of this child into acount | 692 // don't take the height of this child into acount |
693 // because it spans multiple rows | 693 // because it spans multiple rows |
694 rowspan.height = cy; | 694 rowspan.height = cy; |
695 } else { | 695 } else { |