Page 1 of 1

Hiding/showing text

Posted: Mon Nov 30, 2009 12:18 pm
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!

Posted: Mon Nov 30, 2009 12:45 pm
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).

Posted: Mon Nov 30, 2009 4:46 pm
by Sergey Tkachenko

Posted: Tue Dec 01, 2009 8:24 am
by conciliator
Thanks Sergey, that's great stuff!