Just looking to get some feedback on a control I created. Attached is a sample project testing the control's features, let me know if it works for you. All comments, suggestions, <harrasment> welcome! Thanks in advance!
Printable View
Just looking to get some feedback on a control I created. Attached is a sample project testing the control's features, let me know if it works for you. All comments, suggestions, <harrasment> welcome! Thanks in advance!
Awesome. Im been lloking for a progressbar like this! :)
Very Cool !
Do you have any restrictions for using your ActiveX Control ?
Nope just that I get some credit if you use it in your project, other than that it is totally freeware. It's the first step in my portfolio. I'm still not sure if it is 100% bug-free, but that is the reason for this post, anyways ENJOY!
one request. Could you make it accept longs for max? You can only go as high as 32767.
No problem will post a update later, didn't think that anybody would need more than that but I guess I was wrong. ;)
yeah. I need it for file download progress and I set max to the file size.
Damn YoungBuck, that progressbar rocks the house.
I agree about the long, btw. I use progress meters in database loops, and I usually set the max to the recordcount, which can easily go over 32k.
very nice :)
Thanx for the compliments guys (wow 8 posts and no negative comments). BTW I'll post my website address when I get one in case you want to tell anybody else about it ;). I also updated the Comments section of the OCX to include my "restrictions" on using the control.
Ahh..better now. Keep up the good work YB!
Excellent work...very nice custimizability (is that even a word? lol)
:)
Nice work YoungBuck :).
Only thing is, you should have None for a Message as well rather than having to choose Percentage, Value, Message.
Just giving you some feedback :).
Good job with it though :D.
Thanks Matthew, I just added that combo box to the test project to show some possible uses of the ValIncrease Event, it's actually not an option on the actual control, thanks for the feedback though! Does anybody think I should add a ValDecrease Event?
How about a ValueChange event?
ValueChange(curvalue as long)
That would cover both of them.
Gerco Dries.
Thought you would like to see a screen shot of your control being put to good use.. :)
Awesome!
Thanks for the Control.
Nice Screen shot, Cander. :)
Awesome control YB, Cander, may be a dumb question, but how did you get the title bar in black?? I can't figure it out, I must be missing something.
LOL Cool Cander, glad to know somebody can use it. :D
Another update here :).
Changed the ValIncrease Event to ValChange (thx Gerco).
Added a ProgressComplete Event.
Added Vertical Text Alignment.
YoungBuck, cool man! :cool:
Very nice, Young Buck.
It is just my system color for an active window
YoungBuck,
A very fine looking control.
A couple of ideas for you:
Instead of loading the picture from a file, provide a property Picture, which is StdPicture. That way you can load the picture from any source, including imagelists, resource files and files. Also means that you could accept all other picture formats (provided they get converted prior to being passed to you as StdPicture.)
There is a bit of flickering with fast updates. It's not a critical problem, but it's nice to make sure everything is smooth. Are you double-buffering the painting? If not, might not be a bad idea - makes it faster, and looks a heap cleaner.
What does the DisplayProgress method do?
A MouseEnter and MouseExit event would be nice (not critical, but it's something I like writing into my controls - the end developers love the little stuff like that).
Also - and this a bugbear of mine regarding the MS ProgressBar - an event that says I have entered a value that is greater than the max, or a property that allows me specify whether a value that is invalid (either < Min or > Max) passed to the bar is either internally handled (no error) or raises an error event.
Anyway, it is a very nice control - I'm not trying to criticise, just point out some possible enhancements.
Good work. Now, if you could just write me a complete scheduling control, I'd be even happier :)
- gaffa
Hey gaffa thanks for the feedback, now right to it.
I am using a IPictureDisp object to load the picture from a file (so formats accepted are .jpg, .bmp, .gif). Sounds like a good next step.
I am double buffering and I get no flicker on any of the fastest updates on my P1 200 mhz, 32mb ram system, what are the specs on your system??
err... DisplayProgress and DrawControl are both meant to be Private. I'll fix that in the next update.
I don't see why MouseEnter and MouseExit would be necessary, but if you can give me a good reason (or if I come up with one on my own) I'll add them.
Not quite sure what you are asking for here. Currently if value > max then value = max, if value < min then value = min, if min <= 0 then min = 1, if min > max then min = max - 1, if max < min or max < 0 then max = min + 1, and if you enter an overflow value you will receive an error, are you saying you want an event to trigger when these criteria happen rather than fixing the values internally??
BTW my next control is either a DBGrid or a Enhanced List Box (no scheduling control..... yet!)
YoungBuck,
OK, some reasoning for my comments :D
The MouseEnter and MouseExit events are useful for things like changing status bar text. Obviously you can use the MouseOver event, and set status bar text then, but then the form (or other controls nearby), need to make sure that the status bar text is reset. Much easier to do it if you know when the mouse has exited from being over the control.
The buffering problem is interesting. It may be because you are drawing longish lines on the vertical plane, and the eyes play tricks, but I tested some of my doublebuffered stuff with long vertical lines, and didn't see to have a problem (I'm running on a 350Mhz box with 192M RAM). I don't have an answer for that.
The issue with the Max Min and values is strightforward (although I didn't do a fantastic job of expaining it in the last post)
OK, say my Min is 1, and the max is 10. If I set the progress bar value to be 8, then all is well and good. If I was to pass 13 to it, 13 would be outside the bounds of the Max. At this point, the MS Progress Bar raises an error. Personally, I think an option to do either three things might be nice:
1. Value is passed as 13. Result is that the Max is set to 10.
2. Value passed is 13. Result is that the Max is set to 10, and an event is raised to say that the values was too big (but at this point no actual error is raised)
3. Value passed is 13, and an error is raised to that effect.
The reason is that this means I can choose to ignore all dodgy values passed to the bar(option 1), I can effectively ignore the dodgy values, but I get an event so I can at least be aware of the problem (but the system doesn't crash (option 2), or I get an error, and I need to handle that in my code (option 3).
Oh, yeah - the font drawing seems to be a little off. Cjanging the font to Tahoma 9 point Regular makes it very small (more like 4 point)
Hope that helps.
- gaffa
Sorry to be a pain in hte butt, but one more issue.
The progress bar isn't relinquishing control of the CPU, so if I have a long incrementing run (like 1 to 10000), the progress bar rips all the CPU, and the rest of the form doesn't repaint etc.
- gaffa
gaffa,
I'm in the process of adding MouseEnter and MouseExit now :).
Would you mind sending an example of your double buffering stuff, maybe I'm missing a step. I am perfecting a class to handle all my graphics operations for all the controls I have planned in my head and any objective code is nice.
Right now if min is set to 1 and max is set to 10 and you change the value to 13 it resets to 10, I think perhaps a OverStep event might be a good idea.
Yeah I just noticed the font thing myself, right now I'm testing CreateFontIndirect as an alternative to the CreateFont function, I really don't see what the problem could possibly be.
Anyway thanks for the criticism, I live and die this stuff, I can't enough how much I love it!!
I think your painting stuff is pretty good - I tested it by running it paint 1 to 100 about 10000 times - no memory leaks which is nice (cos they are a pain to track with owner drawn stuff)
I'm just preparing the sample I have for upload.
- gaffa
YoungBuck, u sure deserve the credit!
YoungBuck,
I've posted my control on a new thread (I figured it was only fair to let you take my control apart :D)
Have a look if you want. It's still in beta, with a few known bugs (and probably tons of other bugs)
http://forums.vb-world.net/showthrea...threadid=53861
If you are still having problems with the font stuff, drop me an email, or reply to this thread, and I'l sned you the code I have
- gaffa
Hey,
Its excellent. Cheers
Parasuraman
Much Much better than Microsoft....Shall I call it
YoungBuck Progressbar control from YoungBuckSoft?
Just Youngbuck progressbar control would do, imho.
About the hogging the cpu... I think you should insert a DoEvents of something in your code when you update the value.
The MS Control also hogs the cpu when updating fast... I think the client program should control that behaviour. Otherwise operations would go slower, just because the progressbar allows the system to do other stuff every time it is redrawn.
Gerco.
One more suggestion.....
If i chosse the foreground color as black then the text can't be seen....
also when i choose the backcolor as black
Mouse Enter and Exit Extension library (with source), if anyone want's :)
Sweet!
I wonder if Microsoft will rob your ideas?! ;)
Geoff
Give the man credit not his alias just call it the Advanced Progress Bar but give credit to Jon B. Mooty not YoungBuck ;). Anyways remember that it's not completely ready yet so using in your apps is not recommended (although I have yet to see it crash). Anyway thanks for the feedback guys.Quote:
Originally posted by faisalkm
Much Much better than Microsoft....Shall I call it
YoungBuck Progressbar control from YoungBuckSoft?
Hopefully this will be the last update (if nobody finds anything wrong). I fixed the problem with the size of the fonts and basically added everything that gaffa was talking about, including support for the StdPicture object rather than just using the path of a picture file, MouseEnter and MouseExit events (self-explanatory), and also added an OutOfBounds error property which basically if it is set to true raises an error (the error number that is raised is equal to vbObjectError + 66) if Value > Max or Value < Min. Let me know if anybody runs into anymore problems. :D :)
what about the color problem?. When I set the background or foreground color to black, I can't see the text.
The foreground color is the text color, so if you have the background color = black then try setting the foreground color (text color) = white or any other color other than black.Quote:
Originally posted by faisalkm
what about the color problem?. When I set the background or foreground color to black, I can't see the text.
Realistically, setting the foreground and background colours, and checking for same isn't a problem of the control - it really relies on the user to fix that one. You can set a label foreground and background colour the same.
- gaffa
The MouseEnter and MouseExit code was a little off (if you moved the mouse into the control while it was updating the display the updating would be frozen) so here is (once again) hopefully the final update.
I found a bug in your control. I added it to a new project, and tried to make it go from top to bottom, bottom to top, and right to left. It always goes back to left to right. Other than that, I think this is an excellent control. Keep up the good work.
Should work now MidgetsBro, thanks for the feedback.
Thanks for your help everybody!
The appearance is very adjustable and is easy to program. Is it free for use?
Your control is very cool, but the idea is already used:
http://www.planet-source-code.com
Search for "Cool Progress Bar" in the VB section. Still, nice piece of code ;)
Free to use, right click on the ocx file, select properties, and read the version info to see my 'restrictions'.
I got bored and added some new features to this thing and also wrapped up everything in a setup file. Would somebody please test the setup file and everything else and let me know if everything works. Upon running the setup file the ocx is installed in the Win/System folder (jmprgrs.ocx) and a sample project is installed to C:\PBTest, run the project in that folder to test the project. One more thing I also left the VB5 runtime files out of the setup file so you must already have them in order to test and use the control. Thanks in advance! :D
Almost forgot the important part. ;)
You can get it here.
very nice control! I wish to see how you coded that :) One thing, I do not see how to use the picture in the progress :(
For some reason unbeknownst to me everytime you try to click on link to a file geocities returns a 403 Forbidden error. So if anybody has tried to download the file you have to right click on it and select Save Target As in order to download it.
All was ok here and I just clicked ...
There are two ways you can use an ImageList as documented in the code or you can use the Picture property with the LoadPicture function.Quote:
Originally posted by DaoK
very nice control! I wish to see how you coded that :) One thing, I do not see how to use the picture in the progress :(
VB Code:
JMProgress1.Picture = LoadPicture("C:\YourFile.jpg")
Here is the source, now I should really get some good feedback. Keep in mind that when I first started this I wasn't planning on releasing the source so it is only commented as much as I needed it to be.
DaoK: Did you have any problems with the installation, and what is your Operating System and Version of VB?
I downloaded and it installed perfectly on my machine. It has Win98SE with VB 6.0 Professional. The only problem I had was when I tried to include it in a test project of my own, I got confused because I had an older version of it, so there were two Jon Mooty's Advanced Progress Bars. I had to dig through the system folder and remove the old one. Other than that, it installed flawlessly, and it works like a champ. Good job.
No problem and I am on Window Me Edition and I use VisualBasic 6 EnterpriseQuote:
DaoK: Did you have any problems with the installation, and what is your Operating System and Version of VB?
Thanks for the help guys.