Jump to content

String Formatting


Recommended Posts

I put together a quick and dirty VI which takes some form of general markup and applies properties to the built in LabVIEW string controls. The results are usually pretty good, but every so often I see some weird rendering behavior. For example:




Note the "erat. Sed" text is missing, and worse the "erat" even overflows the bounds of the indicator. Has anyone ever played enough with formatting of the string indicators to know how to avoid this?


It would seem if I force the indicator to re-calculate layout after applying the formatting I can fix it, say for example hiding and re-showing scrollbars. But in that case the text that's out of bounds remains painted.


Some really rough code to reproduce is attached (2012). Results may vary depending on OS settings and font availability: Formatter.zip

Link to post

Yup. I've seen this not only with dynamic formatting but also in normal usage. It doesn't seem to happen with the silver indicator (but does with the silver frame-less). Have you tried to defer the update?

Edited by ShaunR
Link to post

Neat, I hadn't seen LVMark, but yes, it does the same thing.


Deferral updates of itself does nothing for my example, text will still paint out of bounds of the indicator. But deferral of updates, combined with some forced layout recalculation of the indicator, then enabling updates works and prevents text from appearing out of bounds. Kludgy though.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.