History - how to remove (missing) items SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
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: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
History - how to remove (missing) items
Hi support,
I'd like to remove the item from the history list - if the file in the history is missing, that is if "the system cannot find the file specified" would appear as the error in the preview.
Is there an event to catch (and I've tried e.history.itemAdded but no luck) when the open history is populated from the history settings file to catch and do the above ?
-žarko
I'd like to remove the item from the history list - if the file in the history is missing, that is if "the system cannot find the file specified" would appear as the error in the preview.
Is there an event to catch (and I've tried e.history.itemAdded but no luck) when the open history is populated from the history settings file to catch and do the above ?
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: History - how to remove (missing) items
Hello žarko,
Sadly there is no method or event to catch to tweak the item insertion. There is an End-User solution to this one, though it requires the dialog to popup. History View/Options/Clear.../Remove/All Broken
Cheers,
Alex
Sadly there is no method or event to catch to tweak the item insertion. There is an End-User solution to this one, though it requires the dialog to popup. History View/Options/Clear.../Remove/All Broken
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: History - how to remove (missing) items
Hi Alex,
Let's say I do not mind popup to get visible briefly ... can this be done from code:
?
-ž
Let's say I do not mind popup to get visible briefly ... can this be done from code:
?
-ž
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: History - how to remove (missing) items
Hello žarko,
There is an easier way - execute an cmd.historyList.clear command and that dialog will show. Before that, you can set the Operations.ClearHistory.Filter setting to 1 (Broken) and the checkbox will select the needed item. Then you should catch the e_ShowModal event in the OnEventMonitor method:
Cheers,
Alex
There is an easier way - execute an cmd.historyList.clear command and that dialog will show. Before that, you can set the Operations.ClearHistory.Filter setting to 1 (Broken) and the checkbox will select the needed item. Then you should catch the e_ShowModal event in the OnEventMonitor method:
Code: Select all
public void OnEventMonitor(PDFXEdit.IUIX_Obj pTarget, PDFXEdit.IUIX_Event pEvent)
{
if (pEvent.Code == (uint)PDFXEdit.UIX_EventCodes.e_ShowModal)
{
IntPtr outPtr;
pTarget.QueryImpl(typeof(PDFXEdit.IUIX_Dialog).GUID, null, out outPtr);
PDFXEdit.IUIX_Dialog dlg = (PDFXEdit.IUIX_Dialog)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
if (dlg == null)
return;
//Here check the dialog ID - should be DlgClearHistory
//
PDFXEdit.IUIX_Obj btnObj = dlg.GetItem("btn.ok");
btnObj.QueryImpl(typeof(PDFXEdit.IUIX_Button).GUID, null, out outPtr);
PDFXEdit.IUIX_Button btn = (PDFXEdit.IUIX_Button)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr);
objectTarget = new ObjectEventTarget(btn.Obj);
btn.AutoClick(0);
}
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: History - how to remove (missing) items
Hi Alex,
p.s.
I can execute "cmd.manageHistory", but from there I would then need to auto click the "Clear..." button and that will dispaly the "Clear History" dialog...
-žarko
I've tried this (so only execute that command), but nothing happens Should I do something before?execute an cmd.historyList.clear command and that dialog will show.
p.s.
I can execute "cmd.manageHistory", but from there I would then need to auto click the "Clear..." button and that will dispaly the "Clear History" dialog...
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: History - how to remove (missing) items
Hello zarko,
You will have to specify the owner of the command - and that is the HistoryView:
Cheers,
Alex
You will have to specify the owner of the command - and that is the HistoryView:
Code: Select all
int nID = pdfCtl.Inst.Str2ID("historyView");
PDFXEdit.IPXV_View view = pdfCtl.Frame.View.Panes.Active[nID];
pdfCtl.Inst.ExecUICmd("cmd.historyList.clear", view.Obj);
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: History - how to remove (missing) items
Hi Alex,
Thanks. This helped and the dialog is displayed.
I have the btn but nothing happens after AutoClick(0) - the dialog does not get closed nor are the broken items removed from the history.
Also, what is this for:
"objectTarget = new ObjectEventTarget(btn.Obj);"
-ž
Thanks. This helped and the dialog is displayed.
I have the btn but nothing happens after AutoClick(0) - the dialog does not get closed nor are the broken items removed from the history.
Also, what is this for:
"objectTarget = new ObjectEventTarget(btn.Obj);"
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: History - how to remove (missing) items
Hello žarko,
This is the leftovers of the code piece that can help you listen to the clicked event for example (made a sample for someone some time ago).
As for the autoclick - it seems that you will need to specify at least 1 second as a timeout (1 as a parameter - then it will work). Though the dialog will hang for a second.
I have a solution to this one that I have made earlier for my own purposes - I've emulated a physical user click on that button. Here's the code that should help:
Cheers,
Alex
Code: Select all
objectTarget = new ObjectEventTarget(btn.Obj);
As for the autoclick - it seems that you will need to specify at least 1 second as a timeout (1 as a parameter - then it will work). Though the dialog will hang for a second.
I have a solution to this one that I have made earlier for my own purposes - I've emulated a physical user click on that button. Here's the code that should help:
Code: Select all
PDFXEdit.UIX_NotifyInfo ni = new PDFXEdit.UIX_NotifyInfo();
ni.nCode = (int)PDFXEdit.UIX_NotifyCodes.UIX_Notify_Clicked;
ni.pFrom = dlg.GetItem("btn.ok");
IntPtr ptr;
ni.pFrom.QueryImpl(typeof(PDFXEdit.IUIX_ObjImpl).GUID, null, out ptr);
PDFXEdit.IUIX_ObjImpl uiObjImpl = (PDFXEdit.IUIX_ObjImpl)System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(ptr);
ni.pFromImpl = uiObjImpl;
ni.nFromID = ni.pFrom.ID;
ni.pData = 0;
evt.nCode = (int)PDFXEdit.UIX_EventCodes.e_Notify;
IntPtr resPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ni));
System.Runtime.InteropServices.Marshal.StructureToPtr(ni, resPtr, false);
evt.nParam1 = (uint)resPtr;
SV.Obj.SendRawEvent(ref evt);
Marshal.FreeHGlobal(resPtr);
resPtr = IntPtr.Zero;
System.Runtime.InteropServices.Marshal.Release(ptr);
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: History - how to remove (missing) items
Hi Alex,
Thanks, will try the "emulated click" ..
Btw, what is "SV" in "SV.Obj.SendRawEvent(ref evt);" ?
-ž
Thanks, will try the "emulated click" ..
Btw, what is "SV" in "SV.Obj.SendRawEvent(ref evt);" ?
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: History - how to remove (missing) items
Hello žarko,
Call this for your dialog's object.
Cheers,
Alex
Call this for your dialog's object.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: History - how to remove (missing) items
Alex,
After a successful mimic-click, now we have this dialog
Can I somehow pre-set "yes, and don't ask again" ?
-ž
After a successful mimic-click, now we have this dialog
Can I somehow pre-set "yes, and don't ask again" ?
-ž
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: History - how to remove (missing) items SOLVED
Hello žarko,
You can set the Prompts.AskForDeleteHistory setting to false - that dialog window won't be shown afterwards.
Cheers,
Alex
You can set the Prompts.AskForDeleteHistory setting to false - that dialog window won't be shown afterwards.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: History - how to remove (missing) items
Hi Alex,
Thanks, that does it
-ž
Thanks, that does it
-ž
-
- Site Admin
- Posts: 6815
- Joined: Mon Oct 15, 2012 9:21 pm
- Location: London, UK
Re: History - how to remove (missing) items
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Thank you.
Best regards
Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com