![]() |
|
Kordinat index no - Baskı Önizleme +- Delphi Can (https://www.delphican.com) +-- Forum: Delphi (https://www.delphican.com/forumdisplay.php?fid=3) +--- Forum: Mobil Platform - FireMonkey (FMX) (https://www.delphican.com/forumdisplay.php?fid=7) +--- Konu Başlığı: Kordinat index no (/showthread.php?tid=2575) |
Kordinat index no - Orhanlar - 27-08-2018 Merhaba. Foruma yeni katıldım Aşağıdaki kodları netde araştırma yaparken buldum. Listviewde satırın index numarasını sorunsuz alabiliyorum. Fakat listbox için uyarladığımda hata alıyorum. Çözüm için ne yapabilirim acaba. Hata Kodu error F2063: F2063 Could not compile used unit 'dinamik.pas' function ListBoxGetIndexAtPos(LBox: TListBox; TP: TPointF): Integer; begin Result := -1; for I := 0 to LBox.Items.Count - 1 do begin Tr := LBox.GetItemRect(I); if Tr.Contains(TP) then begin Result := I; Break; end; end; end; try Obj := ObjectAtPoint(Screen.MousePos); if Obj <> Nil then begin LBIndex := ListBoxGetIndexAtPos(ListBoxDin, Point); if LBIndex <> -1 then begin Kordinat index no - mrmarman - 28-08-2018 Foruma hoş geldiniz Sorunuza başka bir fonksiyon grubu ile cevap vereyim. if PtInRect( ListBox.BoundsRect, P ) ile P koordinatlarının ilgili Listbox üzerinde mi sorgusunu yaptıktan sonra Listbox.ItemByPoint( PListBox.X, PListBox.Y ).Index değeri item indexi verir. Tabi Listbox position.X ve Y değerlerine odaklı olarak P.X ve Y değerlerini - /+ revize ettikten sonra. PListBox burada revize edilmiş koordinatı temsil ediyor. |