Mercurial > projects > dwt-addons
diff 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 |
line wrap: on
line diff
--- a/dwtx/ui/forms/widgets/FormToolkit.d Fri Jun 20 13:00:15 2008 +0200 +++ b/dwtx/ui/forms/widgets/FormToolkit.d Fri Jun 20 14:48:17 2008 +0200 @@ -305,7 +305,14 @@ */ public Composite createCompositeSeparator(Composite parent) { final Composite composite = new Composite(parent, orientation); - composite.addListener(DWT.Paint, dgListener( (Event e, Composite composite) { + // DWT FIXME: problem with DMD and anonclass/nested func + composite.addListener(DWT.Paint, dgListener( &dwtWorkaround, composite)); + if (null !is cast(Section)parent ) + (cast(Section) parent).setSeparatorControl(composite); + return composite; + } + // DWT FIXME: problem with DMD and anonclass/nested func + private void dwtWorkaround (Event e, Composite composite) { if (composite.isDisposed()) return; Rectangle bounds = composite.getBounds(); @@ -315,12 +322,7 @@ gc.setBackground(colors.getBackground()); gc.fillGradientRectangle(0, 0, bounds.width, bounds.height, false); - }, composite)); - if (null !is cast(Section)parent ) - (cast(Section) parent).setSeparatorControl(composite); - return composite; - } - + } /** * Creates a label as a part of the form. *