caret under MSW
Harry
"harry dot news at armadillo dot fr" at a.mx.sunsite.dk
Sat Dec 1 09:42:34 PST 2007
The caret under MSW only works in simple cases.
For example, if I hide the caret when processing a click on a button,
the caret only hides itself when the cursor
leaves the button and is hovering back over the window.
Also, if clicking a button repositions the caret, sometimes an
anti-caret artifact stays on until the window is manually refreshed.
The problem with the wxWidgets implementation of the caret under MSW is
that it does everything by the book.
However, the caret implementation of Windows has always been somewhat
inadequate.
When programing the caret under MSW, I've always done the following:
1. I never hide the caret, as this sometimes works in an unexpected way :
I always destroy and recreate instead of hiding and showing.
2. I never depend upon Windows to refresh the screen when moving or
hiding the caret :
I always refresh the old position of the caret.
Doing the above fixed my caret display problems under wxWidgets (I used
wxCaret::OnKillFocus() to destroy the caret).
I believe that a more robust wxWidgets caret implementation is required
under MSW.
Harry
More information about the wx-users
mailing list