#ifdef __WIN16__
#define CALL_CARET_API(api, args) api args
#else // Win32
- #define CALL_CARET_API(api, args) if ( !api args ) wxLogLastError(#api)
+ #define CALL_CARET_API(api, args) \
+ if ( !api args ) \
+ wxLogLastError(_T(#api))
#endif // Win16/32
// ===========================================================================
int blinkTime = ::GetCaretBlinkTime();
if ( !blinkTime )
{
- wxLogLastError("GetCaretBlinkTime");
+ wxLogLastError(wxT("GetCaretBlinkTime"));
}
return blinkTime;
bool wxCaret::MSWCreateCaret()
{
- wxASSERT_MSG( GetWindow(), _T("caret without window cannot be created") );
- wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be created") );
+ wxASSERT_MSG( GetWindow(), wxT("caret without window cannot be created") );
+ wxASSERT_MSG( IsOk(), wxT("caret of zero size cannot be created") );
if ( !m_hasCaret )
{
void wxCaret::DoShow()
{
- wxASSERT_MSG( GetWindow(), _T("caret without window cannot be shown") );
- wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be shown") );
+ wxASSERT_MSG( GetWindow(), wxT("caret without window cannot be shown") );
+ wxASSERT_MSG( IsOk(), wxT("caret of zero size cannot be shown") );
if ( m_hasCaret )
{
{
if ( m_hasCaret )
{
- wxWindow *winFocus = wxWindow::FindFocus();
- wxASSERT_MSG( winFocus == GetWindow(), _T("how did we lose focus?") );
+ wxASSERT_MSG( wxWindow::FindFocus() == GetWindow(),
+ wxT("how did we lose focus?") );
CALL_CARET_API(SetCaretPos, (m_x, m_y));
}
//else: we don't have caret right now, nothing to do (this does happen)
}
+
+
+// ---------------------------------------------------------------------------
+// resizing the caret
+// ---------------------------------------------------------------------------
+
+void wxCaret::DoSize()
+{
+ if ( m_hasCaret )
+ {
+ m_hasCaret = FALSE;
+ CALL_CARET_API(DestroyCaret, ());
+ MSWCreateCaret();
+ DoMove();
+ }
+}