/// Member initialisation
void wxRichTextCtrl::Init()
{
- m_freezeCount = 0;
m_contextMenu = NULL;
m_caret = NULL;
m_caretPosition = -1;
m_caretPositionForDefaultStyle = -2;
}
-/// Call Freeze to prevent refresh
-void wxRichTextCtrl::Freeze()
+void wxRichTextCtrl::DoThaw()
{
- m_freezeCount ++;
-}
-
-/// Call Thaw to refresh
-void wxRichTextCtrl::Thaw()
-{
- m_freezeCount --;
-
- if (m_freezeCount == 0)
- {
- if (GetBuffer().GetDirty())
- LayoutContent();
- else
- SetupScrollbars();
- Refresh(false);
- }
+ if (GetBuffer().GetDirty())
+ LayoutContent();
+ else
+ SetupScrollbars();
+ Refresh(false);
}
/// Clear all text
m_caretAtLineStart = false;
m_selectionRange.SetRange(-2, -2);
- if (m_freezeCount == 0)
+ if (!IsFrozen())
{
LayoutContent();
Refresh(false);
#else
wxPaintDC dc(this);
#endif
- PrepareDC(dc);
- if (m_freezeCount > 0)
+ if (IsFrozen())
return;
+ PrepareDC(dc);
+
dc.SetFont(GetFont());
// Paint the background
/// Set up scrollbars, e.g. after a resize
void wxRichTextCtrl::SetupScrollbars(bool atTop)
{
- if (m_freezeCount)
+ if (IsFrozen())
return;
if (GetBuffer().IsEmpty())
SelectNone();
m_caretPosition = pos - 1;
+
+ PositionCaret();
}
void wxRichTextCtrl::SetInsertionPointEnd()
sm_availableFontNames.Clear();
}
-void wxRichTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& event)
+void wxRichTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
//wxLogDebug(wxT("wxRichTextCtrl::OnSysColourChanged"));