mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 13:30:55 +02:00
* fixed cluster.findsel
This commit is contained in:
parent
d0956aec45
commit
79f84b67ab
@ -2371,14 +2371,14 @@ END;
|
|||||||
{ FindSel -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 03Jun98 LdB }
|
{ FindSel -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 03Jun98 LdB }
|
||||||
{---------------------------------------------------------------------------}
|
{---------------------------------------------------------------------------}
|
||||||
FUNCTION TCluster.FindSel (P: TPoint): Sw_Integer;
|
FUNCTION TCluster.FindSel (P: TPoint): Sw_Integer;
|
||||||
VAR I, J, S, Vh: Sw_Integer; R: TRect;
|
VAR I, S, Vh: Sw_Integer; R: TRect;
|
||||||
BEGIN
|
BEGIN
|
||||||
GetExtent(R); { Get view extents }
|
GetExtent(R); { Get view extents }
|
||||||
If R.Contains(P) Then Begin { Point in view }
|
If R.Contains(P) Then Begin { Point in view }
|
||||||
Vh := Size.Y; { View height }
|
Vh := Size.Y; { View height }
|
||||||
I := 0; { Preset zero value }
|
I := 0; { Preset zero value }
|
||||||
While (P.X >= Column(I+Vh)) Do Inc(I, Vh); { Inc view size }
|
While (P.X >= Column(I+Vh)) Do Inc(I, Vh); { Inc view size }
|
||||||
S := I + P.Y - J; { Line to select }
|
S := I + P.Y; { Line to select }
|
||||||
If ((S >= 0) AND (S < Strings.Count)) { Valid selection }
|
If ((S >= 0) AND (S < Strings.Count)) { Valid selection }
|
||||||
Then FindSel := S Else FindSel := -1; { Return selected item }
|
Then FindSel := S Else FindSel := -1; { Return selected item }
|
||||||
End Else FindSel := -1; { Point outside view }
|
End Else FindSel := -1; { Point outside view }
|
||||||
@ -4141,7 +4141,10 @@ END;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.31 2004-12-21 18:53:41 peter
|
Revision 1.32 2004-12-22 15:50:38 peter
|
||||||
|
* fixed cluster.findsel
|
||||||
|
|
||||||
|
Revision 1.31 2004/12/21 18:53:41 peter
|
||||||
cmCursorChange event
|
cmCursorChange event
|
||||||
|
|
||||||
Revision 1.30 2004/12/19 20:20:48 hajny
|
Revision 1.30 2004/12/19 20:20:48 hajny
|
||||||
|
Loading…
Reference in New Issue
Block a user