Thema: Delphi Liste

Einzelnen Beitrag anzeigen

daredd

Registriert seit: 2. Apr 2006
433 Beiträge
 
#3

Re: Liste

  Alt 4. Mai 2007, 13:18
Delphi-Quellcode:
if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Font.Color := clBlack
             else begin
                Font.Color := Colors[TMSchemeItem(CLB.Items.Objects[Index]).IndGrp mod 16];
                Brush.Color := clwhite;
             end;
             if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Brush.Color := $00A9EBEB
             else begin
             Brush.Color := clwhite;
             end;
hier noch mal das gesammte:
Delphi-Quellcode:
procedure TpfFormPolling.clbSchemeDrawItem(Control: TWinControl;
  Index: integer; Rect: TRect; State: TOwnerDrawState);
var
   CLB : TCheckListBox;
   RectSize : integer;
   Item : TMSchemeItem;
begin
     CLB := (Control as TCheckListBox);
     with CLB.Canvas do begin
          Font.Name := 'Arial';
          FillRect(Rect);
          RectSize := Rect.Bottom - Rect.Top;
          Item := TMSchemeItem(CLB.Items.Objects[Index]);
          if Item.Grayed then begin
             Font.Color := clBlack;
             TextOut(Rect.Left + RectSize + 3, Rect.Top + 3, CLB.Items[Index]);
             Font.Color := clBlack;
             TextOut(Rect.Left + RectSize + 2, Rect.Top + 2, CLB.Items[Index]);
          end else begin
             if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Font.Color := clBlack
             else begin
                Font.Color := Colors[TMSchemeItem(CLB.Items.Objects[Index]).IndGrp mod 16];
                Brush.Color := clwhite;
             end;
             if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Brush.Color := $00A9EBEB
             else begin
             Brush.Color := clwhite;
             end;
             if (Item.ItemType = rtMoraTherapy) or (Item.ItemType = rtVegetotest) then Font.Style := [fsItalic]
             else Font.Style := [];
             TextOut(Rect.Left + RectSize + 2, Rect.Top + 2, CLB.Items[Index]);
             if Item.Passed then begin
                Brush.Color := $0041D3D9; Brush.Style := bsSolid; Pen.Color := clBlack;
                Ellipse(Rect.Left + 5, Rect.Top + 5, Rect.Left + RectSize - 5, Rect.Bottom - 5);
                if (Item.StatInfo.cTotal = 0) then begin
                   ColorList.LoadStatInfoFromField(GetFieldFromIssled(Item.IndIssl));
                   Item.StatInfo := ColorList.StatInfo;
                end;
                Brush.Color := ColorForListsStatInfo(Item.StatInfo);
                Pen.Color := clBlack;
                Brush.Style := bsSolid;
                Ellipse(Rect.Left + 4, Rect.Top + 4, Rect.Left + RectSize - 6, Rect.Bottom - 6);
                if (Item.StatInfo.cRegion > 0) then begin
                   Brush.Style := bsClear;
                   Pen.Width := 1;
                   Rectangle(Rect.Left + 1, Rect.Top + 1, Rect.Left + RectSize - 3, Rect.Bottom - 3);
                end;
             end;
          end;
     end;
end;
Das ist mein code für Das DrawItem der liste, im angehang (downloads) seht ihr was bei mir raus kommt.
Der mach nicht das gesammte feld in der Farbe die ich will.
Was kann ich da machen????
Miniaturansicht angehängter Grafiken
drawitem_207.jpg  
  Mit Zitat antworten Zitat