Mercurial > projects > dwt-mac
changeset 22:c6edc6e9bd0d
Ported dwt.widgets.Composite
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sun, 07 Sep 2008 22:19:25 +0200 |
parents | fdbd69a5f101 |
children | 9414ecde7ba7 |
files | dwt/widgets/Composite.d dwt/widgets/Decorations.d |
diffstat | 2 files changed, 22 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/widgets/Composite.d Sun Sep 07 22:09:59 2008 +0200 +++ b/dwt/widgets/Composite.d Sun Sep 07 22:19:25 2008 +0200 @@ -7,11 +7,12 @@ * * Contributors: * IBM Corporation - initial API and implementation + * + * Port to the D programming language: + * Jacob Carlborg <jacob.carlborg@gmail.com> *******************************************************************************/ module dwt.widgets.Composite; -import dwt.dwthelper.utils; - import dwt.DWT; import dwt.DWTException; @@ -25,6 +26,20 @@ import dwt.internal.cocoa.SWTScrollView; import dwt.internal.cocoa.SWTView; +import dwt.dwthelper.utils; +import dwt.internal.cocoa.NSInteger; +import dwt.widgets.Control; +import dwt.widgets.Decorations; +import dwt.widgets.Display; +import dwt.widgets.Event; +import dwt.widgets.Layout; +import dwt.widgets.Menu; +import dwt.widgets.Scrollable; +import dwt.widgets.ScrollBar; +import dwt.widgets.Shell; +import dwt.widgets.Widget; + + /** * Instances of this class are controls which are capable * of containing other controls. @@ -100,11 +115,11 @@ Control [] _getChildren () { NSArray views = contentView().subviews(); - int count = views.count(); + NSUInteger count = views.count(); Control [] children = new Control [count]; int j = 0; for (int i=0; i<count; i++){ - int tag = new NSView(views.objectAtIndex(i)).tag(); + NSInteger tag = (new NSView(views.objectAtIndex(i))).tag(); if (tag !is 0 && tag !is -1) { Object widget = OS.JNIGetObject(tag); if (widget !is null && widget !is this) { @@ -246,9 +261,9 @@ void createHandle (NSView parent) { state |= CANVAS; - NSRect rect = new NSRect(); + NSRect rect = NSRect(); if ((style & (DWT.V_SCROLL | DWT.H_SCROLL)) !is 0 || hasBorder ()) { - SWTScrollView scrollWidget = cast(SWTScrollView)new SWTScrollView().alloc(); + SWTScrollView scrollWidget = cast(SWTScrollView)(new SWTScrollView()).alloc(); scrollWidget.initWithFrame (rect); scrollWidget.setDrawsBackground(false); if ((style & DWT.H_SCROLL) !is 0) scrollWidget.setHasHorizontalScroller(true); @@ -258,7 +273,7 @@ scrollView = scrollWidget; rect.width = rect.height = 100000; } - SWTView widget = cast(SWTView)new SWTView().alloc(); + SWTView widget = cast(SWTView)(new SWTView()).alloc(); widget.initWithFrame (rect); // widget.setFocusRingType(OS.NSFocusRingTypeExterior); widget.setTag(jniRef);
--- a/dwt/widgets/Decorations.d Sun Sep 07 22:09:59 2008 +0200 +++ b/dwt/widgets/Decorations.d Sun Sep 07 22:19:25 2008 +0200 @@ -20,7 +20,6 @@ import dwt.graphics.ImageData; import dwt.dwthelper.utils; -import dwt.dwthelper.System; import dwt.widgets.Button; import dwt.widgets.Composite; import dwt.widgets.Control;