HISE Logo Forum
    • Categories
    • Register
    • Login

    How to limit the input length for a text label

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 425 Views
    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.
    • L
      LeeC
      last edited by

      Hi guys,

      Does anybody know of a way to set the maximum number of characters that can be inputted into a HISE label (set to editable)?

      I've searched the forum but can't seem to find anything on this.

      I'd imagine that I could achieve it using a timer somehow, but hoped that there would be a more elegant way.

      Please share if you have any ideas.

      Cheers,

      Lee

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @LeeC
        last edited by

        @LeeC If the label's callback is triggered when entering text you could check the string length and delete any additional characters the user tries to enter.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        L 1 Reply Last reply Reply Quote 0
        • L
          LeeC @d.healey
          last edited by LeeC

          @d-healey I like your thinking.
          I don't think that label callbacks are triggered when text is entered, which is why I was thinking about using a timer.

          Also, have you got any thoughts on how to delete the the additional characters that exceed the MaxTextLength?

          1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey
            last edited by

            Callback is triggered when you hit enter (or you could trigger it manually, from a button for example).

            HiseSnippet 806.3ocsUstaSCCE1tqAsFnHlDO.Q6WoRipjcGMALVufp1sJ5Xh+M4l31ZMG6nDmwpl1KCuL75va.bbR5R6naZqRjekykO6Oe7243tQROZbrLBgqb13PJB+JidiEpQMFQXBTmlH7qMNlDqnQVYtNXbHINl5iv3k9h1AtRYT52u+zADNQ3QKbgPmKYdziXALUg2t6eHiyaS7omwBlJ6M2uimTzPxkI.eVxvAER7tjLjdBQmVICD9Es7YJYTOEQQigbNP5Ot2H4ODY4eNKl0mS0FtndvBk4F0XDi62cxYMFgvk6VbxWJ6j+ViiY9r67WTAdSZ.qBDSWCvklkRkmgRtODkZK495E3AnGdJ5UNidqXzyKhEpJhn41KM5HfKmADnrOMsxxEU5WXiFRHCgpd.4RZ6Hv3ND1a63rl0VNN01qpYUSn3GqrthDYcDoOk6Z8AqIXGRUMjAgRAXXuZV3UyPwDblfZMHQ3oXRgkTjEVCMRxs8lfaMXo4IzZUMuopYE1.K6T65bpXnZj0GsbcfXUrfu6vTOlB6mhdsZ0b30iS5GqhXhg1.2AHZVbaJSdbxpWpbN0fv48Aok883Zs8l5TbhTQOUXWy7FyJl2ZZc+PCFL2X4KEmFM2vZEeziAzVjDzmFMoXMIQPFLqN6EOMclWVMYpDkhNBl5zPZtcgRzcNJQTdQE96acZRTDs3L2GjWHMRwzzA2jdEzomIUqXzjFeoRFlla9MABanRiVMWHmV5QLXqW1H6Z.cMjD9PXuFq+4mvO5qd8PIG202Xys1dmceOL+3e5MfNToeBmnlssUOeJO.Timo+P2CHhYpwSO+5YzK6L2d44VAehzcEitLk2n4y2RyguvMw+a9lOYrpQqACndpBxV1n82WzwfOCp7UYhB5zOl.M7ZswIIA8fGG7n.SDBJOVKSJoUoY1NZackoGU3mZ7G3KOnq1FmGzcRPT.wKRdgWV2md16xod.NIRe1oB79GXa4hR6HAbFN0cPAvSBW34oKEuC397wr9BfYiE.ylK.lsV.Lau.X1YAvr6ihQ+Z7mSTxfr1DvQ2Voilv3VBBnxRUjn+B.eJn8D
            

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            L 1 Reply Last reply Reply Quote 2
            • L
              LeeC @d.healey
              last edited by

              @d-healey Great solution... Thanks again mate!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              17

              Online

              2.0k

              Users

              12.7k

              Topics

              109.8k

              Posts