PDW widget: get the rect of the hilitedRange

Monte Goulding monte at appisle.net
Tue Jan 11 18:26:15 EST 2022


I think we would need to add a new property for that. Quite feasible as we already need to determine rects of the halite text to draw the selection. Perhaps create an enhancement request for this?

Cheers

Monte

> On 11 Jan 2022, at 9:19 am, Keith Clarke via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi folks,
> Please can anyone advise how to get the rendered rectangle of highlighted text in the PDF widget…?
> 
> I can successfully get the first word from the page text using something like:
> put pPageNum into tHilitedArray["from"]["page”] // = 1
> 
> put pPageNum into tHilitedArray["to"]["page”] // = 1
> put the length of word tWordNum of pPageText into tWordLength // = ‘3’ as the word is “the"
> 
> put tWordIndex into tHilitedArray["from"]["index”] // = 1
> 
> put tWordIndex + tWordLength -1 into tHilitedArray["to"]["index”] // = 3
> set the hilitedRange of control "PDF1" to tHilitedArray
> 
> put the hilitedRangeText of control "PDF1" into tText // = “the"
> 
> 
> However, when I attempt to get the rendered rect of this word, to compare with namedDestinations in the page ... 
> put the rectangle of the hilitedRange of control "PDF1" into tRect // returns (Chunk: error in object expression) near “the”...
> 
> I’ve tried using the hilitedRangeText but get similar errors. 
> Any clues?
> TIA
> Keith
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list