diff dwt/printing/PrintDialog.d @ 119:d9893755f670

Ported dwt.printing.PrintDialog
author Jacob Carlborg <doob@me.com>
date Wed, 31 Dec 2008 16:07:41 +0100
parents 10760eb00d08
children 7046ca5a6d77
line wrap: on
line diff
--- a/dwt/printing/PrintDialog.d	Wed Dec 31 15:51:54 2008 +0100
+++ b/dwt/printing/PrintDialog.d	Wed Dec 31 16:07:41 2008 +0100
@@ -164,16 +164,16 @@
             NSString filename = new NSString(dict.objectForKey(OS.NSPrintSavePath));
             data.fileName = filename.getString();
         }
-        data.scope_ = new NSNumber(dict.objectForKey(OS.NSPrintAllPages)).intValue() !is 0 ? PrinterData.ALL_PAGES : PrinterData.PAGE_RANGE;
+        data.scope_ = (new NSNumber(dict.objectForKey(OS.NSPrintAllPages))).intValue() !is 0 ? PrinterData.ALL_PAGES : PrinterData.PAGE_RANGE;
         if (data.scope_ is PrinterData.PAGE_RANGE) {
-            data.startPage = new NSNumber(dict.objectForKey(OS.NSPrintFirstPage)).intValue();
-            data.endPage = new NSNumber(dict.objectForKey(OS.NSPrintLastPage)).intValue();
+            data.startPage = (new NSNumber(dict.objectForKey(OS.NSPrintFirstPage))).intValue();
+            data.endPage = (new NSNumber(dict.objectForKey(OS.NSPrintLastPage))).intValue();
         }
-        data.collate = new NSNumber(dict.objectForKey(OS.NSPrintMustCollate)).intValue() !is 0;
-        data.copyCount = new NSNumber(dict.objectForKey(OS.NSPrintCopies)).intValue();
+        data.collate = (new NSNumber(dict.objectForKey(OS.NSPrintMustCollate))).intValue() !is 0;
+        data.copyCount = (new NSNumber(dict.objectForKey(OS.NSPrintCopies))).intValue();
         NSData nsData = NSKeyedArchiver.archivedDataWithRootObject(printInfo);
         data.otherData = new byte[nsData.length()];
-        OS.memmove(data.otherData, nsData.bytes(), data.otherData.length);
+        OS.memmove(&data.otherData, nsData.bytes(), data.otherData.length);
 
         printToFile = data.printToFile;
         scope_ = data.scope_;
@@ -200,7 +200,7 @@
  * @return the scope setting that the user selected
  */
 public int getScope() {
-    return scope;
+    return scope_;
 }
 
 /**
@@ -218,8 +218,8 @@
  *
  * @param scope the scope setting when the dialog is opened
  */
-public void setScope(int scope) {
-    this.scope = scope;
+public void setScope(int scope_) {
+    this.scope_ = scope_;
 }
 
 /**
@@ -299,8 +299,8 @@
 }
 
 protected void checkSubclass() {
-    String name = getClass().getName();
-    String validName = PrintDialog.class.getName();
+    String name = this.classinfo.name;
+    String validName = PrintDialog.classinfo.name;
     if (!validName.equals(name)) {
         DWT.error(DWT.ERROR_INVALID_SUBCLASS);
     }