]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/listbox.cpp
added correct pen styles for wxDOT etc as well as wxSTIPPLE implementation for 8x8...
[wxWidgets.git] / src / mac / carbon / listbox.cpp
index ffbe8e70358ce8c5e161d65fd4edbe8844b9fd69..8aa4fda2a3e16d84fb70b0fa8c216917d8be6681 100644 (file)
 #include "wx/app.h"
 #include "wx/listbox.h"
 #include "wx/settings.h"
+#include "wx/toplevel.h"
 #include "wx/dynarray.h"
 #include "wx/log.h"
 
 #include "wx/utils.h"
-#ifndef __DARWIN__
-//  #include "extldef.h"
-#endif
 
 #if !USE_SHARED_LIBRARY
   IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
@@ -126,6 +124,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
 
 extern "C" void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) ;
 const short kwxMacListWithVerticalScrollbar = 128 ;
+const short kwxMacListItemHeight = 14 ;
 
 // ============================================================================
 // list box control implementation
@@ -164,12 +163,13 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
       macListDefUPP = NewListDefUPP( wxMacListDefinition ); 
     }
         listDef.u.userProc = macListDefUPP ;
+
 #if TARGET_CARBON
     Size asize;
 
 
-    CreateListBoxControl( parent->GetMacRootWindow(), &bounds, false, 0, 1, false, true,
-                          14, 14, false, &listDef, &m_macControl );
+    CreateListBoxControl( parent->MacGetRootWindow(), &bounds, false, 0, 1, false, true,
+                          kwxMacListItemHeight, kwxMacListItemHeight, false, &listDef, &m_macControl );
 
     GetControlData(m_macControl, kControlNoPart, kControlListBoxListHandleTag,
                    sizeof(ListHandle), (Ptr) &m_macList, &asize);
@@ -178,9 +178,10 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     SetControlVisibility(m_macControl, false, false);
 
 #else
+
     long    result ;
 
-    m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false ,
+    m_macControl = ::NewControl( parent->MacGetRootWindow() , &bounds , title , false ,
                   kwxMacListWithVerticalScrollbar , 0 , 0, 
                   kControlListBoxProc , (long) this ) ;
     ::GetControlData( m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
@@ -197,9 +198,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     }
         
     Point pt = (**m_macList).cellSize ;
-    pt.v = 14 ;
+    pt.v = kwxMacListItemHeight ;
     LCellSize( pt , m_macList ) ;
-    
     LAddColumn( 1 , 0 , m_macList ) ;
 #endif
     OptionBits  options = 0;
@@ -587,12 +587,8 @@ void wxListBox::SetupColours()
 
 void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
 {
-    // Set up port
-    WindowRef rootwindow = GetMacRootWindow() ;
-    wxWindow* wxrootwindow = wxFindWinFromMacWindow( rootwindow ) ;
-    wxMacDrawingHelper focus( wxrootwindow );
-
-    UMADrawControl(m_macControl);
+    wxControl::Refresh( eraseBack , rect ) ;
+//    MacRedrawControl() ;
 }
 
 #if wxUSE_OWNER_DRAWN