| View previous topic :: View next topic |
| Author |
Message |
Jerry'Co Valued Newbie
Joined: 16 Jul 2003 Posts: 35
|
Posted: Tue Jun 17, 2014 8:24 pm Post subject: Pie-Chart command error |
|
|
Hi,
I noticed strange 'blinks' when I tried to animate a VDS Piechart command. After a small investigation I realized that this command misfired with two values - 12 and 38. You can see it in my example
| Code: | OPTION DECIMALSEP,.
DIALOG CREATE,test,-1,0,200,220,ONTOP,NOSYS,
dialog add,style,for_pie,,,,blue,yellow
DIALOG ADD,PIECHART,P1,12,20,140,104,,,for_pie
DIALOG ADD,BUTTON,Animate,150,10,84,24,
DIALOG ADD,BUTTON,Error12,180,10,84,24,
DIALOG ADD,BUTTON,Cancel,150,100,64,24,
DIALOG ADD,BUTTON,Error38,180,100,64,24,
DIALOG SHOW
:evloop
wait event
%E = @event()
goto %E
:ANIMATEBUTTON
%i = 0
repeat
dialog set,P1,%i
%i = @succ(%i)
wait .05
until @greater(%i,100)
goto evloop
:ERROR12BUTTON
dialog set,P1,12
goto evloop
:ERROR38BUTTON
dialog set,P1,38
goto evloop
:CANCELBUTTON
DIALOG CLOSE
STOP |
Regards,
Jerry |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jun 18, 2014 2:57 am Post subject: |
|
|
Blinks for me on VDS 6 and Windows 7 32 bit. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Jerry'Co Valued Newbie
Joined: 16 Jul 2003 Posts: 35
|
Posted: Wed Jun 18, 2014 7:03 am Post subject: |
|
|
Hi,
I made some "bypass" for it . It's sure not ideal solution but IMHO it is better than the blinks ...
| Code: | OPTION DECIMALSEP,.
DIALOG CREATE,test,-1,0,200,220,ONTOP,NOSYS,
dialog add,style,for_pie,,,,blue,yellow
DIALOG ADD,PIECHART,P1,12,20,140,104,,,for_pie
DIALOG ADD,BUTTON,Animate,150,10,84,24,
DIALOG ADD,BUTTON,Error12,180,10,84,24,
DIALOG ADD,BUTTON,Cancel,150,100,64,24,
DIALOG ADD,BUTTON,Error38,180,100,64,24,
DIALOG SHOW
:evloop
wait event
%E = @event()
goto %E
:ANIMATEBUTTON
%i = 0
repeat
dialog set,P1,%i
%i = @succ(%i)
if @equal(%i,12)@equal(%i,38)
%i = @succ(%i)
end
wait .02
until @greater(%i,100)
goto evloop
:ERROR12BUTTON
dialog set,P1,12
goto evloop
:ERROR38BUTTON
dialog set,P1,38
goto evloop
:CANCELBUTTON
DIALOG CLOSE
STOP
|
Regards,
Jerry |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jun 18, 2014 4:29 pm Post subject: |
|
|
I found the problem.. It's the size of your pie chart.. I changed it from a height of 104 to 110 and it doesn't flash.
Here's your original code with only the size changed:
| Code: | OPTION DECIMALSEP,.
DIALOG CREATE,test,-1,0,200,220,ONTOP,NOSYS,
dialog add,style,for_pie,,,,blue,yellow
DIALOG ADD,PIECHART,P1,12,20,140,110,,,for_pie
DIALOG ADD,BUTTON,Animate,150,10,84,24,
DIALOG ADD,BUTTON,Error12,180,10,84,24,
DIALOG ADD,BUTTON,Cancel,150,100,64,24,
DIALOG ADD,BUTTON,Error38,180,100,64,24,
DIALOG SHOW
:evloop
wait event
%E = @event()
goto %E
:ANIMATEBUTTON
%i = 0
repeat
dialog set,P1,%i
%i = @succ(%i)
wait .05
until @greater(%i,100)
goto evloop
:ERROR12BUTTON
dialog set,P1,12
goto evloop
:ERROR38BUTTON
dialog set,P1,38
goto evloop
:CANCELBUTTON
DIALOG CLOSE
STOP |
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Jerry'Co Valued Newbie
Joined: 16 Jul 2003 Posts: 35
|
Posted: Wed Jun 18, 2014 8:15 pm Post subject: |
|
|
Hi Garret,
you are right ! Your solution is more elegant
Only for pleasure I arranged this snippet of code once more
(If you will be tired from "monitoring the pie", you can any time click Cancel)
Values like 86, 90, 92, 98, 104 and 118 cheerfully blink, special attention deserve values 105 and 112 ... enjoy
| Code: | OPTION DECIMALSEP,.
%j = 75
DIALOG CREATE,test,-1,0,200,220,ONTOP,NOSYS,
dialog add,style,for_pie,,,,blue,yellow
DIALOG ADD,PIECHART,P1,12,20,140,110,,,for_pie
DIALOG ADD,TEXT,T1,130,5,100,,
DIALOG ADD,BUTTON,Animate,150,10,84,24,
DIALOG ADD,BUTTON,Error12,180,10,84,24,
DIALOG ADD,BUTTON,Cancel,150,100,64,24,
DIALOG ADD,BUTTON,Error38,180,100,64,24,
DIALOG SHOW
:evloop
wait event
%E = @event()
goto %E
:ANIMATEBUTTON
%j = 84
repeat
dialog set,T1,"Height:"%j
dialog setpos,P1,,,,%j
%i = 0
repeat
dialog set,P1,%i
%i = @succ(%i)
wait .001
if @event()
goto evloop
end
until @greater(%i,100)
%j = @succ(%j)
until @greater(%j,120)
goto evloop
:ERROR12BUTTON
dialog set,P1,12
goto evloop
:ERROR38BUTTON
dialog set,P1,38
goto evloop
:CANCELBUTTON
DIALOG CLOSE
STOP
|
Regards,
Jerry |
|
| 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
|
|