'From etoys2.2 of 24 September 2007 [latest update: #1668] on 27 September 2007 at 4:43:22 am'! "Change Set: playfieldOptions-sw Date: 27 September 2007 Author: Scott Wallace Remove the 'viewing' halo handle, as per agreement on conference call on 26 Sept 07. Spruce up the playfield-options menu by: - removing items that no longer make sense [e.g. about SqueakPages] - removing items that already occur elsewhere [e.g. open to drag and drop] - removing many items inappropriate for a World from the playfield options menu for a *world* - adding items formerly in the viewing-menu-halo-handle menu that were otherwise not available. - moving the one pen-trail-related item from the playfield-options to pen-trails menu. Also fixed a refresh bug when toggling the 'indicate cursor' option. Also fixed a bug in, and corrected the wording of, the menu items that show or hide viewers for all scripted players in a playfield."! !Object methodsFor: 'translating' stamp: 'sw 9/27/2007 04:22'! translatedNoop "This is correspondence gettext_noop() in gettext."! ! !HaloMorph methodsFor: 'handles' stamp: 'sw 9/26/2007 11:21'! 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]. " ! ! !PasteUpMorph methodsFor: 'gridding' stamp: 'sw 9/27/2007 04:38'! gridVisibleString "Answer a string to be used in a menu offering the opportunity to show or hide the grid" ^ (self gridVisible ifTrue: [''] ifFalse: ['']) , 'grid visible when gridding' translated! ! !PasteUpMorph methodsFor: 'menu & halo' stamp: 'sw 9/27/2007 02:51'! addPenTrailsMenuItemsTo: aMenu "Add items relating to pen trails to aMenu" | oldTarget | oldTarget _ aMenu defaultTarget. aMenu defaultTarget: self. 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 addLine. 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 defaultTarget: oldTarget! ! !PasteUpMorph methodsFor: 'menu & halo' stamp: 'sw 9/27/2007 04:38'! playfieldOptionsMenu "Answer an auxiliary menu with options specific to playfields -- too many to be housed in the main menu" | aMenu isWorld | isWorld _ self isWorldMorph. aMenu _ MenuMorph new defaultTarget: self. aMenu addStayUpItem. #( (autoLineLayoutString toggleAutoLineLayout 'whether submorphs should automatically be laid out in lines') (autoExpansionString toggleAutomaticPhraseExpansion 'whether tile phrases, dropped on me, should automatically sprout Scriptors around them') (autoViewingString toggleAutomaticViewing 'governs whether, when an object is touched inside me, a viewer should automatically be launched for it') (behaveLikeAHolderString toggleBehaveLikeAHolder 'whether auto-line-layout, resize-to-fit, and indicate-cursor should be set to true; useful for animation control, etc') (fenceEnabledString toggleFenceEnabled 'whether moving objects should stop at the edge of their container') (gridVisibleString gridVisibleOnOf 'whether the grid should be shown when gridding is on') (indicateCursorString toggleIndicateCursor 'whether the "current" submorph should be indicated with a dark black border') (mouseOverHalosString toggleMouseOverHalos 'whether objects should put up halos when the mouse is over them') (originAtCenterString toggleOriginAtCenter 'whether the cartesian origin of the playfield should be at its lower-left corner or at the center of the playfield') (isPartsBinString toggleIsPartsBin 'whether dragging an object from the interior should produce a COPY of the object') (resizeToFitString toggleResizeToFit 'whether I should automatically strive exactly to fit my contents') (showThumbnailString toggleAlwaysShowThumbnail 'whether large objects should be represented by thumbnail miniatures of themselves') (griddingString griddingOnOff 'whether gridding should be used in my interior') ) translatedNoop do: [:triplet | (isWorld and: [#(toggleAutoLineLayout toggleBehaveLikeAHolder toggleIndicateCursor toggleIsPartsBin toggleAlwaysShowThumbnail toggleResizeToFit ) includes: triplet second]) ifFalse: [aMenu addUpdating: triplet first action: triplet second. aMenu balloonTextForLastItem: triplet third translated]]. aMenu addLine. aMenu add: 'round up strays' translated action: #roundUpStrays. aMenu balloonTextForLastItem: 'Bring back all objects whose current coordinates keep them from being visible, so that at least a portion of each of my interior objects can be seen.' translated. isWorld ifFalse: [aMenu add: 'shuffle contents' translated action: #shuffleSubmorphs. aMenu balloonTextForLastItem: 'Rearranges my contents in random order' translated]. aMenu add: 'set grid spacing...' translated action: #setGridSpec. aMenu balloonTextForLastItem: 'Set the spacing to be used when gridding is on' translated. isWorld ifFalse: [aMenu add: 'set thumbnail height...' translated action: #setThumbnailHeight. aMenu balloonTextForLastItem: 'if currently showing thumbnails governs the standard height for them' translated]. self backgroundSketch ifNotNil: [aMenu add: 'delete background painting' translated action: #deleteBackgroundPainting. aMenu balloonTextForLastItem: 'delete the graphic that forms the background for this me.' translated]. presenter ifNil: [aMenu add: 'make detachable' translated action: #makeDetachable. aMenu balloonTextForLastItem: 'Allow this area to be separately governed by its own controls.' translated]. aMenu addLine. aMenu add: 'use standard texture' translated action: #setStandardTexture. aMenu balloonTextForLastItem: 'use a pale yellow-and-blue background texture here.' translated. aMenu add: 'make graph paper...' translated action: #makeGraphPaper. aMenu balloonTextForLastItem: 'Design your own graph paper and use it as the background texture here.' translated. aMenu addLine. aMenu add: 'show viewers of all players' translated action: #showAllPlayers. aMenu balloonTextForLastItem: 'Make viewers for all players which have user-written scripts in this playfield.' translated. aMenu add: 'remove viewers of all players' translated action: #hideAllPlayers. aMenu balloonTextForLastItem: 'Remove the viewers for all players in this playfield. This will save space before you publish this project' translated. aMenu addTitle: 'playfield options' translated. ^ aMenu ! ! !PasteUpMorph methodsFor: 'options' stamp: 'sw 9/27/2007 04:24'! 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. self changed "redraw" ! ! !PasteUpMorph methodsFor: 'scripting' stamp: 'sw 9/27/2007 04:04'! hideAllPlayers "Remove all Viewers belonging to scripted players associated with the receiver or any of its subjects from the screen." | a | a _ OrderedCollection new. self allMorphsDo: [ :x | (ActiveWorld presenter currentlyViewing: x player) ifTrue: [a add: x player viewerFlapTab]]. a do: [ :each | each dismissViaHalo]. ! ! !PasteUpMorph methodsFor: 'scripting' stamp: 'sw 9/27/2007 03:08'! showAllPlayers "Open up viewers on all scripted players in the interior." | a | a _ OrderedCollection new. self allMorphsDo: [ :x | (x player notNil and: [x player hasUserDefinedScripts]) ifTrue: [a add: x] ]. a do: [ :each | each openViewerForArgument]. ! !