Announcement

Collapse
No announcement yet.

Centering Strings in Visi-Genie

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

  • Centering Strings in Visi-Genie

    Hey Everybody,

    I have several strings on one of my forms. I use the Write String (ASCII) Message command to do this. Even though the text is centered in my Visi-Genie design, when the characters appear on screen, they are not centered.

    In creating the strings in Visi-Genie, I created strings that are ONE character and centered. For instance, I want one of the strings to provide cost info like $1, $23, $147. I want the dollar amount centered regardless of the number of characters. Since I know that the longest string will be 4 characters (no costs greater than $100), I could probably add concatenate some spaces at the beginning and end depending on the cost. Any suggestions????

    TIA,
    --Neal
    TIA,

    Neal

  • #2
    Yes, you will need to put spaces at the front. As per the manual, alignment only applies to static strings.

    Normally, two spaces = 1 'number'
    Mark

    Comment


    • #3
      Hello,

      this should definitely considered as feature request, as even my rudimentary e-paper graphics driver written for an 8-bit microcontroller was capable of that.
      And centering with spaces is highly inaccurate and font dependent.
      This is really an easy thing to implement

      I personally would love to see this working in future releases.

      Thanks!

      Comment


      • #4
        Hello,

        Thank you for your input, there is a function available in 4DGL for centering printed strings putstrCentred().
        But in order to do this in ViSi-genie you will need to use Magic codes.

        putstrCentred() prints a string centered at position x, y on the display.
        The string constants and data statement pointers are byte aligned.

        I have attached a sample code for reference. I hope it helps.

        Best regard,
        Bern
        Attached Files

        Comment

        Working...
        X