Home   Archive   Permalink



R2 VID edge facet

I never have used the 'edge' facet until now, so I am trying it out. I don't know what the various options are supposed to look like, but when I make an example, they all look the same. Am I doing something wrong, or is this what it is supposed to look like?
    
Thank you.
    
R E B O L [
     Title: 'VID test harness'
]
;; Paste code below to test
view layout [
     button 100x60 'bevel' edge [size: 10x10 color: red effect: [bevel]]
     button 100x60 'ibevel' edge [size: 10x10 color: red effect: [ibevel]]
     button 100x60 'bezel' edge [size: 10x10 color: red effect: [bezel]]
     button 100x60 'ibezel' edge [size: 10x10 color: red effect: [ibezel]]
     button 100x60 'nubs' edge [size: 10x10 color: red effect: [nubs]]
     return
     button 100x60 'bevel' edge [size: 10x10 color: green effect: 'bevel]
     button 100x60 'ibevel' edge [size: 10x10 color: green effect: 'ibevel]
     button 100x60 'bezel' edge [size: 10x10 color: green effect: 'bezel]
     button 100x60 'ibezel' edge [size: 10x10 color: green effect: 'ibezel]
     button 100x60 'nubs' edge [size: 10x10 color: green effect: 'nubs]
]

posted by:   Steven White     20-Apr-2015/10:49:48-7:00



I think the EDGE/EFFECT should not be a block, so you can dispense with those.
    
To help diagnose the problem, I substitute the BOX style for the BUTTON style, as it's a simpler style.
    
view layout [box 100x60 edge [size: 10x10 color: red effect: 'ibezel]]
    
To see what BUTTON does with its EDGE facet, take a look at the code here:
    
print mold system/view/vid/vid-styles/button
    
Look near the beginning, you see the EDGE object:
    
     edge: make object! [
         color: 110.120.130
         image: none
         effect: 'bevel
         size: 2x2
     ]
    
Look at the INIT block, you see this line:
    
     edge: make edge []
    
Look at the FEEL object, in REDRAW function, you see face/edge/effect is being set dependent on face/state only; it does not take into account any custom EDGE/EFFECT.
    
So BUTTON is not so easily customized, in some ways. It can be done, though.
You can customize the FEEL/REDRAW function; either modify the one that you're supplied, or replace it;
For example, here I replace the FEEL/REDRAW function with a quick hack:
    
view layout [b: button 100x60 edge [size: 10x10 color: red] feel [redraw: func [face action event][face/edge/effect: pick
[ibezel bezel] face/state]]]
    
If you look at the original BUTTON FEEL, you will see I left out most of the code to keep the example short; you can add it back in if you need it.

posted by:   Anton Rolls     20-Apr-2015/12:09:29-7:00