wxGridCellAttr::Clone() added to allow the demo of custom grid cell attr provider to work

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-28 19:08:01 +00:00
parent 3f5513f5bb
commit a68c1246db
4 changed files with 116 additions and 4 deletions

View File

@@ -1354,6 +1354,37 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid,
// wxGridCellAttr
// ----------------------------------------------------------------------------
wxGridCellAttr *wxGridCellAttr::Clone()
{
wxGridCellAttr *attr = new wxGridCellAttr;
if ( HasTextColour() )
attr->SetTextColour(GetTextColour());
if ( HasBackgroundColour() )
attr->SetBackgroundColour(GetBackgroundColour());
if ( HasFont() )
attr->SetFont(GetFont());
if ( HasAlignment() )
attr->SetAlignment(m_hAlign, m_vAlign);
if ( m_renderer )
{
attr->SetRenderer(m_renderer);
m_renderer = NULL;
}
if ( m_editor )
{
attr->SetEditor(m_editor);
m_editor = NULL;
}
if ( IsReadOnly() )
attr->SetReadOnly();
attr->SetDefAttr(m_defGridAttr);
return attr;
}
const wxColour& wxGridCellAttr::GetTextColour() const
{
if (HasTextColour())