SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
+ GetBuffer().Reset();
GetBuffer().SetRichTextCtrl(this);
if (style & wxTE_READONLY)
/// Clear all text
void wxRichTextCtrl::Clear()
{
- m_buffer.Reset();
+ m_buffer.ResetAndClearCommands();
m_buffer.SetDirty(true);
m_caretPosition = -1;
m_caretPositionForDefaultStyle = -2;
GetEventHandler()->ProcessEvent(textEvent);
}
+ Update();
}
else if (event.GetKeyCode() == WXK_BACK)
{
EndBatchUndo();
- // Shouldn't this be in Do()?
if (GetLastPosition() == -1)
{
GetBuffer().Reset();
}
ScrollIntoView(m_caretPosition, WXK_LEFT);
+ Update();
}
else if (event.GetKeyCode() == WXK_DELETE)
{
EndBatchUndo();
- // Shouldn't this be in Do()?
if (GetLastPosition() == -1)
{
GetBuffer().Reset();
PositionCaret();
SetDefaultStyleToCursorStyle();
}
+ Update();
}
else
{
SetDefaultStyleToCursorStyle();
ScrollIntoView(m_caretPosition, WXK_RIGHT);
+ Update();
}
}
}