void MenuBarComponent::timerCallback() { stopTimer(); const Point<int> mousePos (getMouseXYRelative()); updateItemUnderMouse (mousePos.getX(), mousePos.getY()); }
void MenuBarComponent::mouseDown (const MouseEvent& e) { if (currentPopupIndex < 0) { const MouseEvent e2 (e.getEventRelativeTo (this)); updateItemUnderMouse (e2.getPosition()); currentPopupIndex = -2; showMenu (itemUnderMouse); } }
void MenuBarComponent::handleCommandMessage (int commandId) { const Point<int> mousePos (getMouseXYRelative()); updateItemUnderMouse (mousePos); if (currentPopupIndex == topLevelIndexClicked) setOpenItem (-1); if (commandId != 0 && model != nullptr) model->menuItemSelected (commandId, topLevelIndexClicked); }
void MenuBarComponent::mouseUp (const MouseEvent& e) { const MouseEvent e2 (e.getEventRelativeTo (this)); updateItemUnderMouse (e2.getPosition()); if (itemUnderMouse < 0 && getLocalBounds().contains (e2.x, e2.y)) { setOpenItem (-1); PopupMenu::dismissAllActiveMenus(); } }
void MenuBarComponent::mouseMove (const MouseEvent& e) { const MouseEvent e2 (e.getEventRelativeTo (this)); if (lastMousePos != e2.getPosition()) { if (currentPopupIndex >= 0) { const int item = getItemAt (e2.getPosition()); if (item >= 0) showMenu (item); } else { updateItemUnderMouse (e2.getPosition()); } lastMousePos = e2.getPosition(); } }
void MenuBarComponent::mouseMove (const MouseEvent& e) { const MouseEvent e2 (e.getEventRelativeTo (this)); if (lastMouseX != e2.x || lastMouseY != e2.y) { if (currentPopupIndex >= 0) { const int item = getItemAt (e2.x, e2.y); if (item >= 0) showMenu (item); } else { updateItemUnderMouse (e2.x, e2.y); } lastMouseX = e2.x; lastMouseY = e2.y; } }
void MenuBarComponent::timerCallback() { stopTimer(); updateItemUnderMouse (getMouseXYRelative()); }
void MenuBarComponent::mouseExit (const MouseEvent& e) { if (e.eventComponent == this) updateItemUnderMouse (e.getPosition()); }
void MenuBarComponent::mouseExit (const MouseEvent& e) { if (e.eventComponent == this) updateItemUnderMouse (e.x, e.y); }