[squeak-dev] The Inbox: Tools-cbc.972.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jun 6 00:21:20 UTC 2020


Chris Cunningham uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-cbc.972.mcz

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

Name: Tools-cbc.972
Author: cbc
Time: 5 June 2020, 5:21:18.741315 pm
UUID: 50b03b92-aa1d-4e4a-91fd-be3648f39855
Ancestors: Tools-mt.970

Enhance ObjectExlporer>>copyValue to copy a string that would re-constitute the base value using the representation show in the explorer.
An explicit example: If your are exploring the integer 42 and choose the menu item 'copy value' from the menu while hovering over the "binary '0010 1010'" (or "binary '101010"), it will copy the string '2r101010' to the clipboard.
This is extensible to other objects as well, but currently only supports Integer display options.

=============== Diff against Tools-mt.970 ===============

Item was added:
+ ----- Method: Integer>>valueStringForDisplayMethod: (in category '*Tools-Explorer') -----
+ valueStringForDisplayMethod: displayMethod
+ 	displayMethod = 'hexadecimal' ifTrue: [^'16r', (self printStringBase: 16)].
+ 	displayMethod = 'octal' ifTrue: [^'8r', (self printStringBase: 8)].
+ 	displayMethod = 'binary' ifTrue: [^'2r', (self printStringBase: 2)].
+ 	^self asStringOrText !

Item was changed:
  ----- Method: ObjectExplorer>>copyValue (in category 'menus - actions') -----
  copyValue
  	"Copy a description of the value of the current variable, so the user can paste it into the window below and work with it."
+ 	| value |
+ 	value := (self currentParent value respondsTo: #valueStringForDisplayMethod:)
+ 		ifTrue: [self currentParent value valueStringForDisplayMethod: self currentSelection key]
+ 		ifFalse: [self currentSelection value].
+ 	Clipboard clipboardText: value asStringOrText.!
- 	
- 	Clipboard clipboardText: self currentSelection value asStringOrText.	!



More information about the Squeak-dev mailing list