Announcement

Collapse
No announcement yet.

Touch and type in text box

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Touch and type in text box

    I'm seeking a nudge in the right direction. My VisiGenie project targets a Diablo16 board and the goal is text boxes that the user can touch to pop-up a keyboard where they can then type into the box. Can someone please point me in the right general direction for (1) How do I make a box that can hold text, and (2) how do I detect that the user has touched the box and then pop-up a keyboard that types into the box? Can this all be handled in the VisiGenie project, or is the proper way to somehow detect where the screen was touched and send those coordinates over serial to my processor where I then calculate whether the touch was inside one of my boxes, and if so then somehow trigger the keyboard to pop-up and then direct all keyboard input to that box?

    Also I've drawn boxes and put "labels" inside them, but the labels keep getting hidden behind the boxes. If I make the boxes not "filled" the border disappears. Is there a way to specify the Z priority so the text stays on top, or make the boxes transparent so they don't hide the text? I copied an image below, you can see most of the boxes are hiding their strings.


    Click image for larger version  Name:	temp.jpg Views:	0 Size:	15.1 KB ID:	71012
    Last edited by MattFL; 22 January 2020, 11:55 AM.

  • #2
    Hi Mat,

    Welcome to the forum!

    This can be achieved using the ViSi-Gene Magic (available on Workshop4 PRO version).

    (1). You can use the "Strings" widget to display some texts on the screen or just a simple print() function specifying the location where it can be printed. If you want to create a border to encapsulate the text, use the "Rectangle" on the Primitives Tab.

    (2). You can specify the touched area by using the "TouchXpos" - which returns the x-coordinates of the touch region, and the "TouchYpos" - which returns the y-coordinates of the touch region. (Please refer to the ViSi-Genie Reference Manual for more information). For the keyboard, can I ask if it is necessary to produce a pop-up image? Can't you just show the keyboard when the form activates? Or you don't have enough space on your GUI? If you will be adding a keyboard on top of other widgets, you must first disable the widgets, and hide them accordingly.

    If you will be editing the texts which you have touched, it will be better if you can implement a buffer to store the data.

    This can all be done by adding snippets of code to your program.

    I hope this helps.

    Best Regards,
    Kevin

    Comment


    • #3
      Thank you very much for the reply, this helps a lot! The keyboard does not need to pop-up necessarily, just appear in some way so the user can type, and disappear when they are done. My device is actually a 3.5" screen so not much room, it is even OK (maybe best?) to load a new form to show the keyboard and a text box when the user touches in the box to type. The picture above is a screen shot of my GUI, so for example when the user touches the "IP Address" box I need to present a way for the user to type in a new IP address.

      Is this functionality possible with the standard Workshop application, or is the Pro version mandatory?

      Comment


      • #4
        Hello,

        Yes, introducing a new form with the keyboard and text should be much easier to implement. To navigate to a new form, you can use a "button" widget. The "string" widget does not have a touch input wherein you can set/change forms (although this is possible on ViSi-Genie Magic).

        I would recommend you to put a "button" besides the text - this should trigger a change form which contains the "keyboard" and a "string" widget. On the keyboard widget, set the 'OnChanged Event' to Report Message. The host controller should receive the bytes as a standard 6-byte message. Process the bytes and get the value for every key pressed then update the text on the string by sending a "WriteStr" command. If you navigate back to the previous form, do not forget to send another "WriteStr" command to update the text on that form.

        I hope this helps.

        Best Regards,
        Kevin

        Comment

        Working...
        X