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 


Another (better) Progress bar example

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 766
Location: Eastman, GA

PostPosted: Thu Sep 26, 2002 1:03 am    Post subject: Another (better) Progress bar example Reply with quote

The other day I released embossed progress bar, don't use it LOL


OFF TOPIC (Speaking of embossed progress)
The reason I used a button on top of an edit is because I could make the button flat like a text element, and yet contain it inside of an edit giving it a 3d effect. The importance of a flat element is that the text progress indicator smoothly changes colors...

The problem with the button api is it is easily reset, and not only that, you can't modify the colors of a button.

ON TOPIC
Now I have found a way to give text elements a 3d appearance, thus ending the need to use a button!

OK Ok, you looked at this for code, not babble.

Code:

DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,STYLE,STYLE2,,6,B,white,DKBLUE
  DIALOG ADD,STYLE,STYLE1,,6,B,DKBLUE,WHITE
  DIALOG ADD,GROUP,GROUP1,50,22,202,16
  DIALOG ADD,TEXT,EDIT2,51,23,200,14,,,STYLE2
  DIALOG ADD,TEXT,EDIT1,51,23,200,14,,,,STYLE1
  DIALOG SHOW

%%count = 0
repeat
wait .1
%%count = @succ(%%count)
dialog set,edit1,"                    "%%count"%"
dialog set,edit2,"                    "%%count"%"
dialog setpos,edit1,,,@fmul(%%count,2)
until @equal(%%count,100)

  :evloop
  wait event
  goto @event()
 
  :close
  exit
Back to top
View user's profile Send private message AIM Address
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Sep 26, 2002 8:57 pm    Post subject: Reply with quote

Nice job there... Smile

I like the numbers that count... Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Sep 29, 2002 3:07 pm    Post subject: that is neat Reply with quote

that is really nice

how would a person uses that fuctions when d/l files off the net within vds program? can you give a expamle code for this please

thanks
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Sep 29, 2002 3:35 pm    Post subject: Reply with quote

I've redesigned the code, so it's easier to understand...
Another new feature... You can stop the progress by making an event...

Code:

option decimalsep,.
  DIALOG CREATE,New Dialog,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,90,8,120,24,From 1 to 100
  DIALOG SHOW

rem Creates the progress bar... name     |top|left
%%progressproperties =          progress1|10 |10
gosub Createprogress

  :evloop
  wait event
  goto @event()

:button1button
%%count = 0
repeat
wait 0.1
%%count = @succ(%%count)

rem Set the progress bar with the next 2 lines:
%%setprogress = progress1|%%count
gosub setprogress
rem The first parameter is the progress name, the second the counter, 1/100

until @equal(%%count,100)@event()
goto evloop
 
:close
exit
 
rem Include this in your program: 
 
:Setprogress
option fieldsep,|
parse "%%name;%%count",%%setprogress
  dialog set,%%name"edit1","                    "%%count"%"
  dialog set,%%name"edit2","                    "%%count"%"
  dialog setpos,%%name"edit1",,,@fmul(%%count,2)
exit 
 
:Createprogress
option fieldsep,|
parse "%%name;%%top;%%left",%%progressproperties
  DIALOG ADD,STYLE,%%name"STYLE2",,6,B,white,DKBLUE
  DIALOG ADD,STYLE,%%name"STYLE1",,6,B,DKBLUE,WHITE
  DIALOG ADD,GROUP,%%name"PROGRESS",%%top,%%left,202,16
  DIALOG ADD,TEXT,%%name"EDIT2",@fadd(%%top,1),@fadd(%%left,1),200,14,,,%%name"STYLE2"
  DIALOG ADD,TEXT,%%name"EDIT1",@fadd(%%top,1),@fadd(%%left,1),200,14,,,,%%name"STYLE1"
exit


Hope you now know how to use it...

Btw. If you want to download something, this only works if you have more then 1 files, because you can't see the progress of a big download with VDS... I think this is easy to use for a Install program.


Last edited by Skit3000 on Sun Feb 09, 2003 11:57 am; edited 1 time in total
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 29, 2002 4:51 pm    Post subject: Reply with quote

Of course, you could always use a style with a progress bar (to use it in XP, compile it then run it, but don't make a manifest file for it because then you won't be able to see it correctly with the Windows XP Controls...

VDS 3 Users please adjust the style option for the progress bar:

Code:
  DIALOG CREATE,Progress Bar,-1,0,240,112
  DIALOG ADD,STYLE,PS,,,,WHITE,NAVY
  DIALOG ADD,BUTTON,BUTTON1,56,78,82,24,Go
  DIALOG ADD,PROGRESS,p,18,20,208,24,0,,PS,SMOOTH
  DIALOG ADD,STATUS,s
  DIALOG SHOW
  wait event
  %%count = 0
  repeat
    wait 0.1
    %%count = @succ(%%count)
  dialog set,p,%%count
  dialog set,s,%%count
  until @equal(%%count,100)
  wait 1
  exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 766
Location: Eastman, GA

PostPosted: Mon Sep 30, 2002 5:18 am    Post subject: Reply with quote

Thanx for the cool upgrade Skit Wink

I just didn't have time to do something like that for this one...although I did for embossed progress bars...which you could make the progress bars any size on (not just width 200) but i'm too busy to do any major coding right now...that's why my examples seem skimpy.

NodNarb
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code 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