David T. Lewis uploaded a new version of Morphic to project The Trunk: http://source.squeak.org/trunk/Morphic-dtl.2142.mcz
==================== Summary ====================
Name: Morphic-dtl.2142 Author: dtl Time: 25 November 2023, 2:55:39.560759 pm UUID: 24340daa-89b7-422e-a886-8ddeefbe67df Ancestors: Morphic-ct.2141
Move methods to Etoys if they are referenced only by the full Etoys image, based on Marcel's unload-etoys.33.cs Etoys removal script. Reference squeak-dev 29-Aug-2023 Let's discuss the future of Etoys in Squeak 6.1 (and beyond)
=============== Diff against Morphic-ct.2141 ===============
Item was removed: - PluggableTextMorph subclass: #AcceptableCleanTextMorph - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Pluggable Widgets'!
Item was removed: - ----- Method: AcceptableCleanTextMorph>>accept (in category 'menu commands') ----- - accept - "Overridden to allow accept of clean text" - - | textToAccept ok | - textToAccept := textMorph text. - ok := setTextSelector isNil or: - [setTextSelector numArgs = 2 - ifTrue: - [model - perform: setTextSelector - with: textToAccept - with: self] - ifFalse: [model perform: setTextSelector with: textToAccept]]. - ok - ifTrue: - [self setText: self getText. - self hasUnacceptedEdits: false]!
Item was removed: - BorderedMorph subclass: #BorderedSubpaneDividerMorph - instanceVariableNames: 'resizingEdge' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Windows'!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph class>>forBottomEdge (in category 'instance creation') ----- - forBottomEdge - ^self new horizontal resizingEdge: #bottom!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph class>>forTopEdge (in category 'instance creation') ----- - forTopEdge - ^self new horizontal resizingEdge: #top!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph class>>horizontal (in category 'instance creation') ----- - horizontal - ^self new horizontal!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph class>>vertical (in category 'instance creation') ----- - vertical - ^self new vertical!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>defaultBorderWidth (in category 'initialization') ----- - defaultBorderWidth - "answer the default border width for the receiver" - ^ 0!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>defaultColor (in category 'initialization') ----- - defaultColor - "answer the default color/fill style for the receiver" - ^ Color black!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>firstEnter: (in category 'private') ----- - firstEnter: evt - "The first time this divider is activated, find its window and redirect further interaction there." - | window | - - window := self firstOwnerSuchThat: [:m | m respondsTo: #secondaryPaneTransition:divider:]. - window ifNil: [ self suspendEventHandler. ^ self ]. "not working out" - window secondaryPaneTransition: evt divider: self. - self on: #mouseEnter send: #secondaryPaneTransition:divider: to: window. - !
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>horizontal (in category 'layout') ----- - horizontal - - self hResizing: #spaceFill.!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>initialize (in category 'initialization') ----- - initialize - "initialize the state of the receiver" - super initialize. - "" - self extent: 1 @ 1!
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>resizingEdge (in category 'accessing') ----- - resizingEdge - - ^resizingEdge - !
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>resizingEdge: (in category 'accessing') ----- - resizingEdge: edgeSymbol - - (#(top bottom) includes: edgeSymbol) ifFalse: - [ self error: 'resizingEdge must be #top or #bottom' ]. - resizingEdge := edgeSymbol. - self on: #mouseEnter send: #firstEnter: to: self. - !
Item was removed: - ----- Method: BorderedSubpaneDividerMorph>>vertical (in category 'layout') ----- - vertical - - self vResizing: #spaceFill.!
Item was removed: - ----- Method: ColorPickerMorph>>delete (in category 'submorphs - add/remove') ----- - delete - "The moment of departure has come. - If the receiver has an affiliated command, finalize it and have the system remember it. - In any case, delete the receiver" - - (selector isNil or: [ target isNil ]) ifFalse: [ - self rememberCommand: - (Command new - cmdWording: 'color change' translated; - undoTarget: target selector: selector arguments: (self argumentsWith: originalColor); - redoTarget: target selector: selector arguments: (self argumentsWith: selectedColor)). - ]. - super delete!
Item was removed: - ----- Method: ColorPickerMorph>>getColorFromKedamaWorldIfPossible: (in category 'kedama') ----- - getColorFromKedamaWorldIfPossible: aGlobalPoint - - self world submorphs do: [:sub | - (sub isKedamaMorph) ifTrue: [ - sub morphsAt: aGlobalPoint unlocked: false do: [:e | - ^ e colorAt: (aGlobalPoint - e topLeft). - ]. - ]. - ]. - ^ nil. - !
Item was removed: - ----- Method: DockingBarMorph>>isSticky (in category 'accessing') ----- - isSticky - "answer whether the receiver is Sticky" - ^ Preferences noviceMode - or: [super isSticky] !
Item was removed: - ----- Method: DockingBarMorph>>resistsRemoval (in category 'accessing') ----- - resistsRemoval - "Answer whether the receiver is marked as resisting removal" - ^ Preferences noviceMode - or: [super resistsRemoval]!
Item was removed: - ----- Method: HaloMorph>>addChooseGraphicHandle: (in category 'handles') ----- - addChooseGraphicHandle: haloSpec - "If the target is a sketch morph, and if the governing preference is set, add a halo handle allowing the user to select a new graphic" - - (Preferences showChooseGraphicHaloHandle and: [innerTarget isSketchMorph]) ifTrue: - [self addHandle: haloSpec - on: #mouseDown send: #chooseNewGraphicFromHalo to: innerTarget] - !
Item was removed: - ----- Method: HaloMorph>>addMakeSiblingHandle: (in category 'handles') ----- - addMakeSiblingHandle: haloSpec - "Add the halo handle that allows a sibling instance to be torn off, or, if the shift key is down, for a deep-copy duplicate to be made." - - self addHandle: haloSpec on: #mouseDown send: #doMakeSiblingOrDup:with: to: self - - !
Item was removed: - ----- Method: HaloMorph>>addPaintBgdHandle: (in category 'handles') ----- - addPaintBgdHandle: haloSpec - (innerTarget isKindOf: PasteUpMorph) ifTrue: - [self addHandle: haloSpec - on: #mouseDown send: #paintBackground to: innerTarget]. - !
Item was removed: - ----- Method: HaloMorph>>addPoohHandle: (in category 'handles') ----- - addPoohHandle: handleSpec - (innerTarget isKindOf: (Smalltalk at: #WonderlandCameraMorph ifAbsent:[nil])) ifTrue: - [self addHandle: handleSpec on: #mouseDown send: #strokeMode to: innerTarget] - !
Item was removed: - ----- Method: HaloMorph>>addRepaintHandle: (in category 'handles') ----- - addRepaintHandle: haloSpec - (innerTarget isSketchMorph) ifTrue: - [self addHandle: haloSpec - on: #mouseDown send: #editDrawing to: innerTarget] - !
Item was removed: - ----- Method: HaloMorph>>addScriptHandle: (in category 'handles') ----- - addScriptHandle: haloSpec - "If the halo's innerTarget claims it wants a Script handle, add one to the receiver, forming it as per haloSpec" - - innerTarget wantsScriptorHaloHandle ifTrue: - [self addHandle: haloSpec - on: #mouseUp send: #editButtonsScript to: innerTarget] - !
Item was removed: - ----- Method: HaloMorph>>addTileHandle: (in category 'handles') ----- - addTileHandle: haloSpec - "Add the 'tear-off-tile' handle from the spec" - - self addHandle: haloSpec on: #mouseDown send: #tearOffTileForTarget:with: to: self - !
Item was removed: - ----- Method: HaloMorph>>addViewHandle: (in category 'handles') ----- - addViewHandle: haloSpec - "Add the 'open viewer' handle from the halo spec" - - self addHandle: haloSpec - on: #mouseDown send: #openViewerForTarget:with: to: self - - - !
Item was removed: - ----- Method: HaloMorph>>addViewingHandle: (in category 'handles') ----- - addViewingHandle: haloSpec - "If appropriate, add a special Viewing halo handle to the receiver. On 26 Sept 07, we decided to eliminate this item from the UI, so the code of is method is now commented out... - - (innerTarget isKindOf: PasteUpMorph) ifTrue: - [self addHandle: haloSpec - on: #mouseDown send: #presentViewMenu to: innerTarget]. - " - !
Item was removed: - ----- Method: HaloMorph>>doDupOrMakeSibling:with: (in category 'handles') ----- - doDupOrMakeSibling: evt with: dupHandle - "Ask hand to duplicate my target, if shift key *not* pressed, or make a sibling if shift key *is* pressed" - - ^ (evt shiftPressed and: [target couldMakeSibling]) - ifTrue: - [dupHandle color: Color green muchDarker. - self doMakeSibling: evt with: dupHandle] - ifFalse: - [self doDup: evt with: dupHandle]!
Item was removed: - ----- Method: HaloMorph>>doMakeSibling:with: (in category 'private') ----- - doMakeSibling: evt with: dupHandle - "Ask hand to make a sibling of my target. Only reachable if target is of a uniclass" - - target couldMakeSibling ifFalse: [^ self]. - - target assuredPlayer assureUniClass. - self obtainHaloForEvent: evt andRemoveAllHandlesBut: dupHandle. - self setTarget: (target makeSiblings: 1) first. - evt hand grabMorph: target. - self step. "update position if necessary" - evt hand addMouseListener: self. "Listen for the drop"!
Item was removed: - ----- Method: HaloMorph>>doMakeSiblingOrDup:with: (in category 'handles') ----- - doMakeSiblingOrDup: evt with: dupHandle - "Ask hand to duplicate my target, if shift key *is* pressed, or make a sibling if shift key *not* pressed" - - ^ (evt shiftPressed or: [target couldMakeSibling not]) - ifFalse: - [self doMakeSibling: evt with: dupHandle] - ifTrue: - [dupHandle color: Color green. - self doDup: evt with: dupHandle]!
Item was removed: - ----- Method: HaloMorph>>fadeIn (in category 'stepping') ----- - fadeIn - self magicAlpha >= 1.0 ifTrue:[self stopSteppingSelector: #fadeIn]. - self magicAlpha: ((self magicAlpha + 0.1) min: 1.0) - !
Item was removed: - ----- Method: HaloMorph>>fadeInInitially (in category 'stepping') ----- - fadeInInitially - | max | - max := self isMagicHalo ifTrue:[0.3] ifFalse:[1.0]. - self magicAlpha >= max ifTrue:[self stopSteppingSelector: #fadeInInitially]. - self magicAlpha: ((self magicAlpha + (max * 0.1)) min: max) - !
Item was removed: - ----- Method: HaloMorph>>fadeOut (in category 'stepping') ----- - fadeOut - self magicAlpha <= 0.3 ifTrue:[self stopSteppingSelector: #fadeOut]. - self magicAlpha: ((self magicAlpha - 0.1) max: 0.3) - !
Item was removed: - ----- Method: HaloMorph>>fadeOutFinally (in category 'stepping') ----- - fadeOutFinally - self magicAlpha <= 0.05 ifTrue:[^super delete]. - self magicAlpha <= 0.3 ifTrue:[ - ^self magicAlpha: (self magicAlpha - 0.03 max: 0.0)]. - self magicAlpha: ((self magicAlpha * 0.5) max: 0.0) - !
Item was removed: - ----- Method: HaloMorph>>handleEntered (in category 'stepping') ----- - handleEntered - self isMagicHalo ifFalse:[^self]. - self stopStepping; startStepping. - self startSteppingSelector: #fadeIn. - !
Item was removed: - ----- Method: HaloMorph>>handleLeft (in category 'stepping') ----- - handleLeft - self isMagicHalo ifFalse:[^self]. - self stopStepping; startStepping. - self startSteppingSelector: #fadeOut.!
Item was removed: - ----- Method: HaloMorph>>isMagicHalo (in category 'accessing') ----- - isMagicHalo - ^self valueOfProperty: #isMagicHalo ifAbsent:[false].!
Item was removed: - ----- Method: HaloMorph>>isMagicHalo: (in category 'accessing') ----- - isMagicHalo: aBool - self setProperty: #isMagicHalo toValue: aBool. - aBool - ifTrue: [ - self on: #mouseEnter send: #handleEntered to: self. - self on: #mouseLeave send: #handleLeft to: self] - ifFalse:[ - "Reset everything" - self eventHandler ifNotNil: [:eh | - eh forgetDispatchesTo: #handleEntered; - forgetDispatchesTo: #handleLeft]. - self stopStepping. "get rid of all" - self startStepping. "only those of interest"].!
Item was removed: - ----- Method: HaloMorph>>mouseDown: (in category 'events') ----- - mouseDown: event - - self isMagicHalo ifTrue: [ - self isMagicHalo: false. - self magicAlpha: 1.0]. - - super mouseDown: event.!
Item was removed: - ----- Method: HaloMorph>>openViewerForTarget:with: (in category 'handles') ----- - openViewerForTarget: evt with: aHandle - "Open a viewer for my inner target or if shift pressed make a snapshot of morph." - self obtainHaloForEvent: evt andRemoveAllHandlesBut: nil. - evt shiftPressed - ifTrue: [target duplicateMorphImage: evt] - ifFalse: [innerTarget openViewerForArgument]!
Item was removed: - ----- Method: HaloMorph>>popUpMagicallyFor:hand: (in category 'pop up') ----- - popUpMagicallyFor: aMorph hand: aHand - "Programatically pop up a halo for a given hand." - - super - popUpMagicallyFor: aMorph - hand: aHand. - - Preferences magicHalos - ifTrue: [self isMagicHalo: true]. - (Preferences haloTransitions not and: [self isMagicHalo]) - ifTrue: [self magicAlpha: 0.2]. - !
Item was removed: - ----- Method: HaloMorph>>tearOffTileForTarget:with: (in category 'handles') ----- - tearOffTileForTarget: evt with: aHandle - "Tear off a tile representing my inner target. If shift key is down, open up an instance browser on the morph itself, not the player, with tiles showing, instead" - - self obtainHaloForEvent: evt andRemoveAllHandlesBut: nil. - innerTarget tearOffTile!
Item was removed: - ----- Method: HandMorph>>removePendingHaloFor: (in category 'halo handling') ----- - removePendingHaloFor: aMorph - "Get rid of pending balloon help or halo actions." - self removeAlarm: #spawnMagicHaloFor:.!
Item was removed: - ----- Method: HandMorph>>spawnMagicHaloFor: (in category 'halo handling') ----- - spawnMagicHaloFor: aMorph - - self halo ifNotNil: [ :halo | - halo target == aMorph ifTrue:[ ^self ] ]. - aMorph addMagicHaloFor: self.!
Item was removed: - ----- Method: HandMorph>>triggerHaloFor:after: (in category 'halo handling') ----- - triggerHaloFor: aMorph after: timeOut - "Trigger automatic halo after the given time out for some morph" - self addAlarm: #spawnMagicHaloFor: with: aMorph after: timeOut!
Item was removed: - ----- Method: ImageMorph class>>descriptionForPartsBin (in category 'parts bin') ----- - descriptionForPartsBin - ^ self partName: 'Image' translatedNoop - categories: #('Graphics' 'Basic') - documentation: 'A non-editable picture. If you use the Paint palette to make a picture, you can edit it afterwards.' translatedNoop!
Item was removed: - Object subclass: #KeyboardBuffer - instanceVariableNames: 'event eventUsed' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Text Support'!
Item was removed: - ----- Method: KeyboardBuffer>>commandKeyPressed (in category 'testing') ----- - commandKeyPressed - ^ event commandKeyPressed!
Item was removed: - ----- Method: KeyboardBuffer>>controlKeyPressed (in category 'testing') ----- - controlKeyPressed - ^ event controlKeyPressed!
Item was removed: - ----- Method: KeyboardBuffer>>flushKeyboard (in category 'keyboard control') ----- - flushKeyboard - eventUsed ifFalse: [^ eventUsed := true].!
Item was removed: - ----- Method: KeyboardBuffer>>keyboard (in category 'keyboard control') ----- - keyboard - eventUsed ifFalse: [eventUsed := true. ^ event keyCharacter]. - ^ nil!
Item was removed: - ----- Method: KeyboardBuffer>>keyboardPeek (in category 'keyboard control') ----- - keyboardPeek - eventUsed ifFalse: [^ event keyCharacter]. - ^ nil!
Item was removed: - ----- Method: KeyboardBuffer>>keyboardPressed (in category 'testing') ----- - keyboardPressed - ^eventUsed not!
Item was removed: - ----- Method: KeyboardBuffer>>leftShiftDown (in category 'testing') ----- - leftShiftDown - ^ event shiftPressed!
Item was removed: - ----- Method: KeyboardBuffer>>startingEvent: (in category 'private') ----- - startingEvent: evt - event := evt. - eventUsed := false!
Item was removed: - ----- Method: MenuItemMorph>>adaptToWorld: (in category 'accessing') ----- - adaptToWorld: aWorld - - super adaptToWorld: aWorld. - target := target adaptedToWorld: aWorld.!
Item was removed: - ----- Method: MenuItemMorph>>allWordingsNotInSubMenus: (in category 'accessing') ----- - allWordingsNotInSubMenus: verbotenSubmenuContentsList - "Answer a collection of the wordings of all items and subitems, but omit the stay-up item, and also any items in any submenu whose tag is in verbotenSubmenuContentsList" - - self isStayUpItem ifTrue:[^ #()]. - subMenu ifNotNil: - [^ (verbotenSubmenuContentsList includes: self contents asString) - ifTrue: - [#()] - ifFalse: - [subMenu allWordingsNotInSubMenus: verbotenSubmenuContentsList]]. - - ^ Array with: self contents asString!
Item was removed: - ----- Method: MenuMorph>>undoGrabCommand (in category 'dropping/grabbing') ----- - undoGrabCommand - ^nil!
Item was removed: - ----- Method: Morph class>>selectionBackground (in category 'defaults') ----- - selectionBackground - "The background for selected items in lists and tree-list thingies." - ^ self subduedHilites ifTrue: [ - TranslucentColor r: 0.0 g: 0.0 b: 0.8 alpha: 0.2 - ] ifFalse: [ - "This is tuned so the red-foreground used for list texts stays somewhat legible." - Color r: 0.8 g:0.8 b: 0.81 alpha: 0.85 - ]. - !
Item was removed: - ----- Method: Morph>>adaptToWorld: (in category 'e-toy support') ----- - adaptToWorld: aWorld - "The receiver finds itself operating in a possibly-different new world. If any of the receiver's parts are world-dependent (such as a target of a SimpleButtonMorph, etc.), then have them adapt accordingly" - submorphs do: [:m | m adaptToWorld: aWorld]. - self eventHandler ifNotNil: - [self eventHandler adaptToWorld: aWorld]!
Item was removed: - ----- Method: Morph>>addMagicHaloFor: (in category 'halos and balloon help') ----- - addMagicHaloFor: aHand - - aHand halo ifNotNil: [:halo | - halo target == self ifTrue:[^self]. - halo isMagicHalo ifFalse:[^self]]. - - self createHalo - popUpMagicallyFor: self hand: aHand!
Item was removed: - ----- Method: Morph>>addMorphNearBack: (in category 'submorphs - misc') ----- - addMorphNearBack: aMorph - | bg | - (submorphs notEmpty and: [submorphs last mustBeBackmost]) - ifTrue: - [bg := submorphs last. - bg privateDelete]. - self addMorphBack: aMorph. - bg ifNotNil: [self addMorphBack: bg]!
Item was removed: - ----- Method: Morph>>addPaintingItemsTo:hand: (in category 'menus') ----- - addPaintingItemsTo: aMenu hand: aHandMorph - | subMenu movies | - subMenu := MenuMorph new defaultTarget: self. - subMenu - add: 'repaint' translated action: #editDrawing; - add: 'set rotation center' translated action: #setRotationCenter; - add: 'reset forward-direction' translated action: #resetForwardDirection; - add: 'set rotation style' translated action: #setRotationStyle; - add: 'erase pixels of color' translated action: #erasePixelsUsing:; - add: 'recolor pixels of color' translated action: #recolorPixelsUsing:; - add: 'reduce color palette' translated action: #reduceColorPalette:; - add: 'detect edges' translated action: #edgeDetect; - add: 'sharpen' translated action: #sharpen; - add: 'blur' translated action: #blur; - add: 'emboss' translated action: #emboss; - add: 'add a border around this shape...' translated action: #addBorderToShape:. - movies := (self world rootMorphsAt: aHandMorph targetPoint) - select: [:m | (m isKindOf: MovieMorph) or: [m isSketchMorph]]. - movies size > 1 - ifTrue: - [subMenu add: 'insert into movie' translated action: #insertIntoMovie:]. - aMenu add: 'painting...' translated subMenu: subMenu!
Item was removed: - ----- Method: Morph>>allMenuWordings (in category 'menus') ----- - allMenuWordings - | tempMenu | - tempMenu := self buildHandleMenu: self currentHand. - tempMenu allMorphsDo: [:m | m step]. "Get wordings current" - ^ tempMenu allWordings!
Item was removed: - ----- Method: Morph>>allMorphsAndBookPagesInto: (in category 'e-toy support') ----- - allMorphsAndBookPagesInto: aSet - "Return a set of all submorphs. Don't forget the hidden ones like BookMorph pages that are not showing. Consider only objects that are in memory (see allNonSubmorphMorphs)." - - submorphs do: [:m | m allMorphsAndBookPagesInto: aSet]. - self allNonSubmorphMorphs do: [:m | - (aSet includes: m) ifFalse: ["Stop infinite recursion" - m allMorphsAndBookPagesInto: aSet]]. - aSet add: self. - self player ifNotNil: - [self player allScriptEditors do: [:e | e allMorphsAndBookPagesInto: aSet]]. - ^ aSet!
Item was removed: - ----- Method: Morph>>allMorphsWithPlayersDo: (in category 'submorphs - misc') ----- - allMorphsWithPlayersDo: aTwoArgumentBlock - "Evaluate the given block for all morphs in this composite morph that have non-nil players. - Also evaluate the block for the receiver if it has a player." - - submorphs do: [:m | m allMorphsWithPlayersDo: aTwoArgumentBlock ]. - self playerRepresented ifNotNil: [ :p | aTwoArgumentBlock value: self value: p ]. - !
Item was removed: - ----- Method: Morph>>applyStatusToAllSiblings: (in category 'meta-actions') ----- - applyStatusToAllSiblings: evt - "Apply the statuses of all my scripts to the script status of all my siblings" - - | aPlayer | - (aPlayer := self topRendererOrSelf player) belongsToUniClass ifFalse: [self error: 'not uniclass']. - aPlayer instantiatedUserScriptsDo: - [:aScriptInstantiation | aScriptInstantiation assignStatusToAllSiblings]!
Item was removed: - ----- Method: Morph>>asNumber: (in category 'e-toy support') ----- - asNumber: aPointOrNumber - "Support for e-toy demo." - - aPointOrNumber class = Point - ifTrue: [^ aPointOrNumber r] - ifFalse: [^ aPointOrNumber]. - !
Item was removed: - ----- Method: Morph>>automaticViewing (in category 'e-toy support') ----- - automaticViewing - "Backstop, in case this message gets sent to an owner that is not a playfield" - ^ false!
Item was removed: - ----- Method: Morph>>bringAllSiblingsToMe: (in category 'meta-actions') ----- - bringAllSiblingsToMe: evt - "bring all siblings of the receiver's player found in the same container to the receiver's location." - - | aPlayer aPosition aContainer | - (aPlayer := self topRendererOrSelf player) belongsToUniClass ifFalse: [self error: 'not uniclass']. - aPosition := self topRendererOrSelf position. - aContainer := self topRendererOrSelf owner. - (aPlayer class allInstances copyWithout: aPlayer) do: - [:each | - (aContainer submorphs includes: each costume) ifTrue: - [each costume position: aPosition]]!
Item was removed: - ----- Method: Morph>>chooseNewGraphic (in category 'menus') ----- - chooseNewGraphic - "Used by any morph that can be represented by a graphic" - self chooseNewGraphicCoexisting: false - !
Item was removed: - ----- Method: Morph>>chooseNewGraphicCoexisting: (in category 'menus') ----- - chooseNewGraphicCoexisting: aBoolean - "Allow the user to choose a different form for her form-based morph" - - | replacee aGraphicalMenu | - self isInWorld ifFalse: "menu must have persisted for a not-in-world object." - [aGraphicalMenu := Project current world submorphThat: - [:m | (m isKindOf: GraphicalMenu) and: [m target == self]] - ifNone: - [^ self]. - ^ aGraphicalMenu show; flashBounds]. - aGraphicalMenu := GraphicalMenu new - initializeFor: self - withForms: self reasonableForms - coexist: aBoolean. - aBoolean - ifTrue: [self primaryHand attachMorph: aGraphicalMenu] - ifFalse: [replacee := self topRendererOrSelf. - replacee owner replaceSubmorph: replacee by: aGraphicalMenu]!
Item was removed: - ----- Method: Morph>>chooseNewGraphicFromHalo (in category 'menus') ----- - chooseNewGraphicFromHalo - "Allow the user to select a changed graphic to replace the one in the receiver" - - self currentWorld abandonAllHalos. - self chooseNewGraphicCoexisting: true - !
Item was removed: - ----- Method: Morph>>couldMakeSibling (in category 'testing') ----- - couldMakeSibling - "Answer whether it is appropriate to ask the receiver to make a sibling" - - ^ true!
Item was removed: - ----- Method: Morph>>currentPlayerDo: (in category 'e-toy support') ----- - currentPlayerDo: aBlock - "If the receiver is a viewer/scriptor associated with a current Player object, evaluate the given block against that object"!
Item was removed: - ----- Method: Morph>>cursor (in category 'e-toy support') ----- - cursor - "vacuous backstop in case it gets sent to a morph that doesn't know what to do with it" - - ^ 1!
Item was removed: - ----- Method: Morph>>cursor: (in category 'e-toy support') ----- - cursor: aNumber - "vacuous backstop in case it gets sent to a morph that doesn't know what to do with it" - !
Item was removed: - ----- Method: Morph>>decimalPlacesForGetter: (in category 'e-toy support') ----- - decimalPlacesForGetter: aGetter - "Answer the decimal places I prefer for showing a slot with the given getter, or nil if none" - - | decimalPrefs | - decimalPrefs := self renderedMorph valueOfProperty: #decimalPlacePreferences ifAbsent: [^ nil]. - ^ decimalPrefs at: aGetter ifAbsent: [nil]!
Item was removed: - ----- Method: Morph>>defaultValueOrNil (in category 'e-toy support') ----- - defaultValueOrNil - "If the receiver has a property named #defaultValue, return that property's value, else return nil" - - ^ self valueOfProperty: #defaultValue ifAbsent: [nil]!
Item was removed: - ----- Method: Morph>>demandsBoolean (in category 'classification') ----- - demandsBoolean - "Answer whether the receiver will only accept a drop if it is boolean-valued. Particular to tile-scripting." - - ^ self hasProperty: #demandsBoolean!
Item was removed: - ----- Method: Morph>>demandsThumbnailing (in category 'thumbnail') ----- - demandsThumbnailing - "Answer whether the receiver, if in a thumbnailable parts bin, wants to be thumbnailed whether or not size requires it" - - ^ false!
Item was removed: - ----- Method: Morph>>doMenuItem: (in category 'menus') ----- - doMenuItem: menuString - | aMenu anItem aNominalEvent aHand | - aMenu := self buildHandleMenu: (aHand := self currentHand). - aMenu allMorphsDo: [:m | m step]. "Get wordings current" - anItem := aMenu itemWithWording: menuString. - anItem ifNil: - [^ self player scriptingError: 'Menu item not found: ', menuString]. - aNominalEvent := MouseButtonEvent new - setType: #mouseDown - position: anItem bounds center - which: 4 "red" - buttons: 4 "red" - hand: aHand - stamp: nil. - anItem invokeWithEvent: aNominalEvent!
Item was removed: - ----- Method: Morph>>embedInWindow (in category 'e-toy support') ----- - embedInWindow - - | window worldToUse | - - worldToUse := self world. "I'm assuming we are already in a world" - window := (SystemWindow labelled: self defaultLabelForInspector) model: nil. - window bounds: ((self position - ((0@window labelHeight) + window borderWidth)) - corner: self bottomRight + window borderWidth). - window addMorph: self frame: (0@0 extent: 1@1). - window updatePaneColors. - worldToUse addMorph: window. - window beKeyWindow.!
Item was removed: - ----- Method: Morph>>embeddedInMorphicWindowLabeled: (in category 'e-toy support') ----- - embeddedInMorphicWindowLabeled: labelString - | window | - window := (SystemWindow labelled: labelString) model: nil. - window setStripeColorsFrom: Color white. - window addMorph: self frame: (0@0 extent: 1@1). - ^ window!
Item was removed: - ----- Method: Morph>>getNumericValue (in category 'e-toy support') ----- - getNumericValue - "Only certain kinds of morphs know how to deal with this frontally; here we provide support for a numeric property of any morph" - - ^ self valueOfProperty: #numericValue ifAbsent: [0]!
Item was removed: - ----- Method: Morph>>gridFormOrigin:grid:background:line: (in category 'e-toy support') ----- - gridFormOrigin: origin grid: smallGrid background: backColor line: lineColor - - | bigGrid gridForm gridOrigin | - gridOrigin := origin \ smallGrid. - bigGrid := (smallGrid asPoint x) @ (smallGrid asPoint y). - gridForm := Form extent: bigGrid depth: Display depth. - backColor ifNotNil: [gridForm fillWithColor: backColor]. - gridOrigin x to: gridForm width by: smallGrid x do: - [:x | gridForm fill: (x@0 extent: 1@gridForm height) fillColor: lineColor]. - gridOrigin y to: gridForm height by: smallGrid y do: - [:y | gridForm fill: (0@y extent: gridForm width@1) fillColor: lineColor]. - ^ InfiniteForm with: gridForm - !
Item was removed: - ----- Method: Morph>>handUserASibling (in category 'e-toy support') ----- - handUserASibling - "Make and hand the user a sibling instance. Force the creation of a uniclass at this point if one does not already exist for the receiver." - - | topRend | - topRend := self topRendererOrSelf. - topRend couldMakeSibling ifFalse: [^ Beeper beep]. - - topRend assuredPlayer assureUniClass. - (topRend makeSiblings: 1) first openInHand!
Item was removed: - ----- Method: Morph>>indicateAllSiblings (in category 'meta-actions') ----- - indicateAllSiblings - "Indicate all the receiver and all its siblings by flashing momentarily." - - | aPlayer allBoxes | - (aPlayer := self topRendererOrSelf player) belongsToUniClass ifFalse: [^ self "error: 'not uniclass'"]. - allBoxes := aPlayer class allInstances - select: [:m | m costume world == self currentWorld] - thenCollect: [:m | m costume boundsInWorld]. - - 5 timesRepeat: - [Display flashAll: allBoxes andWait: 120].!
Item was removed: - ----- Method: Morph>>inspectArgumentsPlayerInMorphic: (in category 'debug and other') ----- - inspectArgumentsPlayerInMorphic: evt - evt hand attachMorph: ((Inspector openOn: self player) extent: 300@200)!
Item was removed: - ----- Method: Morph>>isAViewer (in category 'e-toy support') ----- - isAViewer - ^ false!
Item was removed: - ----- Method: Morph>>isCompoundTileMorph (in category 'classification') ----- - isCompoundTileMorph - ^false!
Item was removed: - ----- Method: Morph>>isKedamaMorph (in category 'classification') ----- - isKedamaMorph - ^false!
Item was removed: - ----- Method: Morph>>isLikelyRecipientForMouseOverHalos (in category 'halos and balloon help') ----- - isLikelyRecipientForMouseOverHalos - ^self player notNil!
Item was removed: - ----- Method: Morph>>isModalShell (in category 'classification') ----- - isModalShell - ^false!
Item was removed: - ----- Method: Morph>>isNumericReadoutTile (in category 'classification') ----- - isNumericReadoutTile - ^false!
Item was removed: - ----- Method: Morph>>isPhraseTileMorph (in category 'classification') ----- - isPhraseTileMorph - ^false!
Item was removed: - ----- Method: Morph>>isPlayfieldLike (in category 'classification') ----- - isPlayfieldLike - ^ false!
Item was removed: - ----- Method: Morph>>isSoundTile (in category 'classification') ----- - isSoundTile - ^false!
Item was removed: - ----- Method: Morph>>isStandardViewer (in category 'classification') ----- - isStandardViewer - ^false!
Item was removed: - ----- Method: Morph>>isStickySketchMorph (in category 'classification') ----- - isStickySketchMorph - ^false!
Item was removed: - ----- Method: Morph>>isSyntaxMorph (in category 'classification') ----- - isSyntaxMorph - ^false!
Item was removed: - ----- Method: Morph>>isTileEditor (in category 'e-toy support') ----- - isTileEditor - "No, I'm not" - ^false!
Item was removed: - ----- Method: Morph>>isTileMorph (in category 'classification') ----- - isTileMorph - ^false!
Item was removed: - ----- Method: Morph>>isTilePadMorph (in category 'classification') ----- - isTilePadMorph - ^false!
Item was removed: - ----- Method: Morph>>isViewer (in category 'classification') ----- - isViewer - ^false!
Item was removed: - ----- Method: Morph>>makeGraphPaper (in category 'e-toy support') ----- - makeGraphPaper - | smallGrid backColor lineColor | - smallGrid := Compiler evaluate: (UIManager default request: 'Enter grid size' translated initialAnswer: '16'). - smallGrid ifNil: [^ self]. - UIManager default informUser: 'Choose a background color' translated during: [backColor := Color fromUser]. - UIManager default informUser: 'Choose a line color' translated during: [lineColor := Color fromUser]. - self makeGraphPaperGrid: smallGrid background: backColor line: lineColor.!
Item was removed: - ----- Method: Morph>>makeGraphPaperGrid:background:line: (in category 'e-toy support') ----- - makeGraphPaperGrid: smallGrid background: backColor line: lineColor - - | gridForm | - gridForm := self gridFormOrigin: 0@0 grid: smallGrid asPoint background: backColor line: lineColor. - self color: gridForm. - self world ifNotNil: [self world fullRepaintNeeded]. - self changed: #newColor. "propagate to view" - !
Item was removed: - ----- Method: Morph>>makeMultipleSiblings: (in category 'meta-actions') ----- - makeMultipleSiblings: evt - "Make multiple siblings, first prompting the user for how many" - - | result | - self topRendererOrSelf couldMakeSibling ifFalse: [^ Beeper beep]. - result := UIManager default request: 'how many siblings do you want?' translated initialAnswer: '2'. - result isEmptyOrNil ifTrue: [^ self]. - result first isDigit ifFalse: [^ Beeper beep]. - self topRendererOrSelf makeSiblings: result asInteger.!
Item was removed: - ----- Method: Morph>>makeNascentScript (in category 'menus') ----- - makeNascentScript - ^ self notYetImplemented!
Item was removed: - ----- Method: Morph>>makeNewPlayerInstance: (in category 'meta-actions') ----- - makeNewPlayerInstance: evt - "Make a duplicate of the receiver's argument. This is called only where the argument has an associated Player as its costumee, and the intent here is to make another instance of the same uniclass as the donor Player itself. Much works, but there are flaws so this shouldn't be used without recognizing the risks" - - evt hand attachMorph: self usableSiblingInstance!
Item was removed: - ----- Method: Morph>>makeSiblings: (in category 'meta-actions') ----- - makeSiblings: count - "Make multiple sibling, and return the list" - - | listOfNewborns aPosition | - aPosition := self position. - listOfNewborns := (1 to: count asInteger) asArray collect: - [:anIndex | | anInstance | - anInstance := self usableSiblingInstance. - owner addMorphFront: anInstance. - aPosition := aPosition + (10@10). - anInstance position: aPosition. - anInstance]. - self currentWorld startSteppingSubmorphsOf: self topRendererOrSelf owner. - ^ listOfNewborns!
Item was removed: - ----- Method: Morph>>makeSiblingsLookLikeMe: (in category 'meta-actions') ----- - makeSiblingsLookLikeMe: evt - "Make all my siblings wear the same costume that I am wearing." - - | aPlayer | - (aPlayer := self topRendererOrSelf player) belongsToUniClass ifFalse: [self error: 'not uniclass']. - aPlayer class allInstancesDo: - [:anInstance | anInstance == aPlayer ifFalse: - [anInstance wearCostumeOf: aPlayer]]!
Item was removed: - ----- Method: Morph>>menuItemAfter: (in category 'menus') ----- - menuItemAfter: menuString - | allWordings | - allWordings := self allMenuWordings. - ^ allWordings atWrap: ((allWordings indexOf: menuString) + 1)!
Item was removed: - ----- Method: Morph>>menuItemBefore: (in category 'menus') ----- - menuItemBefore: menuString - | allWordings | - allWordings := self allMenuWordings. - ^ allWordings atWrap: ((allWordings indexOf: menuString) - 1)!
Item was removed: - ----- Method: Morph>>methodCommentAsBalloonHelp (in category 'accessing') ----- - methodCommentAsBalloonHelp - "Given that I am a morph that is associated with an object and a method, answer a suitable method comment relating to that object & method if possible" - - | inherentSelector actual | - (inherentSelector := self valueOfProperty: #inherentSelector) - ifNotNil: - [(actual := (self firstOwnerSuchThat:[:m| m isPhraseTileMorph or:[m isSyntaxMorph]]) actualObject) ifNotNil: - [^ actual class precodeCommentOrInheritedCommentFor: inherentSelector]]. - ^ nil!
Item was removed: - ----- Method: Morph>>mustBeBackmost (in category 'e-toy support') ----- - mustBeBackmost - "Answer whether the receiver needs to be the backmost morph in its owner's submorph list" - - ^ false!
Item was removed: - ----- Method: Morph>>noteDecimalPlaces:forGetter: (in category 'e-toy support') ----- - noteDecimalPlaces: aNumber forGetter: aGetter - "Make a mental note of the user's preference for a particular number of decimal places to be associated with the slot with the given getter" - - (self renderedMorph valueOfProperty: #decimalPlacePreferences ifAbsentPut: [IdentityDictionary new]) - at: aGetter put: aNumber!
Item was removed: - ----- Method: Morph>>objectViewed (in category 'e-toy support') ----- - objectViewed - "Answer the morph associated with the player that the structure the receiver currently finds itself within represents." - - ^ (self outermostMorphThat: [:o | o isViewer or:[ o isScriptEditorMorph]]) objectViewed - !
Item was removed: - ----- Method: Morph>>offerCostumeViewerMenu: (in category 'menu') ----- - offerCostumeViewerMenu: aMenu - "do nothing"!
Item was removed: - ----- Method: Morph>>openAPropertySheet (in category 'meta-actions') ----- - openAPropertySheet - - Smalltalk at: #ObjectPropertiesMorph ifPresent:[:aClass| - ^aClass basicNew - targetMorph: self; - initialize; - openNearTarget - ]. - Beeper beep.!
Item was removed: - ----- Method: Morph>>openViewerForArgument (in category 'player viewer') ----- - openViewerForArgument - "Open up a viewer for a player associated with the morph in question. " - self presenter viewMorph: self!
Item was removed: - ----- Method: Morph>>overlapsShadowForm:bounds: (in category 'geometry - etoys') ----- - overlapsShadowForm: itsShadow bounds: itsBounds - "Answer true if itsShadow and my shadow overlap at all" - | overlapExtent overlap myRect myShadow goalRect goalShadow bb | - overlap := self fullBounds intersect: itsBounds. - overlapExtent := overlap extent. - overlapExtent > (0 @ 0) - ifFalse: [^ false]. - myRect := overlap translateBy: 0 @ 0 - self topLeft. - myShadow := (self imageForm contentsOfArea: myRect) stencil. - goalRect := overlap translateBy: 0 @ 0 - itsBounds topLeft. - goalShadow := (itsShadow contentsOfArea: goalRect) stencil. - - "compute a pixel-by-pixel AND of the two stencils. Result will be black - (pixel value = 1) where black parts of the stencils overlap" - bb := BitBlt toForm: myShadow. - bb - copyForm: goalShadow - to: 0 @ 0 - rule: Form and. - - ^(bb destForm tallyPixelValues second) > 0 !
Item was removed: - ----- Method: Morph>>pasteUpMorphHandlingTabAmongFields (in category 'structure') ----- - pasteUpMorphHandlingTabAmongFields - "Answer the nearest PasteUpMorph in my owner chain that has the tabAmongFields property, or nil if none" - - | aPasteUp | - aPasteUp := self owner. - [aPasteUp notNil] whileTrue: - [aPasteUp tabAmongFields ifTrue: - [^ aPasteUp]. - aPasteUp := aPasteUp owner]. - ^ nil!
Item was removed: - ----- Method: Morph>>player (in category 'accessing') ----- - player - "answer the receiver's player" - ^ extension ifNotNil: [extension player]!
Item was removed: - ----- Method: Morph>>player: (in category 'accessing') ----- - player: anObject - "change the receiver's player" - self assureExtension player: anObject!
Item was removed: - ----- Method: Morph>>playerRepresented (in category 'accessing') ----- - playerRepresented - "Answer the player represented by the receiver. Morphs that serve as references to other morphs reimplement this; be default a morph represents its own player." - - ^ self player!
Item was removed: - ----- Method: Morph>>preferredDuplicationHandleSelector (in category 'halos and balloon help') ----- - preferredDuplicationHandleSelector - "Answer the selector, either #addMakeSiblingHandle: or addDupHandle:, to be offered as the default in a halo open on me" - - Preferences oliveHandleForScriptedObjects ifFalse: - [^ #addDupHandle:]. - ^ self renderedMorph valueOfProperty: #preferredDuplicationHandleSelector ifAbsent: - [self player class isUniClass - ifTrue: - [#addMakeSiblingHandle:] - ifFalse: - [#addDupHandle:]]!
Item was removed: - ----- Method: Morph>>presenter (in category 'accessing') ----- - presenter - ^ owner ifNotNil: [owner presenter] ifNil: [self currentWorld presenter]!
Item was removed: - ----- Method: Morph>>readoutForField: (in category 'thumbnail') ----- - readoutForField: fieldSym - "Provide a readout that will show the value of the slot/pseudoslot of the receiver generated by sending fieldSym to the receiver" - - | aContainer | - "still need to get this right" - aContainer := AlignmentMorph newColumn. - aContainer layoutInset: 0; hResizing: #rigid; vResizing: #shrinkWrap. - aContainer addMorphBack: (StringMorph new contents: (self perform: fieldSym) asString). - ^ aContainer!
Item was removed: - ----- Method: Morph>>referencePlayfield (in category 'e-toy support') ----- - referencePlayfield - "Answer the PasteUpMorph to be used for cartesian-coordinate reference" - - | former | - owner ifNotNil: - [(self topRendererOrSelf owner isHandMorph and: [(former := self formerOwner) notNil]) - ifTrue: - [former := former renderedMorph. - ^ former isPlayfieldLike - ifTrue: [former] - ifFalse: [former referencePlayfield]]]. - - self allOwnersDo: [:o | o isPlayfieldLike ifTrue: [^ o]]. - ^ Project current world!
Item was removed: - ----- Method: Morph>>renameInternal: (in category 'testing') ----- - renameInternal: aName - "Change the internal name (because of a conflict) but leave the external name unchanged. Change Player class name, but do not change the names that appear in tiles. When coming in from disk, and have name conflict, References will already have the new name. " - - self knownName = aName ifTrue: [^ aName]. - self topRendererOrSelf setNameTo: aName. - - "References dictionary already has key aName" - - "If this player has a viewer flap, it will remain present" - - "Tiles in scripts all stay the same" - - "Compiled methods for scripts have been fixed up because the same association was reused" - - ^ aName!
Item was removed: - ----- Method: Morph>>rotationStyle (in category 'e-toy support') ----- - rotationStyle - "Return the 'rotation style' of the receiver" - ^#normal!
Item was removed: - ----- Method: Morph>>rotationStyle: (in category 'e-toy support') ----- - rotationStyle: aSymbol - "Set the 'rotation style' of the receiver; this is ignored for non-sketches"!
Item was removed: - ----- Method: Morph>>roundUpStrays (in category 'miscellaneous') ----- - roundUpStrays - "Bring submorphs of playfieldlike structures in the receiver's interior back within view." - - self submorphsDo: - [:m | m isPlayfieldLike ifTrue: [m roundUpStrays]]!
Item was removed: - ----- Method: Morph>>saveDocPane (in category 'fileIn/out') ----- - saveDocPane - - Smalltalk at: #DocLibrary ifPresent:[:dl| dl external saveDocCheck: self]!
Item was removed: - ----- Method: Morph>>screenLocation (in category 'geometry - etoys') ----- - screenLocation - "For compatibility only" - - ^ self fullBounds origin!
Item was removed: - ----- Method: Morph>>screenRectangle (in category 'geometry - etoys') ----- - screenRectangle - "For compatibility only" - - ^ self fullBounds!
Item was removed: - ----- Method: Morph>>setAsActionInButtonProperties: (in category 'e-toy support') ----- - setAsActionInButtonProperties: buttonProperties - - ^false "means I don't know how to be set as a button action"!
Item was removed: - ----- Method: Morph>>setNumericValue: (in category 'e-toy support') ----- - setNumericValue: aValue - "Set the receiver's contents to reflect the given numeric value. Only certain kinds of morphs know what to do with this, the rest, for now, stash the number in a property, where it may not be visible but at least it won't be lost, and can be retrieved by the companion getter. This code is never reached under normal circumstances, because the #numericValue slot is not shown in Viewers for most kinds of morphs, and those kinds of morphs that do show it also reimplement this method. However, this code *could* be reached via a user script which sends #setNumericValue: but whose receiver has been changed, via tile-scripting drag and drop for example, to one that doesn't directly handle numbers" - - ScriptingSystem informScriptingUser: 'an unusual setNumericValue: call was made'. - self renderedMorph setProperty: #numericValue toValue: aValue - !
Item was removed: - ----- Method: Morph>>setStandardTexture (in category 'e-toy support') ----- - setStandardTexture - | parms | - parms := self textureParameters. - self makeGraphPaperGrid: parms first - background: parms second - line: parms third!
Item was removed: - ----- Method: Morph>>shouldRememberCostumes (in category 'player') ----- - shouldRememberCostumes - ^true!
Item was removed: - ----- Method: Morph>>shuffleSubmorphs (in category 'submorphs - misc') ----- - shuffleSubmorphs - "Randomly shuffle the order of my submorphs. Don't call this method lightly!!" - - | bg | - self invalidRect: self fullBounds. - (submorphs notEmpty and: [submorphs last mustBeBackmost]) - ifTrue: - [bg := submorphs last. - bg privateDelete]. - submorphs := submorphs shuffled. - bg ifNotNil: [self addMorphBack: bg]. - self layoutChanged!
Item was removed: - ----- Method: Morph>>standardPalette (in category 'initialization') ----- - standardPalette - "Answer a standard palette forced by some level of enclosing presenter, or nil if none" - | pal aPresenter itsOwner | - (aPresenter := self presenter) ifNil: [^ nil]. - ^ (pal := aPresenter ownStandardPalette) - ifNotNil: [pal] - ifNil: [(itsOwner := aPresenter associatedMorph owner) - ifNotNil: - [itsOwner standardPalette] - ifNil: - [nil]]!
Item was removed: - ----- Method: Morph>>tabAmongFields (in category 'event handling') ----- - tabAmongFields - ^ Preferences tabAmongFields - or: [self hasProperty: #tabAmongFields] !
Item was removed: - ----- Method: Morph>>textureParameters (in category 'e-toy support') ----- - textureParameters - "Answer a triplet giving the preferred grid size, background color, and line color. The choices here are as suggested by Alan, 9/13/97" - - ^ Array with: 16 with: Color lightYellow with: Color lightGreen lighter lighter!
Item was removed: - ----- Method: Morph>>unlockOneSubpart (in category 'e-toy support') ----- - unlockOneSubpart - | unlockables reply | - unlockables := self submorphs select: - [:m | m isLocked]. - unlockables size <= 1 ifTrue: [^ self unlockContents]. - reply := UIManager default - chooseFrom: (unlockables collect: [:m | m externalName]) - values: unlockables - title: 'Who should be be unlocked?' translated. - reply isNil ifTrue: [^ self]. - reply unlock!
Item was removed: - ----- Method: Morph>>updateAllScriptingElements (in category 'naming') ----- - updateAllScriptingElements - "A sledge-hammer sweep from the world down to make sure that all live scripting elements are up to date. Presently in eclipse, not sent at the moment." - - | aPasteUp | - (aPasteUp := self topPasteUp) ifNotNil: - [aPasteUp allTileScriptingElements do: [:m | m bringUpToDate]]!
Item was removed: - ----- Method: Morph>>updateCachedThumbnail (in category 'e-toy support') ----- - updateCachedThumbnail - "If I have a cached thumbnail, then update it. Copied up from Dan's original version in PasteUpMorph so it can be used by all morphs." - | cachedThumbnail | - - (cachedThumbnail := self valueOfProperty: #cachedThumbnail) ifNotNil: - [(cachedThumbnail respondsTo: #computeThumbnail) - ifTrue: [cachedThumbnail computeThumbnail] - ifFalse: [self removeProperty: #computeThumbnail]]. - "Test and removal are because the thumbnail is being replaced by another Morph. We don't know why. Need to fix that at the source."!
Item was removed: - ----- Method: Morph>>usableSiblingInstance (in category 'copying') ----- - usableSiblingInstance - "Return another similar morph whose Player is of the same class as mine. - Do not open it in the world." - - | aName newPlayer newMorph topRenderer counter world | - (topRenderer := self topRendererOrSelf) == self - ifFalse: [^topRenderer usableSiblingInstance]. - self assuredPlayer assureUniClass. - newMorph := self veryDeepCopySibling. - newPlayer := newMorph player. - newPlayer resetCostumeList. - (aName := self knownName) isNil - ifTrue: [self player notNil ifTrue: [aName := newMorph innocuousName]]. - "Force a difference here" - - aName := aName stemAndNumericSuffix at: 1. - - world := self world ifNil: [Project current world]. - (world hasProperty: #nameCounter) ifFalse: [ - (world setProperty: #nameCounter toValue: Dictionary new) - ]. - - counter := (world valueOfProperty: #nameCounter) at: aName ifAbsent: [1]. - newMorph setNameTo: aName, counter. - (world valueOfProperty: #nameCounter) at: aName put: counter + 1. - - newMorph privateOwner: nil. - newPlayer assureEventHandlerRepresentsStatus. - self presenter flushPlayerListCache. - ^newMorph!
Item was removed: - ----- Method: Morph>>viewMorphDirectly (in category 'debug and other') ----- - viewMorphDirectly - "Open a Viewer directly on the Receiver, i.e. no Player involved" - - self presenter viewObjectDirectly: self renderedMorph - - !
Item was removed: - ----- Method: Morph>>wantsHalo (in category 'halos and balloon help') ----- - wantsHalo - | topOwner | - ^(topOwner := self topRendererOrSelf owner) notNil - and: [topOwner wantsHaloFor: self]!
Item was removed: - ----- Method: Morph>>wantsHaloFor: (in category 'halos and balloon help') ----- - wantsHaloFor: aSubMorph - ^ false!
Item was removed: - ----- Method: Morph>>wantsScriptorHaloHandle (in category 'halos and balloon help') ----- - wantsScriptorHaloHandle - "Answer whether the receiver would like to have a Scriptor halo handle put up on its behalf. Initially, only the ScriptableButton says yes" - - ^ false!
Item was removed: - ----- Method: Morph>>wouldAcceptKeyboardFocusUponTab (in category 'event handling') ----- - wouldAcceptKeyboardFocusUponTab - "Answer whether the receiver is in the running as the new keyboard focus if the tab key were hit at a meta level. This provides the leverage for tabbing among fields of a card, for example." - - ^ false!
Item was removed: - ----- Method: Morph>>wrappedInWindow: (in category 'e-toy support') ----- - wrappedInWindow: aSystemWindow - | aWindow | - aWindow := aSystemWindow model: Model new. - aWindow addMorph: self frame: (0@0 extent: 1@1). - aWindow extent: self extent. - ^ aWindow!
Item was removed: - ----- Method: Morph>>wrappedInWindowWithTitle: (in category 'e-toy support') ----- - wrappedInWindowWithTitle: aTitle - | aWindow w2 | - aWindow := (SystemWindow labelled: aTitle) model: Model new. - aWindow addMorph: self frame: (0@0 extent: 1@1). - w2 := aWindow borderWidth * 2. - w2 := 3. "oh, well" - aWindow extent: self fullBounds extent + (0 @ aWindow labelHeight) + (w2 @ w2). - ^ aWindow!
Item was removed: - ----- Method: MorphExtension>>player (in category 'accessing') ----- - player - "answer the receiver's player" - ^ player!
Item was removed: - ----- Method: MorphExtension>>player: (in category 'accessing') ----- - player: anObject - "change the receiver's player" - player := anObject !
Item was removed: - ListItemWrapper subclass: #MorphWithSubmorphsWrapper - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Explorer'! - - !MorphWithSubmorphsWrapper commentStamp: 'ls 3/1/2004 17:32' prior: 0! - Display a morph in a SimpleHierarchicalListMorph, and arrange to recursively display the morph's submorphs. The "item" that is wrapped is the morph to display.!
Item was removed: - ----- Method: MorphWithSubmorphsWrapper>>contents (in category 'hierarchy') ----- - contents - ^item submorphs collect: [ :m | - self class with: m ]!
Item was removed: - ----- Method: MorphicModel>>addModelYellowButtonMenuItemsTo:forMorph:hand: (in category 'graph model') ----- - addModelYellowButtonMenuItemsTo: aCustomMenu forMorph: aMorph hand: aHandMorph - - Preferences noviceMode ifFalse: [ - super addModelYellowButtonMenuItemsTo: aCustomMenu forMorph: aMorph hand: aHandMorph]. - ^ aCustomMenu!
Item was removed: - ----- Method: MorphicProject>>exportSegmentInSexpWithChangeSet:fileName:directory:withoutInteraction: (in category 'file in/out') ----- - exportSegmentInSexpWithChangeSet: aChangeSetOrNil fileName: aFileName directory: aDirectory withoutInteraction: noInteraction - - | fd sexp actualName | - - world ifNil: [^ false]. - world presenter ifNil: [^ false]. - (world respondsTo: #sissScanObjectsAsEtoysProject) ifFalse: [^ false]. - - Command initialize. - world clearCommandHistory. - world cleanseStepList. - world localFlapTabs size = world flapTabs size ifFalse: [ - noInteraction ifTrue: [^ false]. - self error: 'Still holding onto Global flaps']. - - fd := aDirectory directoryNamed: self resourceDirectoryName. - fd assureExistence. - - "Must activate old world because this is run at #armsLength. - Otherwise references to ActiveWorld, ActiveHand, or ActiveEvent - will not be captured correctly if referenced from blocks or user code." - world becomeActiveDuring:[ - sexp := world sissScanObjectsAsEtoysProject. - ]. - (aFileName endsWith: '.pr') ifTrue: [ - actualName := (aFileName copyFrom: 1 to: aFileName size - 3), '.sexp'. - ] ifFalse: [ - actualName := aFileName - ]. - - self - writeForExportInSexp: sexp withSources: actualName - inDirectory: fd - changeSet: aChangeSetOrNil. - SecurityManager default signFile: actualName directory: fd. - self storeHtmlPageIn: fd. - (world valueOfProperty: #ProjectDetails ifAbsent: [Dictionary new]) - at: 'Project-Format' put: 'S-Expression'. - self storeManifestFileIn: fd. - self compressFilesIn: fd to: aFileName in: aDirectory. - - ^ true - !
Item was removed: - ----- Method: MorphicProject>>initMorphic (in category 'initialize') ----- - initMorphic - "Written so that Morphic can still be removed. Note that #initialize is never actually called for a morphic project -- see the senders of this method." - - self flag: #toRemove. "check if this method still used by Etoys" - Smalltalk verifyMorphicAvailability ifFalse: [^ nil]. - changeSet := ChangeSet new. - transcript := TranscriptStream new. - displayDepth := Display depth. - parentProject := CurrentProject. - world := PasteUpMorph newWorldForProject: self. - Locale switchToID: CurrentProject localeID. - self initializeProjectPreferences. "Do this *after* a world is installed so that the project will be recognized as a morphic one." - Preferences useVectorVocabulary ifTrue: [world installVectorVocabulary]!
Item was removed: - ----- Method: MorphicProject>>myPlayerClasses (in category 'release') ----- - myPlayerClasses - "Answer all my (non-systemDefined) player classes" - | classes presenter | - classes := Set new. - presenter := self world presenter. - presenter ifNotNil: [ - presenter flushPlayerListCache. "old and outside guys" - presenter allExtantPlayers do: - [:p | p class isSystemDefined ifFalse: [classes add: p class]]]. - ^classes!
Item was removed: - ----- Method: MorphicProject>>setFlaps (in category 'flaps support') ----- - setFlaps - - | flapTabs flapIDs sharedFlapTabs navigationMorph | - self flag: #toRemove. "check if this method still used by Etoys" - - flapTabs := self world flapTabs. - flapIDs := flapTabs collect: [:tab | tab knownName]. - flapTabs - do: [:tab | (tab isMemberOf: ViewerFlapTab) - ifFalse: [tab isGlobalFlap - ifTrue: [Flaps removeFlapTab: tab keepInList: false. - tab currentWorld reformulateUpdatingMenus] - ifFalse: [| referent | - referent := tab referent. - referent isInWorld - ifTrue: [referent delete]. - tab delete]]]. - sharedFlapTabs := Flaps classPool at: #SharedFlapTabs. - flapIDs - do: [:id | - id = 'Navigator' translated - ifTrue: [sharedFlapTabs add: Flaps newNavigatorFlap]. - id = 'Widgets' translated - ifTrue: [sharedFlapTabs add: Flaps newWidgetsFlap]. - id = 'Tools' translated - ifTrue: [sharedFlapTabs add: Flaps newToolsFlap]. - id = 'Squeak' translated - ifTrue: [sharedFlapTabs add: Flaps newSqueakFlap]. - id = 'Supplies' translated - ifTrue: [sharedFlapTabs add: Flaps newSuppliesFlap]. - id = 'Stack Tools' translated - ifTrue: [sharedFlapTabs add: Flaps newStackToolsFlap]. - id = 'Painting' translated - ifTrue: [sharedFlapTabs add: Flaps newPaintingFlap]. - id = 'Objects' translated - ifTrue: [sharedFlapTabs add: Flaps newObjectsFlap ]]. - 2 timesRepeat: [flapIDs do: [:id | Flaps enableDisableGlobalFlapWithID: id]]. - self world flapTabs - do: [:flapTab | flapTab isCurrentlyTextual - ifTrue: [flapTab changeTabText: flapTab knownName]]. - Flaps positionNavigatorAndOtherFlapsAccordingToPreference. - navigationMorph := self currentWorld findDeeplyA: ProjectNavigationMorph preferredNavigator. - navigationMorph isNil - ifTrue: [^ self]. - navigationMorph allMorphs - do: [:morph | morph class == SimpleButtonDelayedMenuMorph - ifTrue: [(morph findA: ImageMorph) isNil - ifTrue: [| label | - label := morph label. - label isNil - ifFalse: [| name | - name := morph knownName. - name isNil - ifTrue: [morph name: label. - name := label]. - morph label: name translated]]]]!
Item was removed: - ----- Method: PasteUpMorph>>abandonCostumeHistory (in category 'misc') ----- - abandonCostumeHistory - self allMorphsDo: - [:m | m player ifNotNil: [m player forgetOtherCostumes]]!
Item was removed: - ----- Method: PasteUpMorph>>adaptedToWorld: (in category 'initialization') ----- - adaptedToWorld: aWorld - "If I refer to a world or a hand, return the corresponding items in the new world." - self isWorldMorph ifTrue:[^aWorld].!
Item was removed: - ----- Method: PasteUpMorph>>addPenMenuItems:hand: (in category 'menu & halo') ----- - addPenMenuItems: menu hand: aHandMorph - "Add a pen-trails-within submenu to the given menu" - - menu add: 'pen trails...' translated target: self selector: #putUpPenTrailsSubmenu. - menu balloonTextForLastItem: 'its governing pen trails drawn within' translated!
Item was removed: - ----- Method: PasteUpMorph>>addPenTrailsMenuItemsTo: (in category 'menu & halo') ----- - addPenTrailsMenuItemsTo: aMenu - "Add items relating to pen trails to aMenu" - - | oldTarget | - oldTarget := aMenu defaultTarget. - aMenu defaultTarget: self. - aMenu add: 'clear pen trails' translated action: #clearTurtleTrails. - aMenu addLine. - aMenu add: 'all pens up' translated action: #liftAllPens. - aMenu add: 'all pens down' translated action: #lowerAllPens. - aMenu addLine. - aMenu add: 'all pens show lines' translated action: #linesForAllPens. - aMenu add: 'all pens show arrowheads' translated action: #arrowsForAllPens. - aMenu add: 'all pens show arrows' translated action: #linesAndArrowsForAllPens. - aMenu add: 'all pens show dots' translated action: #dotsForAllPens. - aMenu addLine. - aMenu addUpdating: #batchPenTrailsString action: #toggleBatchPenTrails. - aMenu balloonTextForLastItem: 'if true, detailed movement of pens between display updates is ignored. Thus multiple line segments drawn within a script may not be seen individually.' translated. - - aMenu defaultTarget: oldTarget!
Item was removed: - ----- Method: PasteUpMorph>>addPlayfieldMenuItems:hand: (in category 'menu & halo') ----- - addPlayfieldMenuItems: menu hand: aHandMorph - "Add playfield-related items to the menu" - - menu add: 'playfield options...' translated target: self action: #presentPlayfieldMenu. - (self hasProperty: #donorTextMorph) ifTrue: - [menu add: 'send contents back to donor' translated action: #sendTextContentsBackToDonor]!
Item was removed: - ----- Method: PasteUpMorph>>addStackMenuItems:hand: (in category 'menu & halo') ----- - addStackMenuItems: menu hand: aHandMorph - "Add appropriate stack-related items to the given menu" - - self isStackBackground - ifTrue: - [menu add: 'card & stack...' target: self action: #presentCardAndStackMenu]!
Item was removed: - ----- Method: PasteUpMorph>>allScriptEditors (in category 'misc') ----- - allScriptEditors - ^ self allMorphs select: - [:s | s isScriptEditorMorph]!
Item was removed: - ----- Method: PasteUpMorph>>allScriptors (in category 'misc') ----- - allScriptors - "Answer a list of all active scriptors running on behalf of the receiver. This is a hook used in past demos and with a future life which however presently is vacuous" - - ^ #() - " - ^ self allMorphs select: [:m | m isKindOf: Scriptor]"!
Item was removed: - ----- Method: PasteUpMorph>>allTileScriptingElements (in category 'scripting') ----- - allTileScriptingElements - "Answer a list of all the morphs that pertain to tile-scripting. A sledge-hammer" - - | all morphs | - morphs := IdentitySet new: 400. - self allMorphsAndBookPagesInto: morphs. - all := morphs select: [:s | s isTileScriptingElement]. - " self closedViewerFlapTabs do: - [:aTab | all addAll: aTab referent allTileScriptingElements]. - " - ^ all asOrderedCollection!
Item was removed: - ----- Method: PasteUpMorph>>assureNotPaintingEvent: (in category 'world state') ----- - assureNotPaintingEvent: evt - "If painting is already underway - in the receiver, put up an informer to that effect and evalute aBlock" - | editor | - (editor := self sketchEditorOrNil) ifNotNil:[ - editor save: evt. - Cursor normal show. - ].!
Item was removed: - ----- Method: PasteUpMorph>>automaticPhraseExpansion (in category 'dropping/grabbing') ----- - automaticPhraseExpansion - ^ self hasProperty: #automaticPhraseExpansion!
Item was removed: - ----- Method: PasteUpMorph>>automaticViewing (in category 'e-toy support') ----- - automaticViewing - ^ self hasProperty: #automaticViewing!
Item was removed: - ----- Method: PasteUpMorph>>behaveLikeHolder (in category 'options') ----- - behaveLikeHolder - - self vResizeToFit: true; autoLineLayout: true; indicateCursor: true!
Item was removed: - ----- Method: PasteUpMorph>>behaveLikeHolder: (in category 'options') ----- - behaveLikeHolder: aBoolean - "Change the receiver's viewing properties such that they conform to what we commonly call a Holder, viz: resize-to-fit, do auto-line-layout, and indicate the 'cursor'" - - self vResizeToFit: aBoolean; autoLineLayout: aBoolean; indicateCursor: aBoolean - !
Item was removed: - ----- Method: PasteUpMorph>>behavingLikeAHolder (in category 'options') ----- - behavingLikeAHolder - "Answer whether the receiver is currently behaving like a Holder" - - ^ self resizeToFit and: [self indicateCursor and: [self autoLineLayout]]!
Item was removed: - ----- Method: PasteUpMorph>>browseAllScriptsTextually (in category 'world menu') ----- - browseAllScriptsTextually - "Put up a browser showing all scripts in the project textually" - - self presenter browseAllScriptsTextually - - "ActiveWorld browseAllScriptsTextually"!
Item was removed: - ----- Method: PasteUpMorph>>buildDebugMenu: (in category 'menu & halo') ----- - buildDebugMenu: aHandMorph - | aMenu | - aMenu := super buildDebugMenu: aHandMorph. - aMenu add: 'abandon costume history' translated target: self action: #abandonCostumeHistory. - ^ aMenu!
Item was removed: - ----- Method: PasteUpMorph>>closedViewerFlapTabs (in category 'misc') ----- - closedViewerFlapTabs - "Answer all the viewer flap tabs in receiver that are closed" - - ^ self submorphs select: - [:m | (m isKindOf: ViewerFlapTab) and: [m flapShowing not]]!
Item was removed: - ----- Method: PasteUpMorph>>couldMakeSibling (in category 'classification') ----- - couldMakeSibling - - ^ self isWorldMorph not!
Item was removed: - ----- Method: PasteUpMorph>>cursor (in category 'e-toy support') ----- - cursor - ^ cursor - !
Item was removed: - ----- Method: PasteUpMorph>>cursor: (in category 'e-toy support') ----- - cursor: aNumber - "for backward compatibility" - - self cursorWrapped: aNumber!
Item was removed: - ----- Method: PasteUpMorph>>cursorWrapped: (in category 'cursor') ----- - cursorWrapped: aNumber - "Set the cursor to the given number, modulo the number of items I - contain. Fractional cursor values are allowed." - | oldRect newRect offset | - cursor = aNumber - ifTrue: [^ self]. - self hasSubmorphs - ifFalse: [cursor := 1. - ^ self]. - oldRect := self selectedRect. - offset := (self asNumber: aNumber) - 1 \ submorphs size. - cursor := offset + 1. - newRect := self selectedRect. - self indicateCursor - ifTrue: [self invalidRect: oldRect; - invalidRect: newRect]!
Item was removed: - ----- Method: PasteUpMorph>>detachableScriptingSpace (in category 'world menu') ----- - detachableScriptingSpace - ScriptingSystem newScriptingSpace openInWorld: self!
Item was removed: - ----- Method: PasteUpMorph>>drawOn: (in category 'drawing') ----- - drawOn: aCanvas - "Draw in order: - - background color - - Update and draw the turtleTrails form. See the comment in updateTrailsForm. - - cursor box if any - - Later (in drawSubmorphsOn:) I will skip drawing the background sketch." - - "draw background fill" - super drawOn: aCanvas. - - "draw turtle trails" - (lastTurtlePositions isNil or: [lastTurtlePositions isEmpty]) ifFalse:[ - self updateTrailsForm. - ]. - turtleTrailsForm - ifNotNil: [aCanvas paintImage: turtleTrailsForm at: self position]. - - "draw cursor" - (submorphs notEmpty and: [self indicateCursor]) - ifTrue: - [aCanvas - frameRectangle: self selectedRect - width: 2 - color: Color black]!
Item was removed: - ----- Method: PasteUpMorph>>dumpPresenter (in category 'accessing') ----- - dumpPresenter - "Dump my current presenter" - presenter := nil.!
Item was removed: - ----- Method: PasteUpMorph>>hideViewerFlaps (in category 'misc') ----- - hideViewerFlaps - self flapTabs do:[:aTab | - (aTab isKindOf: ViewerFlapTab) ifTrue:[aTab hideFlap]]!
Item was removed: - ----- Method: PasteUpMorph>>hideViewerFlapsOtherThanFor: (in category 'misc') ----- - hideViewerFlapsOtherThanFor: aPlayer - self flapTabs do: - [:aTab | (aTab isKindOf: ViewerFlapTab) - ifTrue: - [aTab scriptedPlayer == aPlayer - ifFalse: - [aTab hideFlap]]]!
Item was removed: - ----- Method: PasteUpMorph>>indicateCursor (in category 'options') ----- - indicateCursor - ^ indicateCursor == true!
Item was removed: - ----- Method: PasteUpMorph>>indicateCursor: (in category 'options') ----- - indicateCursor: aBoolean - indicateCursor := aBoolean. - self changed.!
Item was removed: - ----- Method: PasteUpMorph>>indicateCursorString (in category 'menu & halo') ----- - indicateCursorString - "Answer the string to be shown in a menu to represent the - whether-to-indicate-cursor status" - ^ (self indicateCursor - ifTrue: ['<on>'] - ifFalse: ['<off>']) - , 'indicate cursor' translated!
Item was removed: - ----- Method: PasteUpMorph>>isPlayfieldLike (in category 'classification') ----- - isPlayfieldLike - ^ true!
Item was removed: - ----- Method: PasteUpMorph>>makeNewDrawing: (in category 'world menu') ----- - makeNewDrawing: evt - ^self makeNewDrawing: evt at: evt position!
Item was removed: - ----- Method: PasteUpMorph>>makeNewDrawing:at: (in category 'world menu') ----- - makeNewDrawing: evt at: aPoint - "make a new drawing, triggered by the given event, with the painting area centered around the given point" - - | w newSketch newPlayer sketchEditor aPalette rect aPaintBox aPaintTab aWorld | - w := self world. - w assureNotPaintingElse: [^ self]. - rect := self paintingBoundsAround: aPoint. - aPalette := self standardPalette. - aPalette ifNotNil: [aPalette showNoPalette; layoutChanged]. - w prepareToPaint. - - newSketch := self drawingClass new. - Smalltalk at: #UnscriptedPlayer ifPresent:[:aClass| - newSketch player: (newPlayer := aClass newUserInstance). - newPlayer costume: newSketch. - ]. - newSketch nominalForm: (Form extent: rect extent depth: w assuredCanvas depth). - newSketch bounds: rect. - sketchEditor := SketchEditorMorph new. - w addMorphFront: sketchEditor. - sketchEditor initializeFor: newSketch inBounds: rect pasteUpMorph: self. - sketchEditor - afterNewPicDo: [:aForm :aRect | | tfx whereToPresent | - whereToPresent := self presenter. - newSketch form: aForm. - tfx := self transformFrom: w. - newSketch position: (tfx globalPointToLocal: aRect origin). - newSketch rotationStyle: sketchEditor rotationStyle. - newSketch forwardDirection: sketchEditor forwardDirection. - - newPlayer ifNotNil:[newPlayer setHeading: sketchEditor forwardDirection]. - (aPaintTab := (aWorld := self world) paintingFlapTab) - ifNotNil:[aPaintTab hideFlap] - ifNil:[(aPaintBox := aWorld paintBox) ifNotNil:[aPaintBox delete]]. - - self addMorphFront: (newPlayer ifNil:[newSketch] ifNotNil:[newPlayer costume]). - w startSteppingSubmorphsOf: newSketch. - whereToPresent drawingJustCompleted: newSketch] - ifNoBits:[ - (aPaintTab := (aWorld := self world) paintingFlapTab) - ifNotNil:[aPaintTab hideFlap] - ifNil:[(aPaintBox := aWorld paintBox) ifNotNil:[aPaintBox delete]]. - aPalette ifNotNil: [aPalette showNoPalette].]!
Item was removed: - ----- Method: PasteUpMorph>>makeNewDrawingWithin (in category 'painting') ----- - makeNewDrawingWithin - "Start a painting session in my interior which will result in a new SketchMorph being created as one of my submorphs" - - | evt | - evt := MouseEvent new setType: nil position: self center buttons: 0 hand: self world activeHand. - self makeNewDrawing: evt!
Item was removed: - ----- Method: PasteUpMorph>>mouseOverHalosString (in category 'menu & halo') ----- - mouseOverHalosString - "Answer the string to be shown in a menu to represent the - mouse-over-halos status" - ^ (self wantsMouseOverHalos - ifTrue: ['<on>'] - ifFalse: ['<off>']) - , 'mouse-over halos' translated!
Item was removed: - ----- Method: PasteUpMorph>>newDrawingFromMenu: (in category 'world menu') ----- - newDrawingFromMenu: evt - self assureNotPaintingElse: [^ self]. - evt hand attachMorph: PaintInvokingMorph new markAsPartsDonor!
Item was removed: - ----- Method: PasteUpMorph>>numberAtCursor (in category 'cursor') ----- - numberAtCursor - "Answer the number represented by the object at my current cursor position" - - | chosenMorph | - submorphs isEmpty ifTrue: [^ 0]. - chosenMorph := submorphs at: ((cursor truncated max: 1) min: submorphs size). - ^ chosenMorph getNumericValue - !
Item was removed: - ----- Method: PasteUpMorph>>openScrapsBook: (in category 'world menu') ----- - openScrapsBook: evt - "Open up the Scraps book in the center of the screen" - - evt hand world addMorphCentered: ScrapBook default scrapBook!
Item was removed: - ----- Method: PasteUpMorph>>paintArea (in category 'world state') ----- - paintArea - "What rectangle should the user be allowed to create a new painting in?? - An area beside the paintBox. Allow playArea to override with its own - bounds!! " - | playfield paintBoxBounds | - playfield := self - submorphNamed: 'playfield' - ifNone: []. - playfield - ifNotNil: [^ playfield bounds]. - paintBoxBounds := self paintBox bounds. - self firstHand targetPoint x < paintBoxBounds center x - ifTrue: [^ bounds topLeft corner: paintBoxBounds left @ bounds bottom"paint on left side"] - ifFalse: [^ paintBoxBounds right @ bounds top corner: bounds bottomRight]!
Item was removed: - ----- Method: PasteUpMorph>>paintAreaFor: (in category 'world state') ----- - paintAreaFor: aSketchMorph - "Answer the area to comprise the onion-skinned canvas for painting/repainting aSketchMorph" - - | itsOwner | - ((itsOwner := aSketchMorph owner) notNil and: [itsOwner isPlayfieldLike]) - ifTrue: [^itsOwner bounds]. "handles every plausible situation" - ^self paintArea!
Item was removed: - ----- Method: PasteUpMorph>>paintingBoundsAround: (in category 'painting') ----- - paintingBoundsAround: aPoint - "Return a rectangle for painting centered on the given point. Both the argument point and the result rectangle are in world coordinates." - - | paintExtent maxPaintArea myBnds | - paintExtent := self reasonablePaintingExtent. - maxPaintArea := paintExtent x * paintExtent y. - myBnds := self boundsInWorld. - (myBnds area <= maxPaintArea) ifTrue: [^ myBnds]. - ^ (aPoint - (paintExtent // 2) extent: paintExtent) intersect: myBnds - !
Item was removed: - ----- Method: PasteUpMorph>>paintingFlapTab (in category 'flaps') ----- - paintingFlapTab - "If the receiver has a flap which has a paintbox, return it, else return nil" - self flapTabs do: - [:aTab | aTab referent submorphsDo: - [:aMorph | (aMorph isKindOf: PaintBoxMorph) ifTrue: [^ aTab]]]. - ^ nil!
Item was removed: - ----- Method: PasteUpMorph>>prepareToBeSaved (in category 'misc') ----- - prepareToBeSaved - "Prepare for export via the ReferenceStream mechanism" - - | exportDict soundKeyList players | - super prepareToBeSaved. - turtlePen := nil. - self isWorldMorph - ifTrue: - [self removeProperty: #scriptsToResume. - soundKeyList := Set new. - (players := self presenter allExtantPlayers) - do: [:aPlayer | aPlayer slotInfo - associationsDo: [:assoc | assoc value type == #Sound - ifTrue: [soundKeyList - add: (aPlayer instVarNamed: assoc key)]]]. - players - do: [:p | p allScriptEditors - do: [:e | (e allMorphs - select: [:m | m isSoundTile]) - do: [:aTile | soundKeyList add: aTile literal]]]. - (self allMorphs - select: [:m | m isSoundTile]) - do: [:aTile | soundKeyList add: aTile literal]. - soundKeyList removeAllFoundIn: SampledSound universalSoundKeys. - soundKeyList - removeAllSuchThat: [:aKey | (SampledSound soundLibrary includesKey: aKey) not]. - soundKeyList isEmpty - ifFalse: [exportDict := Dictionary new. - soundKeyList - do: [:aKey | exportDict - add: (SampledSound soundLibrary associationAt: aKey)]. - self setProperty: #soundAdditions toValue: exportDict]]!
Item was removed: - ----- Method: PasteUpMorph>>prepareToPaint (in category 'painting') ----- - prepareToPaint - "We're about to start painting. Do a few preparations that make the system more responsive." - - ^ self prepareToPaint: Preferences keepTickingWhilePainting not!
Item was removed: - ----- Method: PasteUpMorph>>prepareToPaint: (in category 'painting') ----- - prepareToPaint: stopRunningScripts - "We're about to start painting. Do a few preparations that make the system more responsive." - - self hideViewerFlaps. "make room" - stopRunningScripts ifTrue: - [self setProperty: #scriptsToResume toValue: self presenter allCurrentlyTickingScriptInstantiations. "We'll restart these when painting is done" - self stopRunningAll]. "stop scripts" - self abandonAllHalos. "no more halos"!
Item was removed: - ----- Method: PasteUpMorph>>presentCardAndStackMenu (in category 'menu & halo') ----- - presentCardAndStackMenu - "Put up a menu holding card/stack-related options." - - | aMenu | - aMenu := MenuMorph new defaultTarget: self. - aMenu addStayUpItem. - aMenu addTitle: 'card and stack' translated. - aMenu add: 'add new card' translated action: #insertCard. - aMenu add: 'delete this card' translated action: #deleteCard. - aMenu add: 'go to next card' translated action: #goToNextCardInStack. - aMenu add: 'go to previous card' translated action: #goToPreviousCardInStack. - aMenu addLine. - aMenu add: 'show foreground objects' translated action: #showForegroundObjects. - aMenu add: 'show background objects' translated action: #showBackgroundObjects. - aMenu add: 'show designations' translated action: #showDesignationsOfObjects. - aMenu add: 'explain designations' translated action: #explainDesignations. - aMenu popUpInWorld: (self world ifNil: [self currentWorld])!
Item was removed: - ----- Method: PasteUpMorph>>presentPlayfieldMenu (in category 'menu & halo') ----- - presentPlayfieldMenu - - self playfieldOptionsMenu popUpForHand: self activeHand in: self world!
Item was removed: - ----- Method: PasteUpMorph>>presenter (in category 'accessing') ----- - presenter - "Normally only the world will have a presenter, but the architecture supports individual localized presenters as well" - - ^ presenter ifNil: - [self isWorldMorph - ifTrue: [presenter := Presenter defaultPresenterClass new associatedMorph: self] - ifFalse: [super presenter]]!
Item was removed: - ----- Method: PasteUpMorph>>printScriptSummary (in category 'world menu') ----- - printScriptSummary - "Put up a window with summaries of all scripts in the world" - - self presenter reportPlayersAndScripts - - "self currentWorld printScriptSummary"!
Item was removed: - ----- Method: PasteUpMorph>>putUpPenTrailsSubmenu (in category 'menu & halo') ----- - putUpPenTrailsSubmenu - "Put up the pen trails menu" - - | aMenu | - aMenu := MenuMorph new defaultTarget: self. - aMenu title: 'pen trails' translated. - aMenu addStayUpItem. - self addPenTrailsMenuItemsTo: aMenu. - ^ aMenu popUpInWorld: self!
Item was removed: - ----- Method: PasteUpMorph>>reasonablePaintingExtent (in category 'painting') ----- - reasonablePaintingExtent - ^ Preferences unlimitedPaintArea - ifTrue: - [3000 @ 3000] - ifFalse: - [Preferences defaultPaintingExtent]!
Item was removed: - ----- Method: PasteUpMorph>>rectifyCursor (in category 'cursor') ----- - rectifyCursor - cursor := ((cursor truncated max: 1) min: submorphs size) - !
Item was removed: - ----- Method: PasteUpMorph>>referencePlayfield (in category 'e-toy support') ----- - referencePlayfield - "Answer a pasteup morph to be used as the reference for cartesian coordinates. - Do not get fooled by other morphs (like viewers) that happen to be named 'playfield'." - - ^self isWorldMorph - ifTrue: [ self submorphThat: [ :s | (s knownName = 'playfield') and: [ s isPlayfieldLike] ] ifNone: [self]] - ifFalse: [ super referencePlayfield ]!
Item was removed: - ----- Method: PasteUpMorph>>referencePool (in category 'objects from disk') ----- - referencePool - ^ self - valueOfProperty: #References - ifAbsentPut: [WeakValueDictionary new] - !
Item was removed: - ----- Method: PasteUpMorph>>releaseViewers (in category 'flaps') ----- - releaseViewers - "In preparation for saving, make the flapTabs release their viewers." - - self flapTabs do: [:ft | - (ft respondsTo: #hibernate) ifTrue: [ft hibernate]]!
Item was removed: - ----- Method: PasteUpMorph>>removeAllViewers (in category 'world menu') ----- - removeAllViewers - "Delete all the viewers lined up along my right margin." - - (self submorphs select: [:m | m isKindOf: ViewerFlapTab]) do: - [:m | - m referent ifNotNil: [m referent delete]. - m delete.]!
Item was removed: - ----- Method: PasteUpMorph>>restoreBoundsOfSubmorphs (in category 'viewing') ----- - restoreBoundsOfSubmorphs - "restores the saved xy-positions and extents" - - submorphs do: - [:aSubmorph | - aSubmorph valueOfProperty: #savedExtent ifPresentDo: - [:anExtent | aSubmorph extent: anExtent]. - aSubmorph valueOfProperty: #savedPosition ifPresentDo: - [:aPosition | aSubmorph position: aPosition]]!
Item was removed: - ----- Method: PasteUpMorph>>resumeScriptsPausedByPainting (in category 'painting') ----- - resumeScriptsPausedByPainting - "If there were any scripts running when painting was initiated, resume them now" - - | aList | - (aList := self valueOfProperty: #scriptsToResume) isEmptyOrNil ifFalse: - [aList do: - [:aScriptInstantiation | - aScriptInstantiation player costume isInWorld ifTrue: - [aScriptInstantiation startRunningIfPaused]]]. - self removeProperty: #scriptsToResume!
Item was removed: - ----- Method: PasteUpMorph>>saveBoundsOfSubmorphs (in category 'viewing') ----- - saveBoundsOfSubmorphs - "store the current xy-positions and extents of submorphs for future use" - - submorphs do: - [:aSubmorph | - aSubmorph setProperty: #savedExtent toValue: aSubmorph extent. - aSubmorph setProperty: #savedPosition toValue: aSubmorph position]!
Item was removed: - ----- Method: PasteUpMorph>>selectedRect (in category 'cursor') ----- - selectedRect - "Return a rectangle enclosing the morph at the current cursor. Note that the cursor may be a float and may be out of range, so pick the nearest morph. Assume there is at least one submorph." - - | p | - p := cursor asInteger. - p := p min: submorphs size. - p := p max: 1. - ^(submorphs at: p) fullBounds expandBy: 2!
Item was removed: - ----- Method: PasteUpMorph>>sendTextContentsBackToDonor (in category 'menu & halo') ----- - sendTextContentsBackToDonor - "Send my string contents back to the Text Morph from whence I came" - - (self valueOfProperty: #donorTextMorph) ifNotNil: - [:aDonor | aDonor setCharacters: self assuredPlayer getStringContents]!
Item was removed: - ----- Method: PasteUpMorph>>showStatusOfAllScripts (in category 'world menu') ----- - showStatusOfAllScripts - "Put up a window that shows, and allows you to change, the status of all scripts" - - self presenter toolToViewScriptInstantiations!
Item was removed: - ----- Method: PasteUpMorph>>showingListView (in category 'viewing') ----- - showingListView - "Answer whether the receiver is currently showing a list view" - - ^ self hasProperty: #showingListView - !
Item was removed: - ----- Method: PasteUpMorph>>sortSubmorphsBy: (in category 'viewing') ----- - sortSubmorphsBy: sortOrderSymbol - "Sort the receiver's submorphs by the criterion indicated in the provided symbol" - self invalidRect: self fullBounds. - submorphs := submorphs sorted: [:a :b | (a perform: sortOrderSymbol) <= (b perform: sortOrderSymbol)]. - self layoutChanged.!
Item was removed: - ----- Method: PasteUpMorph>>standardPlayerHit (in category 'world state') ----- - standardPlayerHit - - self playSoundNamed: 'peaks'. - !
Item was removed: - ----- Method: PasteUpMorph>>startRunningAll (in category 'misc') ----- - startRunningAll - "Start running all scripted morphs. Triggered by user hitting GO button" - - self presenter flushPlayerListCache. "Inefficient, but makes sure things come right whenever GO hit" - self presenter allExtantPlayers do: [:aPlayer | aPlayer costume residesInPartsBin ifFalse: [aPlayer startRunning]]. - - self world updateStatusForAllScriptEditors!
Item was removed: - ----- Method: PasteUpMorph>>stepAll (in category 'misc') ----- - stepAll - "tick all the paused player scripts in the receiver" - - self presenter allExtantPlayers do: - [:aPlayer | - aPlayer startRunning; step; stopRunning]!
Item was removed: - ----- Method: PasteUpMorph>>stopRunningAll (in category 'misc') ----- - stopRunningAll - "Reset all ticking scripts to be paused. Triggered by user hitting STOP button" - - self presenter allExtantPlayers do: - [:aPlayer | - aPlayer stopRunning]. - - self world updateStatusForAllScriptEditors!
Item was removed: - ----- Method: PasteUpMorph>>toggleAutoLineLayout (in category 'options') ----- - toggleAutoLineLayout - "Toggle the auto-line-layout setting" - - self autoLineLayout: self autoLineLayout not. - self autoLineLayout ifFalse: [self restoreBoundsOfSubmorphs].!
Item was removed: - ----- Method: PasteUpMorph>>toggleClassicNavigatorIfAppropriate (in category 'world menu') ----- - toggleClassicNavigatorIfAppropriate - "If appropriate, toggle the presence of classic navigator" - - Preferences classicNavigatorEnabled ifTrue: [^ Preferences toggle: #showProjectNavigator]!
Item was removed: - ----- Method: PasteUpMorph>>toggleMouseOverHalos (in category 'options') ----- - toggleMouseOverHalos - wantsMouseOverHalos := self wantsMouseOverHalos not!
Item was removed: - ----- Method: PasteUpMorph>>triggerClosingScripts (in category 'world state') ----- - triggerClosingScripts - "If the receiver has any scripts set to run on closing, run them now" - | aPlayer | - self allMorphsDo:[ :m| - (aPlayer := m player) ifNotNil: - [aPlayer runAllClosingScripts]]!
Item was removed: - ----- Method: PasteUpMorph>>triggerOpeningScripts (in category 'world state') ----- - triggerOpeningScripts - "If the receiver has any scripts set to run on opening, run them now" - | aPlayer | - self allMorphsDo:[ :m| - (aPlayer := m player) ifNotNil: - [aPlayer runAllOpeningScripts]]!
Item was removed: - ----- Method: PasteUpMorph>>updateStatusForAllScriptEditors (in category 'misc') ----- - updateStatusForAllScriptEditors - self allScriptEditors do: [:anEditor | anEditor updateStatus]!
Item was removed: - ----- Method: PasteUpMorph>>valueAtCursor (in category 'cursor') ----- - valueAtCursor - "Answer the submorph of mine indexed by the value of my 'cursor' slot" - - submorphs isEmpty ifTrue: [^ self presenter standardPlayer costume]. - ^ (submorphs at: ((cursor truncated max: 1) min: submorphs size)) morphRepresented!
Item was removed: - ----- Method: PasteUpMorph>>valueAtCursor: (in category 'cursor') ----- - valueAtCursor: aMorph - submorphs isEmpty ifTrue: [^ self]. - self rectifyCursor. - self replaceSubmorph: self valueAtCursor by: aMorph!
Item was removed: - ----- Method: PasteUpMorph>>viewingNormally (in category 'viewing') ----- - viewingNormally - "Answer whether the receiver is being viewed normally, viz not in list-view or auto-line-layout" - - ^ (self showingListView or: [self autoLineLayout == true]) not - !
Item was removed: - ----- Method: PasteUpMorph>>wantsHaloFor: (in category 'halos and balloon help') ----- - wantsHaloFor: aSubMorph - "Answer whether the receiver wishes for a mouse-over halo to be produced for aSubMorph" - - ^ wantsMouseOverHalos == true and: - [self visible and: - [isPartsBin ~~ true and: - [self dropEnabled and: - [aSubMorph renderedMorph isLikelyRecipientForMouseOverHalos]]]]!
Item was removed: - ----- Method: PasteUpMorph>>wantsMouseOverHalos (in category 'options') ----- - wantsMouseOverHalos - ^ wantsMouseOverHalos == true!
Item was removed: - ----- Method: PasteUpMorph>>wantsMouseOverHalos: (in category 'options') ----- - wantsMouseOverHalos: aBoolean - wantsMouseOverHalos := aBoolean!
Item was removed: - Morph subclass: #PluggableTabButtonMorph - instanceVariableNames: 'active model textSelector arcLengths subMorph' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Pluggable Widgets'! - - !PluggableTabButtonMorph commentStamp: 'KLC 9/17/2004 11:27' prior: 0! - This is a specialized pluggable button morph that is meant to represent a tab in a set of tabs arranged horizontally. Each tab will overlap slightly when drawn. All but one tab will be drawn in left to right order in the specified color, but lighter. The active tab will be drawn last in the full color and slightly taller to indicate that it is selected. Clicking the active tab has no effect but clicking any other tab will change the active tab to the clicked tab. - - This morph does not itself accept any events. The parent tab set will grab the mouse clicks and handle notifying the appropriate tabs that they have been activated or deactivated. - - There is a single selector which provides the text for the button label and affects the width of the tab. When the width changes the tab will inform its parent that it has changed and that the layout needs to be updated. The model for the text selector of course should be the client for the tab set. - - The button label can be a String, Text, or Morph. Texts work better than plain Strings.!
Item was removed: - ----- Method: PluggableTabButtonMorph class>>on:label: (in category 'instance creation') ----- - on: anObject label: getTextSelector - | instance | - instance := super new. - instance model: anObject. - instance textSelector: getTextSelector. - ^ instance !
Item was removed: - ----- Method: PluggableTabButtonMorph>>active (in category 'access') ----- - active - active ifNil: [ active := false ]. - ^ active!
Item was removed: - ----- Method: PluggableTabButtonMorph>>active: (in category 'access') ----- - active: aBoolean - active := aBoolean. - self changed.!
Item was removed: - ----- Method: PluggableTabButtonMorph>>arcLengths (in category 'private - access') ----- - arcLengths - arcLengths ifNil: [ self calculateArcLengths ]. - ^ arcLengths!
Item was removed: - ----- Method: PluggableTabButtonMorph>>arcLengths: (in category 'private - access') ----- - arcLengths: anArrayOfIntegers - arcLengths := anArrayOfIntegers - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>calculateArcLengths (in category 'precalculations') ----- - calculateArcLengths - | array radius | - radius := self cornerRadius. - array := Array new: radius. - - 1 to: radius do: [ :i | | x | - x := i - 0.5. - array at: i - put: (radius - ((2 * x * radius) - (x * x)) sqrt) asInteger]. - - self arcLengths: array!
Item was removed: - ----- Method: PluggableTabButtonMorph>>cornerRadius (in category 'private - access') ----- - cornerRadius - ^ 5 - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>drawOn: (in category 'drawing') ----- - drawOn: aCanvas - self drawTabOn: aCanvas. - self drawSubMorphOn: aCanvas!
Item was removed: - ----- Method: PluggableTabButtonMorph>>drawSubMorphOn: (in category 'drawing') ----- - drawSubMorphOn: aCanvas - | morphBounds | - morphBounds := self bounds insetBy: (self cornerRadius + 3) @ (self topInactiveGap // 2 + 2). - morphBounds := morphBounds translateBy: 0@(self topInactiveGap // 2 + 1). - self active ifTrue: [ - morphBounds := morphBounds translateBy: 0@((self topInactiveGap // 2 + 1) negated)]. - self subMorph bounds height < (morphBounds height) - ifTrue: [ - morphBounds := morphBounds - insetBy: 0@((morphBounds height - self subMorph bounds height) // 2)]. - self subMorph bounds width < (morphBounds width) - ifTrue: [ - morphBounds := morphBounds - insetBy: ((morphBounds width - self subMorph bounds width) // 2)@0]. - - self subMorph bounds: morphBounds. - aCanvas drawMorph: self subMorph!
Item was removed: - ----- Method: PluggableTabButtonMorph>>drawTabOn: (in category 'drawing') ----- - drawTabOn: aCanvas - | top myColor cornerRadius myArcLengths myBounds | - cornerRadius := self cornerRadius. - myBounds := self bounds. - self active - ifTrue: [ top := myBounds top. - myColor := self color ] - ifFalse: [ top := myBounds top + self topInactiveGap. - myColor := self color whiter whiter ]. - aCanvas fillRectangle: - ((myBounds left + cornerRadius) - @ (top + cornerRadius) - corner: (myBounds right - cornerRadius) - @ self bottom) - color: myColor. - aCanvas fillRectangle: - ((myBounds left + (cornerRadius * 2)) @ top - corner: (myBounds right - (cornerRadius * 2)) - @ (top + cornerRadius)) - color: myColor. - aCanvas fillOval: - ((myBounds left + self cornerRadius) @ top - corner: (myBounds left + (self cornerRadius * 3)) - @ (top + (self cornerRadius * 2))) - color: myColor. - aCanvas fillOval: - ((myBounds right - (self cornerRadius * 3)) @ top - corner: (myBounds right - self cornerRadius) - @ (top + (self cornerRadius * 2))) - color: myColor. - - myArcLengths := self arcLengths. - 1 to: myArcLengths size do: [ :i | | length | - length := myArcLengths at: i. - aCanvas line: (myBounds left + cornerRadius - i) @ (myBounds bottom - 1 ) - to: (myBounds left + cornerRadius - i) @ (myBounds bottom - length - 1) - color: myColor. - aCanvas line: (myBounds right - cornerRadius + i - 1) @ (myBounds bottom - 1) - to: (myBounds right - cornerRadius + i - 1) @ (myBounds bottom - length - 1) - color: myColor] - - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>initialize (in category 'initialization') ----- - initialize - ^ super initialize - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>innerExtent: (in category 'access') ----- - innerExtent: aPoint - "Set the extent based on the primary visible part of the tab. In other words add twice the cornerRadius to this extent" - self extent: (aPoint x + (self cornerRadius * 2)) @ (aPoint y)!
Item was removed: - ----- Method: PluggableTabButtonMorph>>model (in category 'access') ----- - model - ^ model - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>model: (in category 'access') ----- - model: anObject - model := anObject!
Item was removed: - ----- Method: PluggableTabButtonMorph>>outerGap (in category 'access') ----- - outerGap - "The horizontal distance of the outer left and right edges of the tab excluding the inner visible part" - ^ self cornerRadius * 2!
Item was removed: - ----- Method: PluggableTabButtonMorph>>step (in category 'stepping') ----- - step - self subMorph step. - self changed. - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>stepTime (in category 'stepping') ----- - stepTime - ^ self subMorph stepTime - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>subMorph (in category 'private - access') ----- - subMorph - subMorph ifNil: [ self update: self textSelector ]. - ^ subMorph!
Item was removed: - ----- Method: PluggableTabButtonMorph>>subMorph: (in category 'private - access') ----- - subMorph: aMorph - subMorph := aMorph - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>textSelector (in category 'access') ----- - textSelector - ^ textSelector - !
Item was removed: - ----- Method: PluggableTabButtonMorph>>textSelector: (in category 'access') ----- - textSelector: aSymbol - textSelector := aSymbol!
Item was removed: - ----- Method: PluggableTabButtonMorph>>toggle (in category 'actions') ----- - toggle - self active: self active not!
Item was removed: - ----- Method: PluggableTabButtonMorph>>topInactiveGap (in category 'private - access') ----- - topInactiveGap - ^ 5!
Item was removed: - ----- Method: PluggableTabButtonMorph>>update: (in category 'updating') ----- - update: aSelector - self textSelector ifNotNil: [ - aSelector = self textSelector - ifTrue: [ | morph | - (aSelector isSymbol and: [model notNil]) - ifTrue: [ - morph := - (self model perform: aSelector) asMorph] - ifFalse: [ morph := aSelector value asMorph]. - self subMorph: morph]]. - self changed!
Item was removed: - ----- Method: PluggableTabButtonMorph>>wantsSteps (in category 'stepping') ----- - wantsSteps - ^ self subMorph wantsSteps!
Item was removed: - ----- Method: PluggableTextMorph>>tileForIt (in category 'menu commands') ----- - tileForIt - "Return a tile referring to the object resulting form evaluating my current selection. Not currently threaded in, but useful in earlier demos and possibly still of value." - - - self handleEdit: - [textMorph editor evaluateSelectionAndDo: [:result | self currentHand attachMorph: result tileToRefer]]!
Item was removed: - Object subclass: #Presenter - instanceVariableNames: '' - classVariableNames: 'DefaultPresenterClass' - poolDictionaries: '' - category: 'Morphic-Worlds'! - - !Presenter commentStamp: '<historical>' prior: 0! - Optionally associated with a PasteUpMorph, provides a local scope for the running of scripts. - - Once more valuable, may be again, but at present occupies primarily a historical niche. - - Maintains a playerList cache. - - Holds, optionally three 'standard items' -- standardPlayer standardPlayfield standardPalette -- originally providing idiomatic support of ongoing squeak-team internal work, but now extended to more general applicability. - - !
Item was removed: - ----- Method: Presenter class>>defaultPresenterClass (in category 'accessing') ----- - defaultPresenterClass - "The default presenter class to use" - ^DefaultPresenterClass ifNil:[self]!
Item was removed: - ----- Method: Presenter class>>defaultPresenterClass: (in category 'accessing') ----- - defaultPresenterClass: aPresenterClass - "The default presenter class to use" - DefaultPresenterClass := aPresenterClass!
Item was removed: - ----- Method: Presenter>>allCurrentlyTickingScriptInstantiations (in category 'stubs') ----- - allCurrentlyTickingScriptInstantiations - "Answer a list of ScriptInstantiation objects representing all the scripts within the scope of the receiver which are currently ticking." - - ^ Array streamContents: - [:aStream | - self allExtantPlayers do: - [:aPlayer | aPlayer instantiatedUserScriptsDo: - [:aScriptInstantiation | - aScriptInstantiation status == #ticking ifTrue: - [aStream nextPut: aScriptInstantiation]]]]!
Item was removed: - ----- Method: Presenter>>allExtantPlayers (in category 'stubs') ----- - allExtantPlayers - ^#()!
Item was removed: - ----- Method: Presenter>>associatedMorph: (in category 'accessing') ----- - associatedMorph: m!
Item was removed: - ----- Method: Presenter>>browseAllScriptsTextually (in category 'stubs') ----- - browseAllScriptsTextually - "Open a method-list browser on all the scripts in the project" - - | aList aMethodList | - self flushPlayerListCache. "Just to be certain we get everything" - - (aList := self uniclassesAndCounts) size == 0 ifTrue: [^ self inform: 'there are no scripted players' translated]. - aMethodList := OrderedCollection new. - aList do: - [:aPair | aPair first addMethodReferencesTo: aMethodList]. - aMethodList size > 0 ifFalse: [^ self inform: 'there are no scripts in this project!!' translated]. - - SystemNavigation new - browseMessageList: aMethodList - name: 'All scripts in this project' - autoSelect: nil - - " - ActiveWorld presenter browseAllScriptsTextually - "!
Item was removed: - ----- Method: Presenter>>currentlyViewing: (in category 'stubs') ----- - currentlyViewing: aPlayer - ^false!
Item was removed: - ----- Method: Presenter>>drawingJustCompleted: (in category 'stubs') ----- - drawingJustCompleted: aSketch!
Item was removed: - ----- Method: Presenter>>flushPlayerListCache (in category 'stubs') ----- - flushPlayerListCache!
Item was removed: - ----- Method: Presenter>>morph:droppedIntoPasteUpMorph: (in category 'stubs') ----- - morph: aMorph droppedIntoPasteUpMorph: aPasteUpMorph!
Item was removed: - ----- Method: Presenter>>ownStandardPalette (in category 'stubs') ----- - ownStandardPalette - ^nil!
Item was removed: - ----- Method: Presenter>>positionStandardPlayer (in category 'stubs') ----- - positionStandardPlayer!
Item was removed: - ----- Method: Presenter>>viewMorph: (in category 'stubs') ----- - viewMorph: aMorph - aMorph inspect. - !
Item was removed: - ----- Method: Presenter>>viewObjectDirectly: (in category 'stubs') ----- - viewObjectDirectly: aMorph - aMorph inspect. - !
Item was removed: - ----- Method: SelectionMorph>>couldMakeSibling (in category 'testing') ----- - couldMakeSibling - "Answer whether it is appropriate to ask the receiver to make a sibling" - - ^ false!
Item was removed: - ----- Method: SelectionMorph>>preferredDuplicationHandleSelector (in category 'testing') ----- - preferredDuplicationHandleSelector - "Answer the selector, to be offered as the default in a halo open on me" - - ^ #addDupHandle:!
Item was removed: - ----- Method: SimpleHaloMorph>>isMagicHalo (in category 'testing') ----- - isMagicHalo - - ^ false!
Item was removed: - ----- Method: SimpleHaloMorph>>popUpMagicallyFor:hand: (in category 'pop up') ----- - popUpMagicallyFor: morph hand: hand - - self - popUpFor: morph - hand: hand.!
Item was removed: - ----- Method: SimpleHierarchicalListMorph class>>submorphsExample (in category 'examples') ----- - submorphsExample - "display a hierarchical list of the current world plus its submorphs plus its submorphs' submorphs etc." - "SimpleHierarchicalListMorph submorphsExample" - | morph | - morph := - SimpleHierarchicalListMorph - on: [ Array with: (MorphWithSubmorphsWrapper with: Project current world) ] - list: #value - selected: nil - changeSelected: nil - menu: nil - keystroke: nil. - - morph openInWindow!
Item was removed: - ----- Method: SketchMorph>>firstIntersectionWithLineFrom:to: (in category 'geometry') ----- - firstIntersectionWithLineFrom: start to: end - | intersections last | - intersections := self fullBounds extrapolatedIntersectionsWithLineFrom: start to: end. - intersections size = 1 ifTrue: [ ^intersections anyOne ]. - intersections isEmpty ifTrue: [ ^nil ]. - intersections := intersections sorted: [ :a :b | (start dist: a) < (start dist: b) ]. - last := intersections first rounded. - last pointsTo: intersections last rounded do: [ :pt | - (self rotatedForm isTransparentAt: (pt - bounds origin)) ifFalse: [ ^last ]. - last := pt. - ]. - ^intersections first rounded!
Item was removed: - Object subclass: #StandardScriptingSystem - instanceVariableNames: '' - classVariableNames: 'ClassVarNamesInUse FormDictionary HelpStrings StandardPartsBin' - poolDictionaries: '' - category: 'Morphic-Worlds'! - - !StandardScriptingSystem commentStamp: '<historical>' prior: 0! - An instance of this is installed as the value of the global variable "ScriptingSystem". Client subclasses are invited, such as one used internally by squeak team for ongoing internal work.!
Item was removed: - ----- Method: StandardScriptingSystem class>>cleanUp: (in category 'class initialization') ----- - cleanUp: agressive - "Clean up unreferenced players. If agressive, reinitialize and nuke players" - - self removeUnreferencedPlayers. - agressive ifTrue:[ - References keys do: [:k | References removeKey: k]. - ClassVarNamesInUse := nil. - self initialize. - ].!
Item was removed: - ----- Method: StandardScriptingSystem class>>initialize (in category 'class initialization') ----- - initialize - "Initialize the scripting system. Sometimes this method is vacuously changed just to get it in a changeset so that its invocation will occur as part of an update" - - (self environment at: #ScriptingSystem ifAbsent: [nil]) ifNil: - [self environment at: #ScriptingSystem put: self new]. - - ScriptingSystem - initializeHelpStrings. - - self registerInFlapsRegistry. - - "StandardScriptingSystem initialize"!
Item was removed: - ----- Method: StandardScriptingSystem class>>removeUnreferencedPlayers (in category 'class initialization') ----- - removeUnreferencedPlayers - "Remove existing but unreferenced player references" - "StandardScriptingSystem removeUnreferencedPlayers" - References keys do: - [ : key | | ref | - ref := References at: key. - ((ref respondsTo: #costume) and: [ ref costume pasteUpMorph isNil ]) ifTrue: [ References removeKey: key ] ]!
Item was removed: - ----- Method: StandardScriptingSystem>>allClassVarNamesInSystem (in category 'utilities') ----- - allClassVarNamesInSystem - "Compute and answer a set of all the class variable names known to the sytem from any class" - - | aList | - aList := OrderedCollection new. - Object withAllSubclasses do: - [:c | aList addAll: c allClassVarNames]. - ^ aList asSet - - "ScriptingSystem allClassVarNamesInSystem" - !
Item was removed: - ----- Method: StandardScriptingSystem>>customizeForEToyUsers: (in category 'utilities') ----- - customizeForEToyUsers: aBoolean - "If aBoolean is true, set things up for etoy users. If it's false, unset some of those things. Some things are set when switching into etoy mode but not reversed when switching out of etoy mode." - - #( - (allowEtoyUserCustomEvents no reverse) - (balloonHelpEnabled yes dontReverse) - (debugHaloHandle no reverse) - (modalColorPickers yes dontReverse) - (oliveHandleForScriptedObjects no dontReverse) - (uniqueNamesInHalos yes reverse) - (useUndo yes dontReverse) - (infiniteUndo no dontReverse) - (warnIfNoChangesFile no reverse) - (warnIfNoSourcesFile no reverse)) do: - [:trip | - (aBoolean or: [trip third == #reverse]) ifTrue: - [Preferences setFlag: trip first toValue: - ((trip second == #yes) & aBoolean) | ((trip second == #no) & aBoolean not)]]!
Item was removed: - ----- Method: StandardScriptingSystem>>deletePrivateGraphics (in category 'form dictionary') ----- - deletePrivateGraphics - "ScriptingSystem deletePrivateGraphics" - self deletePrivateGraphics: self privateGraphics - afterStoringToFileNamed: 'disGraphics'!
Item was removed: - ----- Method: StandardScriptingSystem>>deletePrivateGraphics:afterStoringToFileNamed: (in category 'form dictionary') ----- - deletePrivateGraphics: nameList afterStoringToFileNamed: aFileName - "This method is used to strip private graphics from the FormDictionary and store them on a file of the given name" - - | replacement toRemove aReferenceStream | - toRemove := Dictionary new. - replacement := FormDictionary at: #Gets. - - nameList do: - [:aKey | - | keySymbol | - keySymbol := aKey asSymbol. - (toRemove at: keySymbol put: (self formAtKey: keySymbol)). - FormDictionary at: keySymbol put: replacement]. - - aReferenceStream := ReferenceStream fileNamed: aFileName. - aReferenceStream nextPut: toRemove. - aReferenceStream close!
Item was removed: - ----- Method: StandardScriptingSystem>>formAtKey: (in category 'form dictionary') ----- - formAtKey: aString - "Answer the form saved under the given key" - - ^((Symbol lookup: aString) - ifNotNil: [ :aKey | FormDictionary at: aKey ifAbsent: [ FormDictionary at: #Cat ] ] - ifNil: [ FormDictionary at: #Cat ]) - magnifyBy: RealEstateAgent scaleFactor!
Item was removed: - ----- Method: StandardScriptingSystem>>formAtKey:extent:depth: (in category 'form dictionary') ----- - formAtKey: aKey extent: extent depth: depth - "ScriptingSystem saveForm: (TileMorph downPicture) atKey: 'downArrow'" - ^ FormDictionary at: aKey asSymbol ifAbsent: [Form extent: extent depth: depth]!
Item was removed: - ----- Method: StandardScriptingSystem>>formDictionary (in category 'form dictionary') ----- - formDictionary - ^FormDictionary!
Item was removed: - ----- Method: StandardScriptingSystem>>helpStringOrNilFor: (in category 'help dictionary') ----- - helpStringOrNilFor: aSymbol - "If my HelpStrings dictionary has an entry at the given symbol, - answer that entry's value, else answer nil" - HelpStrings - at: aSymbol - ifPresent:[:string | ^ string translated]. - ^ nil!
Item was removed: - ----- Method: StandardScriptingSystem>>initializeHelpStrings (in category 'help dictionary') ----- - initializeHelpStrings - "Initialize the data structure that determines, for the etoy system, help messages for various scripting elements. The structure is built up by letting every Morph subclass contribute elements simply by implementing method #helpContributions. Consult implementors of #helpContributions for examples of how this goes." - - "ScriptingSystem initializeHelpStrings" - - | aDictionary | - aDictionary := IdentityDictionary new. - "For safety, the new copy is built up in this temp first, so that if an error occurs during the creation of the structure, the old version will remain remain in place" - - Morph withAllSubclasses do: - [:aClass | (aClass class includesSelector: #helpContributions) - ifTrue: - [aClass helpContributions do: - [:pair | aDictionary at: pair first put: pair second]]]. - - HelpStrings := aDictionary!
Item was removed: - ----- Method: StandardScriptingSystem>>inspectFormDictionary (in category 'form dictionary') ----- - inspectFormDictionary - "ScriptingSystem inspectFormDictionary" - - GraphicalDictionaryMenu openOn: FormDictionary withLabel: 'Testing One Two Three'!
Item was removed: - ----- Method: StandardScriptingSystem>>privateGraphics (in category 'form dictionary') ----- - privateGraphics - "ScriptingSystem deletePrivateGraphics" - ^#(#BadgeMiniPic #BadgePic #Broom #CedarPic #CollagePic #CoverMain #CoverSpiral #CoverTexture #Fred #ImagiPic #KayaPic #StudioPic)!
Item was removed: - ----- Method: StandardScriptingSystem>>saveForm:atKey: (in category 'form dictionary') ----- - saveForm: aForm atKey: aKey - FormDictionary at: aKey asSymbol put: aForm!
Item was removed: - ----- Method: StandardScriptingSystem>>soundNamesToSuppress (in category 'utilities') ----- - soundNamesToSuppress - "Answer a list of sound-names that are not to be offered in sound-choice pop-ups unless they are the current choice" - - ^ #('scrape' 'scritch' 'peaks')!
Item was removed: - ----- Method: StandardScriptingSystem>>squeakyMouseForm (in category 'form dictionary') ----- - squeakyMouseForm - ^ self formAtKey: 'squeakyMouse' - - " - ScriptingSystem saveForm: (Form - extent: 30@29 - depth: 16 - fromArray: #( 1811114995 1878286257 2012637171 1811180532 1811180533 1811179508 1811180532 1811179508 1744006133 1878289396 1811180533 1878289396 1744007156 1674736630 1744006132 1811114995 1811181556 1744006131 1811246068 1811180532 1811179508 1811180532 1744071668 1811113972 1811180532 1811180532 1811179507 1878288338 1945529332 1744071668 1743941620 1811112945 1811179506 1811114995 1744006131 1744006130 1744005106 1811048434 1811113969 1743939570 1811179506 1743939571 1676833782 1676765171 1811047410 1744006131 1811048435 1811116020 1811180531 1743939571 1811048435 1743939570 1743939570 1743939570 1743940594 1744005106 1811181556 1811180532 1676766196 1743939570 1878420468 1676963830 1189896082 1811245044 1744137204 1744070644 1811179508 1811113971 1743939571 1811179508 1811246070 1811309524 1811302093 1811310580 1811246068 1674867703 1744049472 1120606594 1118465013 1744137205 1811179508 1811180532 1744071667 1744006132 1811112947 1811247095 1605584589 358761132 289435638 1676 830707 1741975543 1462778473 1811312631 702891724 1811310548 1945528308 1811178450 1945528307 1878288372 1878353875 1878421494 1051471335 1809213397 1118524175 1811246068 1945659348 1185698607 1878486005 1672694510 1118531574 1607626741 1878420467 1811180533 1743942645 1744072693 1811301035 1185770487 1878486006 1324239597 1811180533 1811116019 1120623438 1878352818 1945462739 704868339 1878289395 1811049459 1878221808 1878223859 1743876083 1811162563 1945463796 1811181556 1464746666 1811116018 1809019893 1120551562 1945464821 1741844468 1466842760 1878289395 1811048434 1811050483 1811050483 1878223859 1049188174 1741910004 1811181556 1256998634 1811114994 1878289396 1466840647 1744007156 1744006131 1676877216 1743940596 1878222835 1743938545 1878351792 1676833781 358641652 1743940596 1811050484 845566798 1811113970 1811114995 1811163652 1811112913 1878420468 1878282028 1811179506 1607560178 1878289395 1676900342 1878351825 1466853330 1811113971 1811116019 635659217 1811179506 18112 45045 1676942754 1744137206 1744201717 1676962806 1676962805 1811310581 1676896245 1744199635 1811376117 1744072695 1744005109 1811244019 499279861 1811310581 1811244020 1811293668 1399943159 1605528567 1744136181 982063522 986342388 1744070645 1744189066 430063308 1744071669 1744070644 1744067504 566519797 1744136181 1744137205 1743999854 912813044 1811311606 1742162607 4195488 283139922 1945531382 1253113857 144710948 1601400791 1811246069 1811167879 1464821747 1744136180 1674799094 1811178482 843473875 1811311606 1878533542 2106790 2080066222 1876193270 696845376 627472380 1185772536 1878355957 1743990309 1744007157 1676898294 1744006132 1811114996 1743941620 1811180533 1809204941 4194368 4217681 1878290421 1252982848 4194336 1670540278 1739811795 1878353906 1744006131 1811179506 1744007157 1744005106 1945462771 1811182582 1811311574 1393641133 1462856629 2012638196 1876382449 1112301394 1742041045 1945596917 1676833781 1811113970 1811179507 1811180532 1672705014 1674735606 16726 97648 1945725943 1878551479 1809215479 1811312629 1809216504 1809215479 1809215478 1462853490 1878487029 1744007158 1744005075 1811239726 704979363 495004132 700789287 562372997 631646663 1739998892 4194400 1116497846 698688932 562375109 770124262 633609569 495070758 1257010166 562315916 1809279958 2012894002 1047280171 980237901 910966381 1668677696 4194400 6314867 1047281260 908804749 910968495 1393719290 1809279959 1185750370 1809214455 1878469062 423836236 1532188466 1601592148 1462986647 1672937568 4194368 6319062 1603622706 1601525554 1601522417 1047336194 770206679 1878487031 1878409899 977955830 1809145716 1118586509 980105834 980045584 1811372914 980104778 1605526483 1395605131 910769804 1118651052 1534358520 1809136234 1118596053 1532059506 1878485973 1326456163 1945660374 1742106615 1811311607 1945725942 1742107641 1744072693 1811311605 1744203767 1878551543 564478604 1878553591 1603428242 1811048433 1811049459 1051290611 1744006131 1811049459 1878156273 1743874034 174400 7156 1743874033 1811048434 1811113970 1743939571 1743933228 1603301363 1743875059 1811049458 1945461745 1811181556 1811113971 1811049458 1811048434 1811116020 1878287346 1878223857 1743940594 1744006130 1744007157 1945395153 1945400309 1811048434 1743810547 1676765170 1878353906 1811113970 1743874032 1810983921 1743874033 1811113971 1676765169 1743874034 1743940593 1743939569 1811047409 1676765168 1743940595 1810981872 1945397235 1607560179 1743941620 1810982897 1810983921 1811048433 1744007155 1743875059 1811048434 1743875058 1743939568 1676832754 1811116019 1811114994 1811244019 1676962805 1677029367 1811244020 1744005106 1743940594 1811246068 1744070645 1676961781 1744004084 1676897269 1811180533 1878353908 1744004083 1744070645) - offset: 0@0) atKey: 'squeakyMouse'"!
Item was removed: - ----- Method: StandardScriptingSystem>>stripGraphicsForExternalRelease (in category 'utilities') ----- - stripGraphicsForExternalRelease - "ScriptingSystem stripGraphicsForExternalRelease" - - | replacement | - replacement := FormDictionary at: #Gets. - - #('BadgeMiniPic' 'BadgePic' 'Broom' 'CedarPic' 'CollagePic' 'CoverMain' 'CoverSpiral' 'CoverTexture' 'Fred' 'ImagiPic' 'KayaPic' 'StudioPic') - do: - [:aKey | FormDictionary at: aKey asSymbol put: replacement]!
Item was removed: - ----- Method: SystemWindow>>extantSketchEditor (in category 'top window') ----- - extantSketchEditor - "If my world has an extant SketchEditorMorph associated with anything - in this window, return that SketchEditor, else return nil" - | w sketchEditor pasteUp | - (w := self world) isNil ifTrue: [^ nil]. - (sketchEditor := w sketchEditorOrNil) isNil ifTrue: [^ nil]. - (pasteUp := sketchEditor enclosingPasteUpMorph) isNil ifTrue: [^ nil]. - self findDeepSubmorphThat: [:m | m = pasteUp] - ifAbsent: [^ nil]. - ^ sketchEditor!
Item was removed: - ----- Method: SystemWindow>>wantsExpandBox (in category 'resize/collapse') ----- - wantsExpandBox - "Answer whether I'd like an expand box" - - ^ Preferences alwaysHideExpandButton not!
Item was removed: - ----- Method: SystemWindow>>wantsHalo (in category 'events') ----- - wantsHalo - ^ false!
Item was removed: - RectangleMorph subclass: #TextFieldMorph - instanceVariableNames: '' - classVariableNames: '' - poolDictionaries: '' - category: 'Morphic-Text Support'! - - !TextFieldMorph commentStamp: '<historical>' prior: 0! - Act as a field in a HyperCard-like setting. Has both properties of a Rectangle, and exposes some proteries of the TextMorph it owns. - - !
Item was removed: - ----- Method: TextFieldMorph class>>authoringPrototype (in category 'scripting') ----- - authoringPrototype - "Answer an instance of the receiver that can serve as a prototype for authoring" - - | proto | - proto := super authoringPrototype. - proto setProperty: #shared toValue: true. - proto extent: 170 @ 30. - proto color: Color veryLightGray lighter. - proto contents: 'on a clear day you can...'. - ^ proto - !
Item was removed: - ----- Method: TextFieldMorph class>>initialize (in category 'class initialization') ----- - initialize - - self registerInFlapsRegistry. !
Item was removed: - ----- Method: TextFieldMorph class>>registerInFlapsRegistry (in category 'class initialization') ----- - registerInFlapsRegistry - "Register the receiver in the system's flaps registry" - self environment - at: #Flaps - ifPresent: [:cl | cl registerQuad: {#TextFieldMorph. #exampleBackgroundField. 'Scrolling Field' translatedNoop. 'A scrolling data field which will have a different value on every card of the background' translatedNoop} - forFlapNamed: 'Scripting'.]!
Item was removed: - ----- Method: TextFieldMorph class>>unload (in category 'class initialization') ----- - unload - "Unload the receiver from global registries" - - self environment at: #Flaps ifPresent: [:cl | - cl unregisterQuadsWithReceiver: self] !
Item was removed: - ----- Method: TextFieldMorph>>append: (in category 'just like textMorph') ----- - append: stringOrText - "add to my text" - | tm | - - (tm := self findA: TextMorph) ifNil: [^ nil]. - tm contents append: stringOrText. - tm releaseParagraph; paragraph. - - - !
Item was removed: - ----- Method: TextFieldMorph>>contents (in category 'just like textMorph') ----- - contents - | tm | - "talk to my text" - - (tm := self findA: TextMorph) ifNil: [^ nil]. - ^ tm contents!
Item was removed: - ----- Method: TextFieldMorph>>contents: (in category 'just like textMorph') ----- - contents: textOrString - "talk to my text" - | tm newText atts | - - (tm := self findA: TextMorph) ifNil: [^ nil]. - textOrString isString ifTrue: [ - tm contents ifNotNil: ["Keep previous properties of the field" - newText := textOrString asText. - atts := tm contents attributesAt: 1. - atts do: [:each | newText addAttribute: each]. - ^ tm contents: newText]]. - - ^ tm contents: textOrString!
Item was removed: - ----- Method: TextFieldMorph>>defaultColor (in category 'initialization') ----- - defaultColor - "answer the default color/fill style for the receiver" - ^ Color veryLightGray lighter!
Item was removed: - ----- Method: TextFieldMorph>>fit (in category 'just like textMorph') ----- - fit - "tell my text to recompute its looks" - | tm | - - (tm := self findA: TextMorph) ifNil: [^ nil]. - tm releaseParagraph; paragraph.!
Item was removed: - ----- Method: TextFieldMorph>>fontName:size: (in category 'just like textMorph') ----- - fontName: fontName size: fontSize - | tm | - "talk to my text" - - (tm := self findA: TextMorph) ifNil: [^ nil]. - ^ tm fontName: fontName size: fontSize - !
Item was removed: - ----- Method: TextFieldMorph>>initialize (in category 'initialization') ----- - initialize - "initialize the state of the receiver" - | tm | - super initialize. - "" - - self addMorph: (tm := TextMorph new). - tm fillingOnOff!
Item was removed: - ----- Method: TextFieldMorph>>lineCount (in category 'just like textMorph') ----- - lineCount - | tm | - "how many lines in my text" - - (tm := self findA: TextMorph) ifNil: [^ nil]. - ^ tm contents string lineCount!
Item was removed: - ----- Method: TextFieldMorph>>prepend: (in category 'just like textMorph') ----- - prepend: stringOrText - "add to my text" - | tm | - - (tm := self findA: TextMorph) ifNil: [^ nil]. - tm contents prepend: stringOrText. - tm releaseParagraph; paragraph. - - - !
Item was removed: - ----- Method: TextMorph>>cursor (in category 'accessing') ----- - cursor - "Answer the receiver's logical cursor position" - - | loc | - loc := self valueOfProperty: #textCursorLocation ifAbsentPut: [1]. - loc := loc min: text string size. - ^ loc rounded - !
Item was removed: - ----- Method: TextMorph>>cursorWrapped: (in category 'accessing') ----- - cursorWrapped: aNumber - "Set the cursor as indicated" - - self setProperty: #textCursorLocation toValue: (((aNumber rounded - 1) \ text string size) + 1) - - !
Item was removed: - ----- Method: TextMorph>>getAllButFirstCharacter (in category 'scripting access') ----- - getAllButFirstCharacter - "Obtain all but the first character from the receiver; if that would be empty, return a black dot" - - | aString | - ^ (aString := text string) size > 1 - ifTrue: [aString copyFrom: 2 to: aString size] - ifFalse: ['·']!
Item was removed: - ----- Method: TextMorph>>holderForCharacters (in category 'menu') ----- - holderForCharacters - "Hand the user a Holder that is populated with individual text morphs representing my characters" - - | aHolder | - aHolder := ScriptingSystem prototypicalHolder. - aHolder setNameTo: 'H', self externalName. - text string do: - [:aChar | - aHolder addMorphBack: (TextMorph new contents: aChar asText)]. - aHolder setProperty: #donorTextMorph toValue: self. - aHolder fullBounds. - aHolder openInHand!
Item was removed: - ----- Method: TextMorph>>insertCharacters: (in category 'scripting access') ----- - insertCharacters: aString - "Insert the characters from the given source at my current cursor position" - - | aLoc aText attributes | - aLoc := self cursor max: 1. - aText := aLoc > text size - ifTrue: [aString asText] - ifFalse: [ - attributes := (text attributesAt: aLoc) - select: [:attr | attr mayBeExtended]. - Text string: aString attributes: attributes]. - paragraph replaceFrom: aLoc to: (aLoc - 1) with: aText displaying: true. - self updateFromParagraph !
Item was removed: - ----- Method: TextMorph>>insertContentsOf: (in category 'scripting access') ----- - insertContentsOf: aPlayer - "Insert the characters from the given player at my current cursor position" - - | aLoc | - aLoc := self cursor. - paragraph replaceFrom: aLoc to: (aLoc - 1) with: aPlayer getStringContents displaying: true. - self updateFromParagraph !
Item was removed: - ----- Method: TextMorph>>setAllButFirstCharacter: (in category 'scripting access') ----- - setAllButFirstCharacter: source - "Set all but the first char of the receiver to the source" - | chars | - (chars := self getCharacters) isEmpty - ifTrue: [self newContents: '·' , source asString] - ifFalse: [self newContents: (String - streamContents: [:aStream | - aStream nextPut: chars first. - aStream nextPutAll: source])]!
Item was removed: - ----- Method: TextMorph>>wouldAcceptKeyboardFocusUponTab (in category 'event handling') ----- - wouldAcceptKeyboardFocusUponTab - "Answer whether the receiver might accept keyboard focus if - tab were hit in some container playfield" - ^ self inPartsBin not!
Item was removed: - ----- Method: TextMorphForEditView>>wouldAcceptKeyboardFocusUponTab (in category 'event handling') ----- - wouldAcceptKeyboardFocusUponTab - "Answer whether the receiver would be a happy inheritor of keyboard focus if tab were hit in an enclosing playfield under propitious circumstances. Does not make sense for this kind of morph, which is encased in a window" - - ^ false!
Item was removed: - ----- Method: TheWorldMenu>>menuColorString (in category 'action') ----- - menuColorString - - ^ Preferences menuColorString!
Item was removed: - ----- Method: TheWorldMenu>>mvcProjectsAllowed (in category 'commands') ----- - mvcProjectsAllowed - - ^Preferences mvcProjectsAllowed and: [Smalltalk includesKey: #StandardSystemView]!
Item was removed: - ----- Method: TheWorldMenu>>roundedCornersString (in category 'action') ----- - roundedCornersString - - ^ (((SystemWindow roundedWindowCorners) - ifTrue: ['stop'] - ifFalse: ['start']) , ' rounding window corners') translated!
Item was removed: - ----- Method: TheWorldMenu>>toggleMenuColorPolicy (in category 'action') ----- - toggleMenuColorPolicy - - Preferences toggle: #menuColorFromWorld.!
Item was removed: - ----- Method: UpdatingStringMorph>>isEtoyReadout (in category 'target access') ----- - isEtoyReadout - "Answer whether the receiver can serve as an etoy readout" - - ^ true!
packages@lists.squeakfoundation.org