|
|
|
Get Visual Line Count and Current Visual Line of Insertion
Added on 5/6/2005
|
|
Compatibilities:
|
This item has not yet been rated
|
Due to text wrapping you cannot get the visual line you click on unless 'hard returns' are used after each line. Following are two functions that will return the total number of visual lines and the visual line that the insertion carat is currently on, respectively. The last can be modified to return the line under the mouse cursor.
on getLineCount (theMem)
theMemHeight = theMem.height
theLineCount = theMem.locVtoLinePos(theMemHeight)
return theLineCount
end
on getInsertionLine (theMem)
theSelect = theMem.selection
theLoc = theMem.CharPosToLoc(vSelect[1] + 1)
theLine = theMem.LocVToLinePos(vLoc.locV)
return vLine
end
|
|