comparison dwtx/ui/forms/widgets/FormToolkit.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
comparison
equal deleted inserted replaced
83:028aedd523ad 85:56fea7e5f0f9
303 * the separator parent 303 * the separator parent
304 * @return the separator widget 304 * @return the separator widget
305 */ 305 */
306 public Composite createCompositeSeparator(Composite parent) { 306 public Composite createCompositeSeparator(Composite parent) {
307 final Composite composite = new Composite(parent, orientation); 307 final Composite composite = new Composite(parent, orientation);
308 composite.addListener(DWT.Paint, dgListener( (Event e, Composite composite) { 308 // DWT FIXME: problem with DMD and anonclass/nested func
309 composite.addListener(DWT.Paint, dgListener( &dwtWorkaround, composite));
310 if (null !is cast(Section)parent )
311 (cast(Section) parent).setSeparatorControl(composite);
312 return composite;
313 }
314 // DWT FIXME: problem with DMD and anonclass/nested func
315 private void dwtWorkaround (Event e, Composite composite) {
309 if (composite.isDisposed()) 316 if (composite.isDisposed())
310 return; 317 return;
311 Rectangle bounds = composite.getBounds(); 318 Rectangle bounds = composite.getBounds();
312 GC gc = e.gc; 319 GC gc = e.gc;
313 gc.setForeground(colors.getColor(IFormColors.SEPARATOR)); 320 gc.setForeground(colors.getColor(IFormColors.SEPARATOR));
314 if (colors.getBackground() !is null) 321 if (colors.getBackground() !is null)
315 gc.setBackground(colors.getBackground()); 322 gc.setBackground(colors.getBackground());
316 gc.fillGradientRectangle(0, 0, bounds.width, bounds.height, 323 gc.fillGradientRectangle(0, 0, bounds.width, bounds.height,
317 false); 324 false);
318 }, composite)); 325 }
319 if (null !is cast(Section)parent )
320 (cast(Section) parent).setSeparatorControl(composite);
321 return composite;
322 }
323
324 /** 326 /**
325 * Creates a label as a part of the form. 327 * Creates a label as a part of the form.
326 * 328 *
327 * @param parent 329 * @param parent
328 * the label parent 330 * the label parent