]> git.saurik.com Git - wxWidgets.git/commitdiff
Override CreateItem so wxListBox can turn its notifications into events.
authorRobin Dunn <robin@alldunn.com>
Sun, 8 Oct 2006 06:37:50 +0000 (06:37 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 8 Oct 2006 06:37:50 +0000 (06:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/carbon/private.h
src/mac/carbon/listbox.cpp

index 1546005d453870b70785ed17e707ac524319db3d..75947c1baeac2bb3f5ddb4e41b9c6f318f373a78 100644 (file)
@@ -1054,6 +1054,8 @@ public:
     wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style );
     virtual ~wxMacDataBrowserListControl();
 
+    virtual wxMacDataItem* CreateItem();
+
     // pointing back
 
     wxWindow * GetPeer() const;
index e33c00c5ddaf9a4dbd53454a42f00fb6e372c12c..35de39915c5470ee259b9accd6abe9bde51b2d3b 100644 (file)
@@ -503,10 +503,12 @@ void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner ,
         event.SetString( m_label );
         event.SetInt( owner->GetLineFromItem( this ) );
         event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : true );
-        wxPostEvent( list->GetEventHandler(), event );
 
-        // direct notification is not always having the listbox GetSelection() having in synch with event
+        // direct notification is not always having the listbox GetSelection()
+        // having in synch with event, so use wxPostEvent instead
         // list->GetEventHandler()->ProcessEvent(event);
+
+        wxPostEvent( list->GetEventHandler(), event );
     }
 }
 
@@ -602,6 +604,11 @@ wxWindow * wxMacDataBrowserListControl::GetPeer() const
     return wxDynamicCast( wxMacControl::GetPeer() , wxWindow );
 }
 
+wxMacDataItem* wxMacDataBrowserListControl::CreateItem()
+{
+    return new wxMacListBoxItem();
+}
+
 #if 0
 
 // in case we need that one day