With the following code on a 1280x1024 monitor, i can reproduce it 1 in 10 times. The way the users are complaining, it sounds like for some people it happens every time.
[code]#include “stdafx.h”
class AwesomeComponent : public Component
{
public:
AwesomeComponent()
{
}
~AwesomeComponent()
{
}
void paint(Graphics& g)
{
g.setColour(Colours::black);
g.drawText(T("...click here...."), 0, 0, getWidth(), getHeight(), Justification::centred, true);
}
void mouseDown(const MouseEvent& e)
{
PopupMenu m;
for (int i = 0; i < 10; i++)
m.addItem(1, T("ignore this item"));
PopupMenu subsub;
subsub.addItem(2, T("just try and click this one"));
PopupMenu sub;
sub.addSubMenu(T("test"), subsub);
m.addSubMenu(T("test"), sub);
for (int i = 0; i < 80; i++)
m.addItem(1, T("ignore this item"));
m.showAt(getWidth() - 200, 100);
}
};
class MyApplicationWindow : public DialogWindow
{
public:
MyApplicationWindow() : DialogWindow(T(“Hullo”), Colours::wheat, true)
{
Rectangle rc = Desktop::getInstance().getMainMonitorArea();
setBounds(rc);
setVisible(true);
setContentComponent(new AwesomeComponent());
}
~MyApplicationWindow()
{
}
void closeButtonPressed()
{
JUCEApplication::quit();
}
};
class MyJUCEApp : public JUCEApplication
{
MyApplicationWindow* myMainWindow;
public:
MyJUCEApp() : myMainWindow (0)
{
}
~MyJUCEApp()
{
}
void initialise (const String& commandLine)
{
myMainWindow = new MyApplicationWindow();
}
void shutdown()
{
delete myMainWindow;
}
const String getApplicationName()
{
return T("Super JUCE-o-matic");
}
const String getApplicationVersion()
{
return T("1.0");
}
};
START_JUCE_APPLICATION (MyJUCEApp)[/code]