Gui.Gettext function

Feature requested and implemented
User avatar
cicciocb
Site Admin
Posts: 2795
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 594 times
Been thanked: 2006 times
Contact:

Re: Gui.Gettext function

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Dec 09, 2024 6:13 pm You could write us an onscreen keyboard :D
Is already into the TODO list
User avatar
cicciocb
Site Admin
Posts: 2795
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 594 times
Been thanked: 2006 times
Contact:

Re: Gui.Gettext function

Post by cicciocb »

You can eventually use an external BLE keyboard or USB keyboard if you are using the ESP32-S3
User avatar
cicciocb
Site Admin
Posts: 2795
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 594 times
Been thanked: 2006 times
Contact:

Re: Gui.Gettext function

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Dec 09, 2024 6:13 pm You could write us an onscreen keyboard :D
What is the module that you are using ? ESP32 classic or ESP32-S3?

edit:
I implemented the tft.gettext and the tft.textarea functions ... if you want try just let me know what is the version that you are using so that I can export the right .bin
User avatar
karlkloss
Posts: 180
Joined: Fri Aug 18, 2023 12:21 pm
Has thanked: 25 times
Been thanked: 40 times

Re: Gui.Gettext function

Post by karlkloss »

Thanks, you're the best. That'll make things much easier for me.

I'm always switching between several boards, but at the moment I'm using an ESP32-2432S028, so standard ESP32 without PSRAM.
User avatar
karlkloss
Posts: 180
Joined: Fri Aug 18, 2023 12:21 pm
Has thanked: 25 times
Been thanked: 40 times

Re: Gui.Gettext function

Post by karlkloss »

Oh, and one question: Is there a way to find out how many characters fit into the textarea, resp. how many it has been able to display?
User avatar
cicciocb
Site Admin
Posts: 2795
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 594 times
Been thanked: 2006 times
Contact:

Re: Gui.Gettext function

Post by cicciocb »

I've just updated the version 1.70.5 that contains the following fixes :

Code: [Local Link Removed for Guests]

Version 1.70.5
- Fixex onUrlMessage event
TFT
    - Implemented gui.textarea (same syntax as the VGAGUI.TEXTAREA)
    - Fixed the repetitive event on button when the text changes inside
    - Implemented GUI.GetText (same as VGAGUI.GETTEXT)
    - Implemented GUI.Visible obj, visible (0=hidden, 1=shown)
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Dec 10, 2024 8:13 am Oh, and one question: Is there a way to find out how many characters fit into the textarea, resp. how many it has been able to display?
No, this info is not avalable but could be implemented
User avatar
karlkloss
Posts: 180
Joined: Fri Aug 18, 2023 12:21 pm
Has thanked: 25 times
Been thanked: 40 times

Re: Gui.Gettext function

Post by karlkloss »

Nice, thank you.
No, this info is not avalable but could be implemented
You could simply cut off the text when it is longer than the textarea can display, and then the user can just call len(GUI.GetText(textfieldhandle)).
BeanieBots
Posts: 524
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 294 times
Been thanked: 165 times

Re: Gui.Gettext function

Post by BeanieBots »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Dec 09, 2024 5:17 pm ... is there a possibility to tell a subroutine who called it, and what to call when it closes?
Like an addressof (subroutinelabel) function, and a gosub address?
...
I think what you are describing is what I know as a "state engine".
The caller assigns a value to a 'state' variable. Hence, the sub knows who called it.
Also, (somebody correct me if I have this wrong) subroutines can be called by using a string to hold the name. An array of strings could enable calling subroutines by variable value. A similar function could also be structured within a select/case function.
Maybe not exactly what you are after but a potential workaround?
Post Reply