[BUG] inner worlds

Bob Arning arning at charm.net
Mon Jun 18 17:28:19 UTC 2001


On Mon, 18 Jun 2001 10:59:23 -0400 "Stephen Pair" <spair at advantive.com> wrote:
>The inner worlds feature seems to be broken...(try open->inner world)

This feature has had very little attention since being supplanted by the active world concept. I have added an update to the internal stream to drop the menu item to avoid confusion in the future.

>I was trying to create a project that I could work with directly as opposed
>to jumping into it.  Basically, I like to work on projects where one project
>is the real work, and I have another project for building up SUnit tests.
>But, it can become cumbersome to switch back and forth between the two
>projects.  I'd like to have a window within the main project that allowed me
>to develop the test cases such that those changes would automatically go to
>the "test" change set.  Is there an easy way to do this without needing to
>swith between projects?

I invite you to try the change set below and see if it does what you want. Consider it very experimental and let me know how it works for you.


'From Squeak3.1alpha of 5 February 2001 [latest update: #4158] on 18 June 2001 at 1:21:11 pm'!
"Change Set:		worldSizing
Date:			18 June 2001
Author:			Bob Arning

An experiment in having two worlds (the outer world plus an inner active world) such that changes made in each world will go to the appropriate change set. A possible scenario:

1. Create a new morphic project.
2. Click on the project view for this project and wait for the menu to appear.
3. Select 'ENTER ACTIVE' from this menu.
4. From the red halo menu on the green frame around this active world (or from the control-menu of the world itself), select 'world scale and clip...', then 'resize the world'. This will allow you to choose a new bounds rectangle for the inner active world and will set the scale to 1.0.
5. Changes made in this inner active world will be recorded in the change set for the inner world/project rather than the global change set known as SystemChanges.

For extra amusement, you can put the inner world in a flap so it doesn't take up so much room.


!MenuMorph methodsFor: 'private' stamp: 'RAA 6/18/2001 12:17'!
positionAt: aPoint relativeTo: aMenuItem inWorld: aWorld
	"Note: items may not be laid out yet (I found them all to be at 0 at 0),  
	so we have to add up heights of items above the selected item."

	| i yOffset sub delta ptInWorld |

	"Probably not the best way to do this..."
	ptInWorld _ aPoint - aWorld boundsInWorld topLeft.

	self fullBounds. "force layout"
	i _ 0.
	yOffset _ 0.
	[(sub _ self submorphs at: (i _ i + 1)) == aMenuItem]
		whileFalse: [yOffset _ yOffset + sub height].

	self position: ptInWorld - (2 @ (yOffset + 8)).

	"If it doesn't fit, show it to the left, not to the right of the hand."
	self right > aWorld worldBounds right
		ifTrue: [self left: self left - self width + 4].

	"Make sure that the menu fits in the world."
	delta _ self bounds amountToTranslateWithin: aWorld worldBounds.
	delta = (0 @ 0) ifFalse: [self position: self position + delta]! !

!PasteUpMorph methodsFor: 'menu & halo' stamp: 'RAA 6/18/2001 13:07'!
addScalingMenuItems: menu hand: aHandMorph

	| subMenu |

	(subMenu _ MenuMorph new)
		defaultTarget: self;
		add: 'show application view' action: #showApplicationView;
		add: 'show factory view' action: #showFactoryView;
		add: 'show whole world view' action: #showFullView;
		add: 'expand' action: #showExpandedView;
		add: 'reduce' action: #showReducedView;
		add: 'define application view' action: #defineApplicationView;
		add: 'define factory view' action: #defineFactoryView;
		add: 'resize the world' action: #selectNewWorldSize.
		add: 'world scale and clip...'
		subMenu: subMenu! !

!PasteUpMorph methodsFor: 'menu & halo' stamp: 'RAA 6/18/2001 13:10'!

	| r myTransform greenFrame |

	myTransform _ owner.
	greenFrame _ myTransform owner.
	r _ Rectangle fromUser.
	self extent: r extent.
	self transformToShow: bounds.
	greenFrame extent: r extent + (greenFrame extent - myTransform extent).
	greenFrame position: r origin - greenFrame borderWidth asPoint
! !

!SystemDictionary methodsFor: 'sources, change log' stamp: 'RAA 6/18/2001 13:02'!
	"Answer the current system ChangeSet."

	| p |
	ActiveWorld ifNil: [^SystemChanges].
	(p _ ActiveWorld project) ifNil: [^SystemChanges].
	^p changeSet ifNil: [SystemChanges]! !

More information about the Squeak-dev mailing list