Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: "tabs" in VID

From: anton::wilddsl::net::au at: 10-Apr-2006 2:26

You have discovered the behaviour of LAYOUT which uses the NEXT-TAB function: ;system/view/vid/next-tab: func [tabs way where][ if pair? tabs [ tabs: max 1x1 tabs return where / tabs * tabs + tabs * way + (where * reverse way) ] if block? tabs [ foreach t tabs [ if integer? t [t: t * 1x1] if all [pair? t (way * t) = (way * max t where)] [ return way * t + (where * reverse way) ] ] ] 100 * way + where ] You can see the difference in behaviour between the two modes. If you supply a pair, it always rounds up to the next tab even if it is now on a tab (it uses division on a pair! to get integer division), but if you supply a block of tabs then it does not round up if it is already now on a tab. This prevents the possibility of multiple tabs in block mode. The solution is to change the test to ensure it rounds up by adding 1x1: (way * t) = (way * max t where + 1x1) After doing this, your examples seem to behave much better ! :-) I will submit this patch to the RAMBO bug database. Regards, Anton.