|
|
|
@@ -171,8 +171,7 @@ public: |
|
|
|
|
|
|
|
void resized()
|
|
|
|
{
|
|
|
|
Component* const child = getChildComponent (0);
|
|
|
|
if (child != nullptr)
|
|
|
|
if (Component* const child = getChildComponent (0))
|
|
|
|
child->setBounds (getLocalBounds().reduced (2, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -479,10 +478,9 @@ public: |
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Window* currentlyModalWindow = dynamic_cast <Window*> (Component::getCurrentlyModalComponent());
|
|
|
|
|
|
|
|
if (currentlyModalWindow != nullptr && ! treeContains (currentlyModalWindow))
|
|
|
|
return;
|
|
|
|
if (Window* currentlyModalWindow = dynamic_cast <Window*> (Component::getCurrentlyModalComponent()))
|
|
|
|
if (! treeContains (currentlyModalWindow))
|
|
|
|
return;
|
|
|
|
|
|
|
|
startTimer (PopupMenuSettings::timerInterval); // do this in case it was called from a mouse
|
|
|
|
// move rather than a real timer callback
|
|
|
|
@@ -1257,8 +1255,8 @@ public: |
|
|
|
|
|
|
|
void resized()
|
|
|
|
{
|
|
|
|
if (getChildComponent(0) != nullptr)
|
|
|
|
getChildComponent(0)->setBounds (getLocalBounds());
|
|
|
|
if (Component* const child = getChildComponent(0))
|
|
|
|
child->setBounds (getLocalBounds());
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
@@ -1536,16 +1534,12 @@ int PopupMenu::showAt (Component* componentToAttachTo, |
|
|
|
|
|
|
|
bool JUCE_CALLTYPE PopupMenu::dismissAllActiveMenus()
|
|
|
|
{
|
|
|
|
Array<Window*>& windows = Window::getActiveWindows();
|
|
|
|
|
|
|
|
const Array<Window*>& windows = Window::getActiveWindows();
|
|
|
|
const int numWindows = windows.size();
|
|
|
|
for (int i = numWindows; --i >= 0;)
|
|
|
|
{
|
|
|
|
Window* const pmw = windows[i];
|
|
|
|
|
|
|
|
if (pmw != nullptr)
|
|
|
|
for (int i = numWindows; --i >= 0;)
|
|
|
|
if (Window* const pmw = windows[i])
|
|
|
|
pmw->dismissMenu (nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
return numWindows > 0;
|
|
|
|
}
|
|
|
|
@@ -1566,10 +1560,10 @@ bool PopupMenu::containsCommandItem (const int commandID) const |
|
|
|
{
|
|
|
|
for (int i = items.size(); --i >= 0;)
|
|
|
|
{
|
|
|
|
const Item* const mi = items.getUnchecked (i);
|
|
|
|
const Item& mi = *items.getUnchecked (i);
|
|
|
|
|
|
|
|
if ((mi->itemID == commandID && mi->commandManager != nullptr)
|
|
|
|
|| (mi->subMenu != nullptr && mi->subMenu->containsCommandItem (commandID)))
|
|
|
|
if ((mi.itemID == commandID && mi.commandManager != nullptr)
|
|
|
|
|| (mi.subMenu != nullptr && mi.subMenu->containsCommandItem (commandID)))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
@@ -1582,14 +1576,14 @@ bool PopupMenu::containsAnyActiveItems() const noexcept |
|
|
|
{
|
|
|
|
for (int i = items.size(); --i >= 0;)
|
|
|
|
{
|
|
|
|
const Item* const mi = items.getUnchecked (i);
|
|
|
|
const Item& mi = *items.getUnchecked (i);
|
|
|
|
|
|
|
|
if (mi->subMenu != nullptr)
|
|
|
|
if (mi.subMenu != nullptr)
|
|
|
|
{
|
|
|
|
if (mi->subMenu->containsAnyActiveItems())
|
|
|
|
if (mi.subMenu->containsAnyActiveItems())
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (mi->isActive)
|
|
|
|
else if (mi.isActive)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
@@ -1622,13 +1616,9 @@ void PopupMenu::CustomComponent::setHighlighted (bool shouldBeHighlighted) |
|
|
|
|
|
|
|
void PopupMenu::CustomComponent::triggerMenuItem()
|
|
|
|
{
|
|
|
|
PopupMenu::ItemComponent* const mic = dynamic_cast <PopupMenu::ItemComponent*> (getParentComponent());
|
|
|
|
|
|
|
|
if (mic != nullptr)
|
|
|
|
if (PopupMenu::ItemComponent* const mic = dynamic_cast <PopupMenu::ItemComponent*> (getParentComponent()))
|
|
|
|
{
|
|
|
|
PopupMenu::Window* const pmw = dynamic_cast <PopupMenu::Window*> (mic->getParentComponent());
|
|
|
|
|
|
|
|
if (pmw != nullptr)
|
|
|
|
if (PopupMenu::Window* const pmw = dynamic_cast <PopupMenu::Window*> (mic->getParentComponent()))
|
|
|
|
{
|
|
|
|
pmw->dismissMenu (&mic->itemInfo);
|
|
|
|
}
|
|
|
|
|