+ if ( m_cells.size() > column )
+ return m_cells[column];
+
+ wxPropertyGrid* pg = GetGrid();
+
+ if ( IsCategory() )
+ return pg->GetCategoryDefaultCell();
+
+ return pg->GetPropertyDefaultCell();
+}
+
+wxPGCell& wxPGProperty::GetCell( unsigned int column )
+{
+ EnsureCells(column);
+ return m_cells[column];
+}
+
+void wxPGProperty::SetBackgroundColour( const wxColour& colour,
+ bool recursively )
+{
+ wxPGProperty* firstProp = this;
+
+ //
+ // If category is tried to set recursively, skip it and only
+ // affect the children.
+ if ( recursively )
+ {
+ while ( firstProp->IsCategory() )
+ {
+ if ( !firstProp->GetChildCount() )
+ return;
+ firstProp = firstProp->Item(0);
+ }
+ }
+
+ wxPGCell& firstCell = firstProp->GetCell(0);
+ wxPGCellData* firstCellData = firstCell.GetData();
+
+ wxPGCell newCell(firstCell);
+ newCell.SetBgCol(colour);
+ wxPGCell srcCell;
+ srcCell.SetBgCol(colour);
+
+ AdaptiveSetCell( 0,
+ GetParentState()->GetColumnCount()-1,
+ newCell,
+ srcCell,
+ firstCellData,
+ recursively ? wxPG_PROP_CATEGORY : 0,
+ recursively );
+}
+
+void wxPGProperty::SetTextColour( const wxColour& colour,
+ bool recursively )
+{
+ wxPGProperty* firstProp = this;
+
+ //
+ // If category is tried to set recursively, skip it and only
+ // affect the children.
+ if ( recursively )
+ {
+ while ( firstProp->IsCategory() )
+ {
+ if ( !firstProp->GetChildCount() )
+ return;
+ firstProp = firstProp->Item(0);
+ }
+ }
+
+ wxPGCell& firstCell = firstProp->GetCell(0);
+ wxPGCellData* firstCellData = firstCell.GetData();
+
+ wxPGCell newCell(firstCell);
+ newCell.SetFgCol(colour);
+ wxPGCell srcCell;
+ srcCell.SetFgCol(colour);