Writing a continuous line inside a text model

All graphical and user interfaces problems
Post Reply
manumart1
Posts: 67
Joined: Tue Sep 17, 2013 6:25 am

Writing a continuous line inside a text model

Post by manumart1 »

To draw a continuous line I tried to use the char "─" (push the Alt key and then type the number 2500 or 196). This is the unicode character U+2500. See http://www.fileformat.info/info/unicode ... /index.htm.
This char is encoded in UTF-8 using 3 bytes "E2 94 80". When I type this char several times, the cursor of the editor is incorrectly positioned. See attached image.
Anyway I post it here just for curiosity.

To draw an horizontal line inside a text model I am doing:

Code: Select all

VAR md: TextModels.Model; fm: TextMappers.Formatter;
  hLine: CtlsFigures.Figure;
...
md := TextModels.dir.New(); fm.ConnectTo(md);
...
hLine := CtlsFigures.NewLine(Ports.black, SHORT(ENTIER(0.5 * Ports.mm)));
fm.WriteView(hLine);
hLine.context.SetSize(190 * Ports.mm, 1 * Ports.mm); (* Width DIN A4 = 210 mm. *)
fm.WriteLn;
It uses the Ctls subsystem from http://www.zinnamturm.eu/downloadsAC.htm#Ctls.
It took me some time to arrive at it, in particular how to specify the size of the line via hLine.context.SetSize(); I am not very fluent using views.

Regards
Attachments
cursor_misleading.png
cursor_misleading.png (1.15 KiB) Viewed 6897 times
manumart1
Posts: 67
Joined: Tue Sep 17, 2013 6:25 am

Re: Writing a continuous line inside a text model

Post by manumart1 »

I have discovered that instead of

Code: Select all

fm.WriteView(v);
v.context.SetSize(w, h)
I can use

Code: Select all

fm.rider.WriteView(v, w, h)
Post Reply