Page 1 of 1

[Demos] Expanding-collapsing

Posted: Tue Sep 06, 2005 5:37 pm
by Sergey Tkachenko
This demo hides/shows certain paragraphs when user clicks hyperlinks
Image
http://www.trichview.com/support/files/ ... psible.zip

Multilevel collapsible paragraphs

In addition to collapsible.zip , we've created a new demo:
Image
http://www.trichview.com/support/files/ ... psible.zip

The previous demo shows/hides paragraph between the heading paragraphs.
This demo has multilevel numbered paragraphs, and higher level paragraph hides/shows deeper paragraphs.

Numbering is implemented by LabelItem type. It's possible to use "real"
numbering, but "real" numbering cannot have plus/minus pictures before it.

Multilevel collapsible paragraphs - 2

And one more demo on the same topic:
Image
http://www.trichview.com/support/files/ ... sible2.zip

It's visually like the previous one, but plus/minus pictures are after numbering.
This demo uses real (autocalculated) paragraph numbering, so it does not
need labelitems and special paragraph styles.

Expand/collapse using hidden text

http://www.trichview.com/support/files/ ... entext.zip

Visually, this demo is like the first one.
But unlike all the demos above, it does not need a second TRichView containing a full document.
Instead of deleting collapsed paragraphs, this demo hides them.

See also:
- contact list demo with collapsible user groups http://www.trichview.com/forums/viewtopic.php?p=12608

[+] History of updates
2008-May-14: for compatibility with TRichView 10+.
2008-Dec-9: for compatibility with TRichView 11+
2011-Oct-1: for compatibility with TRichView 13.4+
2013-Jun-28: new demo, made using a "hidden text" feature
2018-Apr-13: for compatibility with TRichView 17.3+
[+] Old versions
Old versions of these demos (for TRichView 17.2 and older):
http://www.trichview.com/support/files/collapsible.zip
http://www.trichview.com/support/files/ ... psible.zip
http://www.trichview.com/support/files/ ... sible2.zip
http://www.trichview.com/support/files/ ... entext.zip

Posted: Sat Feb 25, 2012 7:57 pm
by miwan
this is beautiful

very strong

thank you

miwan.

Posted: Wed May 29, 2013 9:13 am
by Martian
Is there a way to do it without a full copy of the document? As it's not good for big docs.
There is an option to hide/show selected text in rvActionsDemo (buggy), maybe we can use it instead?

Posted: Wed May 29, 2013 9:29 am
by Sergey Tkachenko
It is possible using a hidden text, it can be shown/hidden using rvoShowHidden text in Options.
The same option used in the ActionTest demo.
There are no known bugs for this feature. If you know a bug, please explain how to reproduce it.

Posted: Wed May 29, 2013 7:15 pm
by Martian
Sergey Tkachenko wrote:There are no known bugs for this feature. If you know a bug, please explain how to reproduce it.
There is no way to detect hidden text in your rvActions demo. You select text, press hide and it hides. After that pressing hide again does nothing.

A demo for collapse/expand with [+] sign and hidden text will be useful. Thanks.

Posted: Thu May 30, 2013 1:07 pm
by Sergey Tkachenko
Hidden text becomes visible if you press "Show special characters" button (displayed as Pi-character), so you can unhide it.

I'll try to make a demo in this weekend. Actually, it is simple. All content that must be hidden when collapsing is added using "hidden text" options.
Expanding/collapsing is made by including/excluding rvoShowHiddenText (and, may be, changing +/- button)

Posted: Wed Jun 26, 2013 7:08 am
by Martian
Is there a demo available? Using hidden property instead of additional RVE.

Posted: Fri Jun 28, 2013 6:48 pm
by Sergey Tkachenko
Sorry for the delay, I created the requested demo:
http://www.trichview.com/support/files/ ... entext.zip

Of course, I was wrong by expanding/collapsing using rvoShowHiddenText option. This option could be useful if you need only "expand all" and "collapse all" commands, it cannot be used to expand/collapse only the desired parts.
The correct solution is making collapsed fragments hidden.

Re: [Demos] Expanding-collapsing

Posted: Fri Jul 05, 2019 1:39 pm
by jonjon
Can this be done in a TRichViewEdit by the end-user ? If so, how should it be done ?
Thanks.

Re: [Demos] Expanding-collapsing

Posted: Fri Jul 05, 2019 1:45 pm
by Sergey Tkachenko
jonjon wrote:
Fri Jul 05, 2019 1:39 pm
Can this be done in a TRichViewEdit by the end-user ? If so, how should it be done ?
Thanks.
Sorry, I do not understand the question. "Can be done" what?

Re: [Demos] Expanding-collapsing

Posted: Fri Jul 05, 2019 1:50 pm
by jonjon
Sorry about that. Here is a better explanation:
- The user selects some content and marks it as collapsible
- The user creates a link to expand / collapse this content
I believe that this would require some hidden items to mark the collapsible content with a specific ID, and be able to show / hide this section. Or perhaps add some tags to the selected items... ?
I was wondering if that is possible and how it could be implemented ?
Thank you.

Re: [Demos] Expanding-collapsing

Posted: Sat Jul 06, 2019 8:05 am
by Sergey Tkachenko
I suggest to place collapsible text in a table, and implement a link that hide/show a table (by assigning rvepHidden item property to 1 or 0).

A similar feature is implemented in Help&Manual that uses TRichViewEdit as a topic editor.
Here are examples of collapsible tables:
https://www.trichview.com/help-actions/history.htm (changes in each major update)
https://www.trichview.com/help-actions/actions.htm (groups of actions)
https://www.trichview.com/help-actions/ ... fileio.htm (class hierarchy).

Help&Manual does not collapse content in TRichViewEdit itself, only when saving to HTML. But it's not difficult to implement it directly in TRichView.

Re: [Demos] Expanding-collapsing

Posted: Mon Jul 08, 2019 1:30 pm
by jonjon
OK thank you.