wxCaret MSW bug fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-05-25 23:07:41 +00:00
parent 01eaf507af
commit a8f2578758
2 changed files with 8 additions and 6 deletions

View File

@@ -265,6 +265,8 @@ MyCanvas::MyCanvas( wxWindow *parent )
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER ) wxSUNKEN_BORDER )
{ {
m_text = (char *)NULL;
SetBackgroundColour(* wxWHITE); SetBackgroundColour(* wxWHITE);
m_font = *wxNORMAL_FONT; m_font = *wxNORMAL_FONT;
@@ -282,8 +284,6 @@ MyCanvas::MyCanvas( wxWindow *parent )
m_xMargin = m_yMargin = 5; m_xMargin = m_yMargin = 5;
m_caret.Move(m_xMargin, m_yMargin); m_caret.Move(m_xMargin, m_yMargin);
m_caret.Show(); m_caret.Show();
m_text = (char *)NULL;
} }
MyCanvas::~MyCanvas() MyCanvas::~MyCanvas()

View File

@@ -154,10 +154,12 @@ void wxCaret::DoHide()
void wxCaret::DoMove() void wxCaret::DoMove()
{ {
wxASSERT_MSG( m_hasCaret, "cannot move non existent caret" ); if ( m_hasCaret )
if ( !::SetCaretPos(m_x, m_y) )
{ {
wxLogLastError("SetCaretPos"); if ( !::SetCaretPos(m_x, m_y) )
{
wxLogLastError("SetCaretPos");
}
} }
//else: we don't have caret right now, nothing to do (this does happen)
} }