]> git.saurik.com Git - wxWidgets.git/blobdiff - user/wxLayout/wxLayout.cpp
background bitmap test added, other minor fixes
[wxWidgets.git] / user / wxLayout / wxLayout.cpp
index 75459b8f59f41b14046cad43dfa6d3e39cdd7e37..c5d18ded8076e75b14aae19004eaf013144023aa 100644 (file)
@@ -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