The Game Creators
The Game Creators Home Online Shop Click to Login
  Hot: Christmas CompetitionNovember NewsletterModel Pack 36DB Pro Pack 2009DGS BonanzaCharacter PackFPS Creator Bonanza;
The Game Creators
Code Snippets / [DBC] Media-Less GUI Function Collection

Go to the first page of this board Return to the Forum Menu Post Message
32 Messages - Page   of 1   
Bookmark and Share Search the Forum

Author Message
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 18th Jan 2008 13:41     Edited: 23rd Jan 2008 12:38     | link | toggle

This collection of functions for DB Classic (V1.2 but should work fine in V1.13) does not use a dll or external media so can be used with all versions of DBC.

It includes:

* Message Box - Display a simple message with OK button.
* Alert Box - Confirmation with Yes/No buttons, with or without icon.
* Input Box - Easily allow users to enter/edit text and numbers.
* Colour Picker - Allows users to select a colour (inc RGB tool-tip).


Usage:

Place the "Alerts.dba" file in the same folder as your main DBA file and add the line:

#Include "Alerts.dba"

[Edit] Note: Updated (2nd) version now called GUI.dba instead of Alerts.dba.

as the first line of your program. The demo program included in the attached zip (5K) shows how the functions are used.

Reports on problems, additions etc. welcome.

TDK_Man

Back to top
TDK\'s Web Site
Download: alerts.zip Size: 4263 bytesReport this message as abusive
Sinani201

User


Joined: Mon Apr 16th 2007
Location: tats a vry god cuestan lololol
Posted: 18th Jan 2008 17:48           | link | toggle

Cool!

Seriously, how do you make the little blue text come up below your message?
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 19th Jan 2008 16:49     Edited: 19th Jan 2008 16:52     | link | toggle

Following a little update to my Fileselector function, it occurred to me that it should be part of this little set of GUI functions.

So, it's now included and to avoid confusion with the first version, the #Include file is now called GUI.dba.

New version of the demo program also included in the attached zip file (now 10K).

And, as I forgot in the first post, here's a series of screen snapshots of what you get on the screen from each function:



TDK_Man

Back to top
TDK\'s Web Site
Download: AlertsV1.2.zip Size: 9813 bytesReport this message as abusive
Jmahmood

User


Joined: Tue Apr 3rd 2007
Location: not sure
Posted: 21st Jan 2008 09:56           | link | toggle

the color picker is just what i was looking for R.T.M.
Thanks TDK

Back to top
Report this message as abusive
Zombie 20

User


Joined: Sun Nov 26th 2006
Location: Etters, PA
Posted: 21st Jan 2008 13:49           | link | toggle

Wow thank you very much TDK , very nice of you.


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
Back to top
Send AIM user a message
Report this message as abusive
Kohaku

User


Joined: Mon May 3rd 2004
Location: The not very United Kingdom
Posted: 23rd Jan 2008 16:45           | link | toggle

Very nice!

I only use DBP nowadays but you make the original DB look awesome; I almost miss it.


You are not alone.
Back to top
developing augmentation
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 31st Jan 2008 19:42           | link | toggle

Version 1.3 Update:

Now called GUI.dba, the #Include file now has a MemoBox function.



It can display multiple lines of formatted text (non-editable) in a window, complete with scroll bar to view lines not visible and an OK button.

Text is automatically word wrapped to fit the box.

All you do is supply the width and height of the required text box - and of course the text itself, which can even be a text file!

Zip file (12K) can be downloaded here.

Includes updated demo program.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Zotoaster

User


Joined: Mon Dec 20th 2004
Location: Scotland
Posted: 31st Jan 2008 19:53           | link | toggle

This is really impressive. Nice work man

Your signature has been erased by a mod
Back to top
Report this message as abusive
Blood Of The Prophets

User


Joined: Tue Nov 6th 2007
Location: Cyberspace
Posted: 7th Feb 2008 11:39           | link | toggle

Very impressive. I'm halfway through converting your code to the DarkGDK commands at the minute. But from what i can see in DBPro it would be very easy for me to add new controls like check boxes and radio buttons.
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 8th Feb 2008 08:26           | link | toggle

Quote: "in DBPro it would be very easy for me to add new controls like check boxes and radio buttons."

Yes, it's not difficult in DBC either - I have an incomplete GUI Component Designer in DBC that lets you add things like that to panels - similar to the way that Delphi works when you create a form.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
LBFN

User


Joined: Sat Apr 7th 2007
Location: USA
Posted: 10th Feb 2008 20:41           | link | toggle

Very cool TDK! Nice work.

LB
Back to top
Report this message as abusive
OBese87

User


Joined: Fri Jun 30th 2006
Location: On Toast
Posted: 12th Feb 2008 12:57           | link | toggle

Looking good TDK
Glad to see you still working on this.
Excuse me for asking what is probably an obvious question, but (assuming you will make forms with check boxes and radio buttons etc) how will the user's choice be returned?

Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 12th Feb 2008 23:25           | link | toggle

First of all, to keep it simple, normal buttons and radio buttons won't be combined on the same form.

For example, the ButtonBar lets you easily create a row, column or grid of buttons on a panel. When you click on one, the number of the button is returned.

Whether it acts as a radio button or a normal button isn't relevant to anything other than how the button behaves on the screen. (Stays down while the previously selected one pops back up - or it pops back up automatically when you release the mouse button).

The same goes for multiple choice radio selectors - you know the type where you have small circles in which a black dot appears in the middle when you select one. When you make your choice, the number of the one selected when you click on the OK button is returned from the function.

Anyway...

Version Release 1.4:

Now including the ButtonBar function. Actually, there are two functions - one to create the ButtonBar:

ButtonBar_Create(ButtonBarPosX,ButtonBarPosY,ButtonsAcross,ButtonsDown,32,32,"Keypad",101,201)

..and the other to poll it which is placed in your main program loop:

ButtonPressed = ButtonBar_Poll(ButtonBarPosX,ButtonBarPosY,ButtonsAcross,ButtonsDown,32,32,Radio)

See the demo program for more details.



Download here.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Robert The Robot

User


Joined: Mon Jan 8th 2007
Location: Fireball XL5
Posted: 15th Feb 2008 03:34           | link | toggle

Wow!! This is absolutely Fantastic! Thanks TDK!!!

Did you hear about the two criminals who crashed their getaway car into a cement mixer? Police are looking for two hardened criminals...
Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 9th Mar 2008 01:41           | link | toggle

The latest version now also has a TriInputBox function which allows you to enter three values at the same time.

This is for situations like entering R, G and B values or X, Y and Z co-ordinates/angles but at the same time - rather than using the InputBox function three times.

I've also decided to rewrite the functions using sprites as I've discovered they aren't too clever when used in a 3D environment. I'll post the new update in the next few days.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Sasuke

User


Joined: Fri Dec 2nd 2005
Location: Milton Keynes UK
Posted: 13th Mar 2008 08:28     Edited: 13th Mar 2008 08:29     | link | toggle

Great work as usual TDK, can't wait to see what you come up with next
Back to top
Report this message as abusive
Google Ad
Back to top
 
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 13th Mar 2008 19:50     Edited: 13th Mar 2008 20:05     | link | toggle

EDIT: I got this working and everything, however, if I use it to display alert messages in a game that uses 3d objects it doesn't show up however it suspends the program, any way around this? Or could it be that Im using DBPRO?

Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 15th Mar 2008 00:03     Edited: 15th Mar 2008 00:09     | link | toggle

There's no way round the program stopping while you wait for the user to click on a component button in this version, but a quick fix for 3D is to use:

Set Camera View 0,0,1,1

on the line before calling the function and

Set Camera View 0,0,Screen Width(),Screen Height()

on the line following the function call.

This is one of the reasons I'm rewriting the functions. (Currently being tested with this: http://forum.thegamecreators.com/?m=forum_view&t=125358&b=10)

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 17th Mar 2008 16:02     Edited: 17th Mar 2008 17:05     | link | toggle

Edit: it doesn't seem to want to work could it be because I'm using DBPro?

Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 18th Mar 2008 20:33           | link | toggle

Probably yes.

What is it doing (out of interest)?

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 26th Mar 2008 16:29           | link | toggle

it simply refuses to display anything...

Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 27th Mar 2008 18:33           | link | toggle

Even if you do what I said a couple of posts above?

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 27th Mar 2008 19:47     Edited: 27th Mar 2008 21:02     | link | toggle

actually it appears to work now although..now I have the problem of deciding whether to use these GUI functions or the ones posted under "More Windows!!!!" thread.

edit: I just noticed the colour picker zooms in extremely close when picking a colour. Is this supposed to happen? Also, this is just a nooby question , is it possible to change the colour of the GUI functions?

Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 28th Mar 2008 10:33           | link | toggle

Quote: "the colour picker zooms in extremely close when picking a colour. Is this supposed to happen?"

Sorry - don't know what you mean with that one...

Quote: "is it possible to change the colour of the GUI functions?"

Yes - just change the RGB lines.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 28th Mar 2008 16:13           | link | toggle

Quote: "Quote: "the colour picker zooms in extremely close when picking a colour. Is this supposed to happen?"

Sorry - don't know what you mean with that one..."

Ok, I'll post a screenshot when I get home.


Quote: "Quote: "is it possible to change the colour of the GUI functions?"

Yes - just change the RGB lines."

Oh! lol. Much simpler then I though .

Thanks for the help,
Data

Back to top
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 1st Apr 2008 23:00           | link | toggle

o nvm! it seems to have worked now

Back to top
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 24th May 2008 17:08           | link | toggle

Hi TDK,

I've been using all these functions and I must say they're absolutely great! However, lately, when I attempted to use the file browser function for the first time (never needed that one until now) it comes up with an error message that says 'Array out of bounds'. Any idea what I could be doing wrong?

Also, a perhaps less urgent question, is there any possible way to launch two of these functions at the same time? For instance, the memo box and a input box at the same time?

Thanks
Data

Back to top
Report this message as abusive
TDK

Moderator


Joined: Tue Nov 19th 2002
Location: Tenerife, Spain
Posted: 25th May 2008 14:40           | link | toggle

Without multitasking that would be a little difficult. Being functions, it's the nature of things in DB that once called they must complete and return a value (or not) before the next line of your program is executed.

You would need to turn the functions into procedures which exit without doing anything and write a handler routine to call them if required once each time around the main loop.

Sounds like a lot of work to me...

As for the error, are you using DBC or Pro, as I seem to remember that problem cropping up for DBP users and it was fixed. Try this version:

http://www.computechtenerife.com/zips/fileselectv2b.zip

If it works OK, simply delete the fileselector function in the GUI collection Include file and #Include the new one you download.

TDK_Man

Back to top
TDK\'s Web Site
Report this message as abusive
Data

User


Joined: Fri Nov 26th 2004
Location: Winnipeg,Canada
Posted: 26th May 2008 18:27           | link | toggle

Thanks! the new one appears to work as I was using DBP.

Back to top
Report this message as abusive
Invincibob 8

User


Joined: Mon Feb 4th 2008
Location: The Platefield Universe
Posted: 3rd Jul 2008 11:09     Edited: 3rd Jul 2008 14:27     | link | toggle

I keep getting a window that shows up like this. I did what the example and the actual functions file said, but it still happened.

Back to top
Platefield Productions
Download: error.bmp Size: 1423254 bytesReport this message as abusive
TheComet

User


Joined: Thu Oct 18th 2007
Location: Conker rulz!
Posted: 14th Jul 2008 13:58           | link | toggle

This is sooooooo cool!!! You used these functions in your Level maker, didn`t you?

Fantastic job, TDK!

TheComet

Back to top
http://www.the-comet.blogspot.com
Report this message as abusive
TheComet

User


Joined: Thu Oct 18th 2007
Location: Conker rulz!
Posted: 18th Jul 2008 11:10     Edited: 26th Jul 2008 06:00     | link | toggle

Sorry for double posting, but you have an error with the "TDK`s funky MemoBox":

Runtime Error, cannot divide by zero!

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
Back to top
http://www.the-comet.blogspot.com
Report this message as abusive

Go to the first page of this board Return to the Forum Menu Post Message
32 Messages - Page   of 1   
Search the Forum

Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.

Forum Search

Enter a word or phrase to search our Forum for:

Thread Subject Search
Search Phrase:
Search Scope: Entire forum
Just this board
 
Google Forum Search
Search Phrase:
 
Apollo v2.02


Game Creator Store
Privacy Policy AUP Top of Page