[net.lang.st80] ST80-software exchange

pieter@prls.UUCP (Pieter van der Meulen) (05/14/86)

This newsgroup seems to be an excellent medium for exchanging ST80-software
and idea's. I would liked to get this started, so I posted a utility
(superExtendedBrowser) a few weeks ago, but didn't see much response so far.

Here's another one, much smaller, still very useful, generated in my own time.
If you get the idea you could write it yourself in less than no time.
A description of its use can be found in the code itself.

If you modify GraphicEditorsOpenCodeView.st and feel that it would be beneficial
to others who use this program, or if you find and fix a bug, please send me the
change.
						Thanks, Pieter.


------------------------cut here and maybe at the end too-----------------------
'GraphicEditorsOpenCodeView.st: Form-code generation by formEditor and bitEditor

Description:
This code adds an entry to the middle-mouse-button menu of both the bitEditor
and the formEditor. Besides [accept] and [cancel] you can select [code], which
will open a new window for you with Smalltalk code describing the current form
you are editing. You can copy this code and manipulate it, e.g. <display>,
<magnifyBy:>, etc.

This program is placed in the public domain. Neither I nor my company will
recognize any responsibility for damages arising from use of this program.
                                                 Pieter S. van der Meulen' !

!FormHolderView methodsFor: 'menu messages'!

openCodeView
	"Open a window with a code description of the currently displayed form"

	| aStream |
	aStream _ WriteStream on: (String new: 1000).
	displayedForm storeOn: aStream base: 10.
	StringHolderView open: (StringHolder new contents: aStream contents)
		label: 'Displayed Form Code'! !

!BitEditor methodsFor: 'menu messages'!

openCodeView
	"Open a window with a code description of the currently displayed form"

	view openCodeView! !

!BitEditor class methodsFor: 'class initialization'!

initialize
	"BitEditor initialize."

	YellowButtonMenu _ PopUpMenu labels:
'accept
cancel
code'.
	YellowButtonMessages _ #(accept cancel openCodeView)! !

!FormEditor methodsFor: 'menu messages'!

openCodeView
	"Open a window with a code description of the currently displayed form"

	view updateDisplay.
	view openCodeView! !

!FormEditor class methodsFor: 'class initialization'!

initialize
	"FormEditor initialize."

	FlashCursor _ false.
	self setKeyboardMap.
	YellowButtonMenu _ PopUpMenu labels:
'accept
cancel
code'.
	YellowButtonMessages _ #(accept cancel openCodeView)! !

BitEditor initialize.
FormEditor initialize!
-- 
-----------------------------------------------------------------
|                          |>                                   |
| philabs!\                ||\       P.S. van der Meulen, MS 02 | 
| amdimage!\              /|| \   Philips Research Laboratories |
| --------- prls!pieter  / ||* \          Signetics Corporation |
| pyramid! /            /  ||   \           811 E.Arques Avenue |
| sigvme! /            /   ||    \     Sunnyvale, CA 94088-3409 |
|                     /____||_____\    Telephone (408) 991-5067 |
|                     \prls!pieter/                             |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~