From: Vadim Zeitlin Date: Sat, 5 Jun 1999 22:38:07 +0000 (+0000) Subject: background bitmap test added, other minor fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7cc7f0eb1801e3b97e98b01613b1366347eb46e9 background bitmap test added, other minor fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/user/wxLayout/wxLayout.cpp b/user/wxLayout/wxLayout.cpp index 75459b8f59..c5d18ded80 100644 --- a/user/wxLayout/wxLayout.cpp +++ b/user/wxLayout/wxLayout.cpp @@ -116,6 +116,22 @@ MyFrame::MyFrame(void) : m_lwin->SetWrapMargin(40); m_lwin->Clear(wxROMAN,16,wxNORMAL,wxNORMAL, false); m_lwin->SetFocus(); + + // create and set the background bitmap (this will result in a lattice) + static const int sizeBmp = 10; + wxBitmap *bitmap = new wxBitmap(sizeBmp, sizeBmp); + wxMemoryDC dcMem; + dcMem.SelectObject( *bitmap ); + dcMem.SetBackground( *wxWHITE_BRUSH ); + dcMem.Clear(); + + dcMem.SetPen( *wxGREEN_PEN ); + dcMem.DrawLine(sizeBmp/2, 0, sizeBmp/2, sizeBmp); + dcMem.DrawLine(0, sizeBmp/2, sizeBmp, sizeBmp/2); + + dcMem.SelectObject( wxNullBitmap ); + + m_lwin->SetBackgroundBitmap(bitmap); }; void diff --git a/user/wxLayout/wxllist.cpp b/user/wxLayout/wxllist.cpp index cc7aa01872..880527b2f9 100644 --- a/user/wxLayout/wxllist.cpp +++ b/user/wxLayout/wxllist.cpp @@ -2566,13 +2566,15 @@ wxLayoutList::ApplyStyle(wxLayoutStyleInfo *si, wxDC &dc) void wxLayoutList::Debug(void) { - wxLayoutLine *line; - + WXLO_DEBUG(("Cursor is in line %d, screen pos = (%d, %d)", + m_CursorLine->GetLineNumber(), + m_CursorScreenPos.x, m_CursorScreenPos.y)); - for(line = m_FirstLine; - line; - line = line->GetNextLine()) + wxLayoutLine *line; + for(line = m_FirstLine; line; line = line->GetNextLine()) + { line->Debug(); + } } #endif diff --git a/user/wxLayout/wxlwindow.cpp b/user/wxLayout/wxlwindow.cpp index 16d4d0d5f3..47ab65bdf4 100644 --- a/user/wxLayout/wxlwindow.cpp +++ b/user/wxLayout/wxlwindow.cpp @@ -558,7 +558,7 @@ wxLayoutWindow::ScrollToCursor(void) // Make sure that the scrollbars are at a position so that the cursor is // visible if we are editing WXLO_DEBUG(("m_ScrollToCursor = %d", (int) m_ScrollToCursor)); - wxPoint cc = m_llist->GetCursorScreenPos(*m_memDC); + wxPoint cc = m_llist->GetCursorScreenPos(dc); // the cursor should be completely visible in both directions wxPoint cs(m_llist->GetCursorSize());