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 / Can't erase characters from a string in a textbox

Author
Message
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 13th Jun 2009 21:44 Edited at: 13th Jun 2009 21:51
I thought I had figured this problem out a while ago but I haven't

I'm making a basic bare-bones user interface, with buttons, scrollbars and textboxes and such, and I am having trouble with my textbox. I can't figure out how to properly erase characters from the content string.

I can't use entry$(1) because that would mean that the entire content of the textbox has to be in the entry buffer. What I am doing is using entry$() to add individual characters to the content string, and manually subtracting characters from the end when keystate(14)=1. But i'm having problems with that; when I hold down the backspace key for a short period, it gets to erase about three characters, but if I hold it any longer it starts adding spaces to the end of it, which is the opposite of what's supposed to happen.


my test project is media-free, and here is the code

main.dba


userInterface.dba



halp







OH WAIT
i just fixed it


new uiTextboxWrite() function:



Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Jun 2009 00:19
If you set the entry buffer to not auto-erase, you should be able to erase whenever discovering a char(8) in there, I believe.

Oh wait, you solved it already

Login to post a reply

Server time is: 2024-09-28 08:23:34
Your offset time is: 2024-09-28 08:23:34