PopupMenu - function request


I am offen need to show PopupMenu at direct coordinates. I am add such code evey update.

Maybe it can be included in juce source tree?


Well, maybe… How would you specify the position, though? You’d need to specify which corner of the menu you’re positioning, or maybe you’d want to specify the position of something in the menu… and it all gets a bit complicated.

I am just specify top left position and width of menu.
I add parameter (showAtDirectPostion=false) in showAt function. After call it wil passed to internal funtions to ignore calcing of best(in some cases - not so best) position.

I have not juce code right here. I can send you changed PopupMenu.cpp tommorow, if you want.


That might work fine for what you’re doing, but to add a function like this I’d have to make it quite general, and very often I’m sure you’d want to specify things like the bottom-left corner, or not specify the width, etc… it just seems like it’d become a very convoluted method.

Hm… I am not sure.
We need only one argument - can showAt recalc position or not. So, one new argument with default value - this is not compilant.

But, looks good to add position calculating in LookAndFeel. I think it is best solution for this problem.