PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Jeffrey Ferreira on January 15, 2025, 10:49:44 AM

Title: Max Characters per Line on Multi-Line
Post by: Jeffrey Ferreira on January 15, 2025, 10:49:44 AM
We have descriptions that print in 30 character blocks.
is there a way on a multi-line (that has a height > 1 / i.e. multiple lines)
that i can control it so that if they type 30 characters on a line that it rolls to the next line.
i'm open to any solution.
Title: Re: Max Characters per Line on Multi-Line
Post by: James Zukowski on January 15, 2025, 10:57:03 AM
The first thing that comes to mind has quite a bit of overhead:
Set 'Signal All Changes' on the field and create logic to do the character counting yourself, adding / removing line breaks as appropriate. This also means you'll have to process backspaces, adjust for cursor inserts / deletes / corrections, etc.
Not what you're looking for, I'm sure, but it's an option.
Title: Re: Max Characters per Line on Multi-Line
Post by: Jeffrey Ferreira on January 15, 2025, 11:17:23 AM
James - it is so funny you said that. I did something like this in our billing software (and i forgot about that). the one difference here is that our user wants it to honor their seps/line breaks. I did not do that in the billing software. I might use this as a last resort. Thank you. but i think you are confirming my thought that there is not a really easy way.

right now what i'm doing is using a mixture of : a fixed font , and controlling the width of the control and that seems to be doing it but i'm not sure if it will work with all monitors.
Title: Re: Max Characters per Line on Multi-Line
Post by: James Zukowski on January 15, 2025, 11:19:51 AM
Like I said, that's the first thing that came to mind. There may be something else that someone knows about that would work better.