diff dwt/widgets/Button.d @ 37:642f460a0908

Fixed a lot of compile errors, a "hello world" app compiles now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 10 Oct 2008 12:29:48 +0200
parents db5a898b2119
children d8635bb48c7c
line wrap: on
line diff
--- a/dwt/widgets/Button.d	Tue Oct 07 12:56:18 2008 +0200
+++ b/dwt/widgets/Button.d	Fri Oct 10 12:29:48 2008 +0200
@@ -33,7 +33,9 @@
 
 import dwt.dwthelper.utils;
 import dwt.internal.cocoa.CGFloat;
+import dwt.internal.cocoa.NSCell;
 import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSText;
 import dwt.widgets.Composite;
 import dwt.widgets.Control;
 import dwt.widgets.Decorations;
@@ -167,13 +169,13 @@
     if (font !is null) {
         dict.setObject(font.handle, OS.NSFontAttributeName());
     }
-    int alignment;
+    NSTextAlignment alignment;
     if ((style & DWT.CENTER) !is 0) {
-        alignment = OS.NSCenterTextAlignment;
+        alignment = NSCenterTextAlignment;
     } else if ((style & DWT.LEFT) !is 0) {
-        alignment = OS.NSLeftTextAlignment;
+        alignment = NSLeftTextAlignment;
     } else {
-        alignment = OS.NSRightTextAlignment;
+        alignment = NSRightTextAlignment;
     }
     NSMutableParagraphStyle pStyle = cast(NSMutableParagraphStyle)(new NSMutableParagraphStyle()).alloc().init();
     pStyle.autorelease();
@@ -191,23 +193,23 @@
 void createHandle () {
     NSButton widget = cast(NSButton)(new SWTButton()).alloc();
     widget.initWithFrame(NSRect());
-    int type = OS.NSMomentaryPushButton;
+    NSButtonType type = NSMomentaryPushButton;
     if ((style & DWT.PUSH) !is 0) {
-        widget.setBezelStyle(OS.NSRoundedBezelStyle);
+        widget.setBezelStyle(NSRoundedBezelStyle);
     } else if ((style & DWT.CHECK) !is 0) {
-        type = OS.NSSwitchButton;
+        type = NSSwitchButton;
         widget.setAllowsMixedState (true);
     } else if ((style & DWT.RADIO) !is 0) {
-        type = OS.NSRadioButton;        
+        type = NSRadioButton;        
     } else if ((style & DWT.TOGGLE) !is 0) {
-        type = OS.NSPushOnPushOffButton;
-        widget.setBezelStyle(OS.NSRegularSquareBezelStyle);
+        type = NSPushOnPushOffButton;
+        widget.setBezelStyle(NSRegularSquareBezelStyle);
     } else if ((style & DWT.ARROW) !is 0) {
-        widget.setBezelStyle(OS.NSRoundedDisclosureBezelStyle);
+        widget.setBezelStyle(NSRoundedDisclosureBezelStyle);
     }
     widget.setButtonType(type);
     widget.setTitle(NSString.stringWith(""));
-    widget.setImagePosition(OS.NSImageLeft);
+    widget.setImagePosition(NSImageLeft);
     widget.setTarget(widget);
     widget.setAction(OS.sel_sendSelection);
     widget.setTag(jniRef);