Smart way to determine poupmenu gets out of screen?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
eil
Posts: 1801
Joined: 13 Jan 2011 19:44

Smart way to determine poupmenu gets out of screen?

Post by eil »

Is there a smart way to determine that popupmenu() is too long and some items are out of screen? Smth like a trigger determining that popupmenu is long enough to show those top/bottom arrow, or at least a screen-height variable.
Win 7 SP1 x64 100% 1366x768|1900x1080

admin
Site Admin
Posts: 63856
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Smart way to determine poupmenu gets out of screen?

Post by admin »

Counting?

eil
Posts: 1801
Joined: 13 Jan 2011 19:44

Re: Smart way to determine poupmenu gets out of screen?

Post by eil »

Yeah, that's the only variant i imagined: count how many items are visible, add counter check in menu forming code, put "extra" in nested menu. But that works only if menu position is the same. If menu is formed in various/mouse position, or if screen resolution(monitor) changed, such counter will "miss-calculate".
Win 7 SP1 x64 100% 1366x768|1900x1080

highend
Posts: 14335
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Smart way to determine poupmenu gets out of screen?

Post by highend »

Either create smaller hierarchies via popupnested() or use inputselect() (no, not a menu but no problems to display as many items as you want) instead...
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1801
Joined: 13 Jan 2011 19:44

Re: Smart way to determine poupmenu gets out of screen?

Post by eil »

Thank you for the hint about inputselect(), didn't consider that initially. But in my case it can't do, as only popupmenu() works with b64icons, and that's the main point why i started using dynamic long menus in my workflow.
I was actually hoping that maybe some <get ..> variation could determine popupmenu's state(that those top/bottom arrows for scrolling menu got activated), but guess will try to work smth with <get "screen"> and cursor position.
I'd wish popupmenu could be simply scrollable with mouse.
Win 7 SP1 x64 100% 1366x768|1900x1080

Post Reply