Tell if snapping or rulers are on for a document

PDF-XChange Editor SDK for Developers

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.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Tell if snapping or rulers are on for a document

Post by lidds »

I am using your control in multi document view mode and I was wondering if there is a way to tell if the active document has snapping or rulers enabled so that I can modify my ribbon bar accordingly?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Tell if snapping or rulers are on for a document

Post by Sasha - Tracker Dev Team »

Hello Simon,

Try getting "Measurement.Rulers.Visible" setting from IPXV_Inst.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Tell if snapping or rulers are on for a document

Post by lidds »

Thanks Alex,

I am doing the following, which works for the fine for the Rulers, but not for the Snapping as the e_pagesView_endLayoutChanging does not seem to fire when the snapping is enabled or disabled. Could you please guide me as to what event on should be using to capture the Snapping?

Code: Select all

If e.nEventID = nIDS(CInt(IDS.e_pagesView_endLayoutChanging)) Then
            MISData.Instance.frmMain.btnShowRules.Down = Me.docPreview.Inst.Settings.Item("Measurement.Rulers.Visible").v
            MISData.Instance.frmMain.btnEnableSnap.Down = Me.docPreview.Inst.Settings.Item("Measurement.Snapping.Use").v
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Tell if snapping or rulers are on for a document

Post by Sasha - Tracker Dev Team »

Hello Simon,

The e_documentView_measurementChanged is fired in both cases.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Tell if snapping or rulers are on for a document

Post by lidds »

Thanks Alex,

This if fine for the initial controlling of the custom buttons on my ribbonBar, however if there is more than one document loaded then when the user tabs between them I need to set the buttons to reflect if the snapping is turned on. And as the snapping is document specific, unlike the rulers, then how would I do this?

I have done the following, but this is not picking up the specific document snapping settings:

Code: Select all

        If e.nEventID = nIDS(CInt(IDS.e_activeDocChanged)) Then
            MISData.Instance.frmMain.btnEnableSnap.Down = Me.docPreview.Inst.Settings.Item("Measurement.Snapping.Use").v
Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Tell if snapping or rulers are on for a document

Post by Sasha - Tracker Dev Team »

Hello Simon,

From what I see, the setting itself is for the entire instance, though each of the documents hold it's own snapping settings for the current program instance. Will investigate further.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Tell if snapping or rulers are on for a document

Post by lidds »

Hi Alex

Any update on this?

Thanks

Simon
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Tell if snapping or rulers are on for a document

Post by lidds »

Alex,

Any solution to this?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Tell if snapping or rulers are on for a document

Post by Sasha - Tracker Dev Team »

Hello Simon,

Right now, the only way is to make a custom command handler for the cmd.view.snapGroup and other needed commands and listen to the OnGetItemState method.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply