bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed May 27, 2020 8:18 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Fri Mar 20, 2020 7:12 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi,

Sending the key was working, the problem I had was setting focus to the PDF control in the htmlviewer. It seems as this isn't possible.

Once you click somewhere on an xbase++ control, the pdfcontrol loses the focus. There seems no way to set it back.

However, I found a solution for this with an eventhandler.

When a user select something in the pdfcontrol, the control has focus. As soon as the mouse cursor is out of the range of that pdfcontrol, the eventhandler detects this movement. The only thing you have to do is 'detecting' this and sending the CTRL-C. The PDFcontrol still has focus, and the CTRL-C is send to it.

Now I have the solution I want:
1. user clicks in the PDF control to select a word.
2. Moves the mouse cursor to a get. (CTRL-C is send by the event handler, so the selected text is put in the clipboard)
3. User clicks on the get, and in the gotfocus block, I read the clipboard.

My customer processes about 600 invoices a day, where ther need to copy/paste about 5 elements. This is about 3000 times a day to copy/paste. Now they can do it without these 3000 clicks.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Fri Mar 20, 2020 7:26 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4124
Location: Boise, Idaho USA
I tried using the event handler and made no progress.

Show me your solution.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Fri Mar 20, 2020 7:46 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi Roger,

In attachment the fileviewer with a handler. According to the needs, you can detect on mouse move, buttonclick.

In my application I have added a big vertical button with a width of 10 pixels. When you move the mouse from the PDF to the input fields, the mouse move above that button. This is my handler to detect this.

Code:
STATIC FUNCTION PDFHandler ( nEvent, mp1, mp2, oXbp, _oDlg, GetList, aApp )
***************************************************************************
IF Valtype(oXbp) = 'O' .and. oXbp:ClassName() = 'DC_XbpPushButton' .and. valtype(oXbp:caption)=="C" .and. DC_GetProperty( oXbp, cGETLIST_TITLE )="xpdfx"
   SendCtrlKey( VK_C )
endif

RETURN DCGUI_NONE


See the button with yellow line in the screenshot. It has as title 'xpdfx', so I can select on it. So I select text on the right side, and move the cursor to the left. When it passes the button, the CTRL-C is send and selected text is copied. Each field at the left has a gotfocus with a 'getclipboard' function.

Attachment:
samplepdf.PNG
samplepdf.PNG [ 91.47 KiB | Viewed 926 times ]


Attachments:
fileviewer.zip [460.89 KiB]
Downloaded 41 times

_________________
Best regards,

Chris.
www.aboservice.be
Top
 Profile  
 
PostPosted: Sat Mar 21, 2020 2:21 am 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1183
skiman wrote:
Sending the key was working, the problem I had was setting focus to the PDF control in the htmlviewer. It seems as this isn't possible.

"where" do you send your Keystroke with SendInput API function to :?:

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
PostPosted: Sat Mar 21, 2020 2:31 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 863
Location: Sijsele, Belgium
Hi Jimmy,

The keystroke is send to the component that has focus on that moment. In this case it is the goal to send it the pdfcontrol. Since a user has selected something in the pdf (some text, date or number) this control has the focus.Now the CTRL-C is automatically send to the pdfcontrol.

Meanwhile I changed my event handler, so I can simulate a drag/drop from the PDF control to the fields I need. This will avoid thousands of mouse clicks a day. :dance:

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group