| View previous topic :: View next topic |
| Author |
Message |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Apr 12, 2004 12:35 am Post subject: GRADIENT handling |
|
|
Hi,
I'm wrestling with a GRADIENT problem I seem unable to find the solution for.
I have a dialog which contains a GRADIENT element.
Setting the initial colors in the DIALOG ADD goes fine, but when I later try to change the colors of the GRADIENT element it only changes one of the two colors. The VDS help file is not very helpful on this item so maybe one of you know how to tackle this corectly.
I used:
DIALOG SET,GradientExample,%%GradientColor1,%%GradientColor2
And no matter what I try only the first color gets changed, the second keeps its old color settings.
Hope someone has some bright ideas!
Thanks
Jan |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Mon Apr 12, 2004 3:44 am Post subject: |
|
|
Check this Example out and see if it helps..
| Code: | DIALOG CREATE,test,-1,0,400,175
%%GradientColor1 = green
%%GradientColor2 = purple
DIALOG ADD,GRADIENT,GradientExample,0,0,400,175,%%GradientColor1,%%GradientColor2,,bottomTOtop
DIALOG ADD,LINE,LINE1,5,5,390,135
DIALOG ADD,LIST,box1,15,11,378,115
DIALOG ADD,BUTTON,cancel,148,285,43,19,Exit,,
DIALOG SHOW
DIALOG SET,box1,Hello","@FILL(4,,L) double click here"..."@CR()Gradients are cool!
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:cancelBUTTON
:close
exit |
Goodluck  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Apr 12, 2004 8:13 am Post subject: |
|
|
i suspect that you can only change one colour with dialog set once you have created it....someone else can perhaps confirm this
what you can do is create additional gradients with the new colour settings on top of the existing one
for example,
| Code: |
%i = 0
%i = @succ(%i)
dialog add, gradient, gradient%i,.....
|
serge _________________
|
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Mon Apr 12, 2004 9:35 am Post subject: |
|
|
Nice Serge
Heres another example of more than 1 gradient (mixed) with RESIZE..
| Code: | DIALOG CREATE,test,-1,0,400,175,resizable
DIALOG ADD,LINE,LINE1,5,5,390,135
DIALOG ADD, GRADIENT,cool,-70,0,589,410,red,blue,,topTObottom
DIALOG ADD, GRADIENT,cool2,342,0,589,350,blue,red,,topTObottom
DIALOG ADD,LIST,box1,15,11,,,,,
DIALOG ADD,BUTTON,cancel,148,285,43,19,Exit,,
DIALOG SHOW
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:RESIZE
DIALOG SETPOS,cool,-70,0,@dlgpos(,w),@sum(@dlgpos(,h),40)
DIALOG SETPOS,cool2,@fsub(@dlgpos(,h),50),0,@dlgpos(,w),189
dialog setpos,cancel,@diff(@dlgpos(,h),27),@diff(@dlgpos(,w),115)
dialog setpos,line1,5,5,@diff(@dlgpos(,w),10),@diff(@dlgpos(,h),40)
dialog setpos,box1,15,11,@diff(@dlgpos(,w),22),@diff(@dlgpos(,h),60)
goto evloop
:cancelBUTTON
:close
exit |
Or you could delete the Resize stuff pritty easy..  |
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Apr 12, 2004 4:01 pm Post subject: GRADIENT handling |
|
|
Thanks Vtol, Serge,
I think Serge's workaround might be the solution.
The DIALOG SET simple is not capable of handling gradients correctly so instead of doing a DIALOG SET I will do as Serge suggests and create a second (and 3d, 4th, ......) gradient over the original one at exactly the same location. Not a very nice solution, but one has to survive
Still the dialog is only active for a short time since it's a settings screen which will only be opened occasionally in the application.
Maybe Commercial Research Ltd could make a better working solution in the next release of VDS. It definitely looks like a shortcoming/bug. |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Apr 12, 2004 4:07 pm Post subject: Re: GRADIENT handling |
|
|
| JRoza wrote: | Thanks Vtol, Serge,
I think Serge's workaround might be the solution.
The DIALOG SET simple is not capable of handling gradients correctly so instead of doing a DIALOG SET I will do as Serge suggests and create a second (and 3d, 4th, ......) gradient over the original one at exactly the same location. Not a very nice solution, but one has to survive
Still the dialog is only active for a short time since it's a settings screen which will only be opened occasionally in the application.
Maybe Commercial Research Ltd could make a better working solution in the next release of VDS. It definitely looks like a shortcoming/bug. |
Shortcomming maybe but this is not a bug. Most elements for a VDS dialog have static colors and are not allowed to change. You are usually forced to make duplicates of the items. Now I do have another solution. My Gadget.dll has the ability to place Gradients on the VDS dialog and change their colors on the fly. You can get a copy of this DLL from the link in the signiture of this post. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Apr 12, 2004 5:04 pm Post subject: |
|
|
jroza,
it's actually a very handy work around...one that i have used very effectively in my skins program available from vdsworld
as mindpower has said, this is not a bug...many things require a work around when programming simply because of the way things are...not because there are bugs
serge _________________
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Apr 12, 2004 9:16 pm Post subject: |
|
|
You might also look at the vdsgui.dll, this might have something to help
you.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Apr 12, 2004 10:27 pm Post subject: GRADIENT handling |
|
|
Serge,
You are right, in practice your solution works very well, so I'll stick to it.
And I will look into Gadget and VdsGUI as well although with Serge's solution my problem is solved so there's no real need (yet) for the extra dll's.
Thanks guys!
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|