PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

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

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.
 
jusWest
User
Topic Author
Posts: 27
Joined: Fri Aug 24, 2018 8:26 am

prevent rename of bookmark

Thu Sep 13, 2018 12:51 pm

Hello again! :)

Could not find anything in the forum about this, so I ask here.

Is it possible to prevent the use of F2 and mouseclick that enables the editing of a bookmarks name?

We do not want the users of our application to be able to rename a bookmark.

Regards
Ronny
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3450
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent rename of bookmark

Thu Sep 13, 2018 1:53 pm

Hello Ronny,

Check out this post:
viewtopic.php?f=66&t=31055&p=124996&hilit=e_operBeforeExecute#p124996
You will have to check whether it's a Set Bookmark's Props operation (there also is a sample on how to get to the operation's data in that link):
https://sdkhelp.tracker-software.com/vi ... s_setProps
If it is the needed operation, then you will have to check whether the title modification will take place (mask property):
https://sdkhelp.tracker-software.com/vi ... mMaskFlags
And then if bit flags contain the OpModifyBookm_Title flag then break the operation as it's shown in the first link.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jusWest
User
Topic Author
Posts: 27
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent rename of bookmark

Fri Sep 14, 2018 10:35 am

Thanks, that worked :)

another question, is it possible to translate the title of the bookmarks pane, without going throuh the
whole translation process described elsewhere on this site?

This is what I am talking about:
Image
Attachments
bmtitle.png
bmtitle.png (2.01 KiB) Viewed 62 times
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3450
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent rename of bookmark

Fri Sep 14, 2018 12:11 pm

Hello Ronny,

Well, you can change the window text directly by using this code:
         int nBV = pdfCtl.Inst.Str2ID("bookmarksView");
         for (uint i = 0; i < pdfCtl.Inst.ActiveMainView.Panes.Count; i++)
         {
            PDFXEdit.IPXV_View BV = pdfCtl.Inst.ActiveMainView.Panes[i];
            if (BV.ID == nBV)
            {
               BV.Obj.WndText = "XXX";
               break;
            }
         }


Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jusWest
User
Topic Author
Posts: 27
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent rename of bookmark

Fri Sep 14, 2018 1:13 pm

thanks!

I have implemented the function and it loops trough and matches the id for the bookmarks Pane,
the BV.Obj.WndText gets assigned, but the change never shows in the bookmarkspane.

I use this code:

            //int nBV = pdfCtl.Inst.Str2ID("bookmarksView");
            int nBV = pdfCtl.Doc.View[0].Panes.Active[pdfCtl.Inst.Str2ID("bookmarksView")].ID;

            //for (uint i = 0; i < pdfCtl.Inst.ActiveMainView.Panes.Count; i++)
            for (uint i = 0; i < pdfCtl.Doc.View[0].Panes.Count; i++)
            {
                //IPXV_View BV = pdfCtl.Inst.ActiveMainView.Panes[i];
                IPXV_View BV = pdfCtl.Doc.View[0].Panes[i];

                if (BV != null)
                {
                    if (BV.ID == nBV)
                    {
                        BV.Obj.WndText = "XXX";
                        break;
                    }
                }
            }


Is there anything else I must do, must the pane be open?
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3450
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent rename of bookmark

Fri Sep 14, 2018 2:19 pm

Hello Ronny,

Thought that sample is what you need - seems it's not. By investigating a little I remembered the correct code snippet that will surely do what you need:
IUIX_LayoutItem itm = pdfCtl.Doc.ActiveView.Panes.Layout.GetItem(pdfCtl.Doc.ActiveView.BookmarksView.Obj);
itm.Title = "XXX";


Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jusWest
User
Topic Author
Posts: 27
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent rename of bookmark

Mon Sep 17, 2018 6:21 am

Great, thank you for all your help. One more question concerning renaming bookmarks.

It it possible to prevent the user from entering EDIT mode on the bookmark? The solution earlier in this thread prevents
it from changing, but not from entering edit mode. It is not a big concern, but it would be nice to prevent that too :)

Regards
Ronny
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3450
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent rename of bookmark

Mon Sep 17, 2018 6:43 am

Hello Ronny,

There is a way on how to restrict this, but this also will restrict any bookmark editing operations. You can set this setting to the document (note that this is a Core Document that you will have to get from the IPXV_Document):
IPXC_Document::SetOperationRestriction(Perm_ObjBookmark, Perm_OperModify, VARIANT_TRUE);


Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jusWest
User
Topic Author
Posts: 27
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent rename of bookmark

Mon Sep 17, 2018 7:34 am

great, thank you :)
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3450
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent rename of bookmark

Mon Sep 17, 2018 7:35 am

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Who is online

Users browsing this forum: No registered users and 2 guests