+ return m_defaultRowHeight;
+}
+
+int wxGrid::GetRowSize( int row ) const
+{
+ wxCHECK_MSG( row >= 0 && row < m_numRows, 0, wxT("invalid row index") );
+
+ return GetRowHeight(row);
+}
+
+int wxGrid::GetDefaultColSize() const
+{
+ return m_defaultColWidth;
+}
+
+int wxGrid::GetColSize( int col ) const
+{
+ wxCHECK_MSG( col >= 0 && col < m_numCols, 0, wxT("invalid column index") );
+
+ return GetColWidth(col);
+}
+
+// ============================================================================
+// access to the grid attributes: each of them has a default value in the grid
+// itself and may be overidden on a per-cell basis
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// setting default attributes
+// ----------------------------------------------------------------------------
+
+void wxGrid::SetDefaultCellBackgroundColour( const wxColour& col )
+{
+ m_defaultCellAttr->SetBackgroundColour(col);
+#ifdef __WXGTK__
+ m_gridWin->SetBackgroundColour(col);
+#endif
+}
+
+void wxGrid::SetDefaultCellTextColour( const wxColour& col )
+{
+ m_defaultCellAttr->SetTextColour(col);
+}
+
+void wxGrid::SetDefaultCellAlignment( int horiz, int vert )
+{
+ m_defaultCellAttr->SetAlignment(horiz, vert);
+}
+
+void wxGrid::SetDefaultCellOverflow( bool allow )
+{
+ m_defaultCellAttr->SetOverflow(allow);
+}
+
+void wxGrid::SetDefaultCellFont( const wxFont& font )
+{
+ m_defaultCellAttr->SetFont(font);
+}
+
+// For editors and renderers the type registry takes precedence over the
+// default attr, so we need to register the new editor/renderer for the string
+// data type in order to make setting a default editor/renderer appear to
+// work correctly.
+
+void wxGrid::SetDefaultRenderer(wxGridCellRenderer *renderer)
+{
+ RegisterDataType(wxGRID_VALUE_STRING,
+ renderer,
+ GetDefaultEditorForType(wxGRID_VALUE_STRING));
+}
+
+void wxGrid::SetDefaultEditor(wxGridCellEditor *editor)
+{
+ RegisterDataType(wxGRID_VALUE_STRING,
+ GetDefaultRendererForType(wxGRID_VALUE_STRING),
+ editor);
+}
+
+// ----------------------------------------------------------------------------
+// access to the default attributes
+// ----------------------------------------------------------------------------
+
+wxColour wxGrid::GetDefaultCellBackgroundColour() const
+{
+ return m_defaultCellAttr->GetBackgroundColour();
+}
+
+wxColour wxGrid::GetDefaultCellTextColour() const
+{
+ return m_defaultCellAttr->GetTextColour();
+}
+
+wxFont wxGrid::GetDefaultCellFont() const
+{
+ return m_defaultCellAttr->GetFont();
+}
+
+void wxGrid::GetDefaultCellAlignment( int *horiz, int *vert ) const
+{
+ m_defaultCellAttr->GetAlignment(horiz, vert);
+}
+
+bool wxGrid::GetDefaultCellOverflow() const
+{
+ return m_defaultCellAttr->GetOverflow();
+}
+
+wxGridCellRenderer *wxGrid::GetDefaultRenderer() const
+{
+ return m_defaultCellAttr->GetRenderer(NULL, 0, 0);
+}
+
+wxGridCellEditor *wxGrid::GetDefaultEditor() const
+{
+ return m_defaultCellAttr->GetEditor(NULL, 0, 0);
+}
+
+// ----------------------------------------------------------------------------
+// access to cell attributes
+// ----------------------------------------------------------------------------
+
+wxColour wxGrid::GetCellBackgroundColour(int row, int col) const
+{
+ wxGridCellAttr *attr = GetCellAttr(row, col);
+ wxColour colour = attr->GetBackgroundColour();
+ attr->DecRef();
+
+ return colour;
+}
+
+wxColour wxGrid::GetCellTextColour( int row, int col ) const
+{
+ wxGridCellAttr *attr = GetCellAttr(row, col);
+ wxColour colour = attr->GetTextColour();
+ attr->DecRef();
+
+ return colour;
+}
+
+wxFont wxGrid::GetCellFont( int row, int col ) const
+{
+ wxGridCellAttr *attr = GetCellAttr(row, col);
+ wxFont font = attr->GetFont();
+ attr->DecRef();
+
+ return font;
+}
+
+void wxGrid::GetCellAlignment( int row, int col, int *horiz, int *vert ) const
+{
+ wxGridCellAttr *attr = GetCellAttr(row, col);
+ attr->GetAlignment(horiz, vert);
+ attr->DecRef();
+}
+
+bool wxGrid::GetCellOverflow( int row, int col ) const
+{
+ wxGridCellAttr *attr = GetCellAttr(row, col);
+ bool allow = attr->GetOverflow();
+ attr->DecRef();
+
+ return allow;
+}
+
+wxGrid::CellSpan
+wxGrid::GetCellSize( int row, int col, int *num_rows, int *num_cols ) const
+{
+ wxGridCellAttr *attr = GetCellAttr(row, col);
+ attr->GetSize( num_rows, num_cols );
+ attr->DecRef();
+
+ if ( *num_rows == 1 && *num_cols == 1 )
+ return CellSpan_None; // just a normal cell
+
+ if ( *num_rows < 0 || *num_cols < 0 )
+ return CellSpan_Inside; // covered by a multi-span cell
+
+ // this cell spans multiple cells to its right/bottom
+ return CellSpan_Main;
+}
+
+wxGridCellRenderer* wxGrid::GetCellRenderer(int row, int col) const
+{
+ wxGridCellAttr* attr = GetCellAttr(row, col);
+ wxGridCellRenderer* renderer = attr->GetRenderer(this, row, col);
+ attr->DecRef();
+
+ return renderer;
+}
+
+wxGridCellEditor* wxGrid::GetCellEditor(int row, int col) const
+{
+ wxGridCellAttr* attr = GetCellAttr(row, col);
+ wxGridCellEditor* editor = attr->GetEditor(this, row, col);
+ attr->DecRef();
+
+ return editor;
+}
+
+bool wxGrid::IsReadOnly(int row, int col) const
+{
+ wxGridCellAttr* attr = GetCellAttr(row, col);
+ bool isReadOnly = attr->IsReadOnly();
+ attr->DecRef();
+
+ return isReadOnly;
+}
+
+// ----------------------------------------------------------------------------
+// attribute support: cache, automatic provider creation, ...
+// ----------------------------------------------------------------------------
+
+bool wxGrid::CanHaveAttributes() const
+{
+ if ( !m_table )