comparison dwt/layout/GridLayout.d @ 8:a9ab4c738ed8

Fix: instanceof
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:32:39 +0200
parents e831403a80a9
children fbe68c33eeee
comparison
equal deleted inserted replaced
7:e831403a80a9 8:a9ab4c738ed8
220 data.computeSize (child, data.widthHint, data.heightHint, flushCache); 220 data.computeSize (child, data.widthHint, data.heightHint, flushCache);
221 if (data.grabExcessHorizontalSpace && data.minimumWidth > 0) { 221 if (data.grabExcessHorizontalSpace && data.minimumWidth > 0) {
222 if (data.cacheWidth < data.minimumWidth) { 222 if (data.cacheWidth < data.minimumWidth) {
223 int trim = 0; 223 int trim = 0;
224 //TEMPORARY CODE 224 //TEMPORARY CODE
225 if (child instanceof Scrollable) { 225 if ( null !is cast(Scrollable)child ) {
226 Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0); 226 Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0);
227 trim = rect.width; 227 trim = rect.width;
228 } else { 228 } else {
229 trim = child.getBorderWidth () * 2; 229 trim = child.getBorderWidth () * 2;
230 } 230 }
469 currentWidth += widths [j-k]; 469 currentWidth += widths [j-k];
470 } 470 }
471 currentWidth += (hSpan - 1) * horizontalSpacing - data.horizontalIndent; 471 currentWidth += (hSpan - 1) * horizontalSpacing - data.horizontalIndent;
472 if ((currentWidth !is data.cacheWidth && data.horizontalAlignment is DWT.FILL) || (data.cacheWidth > currentWidth)) { 472 if ((currentWidth !is data.cacheWidth && data.horizontalAlignment is DWT.FILL) || (data.cacheWidth > currentWidth)) {
473 int trim = 0; 473 int trim = 0;
474 if (child instanceof Scrollable) { 474 if ( null !is cast(Scrollable)child ) {
475 Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0); 475 Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0);
476 trim = rect.width; 476 trim = rect.width;
477 } else { 477 } else {
478 trim = child.getBorderWidth () * 2; 478 trim = child.getBorderWidth () * 2;
479 } 479 }