• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
GUI-O Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login

Label, Text input, alignment

Scheduled Pinned Locked Moved
Comments & Feedback
2
18
867
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K
    kl3m3n @DenesL
    last edited by kl3m3n 14 Feb 2023, 22:22

    @DenesL Hi.

    What about the second example? Creating background as a separate widget?

    @kl3m3n said in Label, Text input, alignment:

    "|BSR UID:bg1 X:50 Y:20 W:50 H:5 BTH:0\r\n"
    "|BSR UID:bg2 X:50 Y:26 W:50 H:5 BTH:0\r\n"
    "|BSR UID:bg3 X:50 Y:32 W:50 H:5 BTH:0\r\n"
    "|LB UID:lb1 X:25 Y:20 TXT:"My label 1" ALP:1\r\n"
    "|LB UID:lb2 X:25 Y:26 TXT:"My label 2" ALP:1\r\n"
    "|LB UID:lb3 X:25 Y:32 TXT:"My label 3" ALP:1\r\n"

    P. S.: I will update the designer tool, thank you for the reminder.

    Best regards,
    kl3m3n

    D 1 Reply Last reply 15 Feb 2023, 00:11 Reply Quote 0
    • D
      DenesL @kl3m3n
      last edited by DenesL 15 Feb 2023, 00:11

      @kl3m3n Hi!
      Nope.

      The problem is that ALP 1 aligns the text to the left of the center point i.e. the text ends at the center point, so the texts only seem to left align when they all have equal length (using monospaced fonts).

      You would have to do a lot of trial an error positioning for each widget to get all texts to appear to line up on the left while ending at a different center point. And then reposition the background boxes too. Same issue with any other ALP value.

      I hope I am being clear. I believe things look better when aligned, either on the left edge or the right one (same issue, just on the other side of the center point).

      Regards,
      Denes

      K 2 Replies Last reply 15 Feb 2023, 05:52 Reply Quote 0
      • K
        kl3m3n @DenesL
        last edited by 15 Feb 2023, 05:52

        @DenesL Hi!

        Ok, I understand now. I will see what I can do about this. I will let you know once I've fixed this!

        Best regards,
        kl3m3n

        1 Reply Last reply Reply Quote 0
        • K
          kl3m3n @DenesL
          last edited by kl3m3n 15 Feb 2023, 07:49

          @DenesL Hi.

          To keep backwards compatibility, I have introduced a new parameter for label widget ("LALP", label alignment position), which specifies the text alignment within the background.

          I have set a fixed background and different text lengths with label alignment to the left side of the background (LALP:1). The X origin is determined by the X and ALP parameter.

          |LB UID:lb1 X:5 Y:30 TXT:"The quick brown" ALP:1 BGC:#00ff00 W:80 LALP:1
          |LB UID:lb2 X:5 Y:34 TXT:"The quick brown fox jumps" ALP:1 W:80 LALP:1 BGC:#00ff00
          |LB UID:lb3 X:5 Y:38 TXT:"The quick brown fox jumps over the" ALP:1 W:80 LALP:1 BGC:#00ff00
          

          The result:

          alt text

          If I right-align the label (LALP:2):

          alt text

          And center align the label (LALP:0):

          alt text

          I must also update the GUI-O designer and developer manual to better explain ALP (and its relevance with X position). ALP actually changes the X origin point (left, right, center of the widget).

          It is a bit more complicated now, but does not break previous code.

          I will also replace the ALP parameter for TI and NI widgets with LALP as this seems more consistent with the new scenario.

          What do you think?

          Best regards,
          kl3m3n

          D 1 Reply Last reply 15 Feb 2023, 14:28 Reply Quote 0
          • D
            DenesL @kl3m3n
            last edited by 15 Feb 2023, 14:28

            @kl3m3n Hi!
            It sounds like a good solution but when I tried to test it I got:

            Invalid component parameter LALP (lb3)
            

            running gui-o 1.0.40

            Regards,
            Denes

            K 1 Reply Last reply 15 Feb 2023, 15:57 Reply Quote 0
            • K
              kl3m3n @DenesL
              last edited by 15 Feb 2023, 15:57

              @DenesL Yes, I have not released the fix yet. I wanted to get your opinion first.

              I will create a new release today (with some other minor patches).

              Regards,
              kl3m3n

              D 1 Reply Last reply 16 Feb 2023, 17:14 Reply Quote 0
              • D
                DenesL @kl3m3n
                last edited by 16 Feb 2023, 17:14

                @kl3m3n Hi!
                I noticed gui-o version 1.0.41 is out, does it contain the fixes?

                Regards,
                Denes

                K 1 Reply Last reply 16 Feb 2023, 20:31 Reply Quote 0
                • K
                  kl3m3n @DenesL
                  last edited by 16 Feb 2023, 20:31

                  @DenesL Yes!

                  BR,
                  kl3m3n

                  D 1 Reply Last reply 16 Feb 2023, 22:32 Reply Quote 0
                  • D
                    DenesL @kl3m3n
                    last edited by 16 Feb 2023, 22:32

                    @kl3m3n Hi!
                    It works like a charm!
                    Thanks,
                    Denes

                    D 1 Reply Last reply 17 Feb 2023, 13:50 Reply Quote 0
                    • D
                      DenesL @DenesL
                      last edited by 17 Feb 2023, 13:50

                      @kl3m3n Hi!
                      It occurred to me last night, can you have ALP 3 and 4 instead of LALP 1 and 2?. Simpler?.

                      Regards,
                      Denes

                      K 1 Reply Last reply 17 Feb 2023, 16:36 Reply Quote 0
                      • K
                        kl3m3n @DenesL
                        last edited by 17 Feb 2023, 16:36

                        @DenesL I would like to keep ALP values (and consistency) reserved for future use (maybe vertical alignment, etc.).

                        Thanks for the suggestion though.

                        Regards,
                        kl3m3n

                        1 Reply Last reply Reply Quote 0
                        17 out of 18
                        • First post
                          17/18
                          Last post