MoveSystemWindowToProject

Tony Garnock-Jones tonyg at lshift.net
Fri Aug 19 12:06:14 UTC 2005


Hi all.

I've often wanted this functionality - to be able to move a window from 
Project to Project. It turned out to be surprisingly simple to 
implement. Hopefully I haven't overlooked anything important!

Ideally the same functionality would be extended to arbitrary top-level 
morphs, but I can't think of a good user-interface for that general 
morph-migration feature. Perhaps a "teleporter" that accepts dropped morphs.

Attached is the changeset for review.

Regards,
   Tony
-- 
  [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
    [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
  []  [] http://www.lshift.net/ | Email: tonyg at lshift.net
-------------- next part --------------
'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 19 August 2005 at 1:01:50 pm'!

!SystemWindow methodsFor: 'menu' stamp: 'tonyg 8/19/2005 12:41'!
buildWindowMenu
	| aMenu |
	aMenu _ MenuMorph new defaultTarget: self.
	aMenu add: 'change title...' translated action: #relabel.
	aMenu addLine.
	aMenu add: 'send to back' translated action: #sendToBack.
	aMenu add: 'make next-to-topmost' translated action: #makeSecondTopmost.
	aMenu add: 'send to project...' translated action: #sendToProject.
	aMenu addLine.
	self mustNotClose
		ifFalse:
			[aMenu add: 'make unclosable' translated action: #makeUnclosable]
		ifTrue:
			[aMenu add: 'make closable' translated action: #makeClosable].
	aMenu
		add: (self isSticky ifTrue: ['make draggable'] ifFalse: ['make undraggable']) translated 
		action: #toggleStickiness.
	aMenu addLine.
	aMenu add: 'full screen' translated action: #fullScreen.
	self isCollapsed ifFalse: [aMenu add: 'window color...' translated action: #setWindowColor].
	^aMenu! !

!SystemWindow methodsFor: 'menu' stamp: 'tonyg 8/19/2005 12:59'!
sendToProject
	| pr |
	pr _ CustomMenu new addList: (Project hierarchyOfNamesAndProjects); startUp.
	pr ifNil: [^ self].

	World removeMorph: self.
	pr world addMorph: self.! !


!SystemWindow reorganize!
('drawing' areasRemainingToFill: colorForInsets makeMeVisible raisedColor scrollBarColor wantsRoundedCorners)
('events' doFastFrameDrag: handleListenEvent: handlesMouseDown: handlesMouseOverDragging: isCandidateForAutomaticViewing mouseDown: mouseEnterDragging: mouseLeaveDragging: mouseMove: mouseUp: paneTransition: secondaryPaneTransition:divider: wantsHalo wantsToBeDroppedInto:)
('geometry' borderWidthForRounding extent: justDroppedInto:event: labelRect paneMorphs panelRect position: removeMenuBox setPaneRectsFromBounds)
('initialization' addCloseBox addExpandBox addLabelArea addMenuControl applyModelExtent boxExtent createBox createCloseBox createCollapseBox createExpandBox createMenuBox defaultBorderColor defaultBorderWidth defaultColor initialize initializeLabelArea maximumExtent maximumExtent: model: replaceBoxes setFramesForLabelArea)
('label' externalName getRawLabel label labelHeight labelWidgetAllowance relabel relabelEvent: setLabel: setLabelFont: setLabelWidgetAllowance setStripeColorsFrom: tryToRenameTo: update: wantsLabel widthOfFullLabelText)
('layout' convertAlignment layoutBounds putLabelItemsInLabelArea)
('menu' addCustomMenuItems:hand: buildWindowMenu changeColor deleteCloseBox fullScreen fullScreenMaximumExtent makeClosable makeSecondTopmost makeUnclosable offerWindowMenu sendToBack sendToProject setWindowColor setWindowColor: takeOutOfWindow)
('object fileIn' convertToCurrentVersion:refStream:)
('open/close' closeBoxHit delete initialExtent mustNotClose openAsIs openAsIsIn: openInMVC openInMVCExtent: openInWorld: openInWorld:extent: openInWorldExtent: positionSubmorphs)
('panes' addMorph:frame: addMorph:fullFrame: existingPaneColor holdsTranscript paneColor paneColor: paneColorToUse paneMorphSatisfying: replacePane:with: restoreDefaultPaneColor setUpdatablePanesFrom: titleAndPaneText updatablePanes updateBox:color: updateBoxesColor: updatePaneColors)
('resize/collapse' allowReframeHandles allowReframeHandles: collapse collapseOrExpand collapsedFrame doFastWindowReframe: expand expandBoxHit fastFramingOn fullFrame getBoundsWithFlex getCollapsedFrame isCollapsed mouseLeaveEvent:fromPane: paneWithLongestSide:near: reframePanesAdjoining:along:to: setBoundsWithFlex: spawnOffsetReframeHandle:divider: spawnPaneFrameHandle: spawnReframeHandle: unexpandedFrame unexpandedFrame: wantsExpandBox)
('stepping' amendSteppingStatus stepAt: stepTime wantsSteps wantsStepsWhenCollapsed)
('testing' isSystemWindow shouldDropOnMouseUp wantsToBeCachedByHand)
('top window' activate activateAndForceLabelToShow activeOnlyOnTop activeOnlyOnTop: adjustBorderUponActivationWhenLabeless adjustBorderUponDeactivationWhenLabeless extantSketchEditor isActive lockInactivePortions passivate updatePanesFromSubmorphs)
('*connectors-embeddings' allowsConnectionToSubmorphs)
!



More information about the Squeak-dev mailing list