Hiding/showing text

General TRichView support forum. Please post your questions here
Post Reply
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

Hiding/showing text

Post by conciliator »

I need to have a TRVE component with a fixed set of sections (fixed heading + editable field below heading).

I'd like the user to be able to turn a section on/off at runtime. Is there a style that would enable me to do so? I.e. could I select the desired text in code and then hide/show the selected text by applying the correct style?

If not, I imagine cutting the content to a temporary buffer is desirable. I'd rather not cut it to the clipboard, as the clipboard is (in my opinion) under the users control. For instance, the user could've loaded something important to the clipboard, and I don't want to ruin the day for the user by pasting something over that important stuff. And what, then, if the user loads something to the clipboard between a hide/show cycle? Using it as a temporary buffer is risky, to say the least.

Should I save/read to/from streams instead? Is this the better solution? Or should I perhaps create a second, hidden TRVE? Thanks!
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

Post by conciliator »

I just realised that, in order to get the content from one document to another, I need to save to stream (making my last lines in the previous post complementary, and not orthogonal to each other).
conciliator
Posts: 25
Joined: Thu Sep 17, 2009 7:50 am

Post by conciliator »

Thanks Sergey, that's great stuff!
Post Reply