No announcement yet.

Change String BG color with Magic Event

  • Filter
  • Time
  • Show
Clear All
new posts

  • Change String BG color with Magic Event


    I am making forms with Visi-Genie PRO for an User Interface, in which there are several cells (made with strings) that must be touched in order to change the value of the cell's parameter.
    I need this parameter to be controlled by a host, so I am sending report messages with buttons and returning the value of the cell sending Write_str cmds (I already know the IDs of all the strings and this is the way in which my host program undestand which parameter of the user interfaces has been change)

    My point is that I need to modify the appearance parameters of the string (such as the foreground colour or the font style) when some event are triggered (such as a magic button is released), I know that I can use 4GDL code once this event is triggered but I am not very certain about how to make reference to a certain String using its StringID and the txt_BGcolour for instance.
    I am very new novice with this language and I will be very gratefull if anyone could help me.

    Best regards


    Attached Files

  • #2
    Hi Eduardo,

    In using Workshop4 IDE, the widgets’ attributes can be in the Object Inspector. For the strings object, it includes the string style, font: style, size, and color, as well as the background color. Referring to the discussion in the Visi–Genie Reference Manual under the Genie Magic section, it is stated that the String object is a read-only variable which means the parameters cannot be modified or changed during runtime.
    Click image for larger version

Name:	ReadOnly.jpg
Views:	270
Size:	105.1 KB
ID:	65306
    On the other hand, you may still implement the altering of the foreground color and/or font style by creating another String object which will be activated whenever an event was made. Activating another String widget can be made using the PrintStrings function which is mentioned the Genie Magic Callable Functions. Thus, only Strings function enables you to print data with different font styles and font colors in your project.
    Click image for larger version

Name:	PrintStrigs.jpg
Views:	172
Size:	21.9 KB
ID:	65307 ​​​​​​​

    Hope this helps.

    Best Regards,


    • #3
      Dear Danica,

      Thank you so much for your answer, I have solved the issue establishing my own command communication between the host and the screen using 4GDL code and magic objects, and it works fine.

      Cheers, Eduardo.


      • #4
        Hi Eduardo,

        Glad to hear that the issue was solved.
        If you need further assistance, please do not hesitate to visit the forum.

        Best Regards,