wxCaret now uses backing store instead of forcing window refresh each time the

caret is hidden; the non blinking carets work too


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-09-22 22:44:34 +00:00
parent 64d452a82d
commit f4b8bf2fd1
4 changed files with 89 additions and 38 deletions

View File

@@ -196,5 +196,31 @@ private:
#include "wx/generic/caret.h"
#endif // platform
// ----------------------------------------------------------------------------
// wxCaretSuspend: a simple class which hides the caret in its ctor and
// restores it in the dtor, this should be used when drawing on the screen to
// avoid overdrawing the caret
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxCaretSuspend
{
public:
wxCaretSuspend(wxWindow *win)
{
m_caret = win->GetCaret();
if ( m_caret )
m_caret->Hide();
}
~wxCaretSuspend()
{
if ( m_caret )
m_caret->Show();
}
private:
wxCaret *m_caret;
};
#endif // _WX_CARET_H_BASE_

View File

@@ -73,6 +73,12 @@ private:
// GTK specific initialization
void InitGeneric();
// the bitmap holding the part of window hidden by the caret when it was
// at (m_xOld, m_yOld)
wxBitmap m_bmpUnderCaret;
int m_xOld,
m_yOld;
wxCaretTimer m_timer;
bool m_blinkedOut, // TRUE => caret hidden right now
m_hasFocus; // TRUE => our window has focus