]> git.saurik.com Git - wxWidgets.git/commitdiff
Sizing and positioning fixes for generic control.
authorKevin Ollivier <kevino@theolliviers.com>
Sat, 4 Nov 2006 21:38:36 +0000 (21:38 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sat, 4 Nov 2006 21:38:36 +0000 (21:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/listctrl_mac.cpp

index af509328045803cefd4f75a689087dea6bc402d4..5450de5164af651c0720231f26cc5cdf53bdd005 100644 (file)
@@ -629,7 +629,9 @@ bool wxListCtrl::Create(wxWindow *parent,
 
         if ( !wxWindow::Create(parent, id, pos, size, style & wxNO_BORDER, name) )
             return false;
 
         if ( !wxWindow::Create(parent, id, pos, size, style & wxNO_BORDER, name) )
             return false;
-        m_genericImpl = new wxGenericListCtrlHook(this, id, pos, size, style, validator, name);
+        
+        // since the generic control is a child, make sure we position it at 0, 0
+        m_genericImpl = new wxGenericListCtrlHook(this, id, wxPoint(0, 0), size, style, validator, name);
         m_genericImpl->PushEventHandler( new wxMacListCtrlEventDelegate( this, GetId() ) );
         return true;
     }
         m_genericImpl->PushEventHandler( new wxMacListCtrlEventDelegate( this, GetId() ) );
         return true;
     }
@@ -719,14 +721,11 @@ void wxListCtrl::DoSetSize( int x, int y, int width, int height, int sizeFlags )
     wxControl::DoSetSize(x, y, width, height, sizeFlags);
 
     if (m_genericImpl)
     wxControl::DoSetSize(x, y, width, height, sizeFlags);
 
     if (m_genericImpl)
-        m_genericImpl->SetSize(x, y, width, height, sizeFlags);
+        m_genericImpl->SetSize(0, 0, width, height, sizeFlags);
 }
 
 wxSize wxListCtrl::DoGetBestSize() const
 {
 }
 
 wxSize wxListCtrl::DoGetBestSize() const
 {
-    if (m_genericImpl)
-        return m_genericImpl->GetBestSize();
-
     return wxWindow::DoGetBestSize();
 }
 
     return wxWindow::DoGetBestSize();
 }