removed m_isCaretAtEnd optimization added in rev 1.232 as we don't always detect when the carets position changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -260,12 +260,6 @@ private:
|
|||||||
wxMenu* m_privateContextMenu;
|
wxMenu* m_privateContextMenu;
|
||||||
|
|
||||||
bool m_isNativeCaretShown;
|
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
|
#endif
|
||||||
|
@@ -251,7 +251,6 @@ void wxTextCtrl::Init()
|
|||||||
m_privateContextMenu = NULL;
|
m_privateContextMenu = NULL;
|
||||||
m_updatesCount = -1;
|
m_updatesCount = -1;
|
||||||
m_isNativeCaretShown = true;
|
m_isNativeCaretShown = true;
|
||||||
m_isCaretAtEnd = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl::~wxTextCtrl()
|
wxTextCtrl::~wxTextCtrl()
|
||||||
@@ -1090,8 +1089,6 @@ void wxTextCtrl::SetEditable(bool editable)
|
|||||||
void wxTextCtrl::SetInsertionPoint(long pos)
|
void wxTextCtrl::SetInsertionPoint(long pos)
|
||||||
{
|
{
|
||||||
DoSetSelection(pos, pos);
|
DoSetSelection(pos, pos);
|
||||||
|
|
||||||
m_isCaretAtEnd = pos == GetLastPosition();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::SetInsertionPointEnd()
|
void wxTextCtrl::SetInsertionPointEnd()
|
||||||
@@ -1101,9 +1098,8 @@ void wxTextCtrl::SetInsertionPointEnd()
|
|||||||
// if it doesn't actually move the caret anywhere and so the simple fact of
|
// 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
|
// 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)
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1484,9 +1480,6 @@ void wxTextCtrl::ShowPosition(long pos)
|
|||||||
|
|
||||||
if (linesToScroll != 0)
|
if (linesToScroll != 0)
|
||||||
(void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll);
|
(void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll);
|
||||||
|
|
||||||
// be pessimistic
|
|
||||||
m_isCaretAtEnd = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const
|
long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const
|
||||||
@@ -1563,9 +1556,6 @@ void wxTextCtrl::Undo()
|
|||||||
if (CanUndo())
|
if (CanUndo())
|
||||||
{
|
{
|
||||||
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
|
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
|
||||||
|
|
||||||
// it's not necessarily at the end any more
|
|
||||||
m_isCaretAtEnd = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1580,9 +1570,6 @@ void wxTextCtrl::Redo()
|
|||||||
#endif
|
#endif
|
||||||
// Same as Undo, since Undo undoes the undo, i.e. a redo.
|
// Same as Undo, since Undo undoes the undo, i.e. a redo.
|
||||||
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
|
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
|
||||||
|
|
||||||
// it's not necessarily at the end any more
|
|
||||||
m_isCaretAtEnd = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user