ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PDFium - select text per double click
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

marek

15 Posts

Posted - Jul 03 2021 :  15:06:47  Show Profile  Reply
PDFViewer has the function
function SelectWord(CharIndex: Integer; DoScroll: Boolean = False): Boolean;

I would like to use the function for selecting the word double clicked by the user. Is it possible?
How to get CharIndex from mouse click coordinates?

xequte

6248 Posts

Posted - Jul 05 2021 :  22:32:30  Show Profile  Reply
Hi

Double-clicking a character should automatically select the whole word. Are you seeing something different?

In v10.0.2 you can use CharIndexToWord(), e.g.

// Show the text under the cursor
procedure TfrmMain.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
  charIndex, textIndex, textLength: Integer;
begin
  charIndex := ImageEnView1.PdfViewer.ScrToCharIndex( X, Y );
  ImageEnView1.PdfViewer.CharIndexToWord( charIndex, textIndex, textLength );
  lblWord.Caption := ImageEnView1.PdfViewer.GetText( textIndex, textLength );
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

marek

15 Posts

Posted - Jul 06 2021 :  15:13:46  Show Profile  Reply
In my 10.0.2 version these functions (ScrToCharIndex, CharIndexToWord) does not exists but select per double click works - word under the mouse is selected.
If possible it should be implemented the same way in the form field. Currently always the entire content of the field is selected.

Greetings,
Marek
Go to Top of Page

xequte

6248 Posts

Posted - Jul 07 2021 :  18:30:32  Show Profile  Reply
Hi Marek

If you are using an earlier 10.0.2 beta, email me for an update.

I'll consider double-click field behavior in a later update.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: