[BUG] inner worlds

Stephen Pair spair at advantive.com
Mon Jun 18 18:00:26 UTC 2001


Thanks! This works pretty well, mainly because the scale gets set at 1.0.
Then, I'm able to set the embedded world border very small and embed that in
a system window so that it can be collapsed and expanded.

It would be nice to allow scroll bars in the embedded world to scroll around
the desktop of the embedded world.  Also, if the embedded world is placed in
a window, it would be nice to drop the green border automatically.

Also, it would be handy (and perhaps more directly accomplish the desired
result) to be able to choose a morph in an embedded world to be
simultaneously drawn in the parent world (or any other world).  That way, a
system window, or any morph, could be drawn in a project other than it's
home project.  I suspect that might not be as easily accomplished however.

- Stephen

> -----Original Message-----
> From: Bob Arning [mailto:arning at charm.net]
> Sent: Monday, June 18, 2001 1:28 PM
> To: spair at advantive.com; squeak at cs.uiuc.edu
> Subject: Re: [BUG] inner worlds
>
>
> Stephen,
>
> 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.
>
> Cheers,
> Bob
>
> '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;
> 		addLine;
> 		add: 'define application view' action:
> #defineApplicationView;
> 		add: 'define factory view' action: #defineFactoryView;
> 		add: 'resize the world' action: #selectNewWorldSize.
> 	menu
> 		add: 'world scale and clip...'
> 		subMenu: subMenu! !
>
> !PasteUpMorph methodsFor: 'menu & halo' stamp: 'RAA 6/18/2001 13:10'!
> selectNewWorldSize
>
> 	| 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'!
> changes
> 	"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