]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgrid.cpp
Added 'bool editable' argument to wxPropertyGrid::MakeColumnEditable()
[wxWidgets.git] / src / propgrid / propgrid.cpp
index 6f8ad9737990eab98764c8fc8d906d838c2e3973..e520c268a2b1e6f458a78a522a1d8e67efc2d10d 100644 (file)
@@ -925,6 +925,29 @@ void wxPropertyGrid::DoSetSelection( const wxArrayPGProperty& newSelection,
 
 // -----------------------------------------------------------------------
 
+void wxPropertyGrid::MakeColumnEditable( unsigned int column,
+                                         bool editable )
+{
+    wxASSERT( column != 1 );
+
+    wxArrayInt& cols = m_pState->m_editableColumns;
+
+    if ( editable )
+    {
+        cols.push_back(column);
+    }
+    else
+    {
+        for ( int i = cols.size() - 1; i > 0; i-- )
+        {
+            if ( cols[i] == (int)column )
+                cols.erase( cols.begin() + i );
+        }
+    }
+}
+
+// -----------------------------------------------------------------------
+
 void wxPropertyGrid::DoBeginLabelEdit( unsigned int colIndex,
                                        int selFlags )
 {