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

is this a bug?

 [1/9] from: rishioswal::yahoo::com at: 10-Apr-2001 10:26


tab keyword doesn't seem to function properly when used vertically: Rebol [] view layout [ tabs 40 field "Field 1" tab field "Field 2" tab field "Field 3" ] Why doesn't the tab between field 2 and field 3 show up? Also, the last example in section 10.2 in rebol developers guide doesn't seem to demonstrate anything about tabs. tab sizes are specified, but not used.. Here is the example: view layout [ tabs 40 field "Field 1" field "Field 2" field "Field 3" return across tabs 100 button "Button 1" button "Button 2" button "Button 3" ] shouldn't it be: view layout [ tabs 40 field "Field 1" tab field "Field 2" tab field "Field 3" tab return across tabs 100 button "Button 1" tab button "Button 2" tab button "Button 3" tab ] Rishi

 [2/9] from: arolls:bigpond:au at: 11-Apr-2001 15:17


Yes it does. If you put a tab before the first field, it will work: view layout [tabs 40 tab field tab field tab field] In your example the first field is not tab aligned, but the second and third are. Anton.

 [3/9] from: rishioswal:yah:oo at: 11-Apr-2001 0:14


hi Anton. I'm sorry, it still seems like a bug to me. The documentation says: TAB skips forward in the current direction (across or below) to the next tab position. So if you have the following code: rebol [] view layout [ tabs 40 ;sets tab space to 40 pixels. field "Field 1" ;displays field 1 with no tab tab ; tab 40 spaces below field 1 field "Field 2" ;display field 2 tab ;tab 40 spaces below field 2 field "Field 3" ;display field 3 ] But it does not seem to work this way. Instead it seems like there is 80pixels between field 1 and field2 and 40 pixels between field 2 and field 3. It doesn't seem to make sense to me... rishi ] --- Anton <[arolls--bigpond--net--au]> wrote:

 [4/9] from: brett:codeconscious at: 11-Apr-2001 18:37


Anton has shown how it will work. In your new example you have the comment "tab 40 spaces below field 1" which suggests that you believe a TAB generates space from the current position which is the bit that is confusing for you. Tab does use the current position to calculate the next but not by generating space.. TAB is like a "snap-to-grid" option in a graphics program. That is what "TAB skips forward in the current direction (across or below) to the next tab position." means. The positions are pre-defined. TABS 40 sets up a grid of tab positions. When you use TAB it calculates that next position and places your next element at that point. This is why you must use TAB on your first field if your first field is not already at the correct location. The only thing is that that there is no Tab-zero (unfortunately). VID it goes from Tab-one up. Hope that clear it up! Brett.

 [5/9] from: brett:codeconscious at: 11-Apr-2001 19:10


Damn that send key is too easy to hit. Just ignore this comment in my last mail.
> The only thing is that that there is no Tab-zero (unfortunately). VID it > goes from Tab-one up.
Thanks Brett.

 [6/9] from: gjones05:mail:orion at: 11-Apr-2001 4:57


From: "Brett Handley"
<snip> > TAB is like a "snap-to-grid" option in a graphics program. That is what
TAB
> skips forward in the current direction (across or below) to the next tab > position.
means. The positions are pre-defined.
<snip>
Thanks, Brett, that certainly clarified the point for me and is a very nice analogy. I thought I had this figured out a couple of months ago, but when Rishi asked the question, I couldn't remember the subtlety that causes this behavior (I guess I have slept since then --- the mind is like an hour glass ... ;). --Scott Jones

 [7/9] from: arolls:bigpond:au at: 11-Apr-2001 20:52


Rishi, As Brett says, specifying tabs 40 means there are tab positions at 40, 80, 120 etc. Run the following program. If you look at the offset and size of the first field, you will notice that its bottom edge is at 44. Then we add on the default spacing between elements (8) and we get to 52. It has missed the tab at position 40 by 12 pixels. Therefore the next tab will be at 80. rebol [] view layout [ ;space 0 tabs 40 f1: field ; 200x19 tab f2: field tab f3: field do [ print [f1/offset f1/size] print [f2/offset f2/size] print [f3/offset f3/size] ] ] If you reduce the vertical size of f1 to 11, [f1: field 200x11], then it tabs correctly. Greater than 11 jumps over the tab. If you specify spacing of zero, and the vertical size of f1 to 19 (uncomment the comments above), then you will see that the first field just fits in before the second tab position, 40, which is greater than 20+19. I am looking to see if there is a way to set an offset to the tab positions. Anton.

 [8/9] from: brett:codeconscious at: 12-Apr-2001 9:17


> I am looking to see if there is a way to set > an offset to the tab positions.
I wondered about this too. Having had a peak at the next-tab code I'm guessing, use a pane and offset that. Brett.

 [9/9] from: rishioswal::yahoo at: 11-Apr-2001 19:37


Thanks for the replies... Very helpful.. rishi --- Brett Handley <[brett--codeconscious--com]> wrote: