1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Added a LookAndFeel method preparePopupMenuWindow() to allow the window component to be customised before being displayed

This commit is contained in:
jules 2016-09-04 12:37:53 +01:00
parent 132c1d6ae8
commit 151e3f769e
4 changed files with 6 additions and 0 deletions

View file

@ -1080,6 +1080,8 @@ Component* LookAndFeel_V2::getParentComponentForMenuOptions (const PopupMenu::Op
return options.getParentComponent();
}
void LookAndFeel_V2::preparePopupMenuWindow (Component&) {}
//==============================================================================
void LookAndFeel_V2::fillTextEditorBackground (Graphics& g, int /*width*/, int /*height*/, TextEditor& textEditor)
{

View file

@ -162,6 +162,7 @@ public:
void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight,
int& idealWidth, int& idealHeight) override;
int getMenuWindowFlags() override;
void preparePopupMenuWindow (Component&) override;
void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
int getMenuBarItemWidth (MenuBarComponent&, int itemIndex, const String& itemText) override;

View file

@ -903,6 +903,7 @@ public:
.withTargetComponent (nullptr),
false, dismissOnMouseUp, managerOfChosenCommand);
getLookAndFeel().preparePopupMenuWindow (*activeSubMenu);
activeSubMenu->setVisible (true); // (must be called before enterModalState on Windows to avoid DropShadower confusion)
activeSubMenu->enterModalState (false);
activeSubMenu->toFront (false);

View file

@ -707,6 +707,8 @@ public:
MenuBarComponent&) = 0;
virtual Component* getParentComponentForMenuOptions (const PopupMenu::Options& options) = 0;
virtual void preparePopupMenuWindow (Component& newWindow) = 0;
};
private: