Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.204.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.204
Author: mt
Time: 21 December 2017, 9:03:48.515231 am
UUID: 0832e3f9-24fa-e347-b69e-9835e3ba58b4
Ancestors: ToolBuilder-Morphic-mt.203
Clean-up in Shout styling callback. 1) Use the correct way to recompute the selection. 2) Update comments.
=============== Diff against ToolBuilder-Morphic-mt.203 ===============
Item was changed:
----- Method: PluggableTextMorphPlus>>stylerStyled: (in category 'styling') -----
stylerStyled: styledCopyOfText
+ "Sent after the styler completed styling the underlying text. The behavior is similar to #handleInteraction:event: but we do not have to copy text ore make those other checks."
+
- "Sent after the styler completed styling the underlying text"
textMorph contents runs: styledCopyOfText runs .
+
- "textMorph paragraph recomposeFrom: 1 to: textMorph contents size delta: 0." "caused chars to appear in wrong order esp. in demo mode. remove this line when sure it is fixed"
textMorph paragraph composeAll.
+ textMorph editor recomputeSelection.
textMorph updateFromParagraph.
+
- selectionInterval
- ifNotNil:[
- textMorph editor
- selectInvisiblyFrom: selectionInterval first to: selectionInterval last;
- storeSelectionInParagraph;
- setEmphasisHere].
textMorph editor blinkParen.
+ self scrollSelectionIntoView.!
- self scrollSelectionIntoView!
tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.780.mcz
==================== Summary ====================
Name: Tools-tpr.780
Author: tpr
Time: 20 December 2017, 11:47:36.353661 am
UUID: ff0363cd-738f-4147-bd36-ea2a42f23ffc
Ancestors: Tools-mt.779
Small improvement to the spawnToClass: related browser buiding - gets the initial slection cleaner etc
=============== Diff against Tools-mt.779 ===============
Item was changed:
----- Method: Browser class>>newOnClass:messageCategory:selector:editString:label: (in category 'instance creation') -----
newOnClass: aClass messageCategory: aCategory selector: aSelector editString: aString label: aLabel
"Open a new message protocol browser on this class & protocol with aString pre-selected in the code pane.
We have to be a bit sneaky to do the string insertion since it cannot be handled until after the actual browser is built and opened"
"Browser newOnClass: Browser messageCategory: 'controls' selector: #decorateButtons editString: 'test string edit setup' label: 'Testing class browser with set edit string'"
| newBrowser|
newBrowser := self new.
"setting up a new browser for a specific class, category and selector requires this order of messages
since the #selectMessageCategoryNamed: carefully nils the chosen selector; thus we can't use
the more obvious seeming #setClass:selector: method"
newBrowser
setClass: aClass;
selectMessageCategoryNamed: aCategory;
+ selectMessageNamed: aSelector;
+ editSelection: #editMessage.
- selectMessageNamed: aSelector.
newBrowser buildAndOpenMessageCategoryBrowserLabel: 'Message Category Browser (' , aClass name, ')'.
aString ifNotNil:[newBrowser changed: #editString with: aString].
^newBrowser!
Item was changed:
----- Method: CodeHolder>>buildMessageCategoryBrowserForCategory:class:selector:editString: (in category 'construction') -----
buildMessageCategoryBrowserForCategory: aCategory class: aClass selector: aSelectorOrNil editString: methodSourceCode
"Create and schedule a new class browser for the current selection,
with initial textual contents set to aString. This is used specifically in
spawning where a class is established but a method-category is not."
self flag: #uglyHack. "mt: We should not abuse Browser like this. We should not even know about #Browser in this superclass."
^ (Browser
newOnClass: aClass
messageCategory: aCategory
selector: aSelectorOrNil
editString: methodSourceCode
+ label: 'Message category Browser: ' , aClass name , aCategory)!
- label: 'Message category Browser: ' , aClass name , aCategory)
- editSelection: #editMessage; "...because we know it is method code."
- changed: #editString with: methodSourceCode; "...trigger re-styling."
- yourself!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1378.mcz
==================== Summary ====================
Name: Morphic-mt.1378
Author: mt
Time: 20 December 2017, 4:02:40.532079 pm
UUID: 94c3d2cd-41b5-9742-a30e-7281fec08fd6
Ancestors: Morphic-mt.1377
Makes use of the text cursor in text morphs. If you want, you can drap/drop text selections, too, which has to be enabled via preference "Draggable Text Selection". Fixes cursor appearance when invoking halo, too.
Note that Shout was a little bit annoying here. See TextMorphForEditView >> #acceptDroppingMorph:event:.
Also note that due to the role of TextEditor, dragging is prepared in TextEditor >> #mouseDown: but started in TextMorph >> #startDrag:.
Finally, note that I decided to put the current (rudimentary) version of text dropping into TextMorphForEditView, which makes text-drop only work in PluggableTextMorphs (i.e. ToolBulder-tools) and not pure TextMorphs.
=============== Diff against Morphic-mt.1377 ===============
Item was added:
+ ----- Method: Editor>>destructiveBackWord (in category 'typing/selecting keys') -----
+ destructiveBackWord
+ "If the selection is not a caret, delete it and leave it in the backspace buffer.
+ Else if there is typeahead, delete it.
+ Else, delete the word before the caret."
+
+ | startIndex |
+ self hasCaret
+ ifTrue: "a caret, delete at least one character"
+ [startIndex := 1 max: self markIndex - 1.
+ [startIndex > 1 and:
+ [(self string at: startIndex - 1) tokenish]]
+ whileTrue:
+ [startIndex := startIndex - 1]]
+ ifFalse: "a non-caret, just delete it"
+ [startIndex := self markIndex].
+ self backTo: startIndex.
+ ^ false!
Item was changed:
----- Method: Editor>>destructiveBackWord: (in category 'typing/selecting keys') -----
destructiveBackWord: aKeyboardEvent
+
+ ^ self destructiveBackWord!
- "If the selection is not a caret, delete it and leave it in the backspace buffer.
- Else if there is typeahead, delete it.
- Else, delete the word before the caret."
-
- | startIndex |
- self hasCaret
- ifTrue: "a caret, delete at least one character"
- [startIndex := 1 max: self markIndex - 1.
- [startIndex > 1 and:
- [(self string at: startIndex - 1) tokenish]]
- whileTrue:
- [startIndex := startIndex - 1]]
- ifFalse: "a non-caret, just delete it"
- [startIndex := self markIndex].
- self backTo: startIndex.
- ^false!
Item was changed:
----- Method: Morph>>invokeHaloOrMove: (in category 'meta-actions') -----
invokeHaloOrMove: anEvent
"Special gestures (cmd-mouse on the Macintosh; Alt-mouse on Windows and Unix) allow a mouse-sensitive morph to be moved or bring up a halo for the morph."
| h tfm doNotDrag |
h := anEvent hand halo.
"Prevent wrap around halo transfers originating from throwing the event back in"
doNotDrag := false.
h ifNotNil:[
(h innerTarget == self) ifTrue:[doNotDrag := true].
(h innerTarget hasOwner: self) ifTrue:[doNotDrag := true].
(self hasOwner: h target) ifTrue:[doNotDrag := true]].
tfm := (self transformedFrom: nil) inverseTransformation.
"cmd-drag on flexed morphs works better this way"
h := self addHalo: (anEvent transformedBy: tfm).
h ifNil: [^ self].
doNotDrag ifTrue:[^self].
"Initiate drag transition if requested"
anEvent hand
waitForClicksOrDrag: h
event: (anEvent transformedBy: tfm)
selectors: { nil. nil. nil. #startDragTarget:. }
threshold: HandMorph dragThreshold.
"Pass focus explicitly here"
+ anEvent hand newMouseFocus: h.
+ "Reset temporary cursors to make available halo interaction visible."
+ anEvent hand showTemporaryCursor: nil.!
- anEvent hand newMouseFocus: h.!
Item was added:
+ ----- Method: Text>>asDraggableMorph (in category '*Morphic-converting') -----
+ asDraggableMorph
+ ^ self asMorph!
Item was added:
+ ----- Method: TextEditor>>addText:event: (in category 'editing dragdrop') -----
+ addText: aText event: anEvent
+ "Used for dropping/inserting text."
+
+ | index |
+ index := (paragraph characterBlockAtPoint: anEvent position) stringIndex.
+ self closeTypeIn.
+
+ self selectInvisiblyFrom: index to: index-1.
+ self replaceSelectionWith: aText.!
Item was added:
+ ----- Method: TextEditor>>click: (in category 'events') -----
+ click: evt
+ "This is called if you click in a text selection while drag is enabled, but you did not drag. Also see #startDrag:."
+
+ self selectAt: (paragraph characterBlockAtPoint: evt position) stringIndex.!
Item was added:
+ ----- Method: TextEditor>>isEventInSelection: (in category 'events') -----
+ isEventInSelection: evt
+ "Check whether the event position is within the current selection."
+
+ | pt a b |
+ self hasSelection ifFalse: [^ false].
+
+ pt := evt position.
+ a := self startBlock.
+ b := self stopBlock.
+
+ ^ (pt >= a topLeft and: [pt <= b bottomLeft]) "Start and stop in same line"
+ or: [
+ a top < b top and: [ "Start and stop in different lines."
+ ((pt y > a bottom and: [pt y < b top]) "Fully selected lines in the middle."
+ or: [pt x >= a left and: [pt y between: a top and: a bottom]]) "Top tail."
+ or: [pt x <= b left and: [pt y between: b top and: b bottom]]]]. "Bottom tail."
+
+
+
+
+ !
Item was changed:
----- Method: TextEditor>>mouseDown: (in category 'events') -----
mouseDown: evt
+ "Either 1) handle text actions in the paragraph, 2) begin a text drag operation, or 3) modify the caret/selection."
+
- "An attempt to break up the old processRedButton code into threee phases"
| clickPoint b |
oldInterval := self selectionInterval.
clickPoint := evt cursorPoint.
b := paragraph characterBlockAtPoint: clickPoint.
(paragraph clickAt: clickPoint for: model controller: self) ifTrue: [
markBlock := b.
pointBlock := b.
evt hand releaseKeyboardFocus: morph.
evt hand releaseMouseFocus: morph.
^ self ].
+ (morph dragEnabled and: [self isEventInSelection: evt]) ifTrue: [
+ evt hand
+ waitForClicksOrDrag: morph
+ event: evt
+ selectors: {#click:. nil. nil. #startDrag:}
+ threshold: HandMorph dragThreshold.
+ morph setProperty: #waitingForTextDrag toValue: true.
+ ^ self].
+
evt shiftPressed
ifFalse: [
self closeTypeIn.
markBlock := b.
pointBlock := b ]
ifTrue: [
self closeTypeIn.
self mouseMove: evt ].
self storeSelectionInParagraph!
Item was changed:
----- Method: TextEditor>>mouseMove: (in category 'events') -----
mouseMove: evt
+ "Change the selection in response to mouse-down drag. Do not change the selection if the user wants to drag the current selection."
- "Change the selection in response to mouse-down drag"
+ (morph hasProperty: #waitingForTextDrag) ifTrue: [^ self].
pointBlock := paragraph characterBlockAtPoint: evt position.
self storeSelectionInParagraph!
Item was changed:
----- Method: TextEditor>>mouseUp: (in category 'events') -----
mouseUp: evt
"An attempt to break up the old processRedButton code into threee phases"
+
+ self updateCursorForEvent: evt.
+ morph removeProperty: #waitingForTextDrag.
+
oldInterval ifNil: [^ self]. "Patched during clickAt: repair"
(self hasCaret
and: [oldInterval = self selectionInterval])
ifTrue: [self selectWord].
self setEmphasisHere.
(self isDisjointFrom: oldInterval) ifTrue:
[otherInterval := oldInterval].
self storeSelectionInParagraph!
Item was added:
+ ----- Method: TextEditor>>updateCursorForEvent: (in category 'events') -----
+ updateCursorForEvent: evt
+
+ (((morph bounds containsPoint: evt position)
+ and: [morph dragEnabled not or: [(self isEventInSelection: evt) not]])
+ and: [evt hand temporaryCursor ~~ Cursor text])
+ ifTrue: [evt hand showTemporaryCursor: Cursor text]
+ ifFalse: [evt hand showTemporaryCursor: nil].!
Item was added:
+ ----- Method: TextMorph>>click: (in category 'event handling') -----
+ click: evt
+
+ self
+ handleInteraction: [self editor click: evt]
+ fromEvent: evt.!
Item was changed:
----- Method: TextMorph>>enterClickableRegion: (in category 'editing') -----
enterClickableRegion: evt
| index isLink |
evt hand hasSubmorphs ifTrue:[^self].
- evt hand temporaryCursor ifNotNil:[^self].
paragraph ifNotNil:[
index := (paragraph characterBlockAtPoint: evt position) stringIndex.
isLink := (paragraph text attributesAt: index forStyle: paragraph textStyle)
anySatisfy:[:attr| attr mayActOnClick].
+ isLink ifTrue:[evt hand showTemporaryCursor: Cursor webLink].
- isLink ifTrue:[Cursor webLink show] ifFalse:[Cursor normal show].
].
!
Item was added:
+ ----- Method: TextMorph>>handlesMouseOver: (in category 'event handling') -----
+ handlesMouseOver: evt
+ ^ self isPartsDonor not!
Item was changed:
----- Method: TextMorph>>mouseDown: (in category 'event handling') -----
mouseDown: evt
"Make this TextMorph be the keyboard input focus, if it isn't
already, and repond to the text selection gesture."
evt yellowButtonPressed ifTrue: [
"First check for option (menu) click"
^ self yellowButtonActivity: evt shiftPressed].
"Show the caret immediately on mouse down to give user feedback."
self resetBlinkCursor.
"If focus does not follow the mouse cursor and we click below everything, just grab the focus to not destroy the selection."
((self hasKeyboardFocus: evt hand) not and: [(self bounds containsPoint: evt position) not])
ifTrue: [evt hand newKeyboardFocus: self]
ifFalse: [
evt hand newKeyboardFocus: self.
self
+ handleInteraction: [self mouseEnter: evt. editor mouseDown: evt]
- handleInteraction: [editor mouseDown: evt]
fromEvent: evt].!
Item was added:
+ ----- Method: TextMorph>>mouseEnter: (in category 'event handling') -----
+ mouseEnter: evt
+
+ self editor updateCursorForEvent: evt.!
Item was added:
+ ----- Method: TextMorph>>mouseLeave: (in category 'event handling') -----
+ mouseLeave: evt
+
+ evt hand showTemporaryCursor: nil.!
Item was changed:
----- Method: TextMorph>>mouseMove: (in category 'event handling') -----
mouseMove: evt
+
+ evt redButtonPressed ifFalse: [
+ self editor updateCursorForEvent: evt.
+ self enterClickableRegion: evt.
+ ^ self].
+
+ self
+ handleInteraction: [self editor mouseMove: evt]
+ fromEvent: evt.!
- evt redButtonPressed ifFalse: [^ self enterClickableRegion: evt].
- self handleInteraction: [self editor mouseMove: evt] fromEvent: evt!
Item was added:
+ ----- Method: TextMorph>>startDrag: (in category 'event handling') -----
+ startDrag: evt
+
+ [evt hand grabMorph: (TransferMorph withPassenger: self selection from: self)]
+ ensure: [evt hand releaseMouseFocus: self].!
Item was changed:
TextMorph subclass: #TextMorphForEditView
instanceVariableNames: 'editView acceptOnCR'
+ classVariableNames: 'DraggableTextSelection'
- classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Text Support'!
Item was added:
+ ----- Method: TextMorphForEditView class>>draggableTextSelection (in category 'preferences') -----
+ draggableTextSelection
+
+ <preference: 'Draggable Text Selections'
+ categoryList: #(editing mouse Morphic)
+ description: 'Whether you can drag-and-drop selections in text morphs.'
+ type: #Boolean>
+
+ ^ DraggableTextSelection ifNil: [false]!
Item was added:
+ ----- Method: TextMorphForEditView class>>draggableTextSelection: (in category 'preferences') -----
+ draggableTextSelection: aBoolean
+
+ DraggableTextSelection := aBoolean.
+
+ TextMorphForEditView allInstancesDo: [:tm |
+ tm dragEnabled: aBoolean; dropEnabled: aBoolean].!
Item was added:
+ ----- Method: TextMorphForEditView>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
+ acceptDroppingMorph: aTransferMorph event: evt
+ "Accept a text to be inserted at the event/cursor position. Either remove or keep the source text depending on the transfer morph's copy state."
+
+ self removeProperty: #waitingForTextDrag.
+
+ self
+ handleInteraction: [
+ aTransferMorph shouldCopy
+ ifFalse: [(aTransferMorph source respondsTo: #editor)
+ ifTrue: [aTransferMorph source editor destructiveBackWord]].
+ self editor addText: aTransferMorph passenger asText event: evt]
+ fromEvent: evt.
+
+ self flag: #hack. "mt: Shout background styling restores the selection, which interferes here. *sigh*"
+ self editView instVarNamed: #selectionInterval put: nil.
+ (aTransferMorph source respondsTo: #editView)
+ ifTrue: [aTransferMorph source editView instVarNamed: #selectionInterval put: nil.]!
Item was changed:
----- Method: TextMorphForEditView>>initialize (in category 'initialization') -----
initialize
+
super initialize.
+
+ self acceptOnCR: false.
+ self dragEnabled: self class draggableTextSelection.
+ self dropEnabled: self class draggableTextSelection.!
- acceptOnCR := false!
Item was added:
+ ----- Method: TextMorphForEditView>>wantsDroppedMorph:event: (in category 'dropping/grabbing') -----
+ wantsDroppedMorph: aMorph event: evt
+
+ ^ ((super wantsDroppedMorph: aMorph event: evt)
+ and: [aMorph isKindOf: TransferMorph])
+ and: [aMorph passenger isString or: [aMorph passenger isText]]!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.779.mcz
==================== Summary ====================
Name: Collections-eem.779
Author: eem
Time: 20 December 2017, 12:47:12.586523 am
UUID: 36376941-8dc4-4b3c-8935-f2839a6321c1
Ancestors: Collections-mt.778
Fix bytesPerBasicElement for Spur.
=============== Diff against Collections-mt.778 ===============
Item was changed:
----- Method: ArrayedCollection>>bytesPerBasicElement (in category 'objects from disk') -----
bytesPerBasicElement
"Answer the number of bytes that each of my basic elements requires.
In other words:
self basicSize * self bytesPerBasicElement
should equal the space required on disk by my variable sized representation."
+ | bytesPerElementOrZero |
+ bytesPerElementOrZero := #[0 0 0 0 0 0 0 0 8 4 4 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] at: self class instSpec.
+ ^bytesPerElementOrZero = 0
+ ifTrue: [Smalltalk wordSize]
+ ifFalse: [bytesPerElementOrZero]!
- ^self class isBytes ifTrue: [ 1 ] ifFalse: [ 4 ]!
Eliot Miranda uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-eem.389.mcz
==================== Summary ====================
Name: Graphics-eem.389
Author: eem
Time: 20 December 2017, 12:28:14.285581 am
UUID: c000254c-e001-4382-872d-726048c0b5c0
Ancestors: Graphics-mt.388
Fix hackBits for DoubleWordArray and DoubleByteArray.
=============== Diff against Graphics-mt.388 ===============
Item was changed:
----- Method: Form>>hackBits: (in category 'private') -----
hackBits: bitThing
"This method provides an initialization so that BitBlt may be used, eg, to
copy ByteArrays and other non-pointer objects efficiently.
The resulting form looks 4 wide, 8 deep, and bitThing-size-in-words high."
width := 4.
depth := 8.
bitThing class isBits ifFalse: [self error: 'bitThing must be a non-pointer object'].
+ height := bitThing basicSize * bitThing bytesPerElement // width.
- bitThing class isBytes
- ifTrue: [height := bitThing basicSize // 4]
- ifFalse: [height := bitThing basicSize].
bits := bitThing!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.779.mcz
==================== Summary ====================
Name: Tools-mt.779
Author: mt
Time: 19 December 2017, 8:39:28.282281 am
UUID: 5e2d8ff5-fe52-c743-931e-637a058fcbd8
Ancestors: Tools-eem.778
Fixes the behavior of "browser spawning" (via CMD+O), which affects "copy up or down..." of methods in the class tree.
Note that the rather new interface for building browsers via #newOnClass... introduced a serious deception in terms of which kind of browser (full, class, protocol) is being build. We have to make this more clear!
=============== Diff against Tools-eem.778 ===============
Item was changed:
----- Method: Browser class>>newOnClass:messageCategory:selector:editString:label: (in category 'instance creation') -----
newOnClass: aClass messageCategory: aCategory selector: aSelector editString: aString label: aLabel
"Open a new message protocol browser on this class & protocol with aString pre-selected in the code pane.
We have to be a bit sneaky to do the string insertion since it cannot be handled until after the actual browser is built and opened"
"Browser newOnClass: Browser messageCategory: 'controls' selector: #decorateButtons editString: 'test string edit setup' label: 'Testing class browser with set edit string'"
| newBrowser|
newBrowser := self new.
"setting up a new browser for a specific class, category and selector requires this order of messages
since the #selectMessageCategoryNamed: carefully nils the chosen selector; thus we can't use
the more obvious seeming #setClass:selector: method"
+ newBrowser
+ setClass: aClass;
+ selectMessageCategoryNamed: aCategory;
- newBrowser setClass: aClass;
- selectMessageCategoryNamed: aCategory;
selectMessageNamed: aSelector.
newBrowser buildAndOpenMessageCategoryBrowserLabel: 'Message Category Browser (' , aClass name, ')'.
aString ifNotNil:[newBrowser changed: #editString with: aString].
^newBrowser!
Item was changed:
----- Method: CodeHolder>>buildClassBrowserEditString: (in category 'construction') -----
+ buildClassBrowserEditString: classDefinition
- buildClassBrowserEditString: aString
"Create and schedule a new class browser for the current selection, with initial textual contents set to aString. This is used specifically in spawning where a class is established but a method-category is not."
+ self flag: #uglyHack. "mt: We should not abuse Browser like this. We should not even know about #Browser in this superclass."
+ ^(Browser
+ newOnClass: self selectedClassOrMetaClass
+ editString: classDefinition
+ label: 'Class Browser: ', self selectedClassOrMetaClass name)
+ editSelection: #editClass; "...because we know it is class def code."
+ changed: #editString with: classDefinition; "...trigger re-styling."
+ yourself
- ^Browser newOnClass: self selectedClassOrMetaClass editString: aString label: 'Class Browser: ', self selectedClassOrMetaClass name
!
Item was added:
+ ----- Method: CodeHolder>>buildMessageCategoryBrowserForCategory:class:selector:editString: (in category 'construction') -----
+ buildMessageCategoryBrowserForCategory: aCategory class: aClass selector: aSelectorOrNil editString: methodSourceCode
+ "Create and schedule a new class browser for the current selection,
+ with initial textual contents set to aString. This is used specifically in
+ spawning where a class is established but a method-category is not."
+
+ self flag: #uglyHack. "mt: We should not abuse Browser like this. We should not even know about #Browser in this superclass."
+ ^ (Browser
+ newOnClass: aClass
+ messageCategory: aCategory
+ selector: aSelectorOrNil
+ editString: methodSourceCode
+ label: 'Message category Browser: ' , aClass name , aCategory)
+ editSelection: #editMessage; "...because we know it is method code."
+ changed: #editString with: methodSourceCode; "...trigger re-styling."
+ yourself!
Item was removed:
- ----- Method: CodeHolder>>buildMessageCategoryBrowserForClass:selector:editString: (in category 'construction') -----
- buildMessageCategoryBrowserForClass: aClass selector: aSelectorOrNil editString: aString
- "Create and schedule a new class browser for the current selection,
- with initial textual contents set to aString. This is used specifically in
- spawning where a class is established but a method-category is not."
- ^ Browser
- newOnClass: aClass
- messageCategory: self categoryOfCurrentMethod
- selector: aSelectorOrNil
- editString: aString
- label: 'Message category Browser: ' , self selectedClassOrMetaClass name , self categoryOfCurrentMethod!
Item was changed:
----- Method: CodeHolder>>spawn: (in category 'commands') -----
spawn: aString
"Create and schedule a spawned message category browser for the currently selected message category. The initial text view contains the characters in aString. In the spawned browser, preselect the current selector (if any) as the going-in assumption, though upon acceptance this will often change"
+ self selectedClassOrMetaClass
+ ifNil: [
+ ^ aString isEmptyOrNil ifFalse: [(Workspace new contents: aString) openLabel: 'spawned workspace']]
+ ifNotNil: [:cls |
+ self categoryOfCurrentMethod
+ ifNil: [
+ self buildClassBrowserEditString: aString]
+ ifNotNil: [:category |
+ self
+ buildMessageCategoryBrowserForCategory: category
+ class: cls
+ selector: self selectedMessageName
+ editString: aString]]!
- | aCategory aClass |
- (aClass := self selectedClassOrMetaClass) isNil ifTrue:
- [^ aString isEmptyOrNil ifFalse: [(Workspace new contents: aString) openLabel: 'spawned workspace']].
-
- (aCategory := self categoryOfCurrentMethod)
- ifNil:
- [self buildClassBrowserEditString: aString]
- ifNotNil:
- [self buildMessageCategoryBrowserForClass: aClass selector: self selectedMessageName editString: aString ]!
Item was changed:
----- Method: CodeHolder>>spawnToClass: (in category 'commands') -----
spawnToClass: aClass
"Used to copy down code from a superclass to a subclass in one easy step, if you know what you're doing. Spawns a new message-category browser for the indicated class, populating it with the source code seen in the current tool."
self categoryOfCurrentMethod
+ ifNil: [
+ self buildClassBrowserEditString: self contents]
+ ifNotNil: [:category |
+ self
+ buildMessageCategoryBrowserForCategory: category
+ class: aClass
+ selector: nil
+ editString: self contents]!
- ifNil:
- [self buildClassBrowserEditString: self contents]
- ifNotNil:
- [self buildMessageCategoryBrowserForClass: aClass selector: nil editString: self contents]!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-mt.102.mcz
==================== Summary ====================
Name: HelpSystem-Core-mt.102
Author: mt
Time: 18 December 2017, 5:42:15.024502 pm
UUID: 6871bdd2-b9f9-484b-a35e-f2d659de234e
Ancestors: HelpSystem-Core-bf.101
Makes file-based help topics more robust in case you try to read a binary file as text. This happens, for example, if macOS app bundles do not strip "._" files.
=============== Diff against HelpSystem-Core-bf.101 ===============
Item was changed:
----- Method: FileBasedHelpTopic>>contents (in category 'accessing') -----
contents
^ contents ifNil: [
+ [contents := fileEntry readStream nextChunkText withSqueakLineEndings]
+ on: InvalidUTF8
+ do: [:err | ('Invalid UTF8 contents!! Please check ', self fileEntry fullName) asText addAttribute: TextColor red]]!
- contents := fileEntry readStream nextChunkText withSqueakLineEndings].!