Hello,
Based in a sample that I took from the great book "What's new in 9", I've added a script to a property that I added to one of my classes.
My goal is to open the ColorPicker when the developer clic on the ellipsis or doubleclick the property, and change the property value according to the selected color.
I'm using the script below:
LOCAL aControl[1], nColor
IF ASELOBJ(aControl) = 0
IF ASELOBJ(aControl, 1) = 0
RETURN
ENDIF
ENDIF
IF VARTYPE(aControl[1].BackColor1) = "N"
nColor = aControl[1].BackColor1
ELSE
nColor = 0
ENDIF
nColor = GETCOLOR(nColor)
aControl[1].BackColor1 = nColor
RETURN
It works perfectly, except if the property value contained any kind of expression as an original value. In that case, the colorpicker is opened, but the selected color is not updated to the property.
Can someone give me some enlightening ?
TIA
Cesar