
This method has two parameters:
- First is record for every row in grid.
- Second is used for color change.
public void displayOption(Common _record, FormRowDisplayOption _options)
{
DM_ProductivityTable dm_productivityTable;
real iPercent;
/* record for every row (currently drawn row), get percent from it */
dm_productivityTable = _record;
iPercent = dm_productivityTable.ProductivityPercent;
/* conditions */
if ( ( iPercent > 0 ) && ( iPercent < 75 ) ) {
_options.backColor( WinAPI::RGB2int( 153, 31, 0 ) );
_options.textColor( WinAPI::RGB2int( 255, 255, 255 ) ) ;
_options.affectedElementsByControl( DM_ProductivityTable_ProductivityPercent.id() );
}
if ( ( iPercent >= 75 ) && ( iPercent < 100 ) ) {
_options.backColor( WinAPI::RGB2int( 255, 92, 51 ) );
_options.textColor( WinAPI::RGB2int( 255, 255, 255 ) ) ;
_options.affectedElementsByControl( DM_ProductivityTable_ProductivityPercent.id() );
}
if ( ( iPercent >= 100 ) && ( iPercent < 120 ) ) {
_options.backColor( WinAPI::RGB2int( 0, 230, 0 ) );
//_options.textColor( WinAPI::RGB2int( 255, 255, 255 ) ) ;
_options.affectedElementsByControl( DM_ProductivityTable_ProductivityPercent.id() );
}
if ( iPercent >= 120 ) {
_options.backColor( WinAPI::RGB2int( 0, 128, 0 ) );
_options.textColor( WinAPI::RGB2int( 255, 255, 255 ) ) ;
_options.affectedElementsByControl( DM_ProductivityTable_ProductivityPercent.id() );
}
/* call */
super( _record, _options );
}
No comments:
Post a Comment