void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect,
TGridDrawState State)
{
// Podwietlanie zer - czerwona czcionka oraz pogrubienie
StringGrid1->Canvas->Brush->Color = StringGrid1->Canvas->Brush->Color;
StringGrid1->Canvas->FillRect(Rect);
if( (ACol >=2 && ACol <=41) && (ARow >=1 && ARow <=38) )
{
if(StringGrid1->Cells[ACol][ARow] == "0")
{
StringGrid1->Canvas->Font->Color = clRed;
StringGrid1->Canvas->Font->Style = StringGrid1->Canvas->Font->Style << fsBold;
}
}
StringGrid1->Canvas->TextOut(Rect.Left, Rect.Top, StringGrid1->Cells[ACol][ARow]);
// Wyroznienie niedostatecznych
if( ACol == 46 )
{
if(StringGrid1->Cells[ACol][ARow] == "niedostateczny")
{
StringGrid1->Canvas->Font->Style = StringGrid1->Canvas->Font->Style << fsUnderline;
StringGrid1->Canvas->Brush->Color = clRed;
StringGrid1->Canvas->FillRect(Rect);
StringGrid1->Canvas->TextOut(Rect.Left, Rect.Top, StringGrid1->Cells[ACol][ARow]);
}
}
// Podswietlanie zer - czerwona komorka
//if( (ACol >=2 && ACol <=41) && (ARow >=1 && ARow <=38) )
//{
// if(StringGrid1->Cells[ACol][ARow] == "0")
// {
// StringGrid1->Canvas->Brush->Color = clRed;
// StringGrid1->Canvas->FillRect(Rect);
// StringGrid1->Canvas->TextOut(Rect.Left, Rect.Top, StringGrid1->Cells[ACol][ARow]);
// }
//}
// Wyrownanie - do srodka
if( (ACol >=2 && ACol <=46) && (ARow >=0 && ARow <=38) )
{
Alignment(StringGrid1->Canvas, StringGrid1->Cells[ACol][ARow], Rect, algCenter);
}
}
//---------------------------------------------------------------------------