diff -r e54fd5930e5d -r 681b0263b4fb BrowserView.st --- a/BrowserView.st Thu Jan 07 14:50:50 1999 +0100 +++ b/BrowserView.st Thu Jan 07 15:33:16 1999 +0100 @@ -2775,7 +2775,6 @@ ^ self ]. FileSelectionBox lastFileSelectionDirectory:(saveName asFilename directoryName). - ]. self busyLabel:'saving %1' with:currentClass name. @@ -2794,14 +2793,30 @@ self normalLabel. ] - "Created: 16.4.1997 / 20:55:01 / cg" - "Modified: 9.9.1997 / 10:11:35 / cg" + "Created: / 16.4.1997 / 20:55:01 / cg" + "Modified: / 29.12.1998 / 21:41:09 / cg" ! classFileOutBinary "fileOut the current class as binary bytecode." - |mode| + self classFileOutBinaryAsk:false + + "Modified: / 29.12.1998 / 21:42:15 / cg" +! + +classFileOutBinaryAs + "fileOut the current class as binary bytecode; ask for a fileName." + + self classFileOutBinaryAsk:true + + "Created: / 29.12.1998 / 21:42:27 / cg" +! + +classFileOutBinaryAsk:ask + "fileOut the current class as binary bytecode." + + |mode fileBox saveName dir| mode := Dialog choose:(resources string:'save including sources ?') labels:(resources array:#('cancel' 'discard' 'by file reference' 'include source')) @@ -2816,20 +2831,47 @@ currentClass isPrivate ifTrue:[ self warn:'You must fileOut the owning class: ' , currentClass owningClass name ] ifFalse:[ + ask ifTrue:[ + fileBox := FileSelectionBox + title:(resources string:'binary fileOut %1 as:' with:currentClass name) + okText:(resources string:'fileOut') + abortText:(resources string:'cancel') + action:[:fileName | saveName := fileName]. + fileBox initialText:((Smalltalk fileNameForClass:currentClass) , '.cls'). + dir := FileSelectionBox lastFileSelectionDirectory. + dir notNil ifTrue:[ + fileBox directory:dir. + ]. + fileBox showAtPointer. + fileBox destroy. + saveName isNil ifTrue:[ + ^ self + ]. + saveName isEmpty ifTrue:[ + self warn:'bad name given'. + ^ self + ]. + FileSelectionBox lastFileSelectionDirectory:(saveName asFilename directoryName). + ]. + self busyLabel:'saving binary of %1' with:currentClass name. Class fileOutErrorSignal handle:[:ex | self warn:'cannot create: %1\(%2)' with:ex parameter with:ex errorString. ex return. ] do:[ - currentClass binaryFileOutWithSourceMode:mode. + saveName notNil ifTrue:[ + currentClass binaryFileOutWithSourceMode:mode as:saveName. + ] ifFalse:[ + currentClass binaryFileOutWithSourceMode:mode + ] ]. ]. self normalLabel. ] - "Created: 24.1.1996 / 21:11:03 / cg" - "Modified: 14.10.1996 / 20:12:46 / cg" + "Created: / 29.12.1998 / 21:35:13 / cg" + "Modified: / 29.12.1998 / 21:45:54 / cg" ! classHierarchy @@ -2991,6 +3033,7 @@ ] ifFalse:[ items := #( ('fileOut binary' classFileOutBinary ) + ('fileOut binary as' classFileOutBinaryAs ) ('-' nil ) ('inspect class' classInspect ) ('inspect instances' classInstancesInspect ) @@ -3183,7 +3226,7 @@ m subMenuAt:#otherMenu put:specialMenu. ^ m - "Modified: / 7.8.1998 / 18:43:06 / cg" + "Modified: / 29.12.1998 / 21:42:44 / cg" ! classNewApplication @@ -12633,6 +12676,6 @@ !BrowserView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.464 1998-12-08 14:22:17 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.465 1999-01-07 14:33:16 cg Exp $' ! ! BrowserView initialize!