[Demo] Plain-text checkboxes

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

[Demo] Plain-text checkboxes

Post by Sergey Tkachenko »

This demo shows how to implement checkboxes in TRichViewEdit using plain text.
No controls or images are used inside the editor in this demo: check marks are implemented as Unicode characters. Checkboxes are implemented as hyperlinks.
TextCheckBoxes.zip
(3.65 KiB) Downloaded 3379 times
TextCheckBoxes.png
TextCheckBoxes.png (6.76 KiB) Viewed 43098 times
This demo has methods:

Code: Select all

    // gets the checkbox value
    function GetCheckBoxValue(const CheckBoxName: String): Boolean;
    // sets the checkbox value
    procedure SetCheckBoxValue(const CheckBoxName: String; Value: Boolean);
    // occurs when a checkbox is clicked
    procedure CheckBoxClickInEditor(const CheckBoxName: String; Checked: Boolean);
It shoes how to synchronize checkboxes in the editor and a group of TCheckBox controls.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] Plain-text checkboxes

Post by Sergey Tkachenko »

This document can be stored not only in RVF but also in RTF.
Only one additional setting is needed to make checkboxes work after reloading from RTF: RichViewEdit1.RTFReadProperties.BasePathLinks = False. With this settings, hyperlink targets are saved and loaded as they are.
Post Reply