void BurgerMenuComponent::mouseUp (const MouseEvent& event) { auto rowIndex = listBox.getSelectedRow(); if (rowIndex == lastRowClicked && rowIndex < rows.size() && event.source.getIndex() == inputSourceIndexOfLastClick) { auto& row = rows.getReference (rowIndex); if (! row.isMenuHeader) { listBox.selectRow (-1); lastRowClicked = -1; inputSourceIndexOfLastClick = -1; topLevelIndexClicked = row.topLevelMenuIndex; auto& item = row.item; if (auto* managerOfChosenCommand = item.commandManager) { ApplicationCommandTarget::InvocationInfo info (item.itemID); info.invocationMethod = ApplicationCommandTarget::InvocationInfo::fromMenu; managerOfChosenCommand->invoke (info, true); } postCommandMessage (item.itemID); } } }
void CallOutBox::inputAttemptWhenModal() { const Point<int> mousePos (getMouseXYRelative() + getBounds().getPosition()); if (targetArea.contains (mousePos)) { // if you click on the area that originally popped-up the callout, you expect it // to get rid of the box, but deleting the box here allows the click to pass through and // probably re-trigger it, so we need to dismiss the box asynchronously to consume the click.. postCommandMessage (callOutBoxDismissCommandId); } else { exitModalState (0); setVisible (false); } }
void CallOutBox::dismiss() { postCommandMessage (callOutBoxDismissCommandId); }
void Button::triggerClick() { postCommandMessage (clickMessageId); }
void MenuBarComponent::menuDismissed (int topLevelIndex, int itemId) { topLevelIndexClicked = topLevelIndex; postCommandMessage (itemId); }