Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Help with 'tab' facet
Pages: [1] Print
Author Topic: Help with 'tab' facet  (Read 1086 times)
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Help with 'tab' facet
« on: March 19, 2007, 03:47:28 PM »

Hi;
  I'm having no success with get the 'tab' facet algorithmic shape to work.  According the the "View Developers Guide":
Quote
tab   Generate tab buttons with rounded corners. The optional arguments are: a PAIR that specifies the edge to round, a TUPLE that is used as an edge color, an INTEGER that indicates the radius of the curves, and an INTEGER that controls the thickness of the edge."

So you would think that something like the following would work:

view layout [
   across
   button "TestTab 1" with [effect: [tab 5 100]]
   button "Test Tab 2" with [effect: [tab 5 127]]
]

I can't quite seem to hit the combination that would make this work.  Any suggestions?
Logged
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Re: Help with 'tab' facet
« Reply #1 on: March 20, 2007, 07:33:22 AM »

The arguments for 'tab' in the first post would have been too extreme but before that I had tried more reasonable arguments:

view layout [
   across
   button "Test Tab 1" with [effect [tab]]
   button "Test Tab 2" with [effect [tab 0x0 7.7.7 8 4]] ; Also tried 0x0, 0x1, 1x0 & 1x1
]


Gord
Logged
Anton
Jr. Member
**
Offline Offline

Posts: 65

Rebol veteran


View Profile WWW
Re: Help with 'tab' facet
« Reply #2 on: March 21, 2007, 11:33:28 PM »

Not "TAB"  You want "ROUND".

view layout [
   button "TestTab 1" effect [round 15 5]
   box white 100x40 effect [round 20 0]
   box white 100x40 effect [round 20 0] edge [size: 2x2 color: black]
]

or, equivalent:

view layout [
   button "TestTab 1" with [effect: [round 15 5]]
   box white 100x40 with [effect: [round 20 0]]
   box white 100x40 with [effect: [round 20 0] edge: make edge [size: 2x2 color: black]]
]
Logged
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Re: Help with 'tab' facet
« Reply #3 on: April 24, 2007, 07:34:40 AM »

Thanks Anton!

With a little experimenting I got the button fixed up to not display the square edge using:

view layout [
   button1:  button "TestTab 1" with [edge: [size: 0x0] effect: [round 10 2]]
]


  • I'm curious how you found the "round" effect and it's parameters?
  • Why does the "round" effect only affect the top two corners?
  • Can you make it affect all four corners to get a rectangle button with four rounded corners instead of a nice tab?
Okay the last item is not that important as I see Ammon Johnson has a script called "button.r" where I think he has used an image within a button that has no edges to produce the same effect.
« Last Edit: April 24, 2007, 08:02:23 AM by Gord » Logged
Anton
Jr. Member
**
Offline Offline

Posts: 65

Rebol veteran


View Profile WWW
Re: Help with 'tab' facet
« Reply #4 on: April 27, 2007, 02:53:11 AM »

The ROUND effect: Well, it's been available since View 1.2.1, and maybe before that, in 2001. I must have picked it up in the changes or some other code, maybe posted to the email list.

It's supposed to be documented here (right at the bottom):

http://www.rebol.com/docs/view-guide.html

But it looks like TAB is in its place. (Aha! that's where you got it from.)
(I remember thinking that "round" is too general to be used for the specific purpose of rounding only the top corners for a tab-button. It looks like RT agreed, but I think they might have forgotten to update the implementation...)

Yes, you can EXTEND an image with rounded corners, as the default BTN style does:

Code:
view layout [btn]
print mold find svv/vid-styles/btn/init [if all]

and another way is to use the DRAW dialect.
I've made a button style using the DRAW dialect:

http://anton.wildit.net.au/rebol/gui/agg-button.r
Code:
do http://anton.wildit.net.au/rebol/gui/demo-agg-button.r
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Help with 'tab' facet
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 30, 2008, 06:27:18 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2243 Posts in 587 Topics by 2010 Members
Latest Member: techpon

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc