Linebreaks/Text Wrapping in File Window Layout

Started by ulim, August 11, 2015, 09:50:14 PM

Previous topic - Next topic

ulim

Hello,

when I try to use a user defined template in the File Window to display multi-line text, iMatch doesn't wrap the text, but cuts it off at the end of the first line. I have read the XAML help topic, there is a LineBreak-Tag, but I can't use that within the text of one field.

The File Window Tip does the wrapping very nicely, but is has some strange syntax that isn't covered in the help file:

{File.MD.XMP::dc\description\Description\0|pereplace:{cr}{If}==</Run><LineBreak/><Run Foreground="#ffaa00" FontSize="12pt">;prefix:<Run Foreground="#ffaa00" FontSize="12pt">;postfix:</Run>}

I have no idea what {cr} or pereplace means or even prefix and postfix, but the end result seems to be that in the File Window Tip the multi-line text wraps around nicely. Could that in any way be adapted for the File Window Layouts?

Many thanks in advance for any pointers,

Ulrich

ulim

Whoa, while looking for something else the answer popped right at me:

I need to make more room by specifying a larger size in pixels for the field and then the text wraps around nicely.

Anyway, I would still appreciate if someone could explain the weird syntax I posted.

cheers,

Ulrich

JohnZeman

Quote from: ulim on August 11, 2015, 09:56:13 PM
Anyway, I would still appreciate if someone could explain the weird syntax I posted.


I could explain the syntax but Mario does have a very detailed explanation of the way it works in the Help.  See the Using Variables page or just do a search for pereplace.

In a nutshell both replace and pereplace look for specific text and if found, replaces it with something else.  The difference between replace and pereplace is pereplace happens after a replace operation, it also does not escape potentially unsafe characters.

In your example:

pereplace:{cr}{If}==</Run><LineBreak/>

pereplace looks for Carriage Returns ({cr}) Line Feeds ({lf} not {If}) and if found, replaces those with an XML linebreak.