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

Method LogSGDrawCell

source/main.cpp:579–644  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

577}
578//---------------------------------------------------------------------------
579void __fastcall TMainForm::LogSGDrawCell(TObject *Sender, int ACol,
580 int ARow, TRect &Rect, TGridDrawState State)
581{
582 TCanvas * c = ((TStringGrid *)Sender)->Canvas;
583 String s;
584 if( ARow==0 ) // Grid title
585 {
586 switch( ACol )
587 {
588 case 0: s = " Time"; break;
589 case 1: s = " IP"; break;
590 case 2: s = " Host"; break;
591 case 3: s = " Facility"; break;
592 case 4: s = " Priority"; break;
593 case 5: s = " Tag"; break;
594 case 6: s = " Message"; break;
595 }
596 }
597 else
598 {
599 TSyslogMessage * sm = GetMessageByIndex(ARow - 1);
600 if( sm )
601 {
602 switch( ACol )
603 {
604 case 0: s = sm->DateStr; break;
605 case 1: s = sm->SourceAddr; break;
606 case 2: s = sm->HostName; break;
607 case 3: s = sm->Facility; break;
608 case 4: s = sm->Priority; break;
609 case 5: s = sm->Tag; break;
610 case 6: s = sm->Msg; break;
611 }
612
613 TMessStyle * pMessStyle = &DefaultMessStyle;
614 TMessHighlightList * mhl = HP->GetCurrentProfile();
615 if( mhl )
616 {
617 TMessStyle * ms = mhl->FindStyleForMessage(sm);
618 if( ms )
619 pMessStyle = ms;
620 }
621
622 if( State.Contains(gdSelected) ) // Selected line
623 {
624 }
625 else
626 {
627 c->Brush->Color = pMessStyle->BackgroundColor;
628 c->Font->Color = pMessStyle->TextColor;
629 }
630
631 pMessStyle->SetFontStyle(c->Font);
632 }
633 }
634
635 if( MainCfg.b3D )
636 {

Callers

nothing calls this directly

Calls 5

FillVolumeFunction · 0.85
GetCurrentProfileMethod · 0.80
FindStyleForMessageMethod · 0.80
ContainsMethod · 0.80
SetFontStyleMethod · 0.80

Tested by

no test coverage detected