MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / DrawGridDrawCell

Method DrawGridDrawCell

source/formhl.cpp:149–218  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

147}
148//---------------------------------------------------------------------------
149void __fastcall THighlightForm::DrawGridDrawCell(TObject *Sender, int ACol,
150 int ARow, TRect &Rect, TGridDrawState State)
151{
152 TCanvas * c = ((TStringGrid *)Sender)->Canvas;
153 String s;
154
155 if( ARow==0 ) // Grid title
156 {
157 switch( ACol )
158 {
159 case 0: s = " Active"; break;
160 case 1: s = " Match & Style preview"; break;
161 }
162
163 if( MainCfg.b3D )
164 {
165 FillVolume(c, Rect, c->Brush->Color);
166 c->Brush->Style = bsClear;
167 }
168
169 int x = Rect.Left + 2;
170 int y = Rect.Top + ((Rect.Bottom - Rect.Top - c->TextHeight(s)) / 2);
171 c->TextRect(Rect, x, y, s);
172 }
173 else
174 {
175 TMessHighlightList * p = localHPL->GetCurrentProfile();
176 if( p )
177 {
178 TMessHighlight * mh = p->Get(ARow-1);
179 if( mh )
180 {
181 if( ACol == 0 )
182 {
183 ImageList->Draw(c,
184 Rect.Left + ((Rect.Right - Rect.Left - ImageList->Width) / 2),
185 Rect.Top + ((Rect.Bottom - Rect.Top - ImageList->Height) / 2),
186 mh->bEnable ? 0 : 1, true);
187 }
188 else // ACol == 1
189 {
190 s = String(" ") + mh->Match.GetDescription();
191 /*
192 if( State.Contains(gdSelected) ) // Selected line
193 {
194 }
195 else
196 {
197 */
198 c->Brush->Color = mh->Style.BackgroundColor;
199 c->Font->Color = mh->Style.TextColor;
200 //}
201
202 mh->Style.SetFontStyle(c->Font);
203
204 if( MainCfg.b3D )
205 {
206 FillVolume(c, Rect, c->Brush->Color);

Callers

nothing calls this directly

Calls 5

FillVolumeFunction · 0.85
GetCurrentProfileMethod · 0.80
SetFontStyleMethod · 0.80
GetMethod · 0.45
GetDescriptionMethod · 0.45

Tested by

no test coverage detected