setting command state

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

moke@napconet.com
User
Posts: 60
Joined: Fri Oct 24, 2008 5:17 pm

setting command state

Post by moke@napconet.com »

Hi,
I am trying to control all aspects of users closing a document. Turning off the menu selection seems to work fine but I also need to turn off the close this tab, close all tabs, and any other close i can find. I have 2 question's is there and easier way to disable closing an open document and if not when using for soem reason the code below will not disable the tabs closing only the NAMED comand appears to work. I am not getting an error, am I missing something?
Thanks

Code: Select all

   
    Call CoPDFXCview1.SetProperty("Commands[""Close""].State", "Disabled", 0) 'menu close
    Call CoPDFXCview1.SetProperty("Commands[#33256].State", "Disabled", 0) ' close this tab
    Call CoPDFXCview1.SetProperty("Commands[#33255].State", "Disabled", 0) 'close all tabs
    Call CoPDFXCview1.SetProperty("Commands[#57682].State", "Disabled", 0) ' close window
    '32937 'close active tab
    '32942 'close all windows
    '33038 'close all
    '57602 'close
oops, it looks like the one that really doesn't work is "close this tab", "close active tab" seems to work ok though.
moke@napconet.com
User
Posts: 60
Joined: Fri Oct 24, 2008 5:17 pm

Re: setting command state

Post by moke@napconet.com »

ok I guessI'd like to change my question to is this a bug? It seems I cannot disable or take off line the "close this tab" option.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: setting command state

Post by Vasyl-Tracker Dev Team »

For forcedly turn off these commands please use:

Code: Select all

Call CoPDFXCview1.SetProperty("Commands[""Close""].State", "Offline", 0) 'menu close
Call CoPDFXCview1.SetProperty("Commands[#33256].State", "Offline", 0) 'close this tab
Call CoPDFXCview1.SetProperty("Commands[#33255].State", "Offline", 0) 'close all tabs but this
Call CoPDFXCview1.SetProperty("Commands[#57682].State", "Offline", 0) 'close window
...
Call CoPDFXCview1.SetProperty("View.ShowTabCloseButtons", "false", 0) 'to hide tab close buttons
...
State "Disabled" of command can be replaced by AX-control while the control is working.
State "Offline" is most, and cannot be replaced by AX-control, and this state can be stored in control's settings, i.e. all 'offline' commands
can be restored by LoadSettings routine.
Also for commands #33256(close this tab), #32937(close active tab) - behavior will be fixed in the next build.
In the next build we will to add approved way to deny closing of document. Like as:
Call CoPDFXCview1.SetDocumentProperty("Permissions.Close", "false", 0)
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
moke@napconet.com
User
Posts: 60
Joined: Fri Oct 24, 2008 5:17 pm

Re: setting command state

Post by moke@napconet.com »

OK thank you!
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: setting command state

Post by John - Tracker Supp »

Pleasure :)
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
Tracker Support
http://www.tracker-software.com