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.

AppGameKit Studio Chat / [SOLVED] How to detect when an EditBox is selected

Author
Message
Orion5
3
Years of Service
User Offline
Joined: 6th Jun 2020
Location: SPAIN
Posted: 27th Mar 2023 13:55
Hi all, I have been on this for several hours and driving me crazy!

I have 120 EditBoxes on screen. I need to detect when an editBox is first selected, as far as i can see there is no command for this? There is a command 'GetEditBoxChanged' which will identify the EditBox that has 'just' changed but not 'Just Selected'

The GetPointerPressed() function does not return a 1 when you click on an EditBox ????? Why? I could have used this to then identify the new EditBox selected using something like this:

If GetPointerPressed() = 1
edbox = GetCurrentEditBox
Endif

Any ideas that may help? Thank You

The author of this post has marked a post as an answer.

Go to answer

Orion5
3
Years of Service
User Offline
Joined: 6th Jun 2020
Location: SPAIN
Posted: 27th Mar 2023 14:54 Edited at: 27th Mar 2023 14:55
Hi all, finally sorted it!!!

I hold the previous EditBox ID in a variable 'edtest' and test if the current EditBox is different from edtest and then process. I needed to check for no previous EditBox ID i.e. (edtest = 0) but finally done.

I am writing and Android Electronic Point of Sale System (EPOS) for Bars with touchscreen input with facilities for On Screen Product Buttons, Bar Tabs, Receipt Printing, Stock Control and Reports.

Thank you for any considerations.

Orion5
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Mar 2023 16:05
you could try storing which editbox currently has focus via GetEditBoxHasFocus() and compare it to the last?
Orion5
3
Years of Service
User Offline
Joined: 6th Jun 2020
Location: SPAIN
Posted: 28th Mar 2023 09:13 Edited at: 28th Mar 2023 09:15
This post has been marked by the post author as the answer.
Yes thanks VN, that is what I have done and it works fine. I change the editbox background colour and text colour of the in-focus editbox. I have also implemented using the TAB key to move through the editboxes and detect end-of-line for a carriage return to the next row of edit boxes... All cool for now. Thanks again.

Image attached of basic product file panel.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 16:07:46
Your offset time is: 2024-04-26 16:07:46