|
Pages: [1]
|
 |
|
Author
|
Topic: Help with 'tab' facet (Read 1231 times)
|
|
Gord
|
Hi; I'm having no success with get the 'tab' facet algorithmic shape to work. According the the "View Developers Guide": 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
|
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
|
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
|
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
|
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.htmlBut 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: 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.rdo http://anton.wildit.net.au/rebol/gui/demo-agg-button.r
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2311 Posts in 595 Topics by 4139 Members
Latest Member: DietaVato
|