[javascript FR] app.popUpMenuEx enhancements

Please post any ideas or requests for new features here for the End User Version of PDF-XChange (printer Drivers)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Mathew
User
Posts: 736
Joined: Thu Jun 19, 2014 7:30 pm

[javascript FR] app.popUpMenuEx enhancements

Post by Mathew »

Two enhancements to app.popUpMenuEx would be really helpful:
  1. Add an optional parameter to set the menu at a specific coordinates instead of defaulting to the current cursor position (such as if there's a position: [x,y] parameter added to one of the menu items.)
  2. This is closely related to viewtopic.php?t=46657
    If app.popUpMenuEx or app.popUpMenu are called when another popup menu is currently active, it appears that the previous one is cancelled, because it disappears, but it stays in the stack. This causes stack overflow if it happens more than 20 times. The feature request is for the previously set popUpMenu to get cancelled and return Null if it gets called again.

    Example code:
    Sets up a sequence of popUpMenus at 1/2 second intervals. Usually overflows at 21.

    Code: Select all

    // danger: stack overflower!
    {
    const tests = [];
    
    for (let i = 0; i < 21; i++) {
    	let t = "Test " + i;
    	tests.push(t);
    	app.setTimeOut('{console.println(new Error().stack);let c = app.popUpMenu(...' + JSON.stringify(tests) + '); console.println(c);}', 1+500*i);
    }
    }
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 12227
Joined: Wed Jan 03, 2018 6:52 pm

Re: [javascript FR] app.popUpMenuEx enhancements

Post by Daniel - PDF-XChange »

Hello, Mathew

Thank you for the suggestions, I have passed this along to the Dev team fore review.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com