Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.kei.com!simtel!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: [VW2.0] Tab order problem
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DIpH6r.4A2@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <30B9B86C.6771@cherniak.on.ca>
Date: Mon, 27 Nov 1995 14:20:51 GMT
Lines: 44

In article <30B9B86C.6771@cherniak.on.ca>,
Dennis Smith  <quenton@Cherniak.ON.CA> wrote:
>It seems that when VW2.0 builds its window-widget object structure
>with subcanvases, that it does so by processing all the local widgets
>and then adding the subcanvases and thus all those widgets.  The result
>seems to be that tab order goes through all the local widgets and
>then through each subcanvas.  This does NOT do what any end user
>would expect, which is to tab through the fields in a top-down
>left-right order.  You might want to modify that, but you DO want
>control.
>
>Anyone have a solution? is this "fixed" in 2.5?

You can explicitly re-sort the tab order yourself.  Here's some code
that does that:

    keyboardProcessor := self builder keyboardProcessor.
    keyboardProcessor keyboardConsumers:
        (SequenceableCollectionSorter
          on: keyboardProcessor keyboardConsumers
          using: 
             [:a :b | 
             | ap bp |
             (ap := a localPointToGlobal: 0 @ 0) y = (bp := b
localPointToGlobal: 0 @ 0) y
                ifTrue: [ap x < bp x]
                ifFalse: [ap y < bp y]]) sort collection

Do this in a post-build or whenever you finish adding the widgets and
it will sort the widgets to be top to bottom, left to right.

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|





