Lazarus
Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: antonio on June 24, 2007, 01:41:46 am
-
I have a component where I implement a caret for a window by Windows API calls (CreateCaret, ShowCaret, etc). What should I do to make this component work on Linux?
-
Why not make it a simple Fillrect basically?
-
Drawing the caret myself? Do you think it's a good approach?
-
Drawing the caret myself? Do you think it's a good approach?
Why not? I do this in my RichEdit thingie and I see no problems.
Invalidate just the Rect where the caret is blinking.
I can't see any "magic" in this. It's just a vertical line.
-
How do you handle the selection on this control?
-
How do you handle the selection on this control?
What exactly do you want to know?
-
About the algorithm. In my control, I didn't handle selection at all.
-
Have a look at the Synedit sources.
There the CreateCaret etc. functions from LCLIntf are used.
-
Thanks.
-
Indeed, in order to get synedit to work, we needed to implement our own Caret handling functions :)
-
Is the caret implemented in a different way to Linux and Windows?
-
in windows the real caret is used, in linux it is simulated. The LCLIntf winapi functions are a replacement for common used winapifunctions. On windows they are redirected tothe real winapi function, on other widgetsets they are implemented ourselves, but should behave the same.
Note that you cannot set the caret on all controls on linux.
-
Thanks.