[lazarus] ShowCursor

Marc Weustink weus at quicknet.nl
Fri Jan 7 14:50:15 EST 2000


At 10:44 07-01-2000 -0600, Shane wrote:
>Anyone have an idea on this function?  

This is one of the low priority background processes of mine thinking how
to solve this. I'll try to express most bits and pieces :-)

>How it should be written?  

I think the Caret is a part of the GTK implementation of TWinControl (call
it csFixed or later csWincontrol), since this is the place were I think it
is needed most. All edit capable widgets already have a caret, so if one
derives a class from them it has also a Caret.
If one want to derive from another control which has no edit capabilities
and want to turn it into a editor, than IMHO it is bad luck. (I can't think
of an example why sombody wants to do that, but maybe others ?)

>can anyone give me a hint for this?  
>I need to have a procedure (compatable to windows) 
>that will be called to display the flashing cursor 
>in the editor.  

That's handled by the winapi, you only have to call the
winapi.ShowCaret/SetCaretPos and things like that. This winapi func then in
its turn can determin based upon the handle what kind of window it is
talking to and can call the appropriate funcs. In case of a edit capable
widget, the gtk/gdk funcs and otherwise the caret func, that we have to
create somewhere (I prefer winapi, since I'm playing with the idea to move
(in the far future) the csWinControl code to the CreateWindow APIfunc)

>In windows, there is only one cursor in the entire 
>system so when one window has it, another doesn't  
>The cursor is handled by the OS, not the running 
>program so how do we tap into this under Linux?

I think that not very different. Only [G|S]etCaretPos doesn't take a hWnd
as parameter but then again it works only on the window which has focus.

In this way I see a internal api class TAPICaret which gets created when
the csWinContol is created (or maybe on some create styles if the exist ??)
and handles all caret stuff.


As I said erlier, this was just a background process. I haven't looked how
it is handled in gtk internally. So I don't know if caret support already
is build in the gtkwidgets or XWidgets or.... who knows.

Marc

Since I'm still struggling with the scrollbar support on a csWinControl I
think this problem is pretty close and when I add sb support I might add
the basic Caret stuff as well







More information about the Lazarus mailing list