![]() |
Re: mehrzeilige listbox-einträge
oops! ich war nur schlampig...
hab doch die position zum zeichnen mit dem index errechnet und nich mit den eigenschaften von >>rect<<... also ich denke, damit werd ich jetz erstmal klarkommen und nen bisschen experimentieren. vielen dank nochmal für die hilfe. falls ich später noch fragen hab, werd ich die hier posten, ich wollt ja noch n paar klickereignisse implementieren und auch kleine bildchen zeichnen. aber davon hab ich ja hier schon beispiele in hülle und fülle gesehn. bis dann + grüße maddins |
Re: mehrzeilige listbox-einträge
Hallo,
wo kommt die Funktion "Dispose(...)" rein? |
Re: mehrzeilige listbox-einträge
Hallo,
warum so kompliziert, nimm einen TListView, da musst du gar nichts machen.
Delphi-Quellcode:
ListItem:= ListView.Items.Add;
ListItem.Caption:= 'Spalte 1'; ListItem.SubItems.Add('Spalte2'); Update: Habe gerade "Bildchen zeichnen" gelesen -> TVirtualTreeView, auch wenn der Anfang etwas kompliziert ist, aber dafür gibt es Tutorials (Such-Funktion) Heiko |
Re: mehrzeilige listbox-einträge
Zitat:
Für alle die es interessiert:
Delphi-Quellcode:
type
TCodeInsightItem = record ciType: string[255]; ciKey: string[255]; ciAttri: string[255]; ciReturn: string[255]; ciDesc: string[255]; end; type PCodeInsightItem = ^TCodeInsightItem; ........... procedure X ...; var ciEntry: TCodeInsightItem; ciEntryP: PCodeInsightItem; begin for i := 0 to lbxCodeInsight.Items.Count - 1 do begin ciEntryP := PCodeInsightItem(lbxCodeInsight.Items.Objects[i]); Dispose(ciEntryP); end; lbxCodeInsight.Items.Clear; for i := 0 to intBuffer - 1 do begin ... Definition von ciEntry ... New(ciEntryP); ciEntryP^.ciType := ciEntry.ciType; ciEntryP^.ciKey := ciEntry.ciKey; ciEntryP^.ciAttri := ciEntry.ciAttri; ciEntryP^.ciReturn := ciEntry.ciReturn; ciEntryP^.ciDesc := ciEntry.ciDesc; lbxCodeInsight.Items.AddObject(ciEntryP^.ciKey, TObject(ciEntryP)); end; end; procedure TfrmMain.lbxCodeInsightDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var Entry: PCodeInsightItem; ciKeyWidth, ciAttriWidth: Integer; begin Entry := PCodeInsightItem(Items.Objects[Index]); if ItemIndex <> Index then if Index mod 2 = 0 then Canvas.Brush.Color := $00FDF7EE else Canvas.Brush.Color := clWhite; Canvas.FillRect(Rect); Canvas.TextOut(Rect.Left+1, Rect.Top+1, Entry^.ciType); Canvas.Font.Style := [fsBold]; Canvas.TextOut(Rect.Left+60, Rect.Top+1, Entry^.ciKey); ciKeyWidth := Canvas.TextWidth(Entry^.ciKey); Canvas.Font.Style := []; Canvas.TextOut(Rect.Left+60+ciKeyWidth, Rect.Top+1, ' (' + Entry^.ciAttri + ')'); ciAttriWidth := Canvas.TextWidth(' (' + Entry^.ciAttri + ')'); if Entry^.ciReturn <> '' then Canvas.TextOut(Rect.Left+60+ciKeyWidth+ciAttriWidth, Rect.Top+1, ' : ' + Entry^.ciReturn); Canvas.Font.Style := [fsBold]; Canvas.Font.Size := 8; Canvas.TextOut(Rect.Left+5, Rect.Top+18, Entry^.ciDesc); end; end; ![]() |
Re: mehrzeilige listbox-einträge
Zitat:
MfG, Sun |
Re: mehrzeilige listbox-einträge
Hm,
oha, mehrzeilig. virtual treeview + wordrwap Heiko |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:00 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz