Announcement

Collapse
No announcement yet.

Dynamic text

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

  • Dynamic text

    Hi all,

    I want to make a dynamic interface with 6 buttons on the screen with customizable labels.

    The idea is to put a TXT file on the SD card with one label per line and to print the 6 labels on top of the 6 buttons.

    My question is: which text widget should I use (String?) and how can I print the text from the TXT file into the correct string?
    Which way are the string widgets identified in the code in VISI?

    Thanks in advance!

  • #2


    Because you are in ViSi you can do it any way you want, even using simple print() after drawing each button. Of course the font will look a bit 'plain' and that's why you probably want to use strings.

    The Picaso Visi 'stringsdemo' shows you how to do all of that, the strings object also builds the txt file for you.
    Mark

    Comment


    • #3
      Thanks for your answer.I am using 'Fancy buttons' so "printing after drawing each button" as you suggest, doesn't seem to be working correctly.I'm currently doing the following:1) Print all buttons[HTML]// Winbutton1 1.0 generated 25/06/2013 21:30:09
      img_ClearAttributes(hndl, iWinbutton1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
      img_Show(hndl, iWinbutton1); // show button, only do this once2) Read all labels from the TXT file and print a STRING on top of the button[HTML]if (file_Exists("LABELS.txt"))
      label_hndl := file_Open("LABELS.txt", 'r'); // Open file
      for (i:=0; i

      Comment


      • #4


        No, you have to write the string after each redraw of the button, there is no Z order.

        With a bit of clever coding you can have a routine that does it automatically when you change the button's state.
        Mark

        Comment

        Working...
        X