comparison dwtx/ui/forms/widgets/TableWrapLayout.d @ 128:8df1d4193877

Fix: runtime error in ui.forms. Arrays had an intermediate copy, so values were not stored correctly. Add: collection impls.
author Frank Benoit <benoit@tionex.de>
date Sun, 17 Aug 2008 02:05:20 +0200
parents 04b47443bb01
children
comparison
equal deleted inserted replaced
127:1997315125c0 128:8df1d4193877
510 } 510 }
511 // Store the layout spec. Also cache the childIndex. NOTE: That we 511 // Store the layout spec. Also cache the childIndex. NOTE: That we
512 // assume the children of a 512 // assume the children of a
513 // composite are maintained in the order in which they are created 513 // composite are maintained in the order in which they are created
514 // and added to the composite. 514 // and added to the composite.
515 arrayFromObject!(TableWrapData)( grid.elementAt(row))[column] = spec; 515 (cast(ArrayWrapperObject) grid.elementAt(row)).array[column] = spec;
516 spec.childIndex = i; 516 spec.childIndex = i;
517 if (spec.grabHorizontal) { 517 if (spec.grabHorizontal) {
518 updateGrowingColumns(growingCols, spec, column); 518 updateGrowingColumns(growingCols, spec, column);
519 } 519 }
520 if (spec.grabVertical) { 520 if (spec.grabVertical) {
527 columnFill = spec.colspan - 1; 527 columnFill = spec.colspan - 1;
528 for (int r = 1; r <= rowFill; r++) { 528 for (int r = 1; r <= rowFill; r++) {
529 for (int c = 0; c < spec.colspan; c++) { 529 for (int c = 0; c < spec.colspan; c++) {
530 spacerSpec = new TableWrapData(); 530 spacerSpec = new TableWrapData();
531 spacerSpec.isItemData = false; 531 spacerSpec.isItemData = false;
532 arrayFromObject!(TableWrapData)( grid.elementAt(row + r))[column + c] = spacerSpec; 532 (cast(ArrayWrapperObject) grid.elementAt(row + r)).array[column + c] = spacerSpec;
533 } 533 }
534 } 534 }
535 for (int c = 1; c <= columnFill; c++) { 535 for (int c = 1; c <= columnFill; c++) {
536 for (int r = 0; r < spec.rowspan; r++) { 536 for (int r = 0; r < spec.rowspan; r++) {
537 spacerSpec = new TableWrapData(); 537 spacerSpec = new TableWrapData();
538 spacerSpec.isItemData = false; 538 spacerSpec.isItemData = false;
539 arrayFromObject!(TableWrapData)( grid.elementAt(row + r))[column + c] = spacerSpec; 539 (cast(ArrayWrapperObject) grid.elementAt(row + r)).array[column + c] = spacerSpec;
540 } 540 }
541 } 541 }
542 column = column + spec.colspan - 1; 542 column = column + spec.colspan - 1;
543 } 543 }
544 // Fill out empty grid cells with spacers. 544 // Fill out empty grid cells with spacers.
545 for (int k = column + 1; k < numColumns; k++) { 545 for (int k = column + 1; k < numColumns; k++) {
546 spacerSpec = new TableWrapData(); 546 spacerSpec = new TableWrapData();
547 spacerSpec.isItemData = false; 547 spacerSpec.isItemData = false;
548 arrayFromObject!(TableWrapData)( grid.elementAt(row))[k] = spacerSpec; 548 (cast(ArrayWrapperObject) grid.elementAt(row)).array[k] = spacerSpec;
549 } 549 }
550 for (int k = row + 1; k < grid.size(); k++) { 550 for (int k = row + 1; k < grid.size(); k++) {
551 spacerSpec = new TableWrapData(); 551 spacerSpec = new TableWrapData();
552 spacerSpec.isItemData = false; 552 spacerSpec.isItemData = false;
553 arrayFromObject!(TableWrapData)( grid.elementAt(k))[column] = spacerSpec; 553 (cast(ArrayWrapperObject) grid.elementAt(k)).array[column] = spacerSpec;
554 } 554 }
555 growingColumns = new int[growingCols.size()]; 555 growingColumns = new int[growingCols.size()];
556 for (int i = 0; i < growingCols.size(); i++) { 556 for (int i = 0; i < growingCols.size(); i++) {
557 growingColumns[i] = (cast(Integer) growingCols.get(i)).intValue(); 557 growingColumns[i] = (cast(Integer) growingCols.get(i)).intValue();
558 } 558 }