hello
i am playing with the fulldemo program that came with the SDK
when i click on a form field I have noticed that the VS debug screen displays CMainDlg::OnNamedNotify("Global::FocusGained")
i would like to know where i can get some information about this notification.
i would like to find out if it is possible to then get the field name that i have just selected
with this i could then bring up an option list in my c++ application which the user can select
then i could update the form field text with the selected text.
may thanks
joe@csolutions.com.au
information need - focusgain event in SDK
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 89
- Joined: Wed Dec 29, 2010 8:50 am
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: information need - focusgain event in SDK
Hi, joeitaliano.
This event is periodically sent to the client when the end-user interacts with the our control - clicks with a mouse, activates windows, etc.
Wait for the new build and look to the updated help file...
HTH.
The simple notify "Global::FocusGained" informs you: our control (any related window from our control) gained or have already a input focus.when i click on a form field I have noticed that the VS debug screen displays CMainDlg::OnNamedNotify("Global::FocusGained")
i would like to know where i can get some information about this notification.
This event is periodically sent to the client when the end-user interacts with the our control - clicks with a mouse, activates windows, etc.
In the new build (upcoming) you will be able to use new features for get/set focused field:i would like to find out if it is possible to then get the field name that i have just selected
Code: Select all
// get full name of focused field:
ctrl.DoDocumentVerb(docID, NULL, "GetSelectedField", dataIn, out dataOut, 0);
// dataOut == "TextBox1.0" for example
...
// change focus
dataIn = "CheckBox1";
ctrl.DoDocumentVerb(docID, NULL, "SelectField", dataIn, NULL, 0);
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 89
- Joined: Wed Dec 29, 2010 8:50 am
Re: information need - focusgain event in SDK
thank you so much
that is exactly what i require
one more question. i have been able to insert 1 line of text into my form field as follows
BSTR js = SysAllocString(L"var f = this.getField(\"Text2\"); if (f != null) { f.value; f.value = \"joeitaliano\"; f.value; };");
hRes = m_spView->RunJavaScript(js, NULL, 0, 0);
m_spView->GetTextFromResult(hRes, &msg);
SysFreeString(js);
however the form field is a text box that can hold 5 lines. when i try to use this line to fill up 3 lines i get an error returned
BSTR js = SysAllocString(L"var f = this.getField(\"Text2\"); if (f != null) { f.value; f.value = \"joeitaliano\rline1 \rline2\r"; f.value; };");
i tried \r in an attempt to go to the next line and also \n but still no good so there must be some other way to move to the next line or maybe there is not
any suggestions
thanks again
joe italiano
that is exactly what i require
one more question. i have been able to insert 1 line of text into my form field as follows
BSTR js = SysAllocString(L"var f = this.getField(\"Text2\"); if (f != null) { f.value; f.value = \"joeitaliano\"; f.value; };");
hRes = m_spView->RunJavaScript(js, NULL, 0, 0);
m_spView->GetTextFromResult(hRes, &msg);
SysFreeString(js);
however the form field is a text box that can hold 5 lines. when i try to use this line to fill up 3 lines i get an error returned
BSTR js = SysAllocString(L"var f = this.getField(\"Text2\"); if (f != null) { f.value; f.value = \"joeitaliano\rline1 \rline2\r"; f.value; };");
i tried \r in an attempt to go to the next line and also \n but still no good so there must be some other way to move to the next line or maybe there is not
any suggestions
thanks again
joe italiano
-
- Site Admin
- Posts: 3586
- Joined: Thu Jul 08, 2004 10:36 pm
Re: information need - focusgain event in SDK
Can you try to use the following string?
Note \\ in the string.
Code: Select all
BSTR js = SysAllocString(L"var f = this.getField(\"Text2\"); if (f != null) { f.value = \"joeitaliano\\rline1 \\rline2\\r"; };");
PDF-XChange Co Ltd. (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 89
- Joined: Wed Dec 29, 2010 8:50 am
Re: information need - focusgain event in SDK
that worked
many thanks
many thanks
-
- Site Admin
- Posts: 7370
- Joined: Wed Mar 25, 2009 10:37 pm
Re: information need - focusgain event in SDK

Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com