time entry in a textfield and text wrap / count in multiline text field

Find and share HowTos to various installations / configurations!
Search

Post Reply
6 posts • Page 1 of 1
tpjctrl
Posts: 56
Joined: Tue May 08, 2018 8:30 am

time entry in a textfield and text wrap / count in multiline text field

Post by tpjctrl » Wed Oct 03, 2018 12:04 pm

Three quick questions regarding time / text entry:

- I've configured a single line text field to use Time as text format: %H:%m, but for some reason if I enter for example 10:20 in the field and click outside the field, the contents change to 10:01. If I try it again it changes to 10:10 and stays that way regardless of what "minutes" value I try to enter. Hours change fine, it's just the minutes which seem to be broken

- I've configured a multiline text field to allow users to enter comments, but I'd like to limit the amount of characters entered to 60, is there a way to somehow stop the user typing when the 60 chars limit is reached? can the contents of the multiline text field be monitored live whilst the user is typing to keep checking the lenght?

- The multiline text field described above is wide enough to hold 15 characters, yet if I enter say 10 and break that up with a space in the middle, the second half gets pushed to the second line. Is there a way to have it carrying on in the same line until the end is reached and only then move over to the second line? most text boxes I've seen in other SCADA packages work this way ie. the size is fixed and the text inside wraps around, even if there's no spaces.

Cheers,
T.

tpjctrl
Posts: 56
Joined: Tue May 08, 2018 8:30 am

Re: time entry in a textfield and text wrap / count in multiline text field

Post by tpjctrl » Tue Oct 09, 2018 1:27 pm

Ignore the time question, we've resolved it using integer text fields.

Still looking for ways to count the characters typed in a textedit multiline box, a single textline object has a "text changed" event which is super handy for this, but the multiline object doesn't offer this event for some reason (even though Help says it does). Any ideas are much appreciated, I've tried running a while(true) script in the KeyboardInFocus event, but this slows things waaaay down.

Regards,
Tom

User avatar
eivanovic
Posts: 78
Joined: Wed Sep 03, 2014 12:35 pm

Re: time entry in a textfield and text wrap / count in multiline text field

Post by eivanovic » Tue Oct 09, 2018 1:44 pm

Hi Tom,

There is a second tab in the Properties of the multitext object. There you can find the text changed event!

BR
Emanuel Image
Attachments
Capture-20181009.PNG

tpjctrl
Posts: 56
Joined: Tue May 08, 2018 8:30 am

Re: time entry in a textfield and text wrap / count in multiline text field

Post by tpjctrl » Wed Oct 10, 2018 8:01 am

Hi Emanuel,

I've had a long look at the Expanded tab, but only the top section, where all the parameters are, never noticed the bottom section for events changes!

Huge thanks!

Is there a way to somehow limit the field to 60 characters like on a single line text object?

Regards,
Tom

User avatar
eivanovic
Posts: 78
Joined: Wed Sep 03, 2014 12:35 pm

Re: time entry in a textfield and text wrap / count in multiline text field

Post by eivanovic » Mon Oct 15, 2018 1:09 pm

I am not sure if there is currently an out of the box solution.

do you want it to limit per line for 60 chars? If so you can try using the CursorPositionChanged Script event, which is also available on the extended tab.
This gives you the line and the position number of your cursor. So when entering something in the multiline field you can try checking for the length of the line!

BR
Emanuel

tpjctrl
Posts: 56
Joined: Tue May 08, 2018 8:30 am

Re: time entry in a textfield and text wrap / count in multiline text field

Post by tpjctrl » Tue Oct 16, 2018 12:05 pm

Thanks for your reply Emanuel, I'm already checking string length in the TextChanged event script, the main issue is enforcing a character limit. I've tried cutting down the entered string into 60chars only, but then I need to pass it back to the multiline text field and that removes focus from the field itself.

Rgds,
Tom

Post Reply
6 posts • Page 1 of 1