I have 2 TextAreas, both having the same properties/subclass; only differences: one will be read-only and not shown (I need an offscreen one for printing purposes).
When the user wants to print, from the visible and (for him) single TextArea, I must duplicate the whole content of the first TextArea to the second one, including styles, in order to preserve the initial text; then I replace variables with their values in the 2nd TextArea and print it.
My problem lies in how to transfer the styled information from one TextArea to the other. The “easy” way doesn't quite work, for obscure reasons: using “TAMailing(1).StyledText.RTFData=TAMailing(0).StyledText.RTFData” results in the 2nd TextArea being “lighter”, while the fonts, sizes and other styles are still preserved… Looks like the RTFData mangles something not handled by Xojo.
The other way I think of would be to loop thru all the styles and re-apply them to the other field; it looks like a pain and too much work for something an assignment should be enough.
Am I missing something?