|
잘하신것 같은데...
아래 부분에서 Rect rt는 subitem의 전체 영역이니
전체 가 모두 회색으로 나오는것은 당연하구요
rt 에서 right를 비율에 맞게 수정해주면 될것 같습니다.
개인적으로는 아래와 같이 했죠
iPos가 현재 position입니다.
(iPos는 0~ 100 입니다.)
TRect rs=rt;
rs.left=rs.left+1;
rs.right =rs.left+ ((rt.Width()-2)*iPos)/100; //요기가 핵심일것 같네요...
rs.top=rs.top+1;
rs.bottom=rs.bottom-1;
이렇게 한후에 rs만큼 그렸습니다.
ListView1->Canvas->FillRect(rs);
그럼..
DoyongID 님이 쓰신 글 :
: void __fastcall TForm2::ListView1AdvancedCustomDrawSubItem(TCustomListView *Sender, TListItem *Item, int SubItem,
: TCustomDrawState State, TCustomDrawStage Stage, bool &DefaultDraw)
: {
: int SubItemIndex =3;
:
: TRect rt = Item->DisplayRect(drBounds);
: TListColumn *sItem ;
:
: if(SubItem == 2)
: {
: for(int i = 0; i <= SubItemIndex; i++)
: {
: sItem= ListView1->Column[i];
: if(i < SubItem) rt.left += sItem->Width;
: if(i == SubItem) rt.right = rt.left+sItem->Width;
: }
:
: rt.left;
: rt.right;
: rt.top++;
: rt.bottom;
:
:
: ListView1->Canvas->Brush->Color = clGray;
: ListView1->Canvas->FillRect(rt);
:
: ListView1->Canvas->Pen->Color = clBlack;
: ListView1->Canvas->Rectangle(rt.left, rt.top, rt.right, rt.bottom);
: }
: else
: {
: ListView1->Canvas->Pen->Color = clBlack;
: ListView1->Canvas->Brush->Color = clWhite;
: }
: }
:
: 이런 식으로 했습니다. 그런데, 해당 칼럼이 회색으로 다 채워지네요..
:
: ListView1->Canvas->Brush->Color = clGray; 이게 들어가서 그런것 같은데, 프로그래스바 안에만 색을 채우고 싶거든요.. 어떻게 하면 될까요?
|