Hi,
I just discover an issue on a Windows 8 tablet, using the touch screen. A child component running a modal loop is not able to receive “mouse” events coming from the touch screen… but no problem if the "real mouse " is used instead.
Here is a short piece of code showing the issue. I can “touch” the Open button then the modal component is displayed. But at this time I can’t “touch” the Close button. I can “click” it, but not “touch”… you see what I mean?
Any idea? I know it would be better to migrate my code to use enterModalState instead of runModaLoop, but no time for that right now.
Many thanks in advance,
/Phil
/*
==============================================================================
This file was auto-generated!
It contains the basic outline for a simple desktop window.
==============================================================================
*/
#include "MainWindow.h"
class MyComponent : public Component,
public Button::Listener
{
public:
TextButton btnOpen;
MyComponent()
{
addAndMakeVisible(&btnOpen);
btnOpen.setBounds(20,20,80,20);
btnOpen.setButtonText("Open");
btnOpen.addListener(this);
}
class MyDialog : public Component,
public Button::Listener
{
public:
TextButton btnClose;
MyDialog()
{
addAndMakeVisible(&btnClose);
btnClose.setBounds(20,20,80,20);
btnClose.setButtonText("Close");
btnClose.addListener(this);
}
void buttonClicked (Button* button)
{
exitModalState(0);
}
void paint(Graphics& g)
{
g.fillAll(Colours::red);
}
};
void buttonClicked (Button* button)
{
MyDialog dlg;
addAndMakeVisible(&dlg);
dlg.setBounds(40,40,getWidth()-80,getHeight()-80);
dlg.runModalLoop();
}
};
//==============================================================================
MainAppWindow::MainAppWindow()
: DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
Colours::lightgrey,
DocumentWindow::allButtons)
{
centreWithSize (500, 400);
setVisible (true);
setContentOwned(new MyComponent(), false);
}
MainAppWindow::~MainAppWindow()
{
}
void MainAppWindow::closeButtonPressed()
{
JUCEApplication::getInstance()->systemRequestedQuit();
}