+void wxPGProperty::EnsureCells( unsigned int column )
+{
+ if ( column >= m_cells.size() )
+ {
+ // Fill empty slots with default cells
+ wxPropertyGrid* pg = GetGrid();
+ wxPGCell defaultCell;
+
+ if ( !HasFlag(wxPG_PROP_CATEGORY) )
+ defaultCell = pg->GetPropertyDefaultCell();
+ else
+ defaultCell = pg->GetCategoryDefaultCell();
+
+ // TODO: Replace with resize() call
+ unsigned int cellCountMax = column+1;
+
+ for ( unsigned int i=m_cells.size(); i<cellCountMax; i++ )
+ m_cells.push_back(defaultCell);
+ }
+}
+
+void wxPGProperty::SetCell( int column,
+ const wxPGCell& cell )
+{
+ EnsureCells(column);
+
+ m_cells[column] = cell;
+}
+
+void wxPGProperty::AdaptiveSetCell( unsigned int firstCol,
+ unsigned int lastCol,
+ const wxPGCell& cell,
+ const wxPGCell& srcData,
+ wxPGCellData* unmodCellData,
+ FlagType ignoreWithFlags,
+ bool recursively )
+{
+ //
+ // Sets cell in memory optimizing fashion. That is, if
+ // current cell data matches unmodCellData, we will
+ // simply get reference to data from cell. Otherwise,
+ // cell information from srcData is merged into current.
+ //
+
+ if ( !(m_flags & ignoreWithFlags) && !IsRoot() )
+ {
+ EnsureCells(lastCol);
+
+ for ( unsigned int col=firstCol; col<=lastCol; col++ )
+ {
+ if ( m_cells[col].GetData() == unmodCellData )
+ {
+ // Data matches... use cell directly
+ m_cells[col] = cell;
+ }
+ else
+ {
+ // Data did not match... merge valid information
+ m_cells[col].MergeFrom(srcData);
+ }
+ }
+ }
+
+ if ( recursively )
+ {
+ for ( unsigned int i=0; i<GetChildCount(); i++ )
+ Item(i)->AdaptiveSetCell( firstCol,
+ lastCol,
+ cell,
+ srcData,
+ unmodCellData,
+ ignoreWithFlags,
+ recursively );
+ }
+}
+
+const wxPGCell& wxPGProperty::GetCell( unsigned int column ) const