]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datavcmn.cpp
Remove references to joytest.rc that was recently removed.
[wxWidgets.git] / src / common / datavcmn.cpp
index 5abb787ab2ff2b3b7116c586b55c05c8fdb927e3..1b2d20cdce980f0f7c248dc8e90f33791e3a3ea2 100644 (file)
@@ -357,7 +357,7 @@ void wxDataViewIndexListModel::Reset( unsigned int new_size )
 
     m_nextFreeID = new_size + 1;
 
-    wxDataViewModel::Cleared();
+    /* wxDataViewModel:: */ Cleared();
 }
 
 void wxDataViewIndexListModel::RowPrepended()
@@ -400,7 +400,7 @@ void wxDataViewIndexListModel::RowDeleted( unsigned int row )
     m_ordered = false;
 
     wxDataViewItem item( m_hash[row] );
-    wxDataViewModel::ItemDeleted( wxDataViewItem(0), item );
+    /* wxDataViewModel:: */ ItemDeleted( wxDataViewItem(0), item );
     m_hash.RemoveAt( row );
 }
 
@@ -418,7 +418,7 @@ void wxDataViewIndexListModel::RowsDeleted( const wxArrayInt &rows )
             wxDataViewItem item( m_hash[rows[i]] );
             array.Add( item );
     }
-    wxDataViewModel::ItemsDeleted( wxDataViewItem(0), array );
+    /* wxDataViewModel:: */ ItemsDeleted( wxDataViewItem(0), array );
 
     for (i = 0; i < sorted.GetCount(); i++)
            m_hash.RemoveAt( sorted[i] );
@@ -426,12 +426,12 @@ void wxDataViewIndexListModel::RowsDeleted( const wxArrayInt &rows )
 
 void wxDataViewIndexListModel::RowChanged( unsigned int row )
 {
-    wxDataViewModel::ItemChanged( GetItem(row) );
+    /* wxDataViewModel:: */ ItemChanged( GetItem(row) );
 }
 
 void wxDataViewIndexListModel::RowValueChanged( unsigned int row, unsigned int col )
 {
-    wxDataViewModel::ValueChanged( GetItem(row), col );
+    /* wxDataViewModel:: */ ValueChanged( GetItem(row), col );
 }
 
 unsigned int wxDataViewIndexListModel::GetRow( const wxDataViewItem &item ) const
@@ -501,7 +501,7 @@ void wxDataViewVirtualListModel::Reset( unsigned int new_size )
 {
     m_size = new_size;
 
-    wxDataViewModel::Cleared();
+    /* wxDataViewModel:: */ Cleared();
 }
 
 void wxDataViewVirtualListModel::RowPrepended()
@@ -529,7 +529,7 @@ void wxDataViewVirtualListModel::RowDeleted( unsigned int row )
 {
     m_size--;
     wxDataViewItem item( wxUIntToPtr(row+1) );
-    wxDataViewModel::ItemDeleted( wxDataViewItem(0), item );
+    /* wxDataViewModel:: */ ItemDeleted( wxDataViewItem(0), item );
 }
 
 void wxDataViewVirtualListModel::RowsDeleted( const wxArrayInt &rows )
@@ -543,20 +543,20 @@ void wxDataViewVirtualListModel::RowsDeleted( const wxArrayInt &rows )
     unsigned int i;
     for (i = 0; i < sorted.GetCount(); i++)
     {
-            wxDataViewItem item( wxUIntToPtr(sorted[i]+1) );
-            array.Add( item );
+        wxDataViewItem item( wxUIntToPtr(sorted[i]+1) );
+        array.Add( item );
     }
-    wxDataViewModel::ItemsDeleted( wxDataViewItem(0), array );
+    /* wxDataViewModel:: */ ItemsDeleted( wxDataViewItem(0), array );
 }
 
 void wxDataViewVirtualListModel::RowChanged( unsigned int row )
 {
-    wxDataViewModel::ItemChanged( GetItem(row) );
+    /* wxDataViewModel:: */ ItemChanged( GetItem(row) );
 }
 
 void wxDataViewVirtualListModel::RowValueChanged( unsigned int row, unsigned int col )
 {
-    wxDataViewModel::ValueChanged( GetItem(row), col );
+    /* wxDataViewModel:: */ ValueChanged( GetItem(row), col );
 }
 
 unsigned int wxDataViewVirtualListModel::GetRow( const wxDataViewItem &item ) const
@@ -1433,6 +1433,49 @@ bool wxDataViewChoiceRenderer::GetValue( wxVariant &value ) const
     return true;
 }
 
+// ----------------------------------------------------------------------------
+// wxDataViewChoiceByIndexRenderer
+// ----------------------------------------------------------------------------
+
+wxDataViewChoiceByIndexRenderer::wxDataViewChoiceByIndexRenderer( const wxArrayString &choices,
+                                  wxDataViewCellMode mode, int alignment ) :
+      wxDataViewChoiceRenderer( choices, mode, alignment )
+{
+}
+                            
+wxControl* wxDataViewChoiceByIndexRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
+{
+    wxVariant string_value = GetChoice( value.GetLong() );
+    
+    return wxDataViewChoiceRenderer::CreateEditorCtrl( parent, labelRect, string_value );
+}
+
+bool wxDataViewChoiceByIndexRenderer::GetValueFromEditorCtrl( wxControl* editor, wxVariant &value )
+{
+    wxVariant string_value;
+    if (!wxDataViewChoiceRenderer::GetValueFromEditorCtrl( editor, string_value ))
+        return false;
+
+    value = (long) GetChoices().Index( string_value.GetString() );
+    return true;
+}
+
+bool wxDataViewChoiceByIndexRenderer::SetValue( const wxVariant &value )
+{
+    wxVariant string_value = GetChoice( value.GetLong() );
+    return wxDataViewChoiceRenderer::SetValue( string_value );
+}
+    
+bool wxDataViewChoiceByIndexRenderer::GetValue( wxVariant &value ) const
+{
+    wxVariant string_value;
+    if (!wxDataViewChoiceRenderer::GetValue( string_value ))
+        return false;
+            
+    value = (long) GetChoices().Index( string_value.GetString() );
+    return true;
+}
+
 #endif
 
 //-----------------------------------------------------------------------------