Bug style for text wrap in Ted4

Build 1501 on 14/Nov/2017  This topic last edited on: 24/Oct/2016, at 14:39

Bug style handle inline inserts in text.

Note: if you use bug in a separate frame, then you don't need this procedure - it will flow in its frame.

A separate style is required for each bug text, since it is possible to adjust it to the text content width. For example, as 'Fashion' is shorter than 'COMMENT 123, one style cannot serve both. In each style you will have to test and adjust manually the distance, and hard-code it as the required indent.

To toggle bug in text, create a VBScript such as

ToggleBug "bug05"

and assign it to an icon in the toolbar. When you click the icon for the first time, the bug is inserted in the text. When you click it again, it is removed.

Important: the bug style will work well only if the break point of the paragraph is distant enough from the beginning and the end of the paragraph, thus use in the paragraphs that are long enough to leave at least one line above and one line below the bug.

parisfashion_zoom40

Three hidden styles are required for this to work, and they have to be applied by a VBScript. The styles are:

STYLE

PURPOSE

TAGS

COMMENT

bug05a

Ends the previous paragraph, and extends it to the margin,

>qj<

nothing to adjust here

bug05b

Creates the bug paragraph and contains the bug text

>is<>ld LD<>ta CapH,1<

>f 1<>hld 10pt<>small 2<

COMMENT 123 >f 2<>d 20pt<

>l 70pt<>under -5pt,0.5pt< >under 5pt, 0.5pt<>f 3<

>h 15pt<>w W'800<ENQUIRY 2004

If you change the length of the COMMENT 123 line, adjust the value in >l 70pt<.

bug05c

Creates indent (the hole)

>il 90pt,5<>a -LD*2<>is<

Adjust the value in >il 90...<.

The best way to adjust the styles bug05b and bug05c when changing the content of the bug05b, is to copy the whole code in a sample text (replacing the tags bug05b and bug05c on their respective places), and then modify parameters in >l...< and >il...< tags. The adjustment can be sort of clumsy, and it's based on error-and-trial, but it's worthwhile, because the application for users is very simple.

If you need more bug styles, create them following the naming convention for the one explained here, i.e. use bug0X as the root name, and the suffixes a, b, and c. Thus, the styles for the sixth bug should be named bug06a, bug06b, bug06c. Also, create another VBScript to load them.

hmtoggle_plus1Explanation