Hi All,
I ‘m looking for a way to get the height of a text selection in a field (dontwrap = false).
The selectedLoc return the topleft of the selection.
If my brain work well I understand that I can't use the formattedheight of the text selection (I thought put the selectedtext in an other fld to get its formattedheight). That can't work because the selection can begin at the last word of a "visible line" and end at the first word two or more lines farest.
I hope I'm clear (that should be a good new for my english level).
Best regards and thanks in advance for your ideas
Jean-Marc
How get height of a text selection in a field solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
How get height of a text selection in a field solved
Last edited by jmburnod on Sun Jan 15, 2017 11:06 pm, edited 1 time in total.
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: How get height of a text selection in a field ?
Hi Jean-Marc,
for my first answer I probably misunderstood what you want.
If I now understand correctly then you don't want to use the formattedHeight of the selectedText as it currently is, but you need it always as if it would start at the beginning of a line?
If this is correct then you could try to put (temporarily) a CR before the selectedChunk, select it again and measure it?
Hermann
for my first answer I probably misunderstood what you want.
If I now understand correctly then you don't want to use the formattedHeight of the selectedText as it currently is, but you need it always as if it would start at the beginning of a line?
If this is correct then you could try to put (temporarily) a CR before the selectedChunk, select it again and measure it?
Hermann
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How get height of a text selection in a field
Hi Hermann,
Thanks again.
I didn't read completely the doc.
I thought that formattedheight only works with controls
Warm regards
Jean-Marc
Thanks again.
I didn't read completely the doc.
I thought that formattedheight only works with controls
Warm regards
Jean-Marc
https://alternatic.ch