[squeak-dev] The Trunk: Tools-mt.1054.mcz

commits at source.squeak.org commits at source.squeak.org
Sat May 1 10:06:10 UTC 2021


Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1054.mcz

==================== Summary ====================

Name: Tools-mt.1054
Author: mt
Time: 1 May 2021, 12:06:08.609299 pm
UUID: 9da21c77-f717-ab4c-b024-42dfbe629f2e
Ancestors: Tools-mt.1053

Adds preference and means to embed a transcript in workspaces. Thanks to Jaromir (jar) for the idea!

The preference is disabled by default.

=============== Diff against Tools-mt.1053 ===============

Item was changed:
  StringHolder subclass: #Workspace
  	instanceVariableNames: 'bindings acceptDroppedMorphs acceptAction mustDeclareVariables shouldStyle environment'
+ 	classVariableNames: 'DeclareVariablesAutomatically EmbedTranscript LookupPools ShouldStyle'
- 	classVariableNames: 'DeclareVariablesAutomatically LookupPools ShouldStyle'
  	poolDictionaries: ''
  	category: 'Tools-Base'!
  
  !Workspace commentStamp: 'fbs 6/2/2012 20:46' prior: 0!
  A Workspace is a text area plus a lot of support for executable code.  It is a great place to execute top-level commands to compute something useful, and it is a great place to develop bits of a program before those bits get put into class methods.
  
  To open a new workspace, execute:
  
  	Workspace open
  
  
  A workspace can have its own variables, called "workspace variables", to hold intermediate results.  For example, if you type into a workspace "x := 5" and do-it, then later you could type in "y := x * 2" and y would become 10.
  
  Additionally, in Morphic, a workspace can gain access to morphs that are on the screen.  If acceptDroppedMorphs is turned on, then whenever a morph is dropped on the workspace, a variable will be created which references that morph.  This functionality is toggled with the window-wide menu of a workspace.
  
  
  The instance variables of this class are:
  
  	bindings  -  holds the workspace variables for this workspace
  
  	acceptDroppedMorphs - whether dropped morphs should create new variables!

Item was added:
+ ----- Method: Workspace class>>embedTranscript (in category 'preferences') -----
+ embedTranscript
+ 	<preference: 'Embed a Transcript in Workspace' 
+ 		category: 'browsing' 
+ 		description: 'If true, new workspaces will open with an embedded Transcript.' 
+ 		type: #Boolean>
+ 	^ EmbedTranscript ifNil: [ false ]!

Item was added:
+ ----- Method: Workspace class>>embedTranscript: (in category 'preferences') -----
+ embedTranscript: aBoolean
+ 
+ 	EmbedTranscript := aBoolean.!

Item was added:
+ ----- Method: Workspace>>buildTranscriptWith: (in category 'toolbuilder') -----
+ buildTranscriptWith: builder
+ 
+ 	| textSpec |
+ 	textSpec := builder pluggableTextSpec new.
+ 	textSpec 
+ 		model: Transcript;
+ 		menu: #codePaneMenu:shifted:.
+ 	^ textSpec!

Item was added:
+ ----- Method: Workspace>>buildWith: (in category 'toolbuilder') -----
+ buildWith: builder
+ 
+ 	^ self class embedTranscript
+ 		ifTrue: [self buildWorkspaceTranscriptWith: builder]
+ 		ifFalse: [super buildWith: builder]!

Item was added:
+ ----- Method: Workspace>>buildWorkspaceTranscriptWith: (in category 'toolbuilder') -----
+ buildWorkspaceTranscriptWith: builder
+ 
+ 	| windowSpec |
+ 	windowSpec := self buildWindowWith: builder specs: {
+ 		(0.0 @ 0.0 corner: 1.0 @ 0.6) -> [self buildCodePaneWith: builder].
+ 		(0.0 @ 0.6 corner: 1.0 @ 1.0) -> [self buildTranscriptWith: builder].
+ 	}.
+ 	^builder build: windowSpec!



More information about the Squeak-dev mailing list