overlay implementation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -88,10 +88,11 @@ void wxCaret::InitGeneric()
|
||||
{
|
||||
m_hasFocus = true;
|
||||
m_blinkedOut = true;
|
||||
|
||||
#if wxUSE_OVERLAY == 0
|
||||
m_xOld =
|
||||
m_yOld = -1;
|
||||
m_bmpUnderCaret.Create(m_width, m_height);
|
||||
#endif
|
||||
}
|
||||
|
||||
wxCaret::~wxCaret()
|
||||
@@ -154,8 +155,10 @@ void wxCaret::DoSize()
|
||||
m_countVisible = 0;
|
||||
DoHide();
|
||||
}
|
||||
#if wxUSE_OVERLAY == 0
|
||||
// Change bitmap size
|
||||
m_bmpUnderCaret = wxBitmap(m_width, m_height);
|
||||
#endif
|
||||
if (countVisible > 0)
|
||||
{
|
||||
m_countVisible = countVisible;
|
||||
@@ -208,6 +211,18 @@ void wxCaret::Blink()
|
||||
void wxCaret::Refresh()
|
||||
{
|
||||
wxClientDC dcWin(GetWindow());
|
||||
// this is the new code, switch to 0 if this gives problems
|
||||
#if wxUSE_OVERLAY
|
||||
wxDCOverlay dcOverlay( m_overlay, &dcWin, m_x, m_y, m_width , m_height );
|
||||
if ( m_blinkedOut )
|
||||
{
|
||||
dcOverlay.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
DoDraw( &dcWin );
|
||||
}
|
||||
#else
|
||||
wxMemoryDC dcMem;
|
||||
dcMem.SelectObject(m_bmpUnderCaret);
|
||||
if ( m_blinkedOut )
|
||||
@@ -243,6 +258,7 @@ void wxCaret::Refresh()
|
||||
// and draw the caret there
|
||||
DoDraw(&dcWin);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxCaret::DoDraw(wxDC *dc)
|
||||
|
||||
Reference in New Issue
Block a user