added attr assignment for rows/columns

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-11 21:14:58 +00:00
parent 0a97676587
commit 758cbedf84
3 changed files with 230 additions and 17 deletions

View File

@@ -201,6 +201,14 @@ GridFrame::GridFrame()
grid->SetCellAlignment(4, 4, wxCENTRE, wxCENTRE);
grid->SetCellRenderer(4, 4, new MyGridCellRenderer);
wxGridCellAttr *attr;
attr = new wxGridCellAttr;
attr->SetTextColour(*wxBLUE);
grid->SetColAttr(5, attr);
attr = new wxGridCellAttr;
attr->SetBackgroundColour(*wxBLUE);
grid->SetRowAttr(5, attr);
wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
topSizer->Add( grid,
1,
@@ -447,14 +455,20 @@ void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) )
{
wxColour col = wxGetColourFromUser(this);
if ( col.Ok() )
{
grid->SetDefaultCellTextColour(col);
grid->Refresh();
}
}
void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) )
{
wxColour col = wxGetColourFromUser(this);
if ( col.Ok() )
{
grid->SetDefaultCellBackgroundColour(col);
grid->Refresh();
}
}
void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
@@ -573,6 +587,9 @@ void GridFrame::OnQuit( wxCommandEvent& WXUNUSED(ev) )
// MyGridCellRenderer
// ----------------------------------------------------------------------------
// do something that the default renderer doesn't here just to show that it is
// possible to alter the appearance of the cell beyond what the attributes
// allow
void MyGridCellRenderer::Draw(wxGrid& grid,
wxDC& dc,
const wxRect& rect,