[VID][edge] How do I remove 'bevel from edge?
[1/4] from: atruter:labyrinth:au at: 13-Feb-2004 17:17
Here's one for the VID gurus. Given the following code (change "Wingdings
for non-Windows boxen):
<code>
stylize/master: [
chk: FACE 24x24 with [
color: white
font: [
name:
Wingdings"
align: 'center
valign: 'bottom
style: 'bold
shadow: none
colors: reduce [leaf leaf]
]
image: effects: para: none
edge: [size: 1x1 color: black]
feel: svvf/toggle flags: [toggle]
init: [
size/y: size/x
edge: make edge []
edge/effect: none
font: make font []
font/size: to integer! size/y * .75
font/color: first font/colors
texts: copy ["" "=FC"]
]
]
]
view layout [chk 16 chk 24 a: chk 48]
</code>
The borders of the box flicker slightly as:
>> help a/edge
A/EDGE is an object of value:
color tuple! 0.0.0
image none! none
effect word! bevel
size pair! 1x1
even though "edge/effect" is set to 'none. So the question is, how can I
set edge/effect to 'none?
Regards,
Ashley
[2/4] from: g:santilli:tiscalinet:it at: 13-Feb-2004 10:29
Hi Ashley,
On Friday, February 13, 2004, 7:17:06 AM, you wrote:
AT> even though "edge/effect" is set to 'none. So the question is, how can I
AT> set edge/effect to 'none?
Look at the REDRAW feel:
redraw: func [face act pos /local state][
if all [face/texts face/texts/2] [
face/text: either face/state [face/texts/2] [face/texts/1]
]
either face/images [
face/image: either face/state [face/images/2] [face/images/1]
if all [face/colors face/effect find face/effect 'colorize] [
change next find face/effect 'colorize pick face/colors not face/state
]
] [
if face/edge [face/edge/effect: pick [ibevel bevel] face/state]
state: either not face/state [face/blinker] [true]
if face/colors [face/color: pick face/colors not state]
if face/effects [face/effect: pick face/effects not state]
]
]
The line:
if face/edge [face/edge/effect: pick [ibevel bevel] face/state]
is the culprit.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
[3/4] from: atruter:labyrinth:au at: 15-Feb-2004 10:02
Thanks Gabriele,
> The line:
>
> if face/edge [face/edge/effect: pick [ibevel bevel] face/state]
>
> is the culprit.
I've now got it working by this simple addition to the 'init block:
feel/redraw: func [face act pos][
face/text: either face/state [face/texts/2] [face/texts/1]
]
It never ceases to amaze me just how elegant VID is! ;)
Regards,
Ashley
[4/4] from: brett:codeconscious at: 15-Feb-2004 17:40
Hi Ashley,
> I've now got it working by this simple addition to the 'init block:
>
> feel/redraw: func [face act pos][
> face/text: either face/state [face/texts/2] [face/texts/1]
> ]
There is only one small problem with your change - you are modifying the
shared feel object. Instead of using init, you can create a new feel object
inside the With block:
stylize/master: [
chk: FACE 24x24 with [
color: white
font: [
name: "Wingdings"
align: 'center
valign: 'bottom
style: 'bold
shadow: none
colors: reduce [leaf leaf]
]
image: effects: para: none
edge: [size: 1x1 color: black]
; Create a new object using old as template.
feel: make svvf/toggle [
redraw: func [face act pos] [
face/text: either face/state [face/texts/2] [
face/texts/1]
]
]
flags: [toggle]
init: [
size/y: size/x
edge: make edge []
edge/effect: none
font: make font []
font/size: to integer! size/y * .75
font/color: first font/colors
texts: copy ["" "=FC"]
]
]
]
view layout [chk 16 chk 24 a: chk 48]
> It never ceases to amaze me just how elegant VID is! ;)
Me 2!
Regards,
Brett.