Hi all,
I’ve got a PopupMenu
for some audio samples, and I want to have an “audio sample preview” button next to each PopupMenu
item so that a user may preview the audio of any sample in the PopupMenu
list. This way, the user can look through the PopupMenu
, previewing various samples with the preview buttons before they make their final selection and close the PopupMenu
.
PopupMenu::CustomComponent
seems like a great candidate for this. I could add a button to my new PopupMenu::CustomComponent
so when the PopupMenu
row is drawn it draws a Button
in addition to the name of the audio sample.
But, I am having problems:
-
If I set
PopupMenu::CustomComponent::triggeredAutomatically
totrue
via the constructor, whenever I click the sample preview button contained in thePopupMenu::CustomComponent
the correspondingPopupMenu
item is selected and thePopupMenu
is closed. When the audio sample preview button is clicked, I do not want the PopupMenu item to be selected, and I do not want the PopupMenu to close. -
If I set
PopupMenu::CustomComponent::triggeredAutomatically
tofalse
via the constructor, I can get the audio preview button to behave properly: when I click the audio preview button, thePopupMenu
item is not selected, just as I want . But, keyboard navigation with the arrows/enter keys is broken. I can no longer use the arrow keys to move up and down between these custom menu items and I can no longer press enter to select a menu item.
Does anyone know a workaround for this problem?