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.

Newcomers DBPro Corner / INPUT and editing Strings

Author
Message
Pyro_guy
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 13th Jul 2004 03:19
How would I go about creating something similar to the Windows textbox?
(I dont care about how it looks, that command-prompt black and white text will work fine)

I will attempt to describe what I want below:
When the user clicks in a certain area, and input is 'activated' allowing the user to type in their desired string. When the user presses return or clicks out of the text area, the string is displayed as text. However, I can seem to figure out how to allow an INPUT command to actually EDIT a string, it seems that 're-activating' the INPUT will erase the entire string and allow the user to enter different data.

thanks

Screw the rules...what can i blow up?
Pyro_guy
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 13th Jul 2004 03:21 Edited at: 13th Jul 2004 04:24
I have the whole 'user clicks to activate and deactivate part' nailed, I just need the 'edit string' part

DarkBASIC pro, By the way

(I wish there was an 'Edit' feature for your posts, I always end up double posting )

EDIT: Well I'm just blind then!

Screw the rules...what can i blow up?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Jul 2004 03:54
a) each of your posts has an edit feature

b)if you are using the INPUT command, have the string that it displays the same as the current variable that is going to be altered


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
Pyro_guy
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 13th Jul 2004 04:30
I found the edit button, lol

When I setup the INPUT command like this:



It displays my text$ string, but I cannot backspace to delete it
It acts like the C:\ part of the DoS command prompt

What I need is a way to make the second text$ string load into the INPUT as if it has just been typed inm so it can be backspaced and edited by the user

Screw the rules...what can i blow up?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 13th Jul 2004 04:36
oh, I don't think you can do that (inject a string into the part of the prompt that the cursor is at and that is editable)
Maybe someone else has done this?

Have you looked at RobK's blue gui stuff for dbp?
Or there are free plugins that have windows input fields in them, our plugin included


DBP_NETLIB_v1.4.3 - 65 FREE Functions * Click Logo
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 13th Jul 2004 06:24
I've just added my text input routine to the code snippets

http://forum.thegamecreators.com/?m=forum_view&t=35092&b=6

It will need modification for mouse use but currently serves me well in my game engine.

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 14th Jul 2004 12:12
i am not for sure
but what about this

i didn't test this
(i may have got confused with blitz)

Simple-Apps.no-ip.com
good yet simple
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 14th Jul 2004 12:12
add $
as appropiatly

Simple-Apps.no-ip.com
good yet simple
Pyro_guy
20
Years of Service
User Offline
Joined: 10th Oct 2003
Location: England
Posted: 16th Jul 2004 19:39
Using hackr83's method I get an error saying
"the variable 'input' name is not valid"

jasuk70, wow thats alot of code for me to use for a single line name entry, lol. It is what I was looking for, just with more features, I think i'll use CattleRustler's plugin because of its simplicity though

Thanks guys!

Screw the rules...what can i blow up?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 16th Jul 2004 19:46
Input is already the name of a command as so can't be the name of a variable.

Take a look at inkey$(). It stores the letter currently being pressed from the keyboard:



You'll have to type slowly

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 16th Jul 2004 21:02
I find it's best to use ENTRY$()



can i scream
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 16th Jul 2004 23:50
Pyro_guy: I've just recently added mouse support to it too Basically it was a general routine for inputting that I can use in any project I may undertake. And as RPG's are my favourite type of game I tend to use a lot of text.

This is my first attempt I made when starting out with DBP so in a bit simpler and just inputs a line of text. It also had a nice flickery cursor effect. This also uses the ENTRY$() function.



----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"

Login to post a reply

Server time is: 2024-09-22 16:22:37
Your offset time is: 2024-09-22 16:22:37