Results for "Author: vesa piittinen"
This is a new cool progress bar control. I've been doing it two days, based partly on my previos progress bar (I submitted it now already as I'm doing my military service and are therefore limited in time). Though this one is different by looks and is also improved by speed. At the moment the control is not complete, there are properties that are not yet finished. Despite this fact, the control does work. I wish you like that control and that it's customizable :) You can change borders' style, all the colors (15 different), direction (right, up, left, down), set text on it, custom done text and so on.
The best progress bar on PSC: it's fast, it looks cool and it's stable. All you need when it comes to showing a progress. Includes: 1) colors and colorfades! 2) use any font, make it appears as you want 3) you can use seven different borderstyles 4) make the bar grow up, down, right or left 5) Blending (changes color opacity or CosSin mode makes weird colors!) 6) Set the caption just like you want it to be 7) ManualRefresh for optimal usage: if you change colors a lot or do other big changes at a time, you might want to refresh the bar only when you wish 8) Min, Max and Value as big or small as you want 9) You can change parent easily with SetParent 10) enough events: make it a command button as well! 11) clear, optimized code: learn how things can be done fast in VB. Also great example on how to make an ActiveX control with VB. If you like it, please vote & rate :)
Enhanced label with Unicode support. Copy UniLabel.ctl and UniLabel.ctx to your project's path and add the control into the project! Thanks to Paul Caton (SelfSub), Ralph Eastwood (for fixing SelfSub 2.1 bug) and Zhu Jin Yong (for UnicodeStrings.res and sample code to use it). Read special_features.txt for more information! | UPDATE 2.2 - 2007-11-19 - SelfSub fixed to version released by LaVolpe, thus finally fixing the crash issues! | UPDATE 2.3 - 2007-12-05 - BackStyle works now, some additional font properties added to ease font manipulation.
This code seeks from the end of a byte array trying to find a matching text. Why? Well, handling byte arrays is much faster than handling strings. So, if you needed to parse data real fast and a lot, it would be benefical to do it using a byte array instead of a string. My starting point to this was rather simple: do the search faster than InStr and InStrRev. Beating the latter was easy: InStrRev isn't of the fastest build-in functions in VB. With InStr I had to taste half of a defeat: it just is superb when it can search in BinaryCompare. But, what if we wanted to do TextCompare? Well, there InBArr and InBArrRev beat real badly both InStr and InStrRev! Anyways, I hope somebody finds this submission helpful. I'm sorry I didn't comment the code as well as I could/should have, but I hope it doesn't matter as the code should be rather flawless on what it does :) Comments and votes welcome, as always!
This code makes it possible to search byte arrays. You can search in ANSI (textfiles) or Unicode mode (native VB strings) and the function supports vbTextCompare. The search keyword is passed as a normal string for ease of use. *** This function is somewhat a proof that you can make fast stuff with native VB6 code: with a proper search algorithm even the super fast InStr can be beaten in binary compare! The function uses Boyer-Moore algorithm as its base of searching when keyword is longer than two characters. The function will perform faster if the keyword doesn't change often, as its prosessing speed is heavily based on intelligent keyword indexing. The function will also easily beat InStr when searching for a long keyword within a very long text. The code doesn't use API or TLB to help; it would be possible to increase the speed even further with the help of API and TLB. I didn't want to confuse with the use of those methods. *** The function code is commented so it should be possible to follow how it works. I've spent some time to figure out this function with this much performance, so I hope to get votes - the code should be very useful to anyone who wants to search stuff FAST :)
These functions perform a search like InStr within a byte array. Accessing byte arrays is much faster than accessing strings, but there aren't many tools provided in VB to handle the arrays. So here you have something: InBArr and InBArrRev, which can search byte arrays with a string keyword in both Unicode and ANSI modes. *** NOTE: you probably don't have a file named C:\hotfix.txt, so you have to edit Form_Load so you can try it. *** Votes welcome :)
This is a Label replacement control that gives you some limited CSS features (BorderRadius, Border, Margin, Padding, Opacity) and Unicode support. Rounded corners are limited because they are implemented using Windows API RoundRect which doesn't give the nicest results in every case.For a more complete description visit VBForums thread: http://www.vbforums.com/showthread.php?t=626737
While I think these TrimNull functions are a bit silly business, I guess they're mostly used due to lack of understanding of Windows API return values or of the file that is being processed, here you can find proper implementations of the LTrim & RTrim equivalents for NULL characters. Instead of InStr of any kind the string is processed as Integer array, without making a new copy of the string. This allows full control over the validation process and thus string is properly parsed from any NULLs at the end or beginning of a string. A test program is included for comparison which shows the bugs in other implementations. Also a bit fuzzy logic RTrimZZ is included: it is fast, but it is mostly dedicated to cases where you expect a buffer full of NULL, except for the actual data at the beginning of the string. The functions are long but fast.
This is a Collection replacement, limiting itself to objects. This is mostly a usable "technology demo", showcasing how to create a feature full syntax compatible replacement of a Collection. By speed this class only competes in a few areas, being much slower in adding new items for an example. Maybe someone takes this over and makes a syntax compatible version that is much faster. **** Features: Add, Clear, Clone, Count, Index, IndexByPtr, Item, ItemByIndex, ItemByKey, ItemByPtr, Items, Key, KeyByPtr, Keys, Ptrs, Remove, RemoveByIndex, RemoveByKey, RemoveByPtr, Swap, SwapByIndex, SwapByKey and SwapByPtr. As you can guess by this listing of features, you can do a whole lot more than you can do with the native Collection (which only has Add, Count, Item and Remove). **** Based on SelfEnum class posted yesterday. Credits to Paul Caton and LaVolpe for their work on SelfCallback.
By a request here, I was fooling around with different ways of changing a form's caption to Unicode. I've seen commercial controls that take over the drawing routine with some heavy subclassing and other similar poor attempts, which have then broken, if not when theme changes, then by when Vista got released. I started off by figuring out a way to create a custom Unicode window and then make an existing form a child of it, but this got pretty messy and I wasn't very happy with the complexity. However, I had a bug during this process that I by mistake used a non-Unicode version of DefWindowProc, which prevented the caption to be Unicode. And it didn't take me long to figure out that by temporarily changing a window's window procedure any window caption can be made Unicode. So here it is: a very short and clean way to have an Unicode caption in your forms! The code can be pasted directly to your form.
This single class file gives you tons of power in handling the messagebox: you can change the texts in the buttons, you can set the window's icon, you can set the icon shown besides the message and all the the text is understood in Unicode so no more question marks. If you're an advanced coder you can use the provided interface to do practically whatever you like to the message box window! **** Again thanks to Paul Caton and LaVolpe for their work on SelfSub, SelfHook and SelfCallback.
A new class implementation of Winsock API. By style close to the native Winsock control and other class implementations such as CSocket and CSocketMaster, so you don't need to learn or rewrite much of existing code. The new and cool part about this class is that it is just one class file. Also, it performs better (by speed) and handles errors a bit more cleanly (you aren't forced to close the socket each time an error occurs). Other speciality is transparent Unicode support: when you switch to text mode, you start receiving TextArrival event instead of DataArrival and start getting individual lines. These lines are automatically Unicode if received line is UTF-8 or UTF-16! ANSI lines require you to use StrConv to get an usable string, thus you have the power on what to do with the raw data before any conversion has affected it. **** Support thread and documentation: http://www.vbforums.com/showthread.php?t=534580 **** Special thanks to Paul Caton and LaVolpe for their work on SelfSub, SelfHook and SelfCallback. **** UPDATE 2008-08-12: Now Vista compatible!
It is hard to get Unicode in VB6. The biggest reason is the nowhere-to-be-found support in any of the native controls. In the past few years people have been mostly forced to commercial solutions or to move to another language. With UniControls I try to change this by providing some of the most essential tools for working with Unicode. **** This is the summer release. What you find here are a few powerful controls, and some that are still in an earlier level of development, yet useful for many tasks. Included: UniCaption, UniCommand, UniDialog, UniLabel, UniList, UniMenu & UniText, with some additional bonus code. **** NOTE: despite these controls using SelfSub, SelfHook and SelfCallback by Paul Caton and LaVolpe, not all of these controls are Stop button safe. This is because of UserControl's limited OLE interface, which has forced to some IOleInActivePlaceObject hacking, for which there currently is no perfectly IDE safe solution. If I didn't use it, I would have to use complex hooking to capture Enter, Escape, Tabulator, arrow keys and other navigation keys. **** Hopefully you enjoy these controls!
Yes another control aimed for beginners (and why not for everyone else too!): include PictureView.ctl and cJpeg.cls to your project and you have a new nice picture viewing control you can use! *** You can view pictures easily in this control. It adds scrollbars when required, if not required centers the picture. With all the additional features of the control, you can easily create your own Paint program, for example. The control is able to save JPEG pictures thanks to John Korejwa's JPEG Encoder Class. You can define new picture to be created, get picture's DC so you can BitBlt or use any other GDI API to draw to the control... and much else :) *** Properties: borderstyle, cornerstyle, picture, scrollable. Functions: ClearPicture, NewPicture, OpenPicture, PictureDC, PictureHeight, PicturePaint, PictureWidth, SaveJPEG. Events: Click, DblClick, Key-events, Mouse-events, PicMouse-events, PictureLoaded *** Hope you like the control! This is the third public release of the control, first time at PSC. Comments, critics and improvements welcome! :)
The best progress bar on PSC: it's fast, it looks cool and it's stable. All you need when it comes to showing a progress. Includes: 1) colors and colorfades! 2) use any font, make it appears as you want 3) you can use seven different borderstyles 4) make the bar grow up, down, right or left 5) Blending (changes color opacity or CosSin mode makes weird colors!) 6) Set the caption just like you want it to be 7) ManualRefresh for optimal usage: if you change colors a lot or do other big changes at a time, you might want to refresh the bar only when you wish 8) Min, Max and Value as big or small as you want 9) You can change parent easily with SetParent 10) enough events: make it a command button as well! 11) clear, optimized code: learn how things can be done fast in VB. Also great example on how to make an ActiveX control with VB. If you like it, please vote & rate :)
Gradient label! And no, it's not the label's background that has the gradient: it's the text. This is just a control I spend some time with, I wanted a label that doesn't blink and which I could use for big headers. It can do word wrap, autosizing, gradient horizontally and vertically and it has Change and Resize events. The code is commented! Made with VB5CCE and the example program with VB6. Remove the Split function before compiling with VB6! Hope you like it.
A cool cave flying game engine. It's not complete, but it allows already quite much expanding with ease. Supports/includes: 1) random level generation 2) flying particles 3) gravity 4) objects (bullets and such) 5) explosions 6) destroyable terrain 7) automatic FPS control [it's not perfect, slow but works, tries to make the game playable even on an low end system] 8) gamepad/joystic support [in the future, this should help expanding multiplaying: ie. one uses keyboard, three players use USB gamepads] 9) original ship controlling [currently only one player] | My plans are to expand this engine so that it would be easy to create a full game. I'm also considering multiplaying over the internet, but that once I'm done with most of the other. And yes, better graphics would be nice :) | In the main module you can find all kinds of values you might want to edit. Try making the bullet bounce all around the terrain... :) [tip: set CollisionDie = False] | If you think you have something to offer to this little project, feel free to contact. I'm open to suggestions! I'm atleast thinking to add 1) computer players with AI 2) layered level 3) optimize performance [not to draw things not visible to the screen(s) etc.] | Reposted, instead of editing I managed to destroy the whole code. Expect updated and expanded version next month :)
This is a good collision detection that can be used in real time action games. Many, many game developers might find this one useful. I also included gravity and pressure (which you can disable). Enjoy. I'm making a better version of this to my Underground game which source code I'm going to update soon.
You probably have had a need for a unicode label sometime. And maybe need for a label that doesn't blink all the time. I made this usercontrol so you can easily without any hacks have unicode text in your programs. Just include the usercontrol in your project and you're ready to go with it. *** Features: unicode capability under NT4/2000/XP, all the events and properties the default VB label has, autoredraw to enabled/disable blinking. The code is fully commented and being a rather simple control, it should be easy to learn how to make usercontrols. One API call is also introduced. *** Comments and votes welcome - the more interest, the more likely I'm to do more FREE unicode controls :)
This is a new cool progress bar control. I've been doing it two days, based partly on my previos progress bar (I submitted it now already as I'm doing my military service and are therefore limited in time). Though this one is different by looks and is also improved by speed. At the moment the control is not complete, there are properties that are not yet finished. Despite this fact, the control does work. I wish you like that control and that it's customizable :) You can change borders' style, all the colors (15 different), direction (right, up, left, down), set text on it, custom done text and so on.