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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PDFium - select text per double click

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
marek Posted - Jul 03 2021 : 15:06:47
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?
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 07 2021 : 18:30:32
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
marek Posted - Jul 06 2021 : 15:13:46
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
xequte Posted - Jul 05 2021 : 22:32:30
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