+ m_CursorCoords = wxPoint(0, m_CursorCoords.y);
+ m_CursorSize = wxPoint(2,baseLineSkip);
+ }
+ else
+ {
+ // this is not necessarily the most "beautiful" solution:
+ //cursorPosition = wxPoint(position.x, position.y);
+ //cursorSize = wxPoint(size.x > 0 ? size.x : 1,size.y > 0 ? size.y : baseLineSkip);
+ m_CursorCoords = wxPoint(m_CursorCoords.x+obj.GetSize().x, m_CursorCoords.y);
+ m_CursorSize = wxPoint(2, obj.GetSize().y);
+ if(m_CursorSize.y < 1) m_CursorSize.y = baseLineSkip;
+ }
+ WXL_VAR(m_CursorCoords.x);
+ m_CursorMoved = false; // coords are valid
+}
+
+void
+wxLayoutList::DrawCursor(wxDC &dc, bool erase)
+{
+
+ if(erase)
+ {
+ //dc.SetBrush(*wxWHITE_BRUSH);
+ //dc.SetPen(wxPen(*wxWHITE,1,wxSOLID));
+ //dc.DrawRectangle(m_CursorCoords.x, m_CursorCoords.y, m_CursorSize.x, m_CursorSize.y);
+ dc.Blit(m_CursorCoords.x, m_CursorCoords.y, m_CursorSize.x,
+ m_CursorSize.y, &m_CursorMemDC,
+ 0, 0, 0, 0);
+ }
+ else
+ {
+ if(IsDirty() || CursorMoved())
+ {
+ DrawCursor(dc,true);
+ Layout(dc);
+ }
+ // Save background:
+ wxBitmap bm(m_CursorSize.x,m_CursorSize.y);
+ m_CursorMemDC.SelectObject(bm);
+ m_CursorMemDC.Blit(0, 0, m_CursorSize.x, m_CursorSize.y,
+ &dc, m_CursorCoords.x,
+ m_CursorCoords.y, 0, 0);
+ dc.SetBrush(*wxBLACK_BRUSH);
+ dc.SetPen(wxPen(*wxBLACK,1,wxSOLID));
+ dc.DrawRectangle(m_CursorCoords.x, m_CursorCoords.y,
+ m_CursorSize.x, m_CursorSize.y);