Hiding some elements on the Preferences... dialog sheets  SOLVED

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
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Hiding some elements on the Preferences... dialog sheets

Post by zarkogajic »

Hi support,

I can handle the "e.beginPropDialog" and remove a page from the Preferences dialog (using IUIX_PropSheets's RemovePage).

What If I want to hide some elements of a specific page, say "DlgAppPrefs.General". I want to hide the "Tabs and Windows" group:

image.png

I cannot find a method in IUIX_PropSheets or IUIX_PropSheetPage to do something like that.

I can actually hide this group by hiding each element in my custom IUIX_EventMonitor by using IUIX_Dialog.ShowItem() - where I get item names from the DlgTemplates.xml (from Resources.dat).

When I do that the property sheet page looks like:

image.png

Any chance to do the same *without* the need to use IUIX_EventMonitor and also not to have the empty space due to removal of elements?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Hiding some elements on the Preferences... dialog sheets

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

The usage of the event monitor is the only way of doing this. Also, you can manually move the needed items up if needed by using the Rect property of the needed IUIX_Obj. For this you will need to get the delta and cycle through all of the dialog's objects and do get_Rect, modify by delta, put_Rect.


Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hiding some elements on the Preferences... dialog sheets

Post by zarkogajic »

Hi Alex,

Thanks, exactly what I though.

Further, it seems that "InstUI.CurrentThreadCtx.RegisterEventMonitor(myMonitor)" cannot be called when handling "e.beginPropDialog" as the dialog is already being displayed - so registering myMonitor (for "DlgAppPrefs.General") at that time is too late.

So, I need to have my monitor running all the time.

Correct?

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

Re: Hiding some elements on the Preferences... dialog sheets  SOLVED

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

The monitor should be up the entire time, listening to the needed events.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hiding some elements on the Preferences... dialog sheets

Post by zarkogajic »

Hi Alex,

ok, thanks :)

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

Re: Hiding some elements on the Preferences... dialog sheets

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Hiding some elements on the Preferences... dialog sheets

Post by zarkogajic »

Alex,

Just a small addition here.

The event monitor (in this case) does not need to run all the time.

If I custom handle (UIX_CmdNotify_Exec) the "cmd.prefs" command then I can register the even monitor before command execution and unregister afterwards.

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

Re: Hiding some elements on the Preferences... dialog sheets

Post by Sasha - Tracker Dev Team »

Hello žarko,

Well that would be optimal if it works for you.

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