]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/vlbox.cpp
!__WX_DC_BLIT_FIXED__ case
[wxWidgets.git] / src / generic / vlbox.cpp
index 0195b3e4c073509dee66e0bf027aef12609233e2..2a3ca54d1cbce461ab5a6664f0dd6fb3af239648 100644 (file)
@@ -64,7 +64,6 @@ void wxVListBox::Init()
     m_current =
     m_anchor = wxNOT_FOUND;
     m_selStore = NULL;
     m_current =
     m_anchor = wxNOT_FOUND;
     m_selStore = NULL;
-    m_doubleBuffer = NULL;
 }
 
 bool wxVListBox::Create(wxWindow *parent,
 }
 
 bool wxVListBox::Create(wxWindow *parent,
@@ -94,7 +93,6 @@ bool wxVListBox::Create(wxWindow *parent,
 
 wxVListBox::~wxVListBox()
 {
 
 wxVListBox::~wxVListBox()
 {
-    delete m_doubleBuffer;
     delete m_selStore;
 }
 
     delete m_selStore;
 }
 
@@ -264,7 +262,10 @@ void wxVListBox::SetSelection(int selection)
 
     if ( HasMultipleSelection() )
     {
 
     if ( HasMultipleSelection() )
     {
-        Select(selection);
+        if (selection != wxNOT_FOUND)
+            Select(selection);
+        else
+            DeselectAll();
         m_anchor = selection;
     }
 
         m_anchor = selection;
     }
 
@@ -357,18 +358,9 @@ void wxVListBox::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const
 
 void wxVListBox::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
 
 void wxVListBox::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
-    // If size is larger, recalculate double buffer bitmap
     wxSize clientSize = GetClientSize();
 
     wxSize clientSize = GetClientSize();
 
-    if ( !m_doubleBuffer ||
-         clientSize.x > m_doubleBuffer->GetWidth() ||
-         clientSize.y > m_doubleBuffer->GetHeight() )
-    {
-        delete m_doubleBuffer;
-        m_doubleBuffer = new wxBitmap(clientSize.x+25,clientSize.y+25);
-    }
-
-    wxBufferedPaintDC dc(this,*m_doubleBuffer);
+    wxAutoBufferedPaintDC dc(this);
 
     // the update rectangle
     wxRect rectUpdate = GetUpdateClientRect();
 
     // the update rectangle
     wxRect rectUpdate = GetUpdateClientRect();