Hi Support,
Is there a way to override what happens / catch / get notified when a click happens for the item in the QuickLaunch list:
Note: I do not want to custom handle the associated command - I want to know what command was selected/clicked (and stop it from being executed).
I guess that's some IUIX_List and I should be able to use IUIX_ListCallbacks and List_OnItemClick. But not sure from what IUIX_Obj to get to that list? And if I can, how to get the actual command from List_OnItemClick?
-žarko
Override click inside QuickLaunch results list
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1505
- Joined: Thu Sep 05, 2019 12:35 pm
Override click inside QuickLaunch results list
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 11192
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Override click inside QuickLaunch results list
Hello, zarkogajic
I have passed this along for review by the Dev team, hopefully they can get back to us in a timely manner.
Kind regards,
I have passed this along for review by the Dev team, hopefully they can get back to us in a timely manner.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 1505
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Dan,
Ping here ...
-žarko
Ping here ...
-žarko
-
- Site Admin
- Posts: 2447
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Override click inside QuickLaunch results list
Hi Zarko.
You may try this way:
HTH
You may try this way:
Code: Select all
const int id_cmd_quickLaunchList = PXV_Inst.Str2ID("cmd.quickLaunchList");
public void OnEventMonitor(PDFXEdit.IUIX_Obj pTarget, PDFXEdit.IUIX_Event pEvent)
{
if (pEvent.Code == (int)WM_LBUTTONUP)
{
if (pTarget.ID == id_cmd_quickLaunchList)
{
IntPtr impl = IntPtr.Zero;
pTarget.QueryImpl(typeof(IUIX_List).GUID, null, out impl);
IUIX_List list = (IUIX_List)Marshal.GetObjectForIUnknown(impl);
if (!IsMyCallback(list.Callbacks))
{
list.Callbacks = CreateMyCallback(list.Callbacks); // it sets my implementation of IUIX_ListCallbacks interface that
// mostly redirects all calls to the original callbacks,
// BUT overrides the IUIX_ListCallbacks::List_OnItemClicked
}
}
}
}
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: 1505
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Vasyl,
Thanks.
Can I get what item/cmd was clicked with List_OnItemClicked ?
-žarko
Thanks.
Can I get what item/cmd was clicked with List_OnItemClicked ?
-žarko
-
- User
- Posts: 1505
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Vasyl,
I've tried your code ...
WM_LBUTTONUP is too late as at that moment the item in the list is already clicked and the command gets executed and list hidden/destroyed - so List_OnItemClick does not happen.
I've changed that to use "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" - so inject my callback when the list is made visible. This works and upon clicking an item in the list the List_OnItemClick does happen.
But, as I feared - no real data I can use there to figure out what item (what command) was clicked (except the item position in the list (UIX_ListItemID.nItem). As I remember, for a similar request sometime in the past, the answer was "for internal use, not available to SDK"
So, new questions:
Q1. Is my approach with "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" the best I can use?
Q2. Is there any (never mind how crazy or complex) way to get to the actual item that was clicked - the command ID that was selected/clicked to be executed ? I know the item in that list might not be a command but some kind of "show sub-menu" ...
3.How come the selected command does get executed even if I do not call "Original Callbacks List_OnItemClick"?
I tried to return E_FAIL or E_ABORT from my List_OnItemClick but the selected command still gets executed.
If I return S_FALSE - nothing happens (command does not get executed, list remains visible) - so I guess there is some return code I can use to stop the command from being executed (but list made hidden as if it was executed).
Edit: Ok, if I set "result = s_false" and also do "pList.Obj.Show(0, false)" - selected command does not get executed and the list gets hidden - good enough for me.
So, only Q1 and Q2 open ...
-žarko
I've tried your code ...
WM_LBUTTONUP is too late as at that moment the item in the list is already clicked and the command gets executed and list hidden/destroyed - so List_OnItemClick does not happen.
I've changed that to use "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" - so inject my callback when the list is made visible. This works and upon clicking an item in the list the List_OnItemClick does happen.
But, as I feared - no real data I can use there to figure out what item (what command) was clicked (except the item position in the list (UIX_ListItemID.nItem). As I remember, for a similar request sometime in the past, the answer was "for internal use, not available to SDK"

So, new questions:
Q1. Is my approach with "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" the best I can use?
Q2. Is there any (never mind how crazy or complex) way to get to the actual item that was clicked - the command ID that was selected/clicked to be executed ? I know the item in that list might not be a command but some kind of "show sub-menu" ...
3.
I tried to return E_FAIL or E_ABORT from my List_OnItemClick but the selected command still gets executed.
If I return S_FALSE - nothing happens (command does not get executed, list remains visible) - so I guess there is some return code I can use to stop the command from being executed (but list made hidden as if it was executed).
Edit: Ok, if I set "result = s_false" and also do "pList.Obj.Show(0, false)" - selected command does not get executed and the list gets hidden - good enough for me.
So, only Q1 and Q2 open ...
-žarko