]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/listctrl.cpp
Add a trivial virtual dtor to suppress g++ warnings.
[wxWidgets.git] / src / os2 / listctrl.cpp
index 062a528006c8b96673d23fdd0bc63e55ae91b069..9d90a9952370bab5d975b1a8dc7b7ea4b926fa3d 100644 (file)
@@ -106,7 +106,7 @@ typedef struct _MYRECORD
 // Problem:
 //  The MSW version had problems with SetTextColour() et al as the
 //  CListItemAttr's were stored keyed on the item index. If a item was
 // Problem:
 //  The MSW version had problems with SetTextColour() et al as the
 //  CListItemAttr's were stored keyed on the item index. If a item was
-//  inserted anywhere but the end of the list the the text attributes
+//  inserted anywhere but the end of the list the text attributes
 //  (colour etc) for the following items were out of sync.
 //
 // Solution:
 //  (colour etc) for the following items were out of sync.
 //
 // Solution:
@@ -140,8 +140,7 @@ public:
 
     ~CListItemInternalData()
     {
 
     ~CListItemInternalData()
     {
-        delete m_pAttr;
-        m_pAttr = NULL;
+        wxDELETE(m_pAttr);
     }
 
     wxListItemAttr*                 m_pAttr;
     }
 
     wxListItemAttr*                 m_pAttr;
@@ -774,13 +773,6 @@ void ConvertToOS2ListCol (
     pField->offStruct = 0;
 } // end of ConvertToOS2ListCol
 
     pField->offStruct = 0;
 } // end of ConvertToOS2ListCol
 
-
-IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
-IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
-IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
-
-IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
-
 BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
     EVT_PAINT(wxListCtrl::OnPaint)
 END_EVENT_TABLE()
 BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
     EVT_PAINT(wxListCtrl::OnPaint)
 END_EVENT_TABLE()
@@ -965,8 +957,7 @@ wxListCtrl::~wxListCtrl ()
     {
         m_pTextCtrl->SetHWND(0);
         m_pTextCtrl->UnsubclassWin();
     {
         m_pTextCtrl->SetHWND(0);
         m_pTextCtrl->UnsubclassWin();
-        delete m_pTextCtrl;
-        m_pTextCtrl = NULL;
+        wxDELETE(m_pTextCtrl);
     }
 
     if (m_bOwnsImageListNormal)
     }
 
     if (m_bOwnsImageListNormal)
@@ -2256,7 +2247,7 @@ long wxListCtrl::InsertItem (
     vInsert.fInvalidateRecord = TRUE;
 
     //
     vInsert.fInvalidateRecord = TRUE;
 
     //
-    // Check wether we need to allocate our internal data
+    // Check whether we need to allocate our internal data
     //
     bool                            bNeedInternalData = ((rInfo.GetMask() & wxLIST_MASK_DATA) ||
                                                           rInfo.HasAttributes()
     //
     bool                            bNeedInternalData = ((rInfo.GetMask() & wxLIST_MASK_DATA) ||
                                                           rInfo.HasAttributes()
@@ -2454,7 +2445,7 @@ bool wxListCtrl::OS2Command ( WXUINT uCmd, WXWORD wId )
 {
     if (uCmd == CN_ENDEDIT)
     {
 {
     if (uCmd == CN_ENDEDIT)
     {
-        wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, wId );
+        wxCommandEvent vEvent( wxEVT_TEXT, wId );
 
         vEvent.SetEventObject( this );
         ProcessCommand(vEvent);
 
         vEvent.SetEventObject( this );
         ProcessCommand(vEvent);
@@ -2597,19 +2588,6 @@ int wxListCtrl::OnGetItemColumnImage (
     return -1;
 } // end of wxListCtrl::OnGetItemColumnImage
 
     return -1;
 } // end of wxListCtrl::OnGetItemColumnImage
 
-wxListItemAttr* wxListCtrl::OnGetItemAttr (
-  long                              WXUNUSED_UNLESS_DEBUG(lItem)
-) const
-{
-    wxASSERT_MSG( lItem >= 0 && lItem < GetItemCount(),
-                  wxT("invalid item index in OnGetItemAttr()") );
-
-    //
-    // No attributes by default
-    //
-    return NULL;
-} // end of wxListCtrl::OnGetItemAttr
-
 void wxListCtrl::SetItemCount (
   long                              lCount
 )
 void wxListCtrl::SetItemCount (
   long                              lCount
 )
@@ -2696,7 +2674,7 @@ MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg,
                     {
                         PMYRECORD       pRecord = (PMYRECORD)pDragInit->pRecord;
 
                     {
                         PMYRECORD       pRecord = (PMYRECORD)pDragInit->pRecord;
 
-                        vEventType = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
+                        vEventType = wxEVT_LIST_BEGIN_RDRAG;
                         vEvent.m_itemIndex   = pRecord->m_ulItemId;
                         vEvent.m_pointDrag.x = pDragInit->x;
                         vEvent.m_pointDrag.y = pDragInit->y;
                         vEvent.m_itemIndex   = pRecord->m_ulItemId;
                         vEvent.m_pointDrag.x = pDragInit->x;
                         vEvent.m_pointDrag.y = pDragInit->y;
@@ -2707,7 +2685,7 @@ MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg,
                     pEditData = (PCNREDITDATA)lParam;
                     if (pEditData)
                     {
                     pEditData = (PCNREDITDATA)lParam;
                     if (pEditData)
                     {
-                        vEventType = wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
+                        vEventType = wxEVT_LIST_BEGIN_LABEL_EDIT;
                         ConvertFromOS2ListItem( GetHWND()
                                                ,(wxListItem &)vEvent.GetItem()
                                                ,(PMYRECORD)pEditData->pRecord
                         ConvertFromOS2ListItem( GetHWND()
                                                ,(wxListItem &)vEvent.GetItem()
                                                ,(PMYRECORD)pEditData->pRecord
@@ -2720,7 +2698,7 @@ MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg,
                     pEditData = (PCNREDITDATA)lParam;
                     if (pEditData)
                     {
                     pEditData = (PCNREDITDATA)lParam;
                     if (pEditData)
                     {
-                        vEventType = wxEVT_COMMAND_LIST_END_LABEL_EDIT;
+                        vEventType = wxEVT_LIST_END_LABEL_EDIT;
                         ConvertFromOS2ListItem( GetHWND()
                                                ,(wxListItem &)vEvent.GetItem()
                                                ,(PMYRECORD)pEditData->pRecord
                         ConvertFromOS2ListItem( GetHWND()
                                                ,(wxListItem &)vEvent.GetItem()
                                                ,(PMYRECORD)pEditData->pRecord
@@ -2738,7 +2716,7 @@ MRESULT wxListCtrl::OS2WindowProc( WXUINT uMsg,
                         wxListItem*     pItem = (wxListItem*)&vEvent.GetItem();
                         PMYRECORD       pMyRecord = (PMYRECORD)pNotifyEnter->pRecord;
 
                         wxListItem*     pItem = (wxListItem*)&vEvent.GetItem();
                         PMYRECORD       pMyRecord = (PMYRECORD)pNotifyEnter->pRecord;
 
-                        vEventType             = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
+                        vEventType             = wxEVT_LIST_ITEM_ACTIVATED;
                         vEvent.m_itemIndex = pMyRecord->m_ulItemId;
                         pItem->SetText(GetItemText(pMyRecord->m_ulItemId));
                         pItem->SetData(GetItemData(pMyRecord->m_ulItemId));
                         vEvent.m_itemIndex = pMyRecord->m_ulItemId;
                         pItem->SetText(GetItemText(pMyRecord->m_ulItemId));
                         pItem->SetData(GetItemData(pMyRecord->m_ulItemId));