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.

Code Snippets / 10 NEW functions for BUTTONS plus some extras (It couldn't get any easier!)

Author
Message
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 6th Sep 2005 03:04 Edited at: 18th Sep 2005 01:18
EDIT: NOW updated with 3 more NEW functions!

This function set will let you have complete control over your buttons and will save you alot of time, because they ARE VERY EFFECTIVE and EASY TO USE. Give 'em a try.

Just keep in mind that at the moment they are only for DBPro, simply because the functions use a global array, and DBC doesn't support global arrays. If anyone needs a DBC version then just let me know.

ALSO FOR THE DEMO know that it uses a bitmap for the backdrop so make sure you get it before running the demo.

Here's a COMPLETE LIST of all 13 functions:


Here's a DETAILED DESCRIPTION and SYNTAX of all the functions:


Here's all the FUNCTION'S code:


Here's the DEMO code:


Now BE SURE to save the FUNCTIONS as a .dba file called ButtonFunctions, and be sure to KEEP THAT FILE IN SAME DIRECTORY AS THE FILE THAT WILL USE THE FUNCTIONS. Also MAKE SURE THAT YOU USE THE #INCLUDE command to include the ButtonFunctions.dba file with your MAIN SCOURCE file.

I've also included a .zip file with this post that includes the
following in it:


-ButtonFunctions - Descriptions.txt
-ButtonFunctions - List.txt
-Menu.bmp (you need this for the demo to work!)
-ButtonFunctions DEMO.dbpro
-ButtonFunctions DEMO.dba
-ButtonFunctions.dba
-Thread Post.txt

If you just get the .zip file and open it up you can just run the
ButtonFunctions DEMO file in DBPRO and test it out. Now I've
tested all of these functions quite a bit, and I'm pretty sure that
I've fixed all the bugs, but if you do happen to find a bug, then please report it to me as soon as possible. ENJOY!

Attachments

Login to view attachments
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 9th Sep 2005 16:16
nice code

AMD 2,4 512MB RAM,2x200GB hdd,GforceFX5700GT128MB
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 14th Sep 2005 00:52
Thanks

As anybody found this useful? Also any bugs?

Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 17th Sep 2005 23:31 Edited at: 18th Sep 2005 01:18
I've added two NEW functions, which are DefineButtonsToFile() and CreateButtonsFromDefinationFile(). They save a TON of time!

Instead of opening up a program like paint and writing down all the coordinates of your buttons, and then typing the coordinates into DBPro you can just use these two new functions I created.

The basic idea was taken from one of TDK Man's programs for DBC. The program he created was pretty cool, but it was a little confussing and it didn't work with my functions or DBPro for that matter. So, I made my own version with these two functions.

All you do is first paste whatever you want on the screen like the backdrop for the buttons, and then use the DefineButtonsToFile() function. It will give you a crosshair cursor that fills up the whole screen, so you get accurate coordniates instead of guessing. The cursor's coordinates are displayed at the top of the screen as well as some other usefull information. You then move the cursor to the Top-Left of the button and Left-Click and hold. Then move the cursor to the Bottom-Right of the button and release. The Button data will be stored in a file that you can acces at any time. Also by doing a Right-Click you can view or edit that data and close out of the data, and you'll be back in the function. To end the function just hit the ESC key.

Then you can use the CreateButtonsFromDefinationsFile() function to automatically created all those buttons, so you DON'T have to type them in, you won't even have to use the CreateButton() function.

Basically these two functions save so much time! definatly give 'em a try. I haven't found any bugs, but let me know if you find one.

EDIT: My first post is now updated!

Login to post a reply

Server time is: 2025-05-15 22:14:57
Your offset time is: 2025-05-15 22:14:57