---------------------------------------------------------------------------
| 106 | } |
| 107 | //--------------------------------------------------------------------------- |
| 108 | void __fastcall TProcessForm::DrawGridDrawCell(TObject *Sender, int ACol, |
| 109 | int ARow, TRect &Rect, TGridDrawState State) |
| 110 | { |
| 111 | TCanvas * c = ((TStringGrid *)Sender)->Canvas; |
| 112 | String s; |
| 113 | |
| 114 | if( ARow==0 ) // Grid title |
| 115 | { |
| 116 | switch( ACol ) |
| 117 | { |
| 118 | case 0: s = " Active"; break; |
| 119 | case 1: s = " Match"; break; |
| 120 | case 2: s = " Action"; break; |
| 121 | } |
| 122 | int x = Rect.Left + 2; |
| 123 | int y = Rect.Top + ((Rect.Bottom - Rect.Top - c->TextHeight(s)) / 2); |
| 124 | c->TextRect(Rect, x, y, s); |
| 125 | } |
| 126 | else |
| 127 | { |
| 128 | TMessProcessRule * p = localPRL->Get(ARow-1); |
| 129 | if( p ) |
| 130 | { |
| 131 | if( ACol == 0 ) |
| 132 | { |
| 133 | ImageList->Draw(c, |
| 134 | Rect.Left + ((Rect.Right - Rect.Left - ImageList->Width) / 2), |
| 135 | Rect.Top + ((Rect.Bottom - Rect.Top - ImageList->Height) / 2), |
| 136 | p->bEnable ? 0 : 1, true); |
| 137 | } |
| 138 | else if( ACol == 1 ) |
| 139 | { |
| 140 | s = String(" ") + p->Match.GetDescription(); |
| 141 | |
| 142 | int x = Rect.Left + 2; |
| 143 | int y = Rect.Top + ((Rect.Bottom - Rect.Top - c->TextHeight(s)) / 2); |
| 144 | c->TextRect(Rect, x, y, s); |
| 145 | } |
| 146 | else // ACol == 2 |
| 147 | { |
| 148 | s = String(" ") + p->Process.GetDescription(); |
| 149 | //if( State.Contains(gdSelected) ) // Selected line |
| 150 | //{ |
| 151 | //} |
| 152 | //else |
| 153 | //{ |
| 154 | //c->Brush->Color = p->Style.BackgroundColor; |
| 155 | //c->Font->Color = p->Style.TextColor; |
| 156 | //} |
| 157 | |
| 158 | //p->Style.SetFontStyle(c->Font); |
| 159 | |
| 160 | int x = Rect.Left + 2; |
| 161 | int y = Rect.Top + ((Rect.Bottom - Rect.Top - c->TextHeight(s)) / 2); |
| 162 | c->TextRect(Rect, x, y, s); |
| 163 | } |
| 164 | } |
| 165 | } |
nothing calls this directly
no test coverage detected