- if ( !::SetCaretPos(m_x, m_y) )
- {
- wxLogLastError("SetCaretPos");
- }
+ wxASSERT_MSG( wxWindow::FindFocus() == GetWindow(),
+ wxT("how did we lose focus?") );
+
+ // for compatibility with the generic version, the coordinates are
+ // client ones
+ wxPoint pt = GetWindow()->GetClientAreaOrigin();
+ CALL_CARET_API(SetCaretPos, (m_x + pt.x, m_y + pt.y));