Do you mean line numbers on pages (when printing using TRVPrint) or line numbers directly in the editor?
Drawing line numbers directly in TRichViewEdit would be very inefficient. Line numbers are not stored, they are calculated on drawing. In the ScaleRichView example, numbering are started at the page beginning, so calculation is simple. In TRichViewEdit, we would need to iterate each time from the beginning, it is slow.
In TRVPrint, it is possible, although, unlike ScaleRichView, it does not have documented methods for it.
If you need line numbers in TRVPrint, I can make an example.
Sergey Tkachenko wrote:Do you mean line numbers on pages (when printing using TRVPrint) or line numbers directly in the editor?
Drawing line numbers directly in TRichViewEdit would be very inefficient. Line numbers are not stored, they are calculated on drawing. In the ScaleRichView example, numbering are started at the page beginning, so calculation is simple. In TRichViewEdit, we would need to iterate each time from the beginning, it is slow.
In TRVPrint, it is possible, although, unlike ScaleRichView, it does not have documented methods for it.
If you need line numbers in TRVPrint, I can make an example.
I mean line numbers directly in the editor.
I think it's good feature that makes reading/writing and navigation more comfortable, also it can be optional as custom panel, or just for plaintext mode.
To make it a standard feature, line numbers must be stored in a document.
Otherwise, they need to be calculated on painting. For a page, it's not critical, because pages have a limited count of lines.
But for a document containing hundreds of thousands lines, calculating line numbers on painting is unacceptable.
So, until internal representation is changed, this feature will not be added.
Sergey Tkachenko wrote: ↑Tue Mar 10, 2015 3:59 pm
In TRVPrint, it is possible, although, unlike ScaleRichView, it does not have documented methods for it.
If you need line numbers in TRVPrint, I can make an example.
Yes, Sergey, do you have some code for this? I've been trying to figure something out for hours and having no luck at all! Main issues are getting item positions to draw on the print preview canvas to the left of the rv, and getting print preview line numbers correct. I have a little of it working but only on the first page. After that my line numbers are wrong. Any ideas appreciated. I find I can't format the print rv as it garbles everything up, and if I can't format it I get strange results...