forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Pie-Chart command error

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Jerry'Co
Valued Newbie


Joined: 16 Jul 2003
Posts: 35

PostPosted: Tue Jun 17, 2014 8:24 pm    Post subject: Pie-Chart command error Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jun 18, 2014 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Jerry'Co
Valued Newbie


Joined: 16 Jul 2003
Posts: 35

PostPosted: Wed Jun 18, 2014 7:03 am    Post subject: Reply with quote

Hi,

I made some "bypass" for it Very Happy. 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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jun 18, 2014 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jerry'Co
Valued Newbie


Joined: 16 Jul 2003
Posts: 35

PostPosted: Wed Jun 18, 2014 8:15 pm    Post subject: Reply with quote

Hi Garret,

you are right ! Your solution is more elegant Very Happy
Only for pleasure I arranged this snippet of code once more Very Happy
(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 Very Happy

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group