Results 1 to 28 of 28

Thread: Progress bar in Kazaa-Traffic

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Progress bar in Kazaa-Traffic

    Has anyone any idea how they implemented the progress bar in Kazaa-Traffic? The data in traffic seems to be a listview in report mode. But I can't figure out how they implemented the progress bar. I want to implement the same thing in my app. Any ideas?

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    *
    Last edited by leinad31; May 12th, 2003 at 09:42 AM.

  3. #3
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Re: Progress bar in Kazaa-Traffic

    Originally posted by leinad31
    Has anyone any idea how they implemented the progress bar in Kazaa-Traffic? The data in traffic seems to be a listview in report mode. But I can't figure out how they implemented the progress bar. I want to implement the same thing in my app. Any ideas?
    The solution is not that easy...

    U need to have a progress bar which have an index value of 0 to start with...Means a control array of progress bar...

    Then u need to have a listview and the progress bar is hidden behind the listview...Width of the progress bar is exactly same as the column where u want to put the progressbar...Make sure they are in same position as long as the x, y goes...X,Y are the cordinated to give absolute position...

    Then all u need to do is show the progressbar over the listview and show it working...

    If you have more then 1 item is listview then add another progressbar and code that too...

    As I said not that easy work...now comes the hard part...your program need to work and increase the progressbar at the same time is kinda impossible with VB (Please correct me here if I am wrong)...I have never done this b4...

    Hope this is helpful...

    Cheers...

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    That's the original idea I came up with. I guess I can use .GetFirstVisible to get the data, but then I'll have to compute for the last visible item based on the control height and row height. I'll also have to resize the progress bar on control resize and column resize. I'll have to reposition the bar based on column (preceeding columns) resize. I was hoping there is an existing code for such. Oh well.... if I ever get it working I'll donate it to the code bank.

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    perhaps it is easier within kazza because the program was not written in VB.. they might also be using a 3rd party listview control..

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    I wonder what they'll call that 3rd party listview.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Can anyone convert this Delphi implementation to VB?

    http://www.experts-exchange.com/Prog..._20168107.html

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    *bump

  9. #9
    Lively Member
    Join Date
    Nov 2002
    Location
    Perth - Australia
    Posts
    105
    hehehe, if it had been me taking that screenshot i would have at least stopped downloading porn while i took it

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Makes it more realistic, hehehe

  11. #11
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    It also shows illegal downloads

    You fool...Hahahahahahahahaha...

    Anyways, it's pretty straight forward to do if you know what you are doing...

    If you go to a web page called www.vbAccelerator.com, and download all the files required to use S-Grid and then run the demo projects, you will see that it's possible to make a combo box appear in one of the grids cells. All you need to do is replace this combo box with a progress bar, and u're sorted

    U don't need a control array of progress bars. you can create them on the fly...using:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     AddProgressBar
    5. End Sub
    6.  
    7. Private Sub AddProgressBar()
    8. Dim objBar As ProgressBar
    9.     Set objBar = Controls.Add("MSComCtlLib.ProgCtrl.2", "prgBar" & Controls.Count)
    10.     With objBar
    11.         .Top = 1000 * Rnd()
    12.         .Left = 2000 * Rnd()
    13.         .Width = 2000
    14.         .Height = 250
    15.         .Visible = True
    16.     End With
    17.     Set objBar = Nothing
    18. End Sub
    Hope that helps...

    Woka

  12. #12
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Seriously...you guys know how to get someone laughing this early in the morning...

    I came on here and am like ok what is this guy trying to do...kazzaa? .. so im like ok ill look at his screen shot...at the top I see "pamela"...i have that one if you need it j/k. So I start laughing...then I scroll down and someone says, "If I were to post the screen shot..I would have stopped downloading porn"...Immediately I burst out laughing..

    To make things worse I bump in to Woka's thread and his laughing about downloading illegal mp3s / software / movies / porn...I wake up all other engineers who sit near me by my laughing.

    Then I read woka's signature regarding McGenius...poor guy he seems to be helpful to me..what is it with you guys and him..Id like to see the thread where you were converted into morons.


    Jon

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Originally posted by Wokawidget
    It also shows illegal downloads

    You fool...Hahahahahahahahaha...
    As i said, makes it more realistic Whoever uses P2P software to download exclusively legal files? The only legal files are personals, marketing related and declassified docs.

    I couldn't look at the demo you mentioned. The domain's gone.
    Last edited by leinad31; May 12th, 2003 at 09:50 AM.

  14. #14

  15. #15
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Got scared ehh?

    LOL...he got rid of the screenshot before I sent it to the porn people . There goes my reward.


    Jon

  16. #16
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Ok..read it.

    I dont think McGenius means any harm. Remember programmers take offense to things quickly ..it's our nature...its like pointing out a big zit.

    Deep down we're all humble human beings trying to make things better and better in our lives which amount to NADA .

    Im going back to sleep now at work...

    What a busy day .

    Jon

  17. #17
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    I am not a programmer.
    I just somehow ended up with a career change and somehow became a VB Developer...if someone had told me 3 years ago that I would be a VB Programmer, 1stly I would have said "What's VB", then I would have laughed my tits off
    The money is good, and I am good at what I do, and it's a piece of piss, so here I am...

    Nobody means any harm, didn't you know that. We are all innocent...

    Woka

  18. #18
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492
    Your signature needs to be fixed up to "McGenius"..heaven forbid we get a user with the name you used..you'd be blamed again!

    Jon

  19. #19

  20. #20
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

  21. #21
    New Member webx2000's Avatar
    Join Date
    May 2003
    Posts
    9
    Hi, check this link
    http://www.elitevb.com/content/01,0048,01/01.aspx
    it has a very nicely done listview with progress bar. The downside to it is that it contains subclassing and other heavy stuff. If you don't like using the heavey stuff, I think the example posted by Armbruster would do the job.

  22. #22

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    webx2000: Cool site. I'll need to read up on the topics though. Maybe in a week or so I'll try it...

    Armbruster: Is there a way to implement more than 1 progress bar with your method?

  23. #23
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    Originally posted by leinad31
    webx2000: Cool site. I'll need to read up on the topics though. Maybe in a week or so I'll try it...

    Armbruster: Is there a way to implement more than 1 progress bar with your method?
    Sure, just use a control array. I only did it with one to keep it a simple example but it could easily be modified to load/unload progress bars from an array as needed. If this doesn't make sense, just let me know . . .
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

  24. #24

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Will this line still be the same?

    VB Code:
    1. SetParent pbrStatus.hWnd, lvwExample.hWnd

    Ok, so I'll need to sync the listview and the progress bar. The way that comes to mind right now is to create a class to store reference to the apt listitem and the relevant progressbar control array member. Then create a collection of that class.

    Question is what happens when a listitem in the listview is removed and the items moved. will the reference I stored in the collection become invalid?

  25. #25
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    Originally posted by leinad31
    Will this line still be the same?

    VB Code:
    1. SetParent pbrStatus.hWnd, lvwExample.hWnd

    VB Code:
    1. SetParent pbrStatus(index).hWnd, lvwExample.hWnd
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

  26. #26

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    VB Code:
    1. pbrStatus(index).hWnd

    Will the hWnd apply for the entire control array or for just that one index? So what happens? I show the progress bars one at a time? Won't they get deleted when the listview is repainted?

    I'm asking becuase I'm not very familiar with the use of hWnd.
    Last edited by leinad31; May 13th, 2003 at 08:12 PM.

  27. #27
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    Originally posted by leinad31
    VB Code:
    1. pbrStatus(index).hWnd

    Will the hWnd apply for the entire control array or for just that one index? So what happens? I show the progress bars one at a time? Won't they get deleted when the listview is repainted?
    The hWnd applies to each element independently
    Won't they get deleted when the listview is repainted? No
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

  28. #28

    Thread Starter
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Oh ok. I'll give it a try then. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width