[Openmcl-cvs-notifications] r9749 - in /trunk/source/cocoa-ide: cocoa-utils.lisp ide-contents/Resources/English.lproj/ProgressWindow.nib/designable.nib ide-contents/Resources/English.lproj/ProgressWindow.nib/keyedobjects.nib

mikel at clozure.com mikel at clozure.com
Fri Jun 13 19:11:27 EDT 2008


Author: mikel
Date: Fri Jun 13 19:11:27 2008
New Revision: 9749

Log:
debugging outlets for prgoress window

Modified:
    trunk/source/cocoa-ide/cocoa-utils.lisp
    trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/ProgressWin=
dow.nib/designable.nib
    trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/ProgressWin=
dow.nib/keyedobjects.nib

Modified: trunk/source/cocoa-ide/cocoa-utils.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/cocoa-ide/cocoa-utils.lisp (original)
+++ trunk/source/cocoa-ide/cocoa-utils.lisp Fri Jun 13 19:11:27 2008
@@ -323,6 +323,52 @@
     (unless (eql ns-other-button +null-ptr+)
       (#/release ns-other-button))))
 =

+;;; -----------------------------------------------------------------
+;;; utility to display a Cocoa progress window
+;;; -----------------------------------------------------------------
+
+(defparameter *progress-window-controller* nil)
+
+(defclass progress-window-controller (ns:ns-window-controller)
+    ((progress-window :foreign-type :id :reader progress-window)
+     (message-field :foreign-type :id :reader progress-window-message-fiel=
d)
+     (progress-bar :foreign-type :id :reader progress-window-progress-bar))
+  (:metaclass ns:+ns-object))
+
+(defun get-progress-window ()
+  (unless *progress-window-controller*
+    (setf *progress-window-controller* =

+          (make-instance 'progress-window-controller))
+    (#/initWithWindowNibName: *progress-window-controller* #@"ProgressWind=
ow"))
+  (unless (#/isWindowLoaded *progress-window-controller*)
+    (#/loadWindow *progress-window-controller*))
+  (let ((window (progress-window *progress-window-controller*)))
+    (if (or (null window)
+            (%null-ptr-p window))
+        nil
+        window)))
+
 (defmacro with-modal-progress-dialog (title message &body body)
-  )
-
+  `(let* ((nstitle (%make-nsstring ,title))
+          (nsmessage (%make-nsstring ,message))
+          (window (get-progress-window))
+          (progress-bar (progress-window-progress-bar *progress-window-con=
troller*))
+          (message-field (progress-window-message-field *progress-window-c=
ontroller*)))
+     (unwind-protect =

+          (if window
+              (progn
+                (#/setTitle: window nstitle)
+                (#/setIndeterminate: progress-bar #$YES)
+                (#/setStringValue: message-field nsmessage)
+                (#/makeKeyAndOrderFront: window +null-ptr+)
+                (let ((modal-session (#/beginModalSessionForWindow: ccl::*=
nsapp* window)))
+                  (#/startAnimation: progress-bar +null-ptr+)
+                  , at body
+                  (#/stopAnimation: progress-bar +null-ptr+)
+                  (#/orderOut: window +null-ptr+)
+                  (#/endModalSession: ccl::*nsapp* modal-session)))
+              (alert-window :title "Failure"
+                            :message "Unable to load the modal progress wi=
ndow"))
+       (#/release nstitle)
+       (#/release nsmessage))))
+

Modified: trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/Progr=
essWindow.nib/designable.nib
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/ProgressWin=
dow.nib/designable.nib (original)
+++ trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/ProgressWin=
dow.nib/designable.nib Fri Jun 13 19:11:27 2008
@@ -8,7 +8,7 @@
 		<string key=3D"IBDocument.HIToolboxVersion">352.00</string>
 		<object class=3D"NSMutableArray" key=3D"IBDocument.EditedObjectIDs">
 			<bool key=3D"EncodedWithXMLCoder">YES</bool>
-			<integer value=3D"1" id=3D"9"/>
+			<integer value=3D"2"/>
 		</object>
 		<object class=3D"NSArray" key=3D"IBDocument.PluginDependencies">
 			<bool key=3D"EncodedWithXMLCoder">YES</bool>
@@ -120,6 +120,14 @@
 					</object>
 					<int key=3D"connectionID">8</int>
 				</object>
+				<object class=3D"IBConnectionRecord">
+					<object class=3D"IBOutletConnection" key=3D"connection">
+						<string key=3D"label">progressWindow</string>
+						<reference key=3D"source" ref=3D"1001"/>
+						<reference key=3D"destination" ref=3D"1005"/>
+					</object>
+					<int key=3D"connectionID">9</int>
+				</object>
 			</object>
 			<object class=3D"IBMutableOrderedSet" key=3D"objectRecords">
 				<object class=3D"NSArray" key=3D"orderedObjects">
@@ -216,7 +224,7 @@
 					<string>{{225, 992}, {300, 90}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{225, 992}, {300, 90}}</string>
-					<reference ref=3D"9"/>
+					<integer value=3D"1"/>
 					<string>{196, 240}</string>
 					<string>{{357, 418}, {480, 270}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -245,7 +253,7 @@
 				</object>
 			</object>
 			<nil key=3D"sourceID"/>
-			<int key=3D"maxID">8</int>
+			<int key=3D"maxID">9</int>
 		</object>
 		<object class=3D"IBClassDescriber" key=3D"IBDocument.Classes">
 			<object class=3D"NSMutableArray" key=3D"referencedPartialClassDescripti=
ons">
@@ -258,7 +266,7 @@
 							<bool key=3D"EncodedWithXMLCoder">YES</bool>
 							<string>messageField</string>
 							<string>progressBar</string>
-							<string>window</string>
+							<string>progressWindow</string>
 						</object>
 						<object class=3D"NSMutableArray" key=3D"dict.values">
 							<bool key=3D"EncodedWithXMLCoder">YES</bool>

Modified: trunk/source/cocoa-ide/ide-contents/Resources/English.lproj/Progr=
essWindow.nib/keyedobjects.nib
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
Binary files - no diff available.



More information about the Openmcl-cvs-notifications mailing list