Using our new routine to get the text as displayed from a specified Y position the Item2DrawItem gets called. However this routine seems to fail if the line of text consists of single word that is too long to fit on the line.
Original code:
if (DrawItems.ItemNo<>ItemNo) or
((DrawItems.Offs>=ItemOffs) and not (DrawItems[i-1].Offs+DrawItems[i-1].Length<ItemOffs)) then begin
take out the = and replace with:
if (DrawItems.ItemNo<>ItemNo) or
((DrawItems.Offs>ItemOffs) and not (DrawItems[i-1].Offs+DrawItems[i-1].Length<ItemOffs)) then begin
This seems to fix my problem, but does this have any other undesired effects?
I have sent you some screen shots to show you the problem.
TCustomRVFormattedData.Item2DrawItem
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
The method is correct, however the function returning the line text is wrong.
We cannot use (ItemNo, OffsetInItem) values to identify a line, because it is possible that this position corresponds to two places on the screen (the end of the line N, and the beginning of the line N+1).
So we must work with drawing items directly. Details are sent by email.
We cannot use (ItemNo, OffsetInItem) values to identify a line, because it is possible that this position corresponds to two places on the screen (the end of the line N, and the beginning of the line N+1).
So we must work with drawing items directly. Details are sent by email.