[Lazarus] Memo.Lines.Add seems to be slow with Lazarus 1.6
zeljko
zeljko at holobit.net
Fri Nov 4 16:16:57 CET 2016
On 11/04/2016 02:28 PM, Bart via Lazarus wrote:
> On 11/4/16, Ondrej Pokorny via Lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>> The TextHint implementation should be completely rewritten. It shouldn't
>> use the text property but paint the TextHint onto the control by itself.
>> Windows can do that and Qt/Gtk2 should be able to do it as well (IIRC -
>> I talked about it with zeljko in Lazarus ML). For that some new virtual
>> paint method (PaintAfterInterface) should be introduced - that would
>> call the widgetset dependent PaintAfterInterface method.
>
> The Windows API provides a nice interface to set TextHint (and the
> possibility to display it if control has focus, but Text is empty).
> At the time I implemented it, I saw no API in GTK/QT for a
> TextHint-like feature.
> Unfortunately TCustomEdit does not have a Canvas ;-)
> And I was unable to find a suitable way to paint over the control in a
> reliable way.
It means exactly nothing for qt,gtk2 and carbon/cocoa, don't know about
win32 but I'm pretty sure about mentioned ws.
TCustomEdit uses native WS handle, so WS is taking care about painting
and it does not provide PaintEvent to TCustomEdit (sure for
qt,gtk2,carbon and cocoa) - so Canvas is useless in that case.
Basically, WS should draw it's control and after that LCL should get
PaintEvent and event stopped, so ws won't paint it again.
This is possible under Qt WS (from qt5lcl it will have property for
texthint, so no need to expose paintevent to lcl) but again, not sure
about others. All WS api should be checked if we need paintEvent for
TextHint or WS handle have property for TextHint. Probably we'll have to
support both ways to get all WS functional in case of TextHint.
zeljko
More information about the Lazarus
mailing list