[Demos] Expanding-collapsing

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

[Demos] Expanding-collapsing

Post 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
Last edited by Sergey Tkachenko on Fri Jun 28, 2013 6:44 pm, edited 2 times in total.
miwan
Posts: 26
Joined: Tue Nov 01, 2011 8:30 pm

Post by miwan »

this is beautiful

very strong

thank you

miwan.
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Post by Martian »

Is there a demo available? Using hidden property instead of additional RVE.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
jonjon
Posts: 467
Joined: Sat Aug 27, 2005 4:19 pm

Re: [Demos] Expanding-collapsing

Post by jonjon »

Can this be done in a TRichViewEdit by the end-user ? If so, how should it be done ?
Thanks.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demos] Expanding-collapsing

Post 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?
jonjon
Posts: 467
Joined: Sat Aug 27, 2005 4:19 pm

Re: [Demos] Expanding-collapsing

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demos] Expanding-collapsing

Post 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.
jonjon
Posts: 467
Joined: Sat Aug 27, 2005 4:19 pm

Re: [Demos] Expanding-collapsing

Post by jonjon »

OK thank you.
Post Reply