wxMenu* m_privateContextMenu;
bool m_isNativeCaretShown;
-
- // this is an optimization: instead of checking all the time whether we
- // need to move the caret to the end of text (before appending to the
- // control), we remember whether it is already at the end of text in this
- // variable
- bool m_isCaretAtEnd;
};
#endif
m_privateContextMenu = NULL;
m_updatesCount = -1;
m_isNativeCaretShown = true;
- m_isCaretAtEnd = true;
}
wxTextCtrl::~wxTextCtrl()
void wxTextCtrl::SetInsertionPoint(long pos)
{
DoSetSelection(pos, pos);
-
- m_isCaretAtEnd = pos == GetLastPosition();
}
void wxTextCtrl::SetInsertionPointEnd()
// if it doesn't actually move the caret anywhere and so the simple fact of
// doing it results in horrible flicker when appending big amounts of text
// to the control in a few chunks (see DoAddText() test in the text sample)
- if ( m_isCaretAtEnd || GetInsertionPoint() == GetLastPosition() )
+ if ( GetInsertionPoint() == GetLastPosition() )
{
- m_isCaretAtEnd = true;
return;
}
if (linesToScroll != 0)
(void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll);
-
- // be pessimistic
- m_isCaretAtEnd = false;
}
long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const
if (CanUndo())
{
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
-
- // it's not necessarily at the end any more
- m_isCaretAtEnd = false;
}
}
#endif
// Same as Undo, since Undo undoes the undo, i.e. a redo.
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
-
- // it's not necessarily at the end any more
- m_isCaretAtEnd = false;
}
}