TwoWayScrollPane is obsolete (was Re: Widow activation)

Doug Way dway at mailcan.com
Tue Aug 17 02:16:36 UTC 2004


FYI, TwoWayScrollPane is now obsolete.  ScrollPane now handles two way 
scrolling if needed, so you should be able to use ScrollPane for 
anything that TwoWayScrollPane used to do.  Some of the code in 
TwoWayScrollPane may be getting old and crufty, which may be a source 
of your problems.  See this earlier message:

http://groups.yahoo.com/group/squeak/message/82850

At a minimum, we should add a note in the class comment for 
TwoWayScrollPane that it's obsolete, and then perhaps deprecate any 
instance creation methods.

- Doug


On Monday, August 16, 2004, at 02:26 PM, Hernan Tylim wrote:

> Hi Trygve,
>  
>     It was a long time ago but I think the rationale was this. 
> The DiagramBrowser SystemWindow is composed of 3 panels. The two on 
> the left and the one on the right where the Diagrams appear.
>  
>     This last one isn't a Diagram but a simple Morph acting as a 
> container because if it wasn't in that way then the SystemWindow would 
> change the Diagram's color to match the one of the window.
>  
>     Another reason in using SystemWindows in this way is that I found 
> it more convenient for adding and removing submorphs. Here you just 
> add and remove submorphs from the container and you forget about the 
> SystemWindow. Without the container you would have to be careful on 
> how you add and remove the morphs to not mest up the LayoutFrames and 
> resizeability (does exists that word?) of the SystemWindow panels.
>  
>     Inside Diagram what we have is:
>  
> - a TwoWayScrollablePanel
> - a TransformMorph
> - an HJPasteUpMorph
>  
>     To reduce one level of composition we could make Diagram to be a 
> subclass of TwoWayScrollablePane, but I did it in this way because a 
> Diagram do not only holds the TwoWayScrollablePane but also an extra 
> annotation panel which is not visible by default (right click on the 
> diagram and select: 'shows annotations panel').
>  
>     The TransformMorph is part of the TwoWayScrollablePanel so we 
> cannot get rid of it. The last level is the PasteUpMorph which holds 
> the shapes, and thats it.  Those were the six level.
>  
> Hope it helps.
>  
> Regards,
> Hernán
>  
>
>
> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of 
> Trygve Reenskaug
> Sent: Monday, August 16, 2004 2:23 PM
> To: The general-purpose Squeak developers list
> Subject: RE: Widow activation
>
> Hernán,
> Many thanks for your quick reply.
>
> The problem was that TwoWayScrollPane>>handlesMouseDown: returned true 
> and the event did not reach up to the SystemWindow.
> Changing it to false solved the problem.
>
> Jacaranda was my starting point for the present programs, but I have 
> tried to simplify the morph structure. Corresponding to my three 
> levels, I find 6 levels in Jacaranda:
>
> a SystemWindow
> a Morph (Morph default)
> a Diagram (handlesMouseDown: returns evt yellowButtonPressed, i.e., 
> false)
> a TwoWayScrollPane (handlesMouseDown: returns true)
> a TransformMorph (Morph default)
> a HJPasteUpMorph (handlesMouseDown: returns true)
>
> I haven't quite penetrated the rationale behind the many layers in 
> Jacaranda, but it seems as if I could have introduced a dummy layer 
> below the SystemWindow for the purposes of returning false. My 
> solution is to use my own sco of TwoWayScollPane that returns true. 
> This may be a hack since I there may be a deep reason for ScrollPanes 
> to return true.
>
> Problem resolved. Many thanks for putting me on the right track
> --Trygve
>
> -----------------------------------------------
> At 16.08.2004 11:34, Hernán wrote:
>
> Hi Trygve,
>         
>         You should check DiagramBrowser. In there I have the same
> structure than you (SystemWindow, TwoWayScrollPane and PasteUpMorph) 
> but
> without the problem you are describing.
>
>         How are you handling the events? With #on:send:to: or 
> overriding
> #handlesMouseDown: and #mouseDown: ? Because If you return false in
> #handlesMouseDown: I am pretty sure that the event should reach the
> SystemWindow and get it activated.
>
>         BTW, you can always from the event handler send the #activate
> message to the SystemWindow yourself.
>
> > -----Original Message-----
> > From: Trygve
> >
> > I have a SystemWindow
> >    containing a TwoWayScrollPane
> >      containing a PasteUpMorph
> >
> > The window is activated (moved to the top) if I click the
> > SystemWindow header.
> > It is not activated if I click in a visible corner of the
> > PasteUpMorph.
> >
> > I have tried making the PasteUpMorph keep the event
> > WasHandeled at =false,
> > but it doesn't help.
> >
> > Any ideas?
> > Cheers
> > --Trygve
>
>
>
>
> --
>
> Trygve Reenskaug      mailto: trygver <at> ifi.uio.no
> Morgedalsvn. 5A       http://heim.ifi.uio.no/~trygver
> N-0378 Oslo           Tel: (+47) 22 49 57 27
> Norway
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 5680 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040816/4a2a36ef/attachment.bin


More information about the Squeak-dev mailing list