Jump to content
mje

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:

 

post-11742-0-35336400-1374880539_thumb.p

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I do see this issue in Windows 7 x64, but this reminded me of LVMark.

 

https://code.google.com/p/lvmark/

 

http://lavag.org/topic/14700-lvmark-format-markup-for-string-controls/

 

And oddly enough I couldn't make its indicators break like yours.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.