Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Progress Bar

Author
Message
RisTar
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 31st Aug 2003 06:23
Well im making an ftp program ,
for the downloads/uploads i want a progress bar wich i dont have a clue of how to make it
also i want to know the speed rate of the download and the time left for the download
and again , i dont know how to do it , so plssss andswer me on that 1 , thanks
Duderiza
21
Years of Service
User Offline
Joined: 27th Aug 2003
Location:
Posted: 31st Aug 2003 20:05
I know how you feel RisTar. I want to make a FTP program, and would like a progress bar. But I'm stuck.

I hope there are people who can help Me and Ristar

Thanx In Advance
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st Aug 2003 20:29 Edited at: 31st Aug 2003 20:36
it's really, really easy.

draw a box on the screen

say you are 50% the way through a tranfer and your bar is 200 pixels width, just draw a bar 100 pixels wide:



It's as easy as that haven't tested the code though.

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
Duderiza
21
Years of Service
User Offline
Joined: 27th Aug 2003
Location:
Posted: 31st Aug 2003 22:05
Cheers David. You do make things seem easy.
RisTar
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 1st Sep 2003 16:03
Duderiza i still didnt go it ! if u did explain it to me
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 1st Sep 2003 16:36 Edited at: 1st Sep 2003 16:37
here you are this works. A I didn't test the code I forgot val() was a function so in patch 5 it owuld have given an error.



It's easy to change colours, etc. now.

The function first works out what percent is complete, then multiplies the overall length of the bar on screen by that value (will be from 0-1). That gives you to length of the bar to show progress on screen.

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?

Login to post a reply

Server time is: 2024-09-20 21:29:13
Your offset time is: 2024-09-20 21:29:13