|
void __fastcall TMainForm::lvEventCustomDrawItem(TCustomListView *Sender, TListItem *Item, TCustomDrawState State, bool &DefaultDraw)
{
AnsiString ItemCaption = "";
if (State.Contains(cdsSelected))
{
//lvEvent->Canvas->Font->Color = clDkGray;
//lvEvent->Canvas->Brush->Color = clInfoBk;
TRect Rect = Item->DisplayRect(drBounds);
lvEvent->Canvas->Brush->Color = clInfoBk;
lvEvent->Canvas->FillRect(Rect);
lvEvent->Canvas->Font->Size = 13;
lvEvent->Canvas->Font->Color = clDkGray;
lvEvent->Canvas->Font->Name = "굴림";
}
else
{
ItemCaption = Item->Caption;
if (ItemCaption == "NEXT")
{
lvEvent->Canvas->Font->Color = clYellow;
lvEvent->Canvas->Brush->Color = clGreen;
}
else if (ItemCaption == "TAKE")
{
lvEvent->Canvas->Font->Color = clYellow;
lvEvent->Canvas->Brush->Color = clBackground;
}
else if (ItemCaption == "START")
{
lvEvent->Canvas->Font->Color = clDkGray;
lvEvent->Canvas->Brush->Color = clAqua;
}
else
{
TDateTime now = now.CurrentDateTime();
TDateTime dt = GetDateTime(Item->SubItems->Strings[5]);
// 현재 시간을 기준으로 前은 밝은회색, 後는 바탕색의 보색
if (dt != TDateTime(0))
{
if (dt <= now)
lvEvent->Canvas->Font->Color = clLtGray;
else
lvEvent->Canvas->Font->Color = clBlack;
}
}
}
DefaultDraw = true;
}
//---------------------------------------------------------------------------
리스트뷰를 오너드로우로 그린것인데요...
Selected할때 색갈이 먹질 않네요...
잘못된 부분이 있나요? 혹은 더 좋은 아이디어라도...
|