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.

Dark GDK / Hmm? Textboxes?

Author
Message
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 24th May 2009 11:54
I know this question has been asked countless times, but I don't really see a real explination for Dark GDK users other than, google win32api.

Well I googled win32 api textbox tutorial and they all show me how to create new windows and such with text boxes in them, but I already have my window with my game in it.

I just want to be able to add a textbox for text input, just one thats it, using c++ functions or gdk functions I don't care how it's done I just need some sort of example to learn off of so I can apply a version of my own to my game.

Thank yous! =]

I <3 C++ & Dark GDK 4 2 maek mai gamezorz! =D
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 24th May 2009 12:15
I've been working on this problem recently and my solution was to use the dbEntry command to create a char* array that I would output to the screen. After capturing this string you have to remove any escape characters from it, such as the backspace or tab characters. The way I am doing this now is brutish and ugly and doesn't seem to work properly with the tab character yet, I am going to likely reprogram it before putting it into my main game.

Here is the code, put this in your main loop:

I really suggest changing my example as it is really programmed badly.



I attached to this post the server and chat client I am working on for my game (I will eventually integrate the above code into my game for a chat box), it should show you the code in action.

------------------------------------
Currently 1500+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.

Attachments

Login to view attachments
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 24th May 2009 12:29
i thought about using dbEntry but i figured it would make the program halt and force a user to type something in and only continue after they were finnished, i guess not though haha!

I <3 C++ & Dark GDK 4 2 maek mai gamezorz! =D
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 24th May 2009 15:39
Quote: "thought about using dbEntry but i figured it would make the program halt and force a user to type something in and only continue after they were finnished, i guess not though haha!"


dbInput stops the program, dbEntry does not do this

Koesak
15
Years of Service
User Offline
Joined: 20th Jan 2009
Location:
Posted: 27th May 2009 05:24
How are you detecting a backspace? I'm currently working on a textbox class (shaping up quite nicely but sloppy atm) and noticed that dbEntry() does not pick up the backspace, or any escape characters for that matter. I know I use to be able to get them from DBP but if my memory serves me correctly one of the previous patches (6.? I think) automatically removes them...

If anyone can shed some light of this it would really be appreciated.

A

Login to post a reply

Server time is: 2024-11-05 18:51:23
Your offset time is: 2024-11-05 18:51:23