Subject | Re: [IBO] OnGetCellProps |
---|---|
Author | Lester Caine |
Post date | 2005-08-03T06:37:41Z |
Does this help
// -------------------
void __fastcall TRoomStatusForm::RoomsGridGetCellProps(TObject *Sender,
int ACol, int ARow, TGridDrawState AState, TColor &AColor,
TFont *AFont)
{ if ( !ACol || !ARow ) return;
if( ROOMS && ROOMS->Active )
{ int BufferRowNum = RoomsGrid->DataRow[ ARow ];
if ( BufferRowNum > 0 )
{ ROOMS->BufferRowNum = BufferRowNum;
if ( ROOMS->BufferFieldByName("ALARM")->AsInteger )
AColor = clRed;
else if ( AState.Contains( gdSelected ) )
AColor = TColor( 0x00B7D0D9 );
else
{ AColor = clWhite;
if ( ROOMS->BufferFieldByName("SERVING")->AsInteger )
AColor = TColor( 0x00BDF093 );
else if ( ROOMS->BufferFieldByName("LOGON")->IsNotNull )
AColor = TColor( 0x0093F4ED );
}
}
}
}
// -------------------
I have a few more examples that play with AFont as well, but hopefully
you get the idea.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
// -------------------
void __fastcall TRoomStatusForm::RoomsGridGetCellProps(TObject *Sender,
int ACol, int ARow, TGridDrawState AState, TColor &AColor,
TFont *AFont)
{ if ( !ACol || !ARow ) return;
if( ROOMS && ROOMS->Active )
{ int BufferRowNum = RoomsGrid->DataRow[ ARow ];
if ( BufferRowNum > 0 )
{ ROOMS->BufferRowNum = BufferRowNum;
if ( ROOMS->BufferFieldByName("ALARM")->AsInteger )
AColor = clRed;
else if ( AState.Contains( gdSelected ) )
AColor = TColor( 0x00B7D0D9 );
else
{ AColor = clWhite;
if ( ROOMS->BufferFieldByName("SERVING")->AsInteger )
AColor = TColor( 0x00BDF093 );
else if ( ROOMS->BufferFieldByName("LOGON")->IsNotNull )
AColor = TColor( 0x0093F4ED );
}
}
}
}
// -------------------
I have a few more examples that play with AFont as well, but hopefully
you get the idea.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services