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.

AGK Product Chat / Text Input and v1075

Author
Message
DaveP
User Offline
Joined: 11th Sep 2011
Location:
Posted: 4th Jun 2012 10:17
I'm trying out v1075 in tier 2 (bought last year, finally cracking it open!) and now have the examples working - mostly. One that is troublesome is the text input, which doesn't allow any keys in Windows except for Esc and Return.

Looking through the forum, I understand the text input is not quite up to snuff, but this seems more than that - is this a case of 1075 being broken, or does Windows ignore most of the keyboard for some reason?

Also, according to the docs, agk::GetTextInput() returns a char* - how do we handle the value? Do we manage memory for that (and if so, do we use delete[] or free()?) or if the system does, when does the value go out of scope?

Finally, is there an anticipated timeline for a working text box, or do you recommend I roll my own for now?

Thanks
BatVink
Moderator
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Jun 2012 12:24
You should replace TextInput with Editbox functionality, which is a much richer set of commands and control.

I can't comment on the Tier 2 experience, but it's working better for me in Tier 1. I still have some issues, but hopefully they'll be down to my misunderstanding.

DaveP
User Offline
Joined: 11th Sep 2011
Location:
Posted: 4th Jun 2012 23:49
Excellent! I'm digging into it now... any examples?

I notice this too requires a string returned for the result - does anyone know the proper way to manage its memory in tier 2 as well?
Ancient Lady
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Jun 2012 00:17
Here is a complete example, with fancy bits:
+ Code Snippet

It should be noted that input fields should be displayed 'high' enough on the page to allow for the pop-up keyboard on portable devices. This sample doesn't do that, it just shows off getting multiple inputs in one screen.

Cheers,
Ancient Lady
DaveP
User Offline
Joined: 11th Sep 2011
Location:
Posted: 5th Jun 2012 07:37
Thanks very much!
Paul Johnston
TGC Developer
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th Jun 2012 03:17
Quote: "One that is troublesome is the text input, which doesn't allow any keys in Windows except for Esc and Return."


This can happen if the Core.cpp files is not up to date, the latest should be in the AGK\IDE\apps\interpreter folder.

Quote: "Also, according to the docs, agk::GetTextInput() returns a char* - how do we handle the value? Do we manage memory for that (and if so, do we use delete[] or free()?)"


You should delete the string when you are done with it using delete[]. In general you can assume that if an AGK function returns char* then you are given control of the memory, if it returns const char* then the string is handled by AGK and could disappear at any time (for example reusing an HTTP connection by sending a request deletes any existing response string returned by GetResponseC)

Login to post a reply

Server time is: 2016-07-29 19:45:04
Your offset time is: 2016-07-29 19:45:04