Can you set multiple wxGrid Colum Attributes?
Bob
wxwidgets at gmail.com
Wed Jan 9 12:10:18 PST 2008
I have a wxGrid with three columns. I want all of the grid
to be ReadOnly. If I do this:
m_LogGrid->ClearGrid();
wxGridCellAttr *ReadOnlyAttr =3D new wxGridCellAttr;// Remove all previous
background colors, and set all of grid ReadOnly
ReadOnlyAttr->SetReadOnly();
m_LogGrid->SetColAttr( LogGridColDate, ReadOnlyAttr );
m_LogGrid->SetColAttr( LogGridColEventInHuman, ReadOnlyAttr );
m_LogGrid->SetColAttr( LogGridColEvent, ReadOnlyAttr );
and do not do this:
wxColour default_cell_background_color =3D
m_LogGrid->GetDefaultCellBackgroundColour();
wxGridCellAttr *ColorAttr =3D new wxGridCellAttr;// Remove all previous
background colors, and set all of grid ReadOnly
ColorAttr->SetBackgroundColour( default_cell_background_color );
m_LogGrid->SetColAttr( LogGridColDate, ColorAttr );
m_LogGrid->SetColAttr( LogGridColEventInHuman, ColorAttr );
m_LogGrid->SetColAttr( LogGridColEvent, ColorAttr );
the gird is ReadOnly as I want, but if I do try to set the background color
of the grid as well, then the grid is no longer read only.
Is it possible to set more than one attribute on a column?
Also the setting of the default background color doesn't seem to work.
If I load my data in to the grid, which colors each cell depending on
the data loaded I get colored cells as I want. However when
I try to return all of the cell backgrounds back to their
default color, when I load new data next time, the old
colors remain. How do I restore the entire grid
to its default background color?
This is with wx287, and Digital Mars Compiler, on Windows XP.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080109/a12=
a82be/attachment.htm
More information about the wx-users
mailing list