@@ -41200,7 +41200,7 @@ void Component::exitModalState (const int returnValue) | |||||
void messageCallback() | void messageCallback() | ||||
{ | { | ||||
if (target != 0) | |||||
if (target.getComponent() != 0) // (getComponent() required for VS2003 bug) | |||||
target->exitModalState (result); | target->exitModalState (result); | ||||
} | } | ||||
@@ -77630,7 +77630,7 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in | |||||
Point<int> position; | Point<int> position; | ||||
StringArray files; | StringArray files; | ||||
JUCE_DECLARE_NON_COPYABLE (AsyncFileDropMessage); | |||||
// (NB: don't make this non-copyable, which messes up in VC) | |||||
}; | }; | ||||
(new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post(); | (new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post(); | ||||
@@ -77704,6 +77704,27 @@ void DialogWindow::resized() | |||||
} | } | ||||
} | } | ||||
// (Sadly, this can't be made a local class inside the showModalDialog function, because the | |||||
// VC compiler complains about the undefined copy constructor) | |||||
class TempDialogWindow : public DialogWindow | |||||
{ | |||||
public: | |||||
TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
: DialogWindow (title, colour, escapeCloses, true) | |||||
{ | |||||
if (! JUCEApplication::isStandaloneApp()) | |||||
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
} | |||||
void closeButtonPressed() | |||||
{ | |||||
setVisible (false); | |||||
} | |||||
private: | |||||
JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
}; | |||||
int DialogWindow::showModalDialog (const String& dialogTitle, | int DialogWindow::showModalDialog (const String& dialogTitle, | ||||
Component* contentComponent, | Component* contentComponent, | ||||
Component* componentToCentreAround, | Component* componentToCentreAround, | ||||
@@ -77712,25 +77733,6 @@ int DialogWindow::showModalDialog (const String& dialogTitle, | |||||
const bool shouldBeResizable, | const bool shouldBeResizable, | ||||
const bool useBottomRightCornerResizer) | const bool useBottomRightCornerResizer) | ||||
{ | { | ||||
class TempDialogWindow : public DialogWindow | |||||
{ | |||||
public: | |||||
TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
: DialogWindow (title, colour, escapeCloses, true) | |||||
{ | |||||
if (! JUCEApplication::isStandaloneApp()) | |||||
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
} | |||||
void closeButtonPressed() | |||||
{ | |||||
setVisible (false); | |||||
} | |||||
private: | |||||
JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
}; | |||||
TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | ||||
dw.setContentComponent (contentComponent, true, true); | dw.setContentComponent (contentComponent, true, true); | ||||
@@ -1559,7 +1559,7 @@ void Component::exitModalState (const int returnValue) | |||||
void messageCallback() | void messageCallback() | ||||
{ | { | ||||
if (target != 0) | |||||
if (target.getComponent() != 0) // (getComponent() required for VS2003 bug) | |||||
target->exitModalState (result); | target->exitModalState (result); | ||||
} | } | ||||
@@ -528,7 +528,7 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in | |||||
Point<int> position; | Point<int> position; | ||||
StringArray files; | StringArray files; | ||||
JUCE_DECLARE_NON_COPYABLE (AsyncFileDropMessage); | |||||
// (NB: don't make this non-copyable, which messes up in VC) | |||||
}; | }; | ||||
(new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post(); | (new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post(); | ||||
@@ -60,6 +60,27 @@ void DialogWindow::resized() | |||||
} | } | ||||
} | } | ||||
// (Sadly, this can't be made a local class inside the showModalDialog function, because the | |||||
// VC compiler complains about the undefined copy constructor) | |||||
class TempDialogWindow : public DialogWindow | |||||
{ | |||||
public: | |||||
TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
: DialogWindow (title, colour, escapeCloses, true) | |||||
{ | |||||
if (! JUCEApplication::isStandaloneApp()) | |||||
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
} | |||||
void closeButtonPressed() | |||||
{ | |||||
setVisible (false); | |||||
} | |||||
private: | |||||
JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
}; | |||||
//============================================================================== | //============================================================================== | ||||
int DialogWindow::showModalDialog (const String& dialogTitle, | int DialogWindow::showModalDialog (const String& dialogTitle, | ||||
@@ -70,25 +91,6 @@ int DialogWindow::showModalDialog (const String& dialogTitle, | |||||
const bool shouldBeResizable, | const bool shouldBeResizable, | ||||
const bool useBottomRightCornerResizer) | const bool useBottomRightCornerResizer) | ||||
{ | { | ||||
class TempDialogWindow : public DialogWindow | |||||
{ | |||||
public: | |||||
TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses) | |||||
: DialogWindow (title, colour, escapeCloses, true) | |||||
{ | |||||
if (! JUCEApplication::isStandaloneApp()) | |||||
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level | |||||
} | |||||
void closeButtonPressed() | |||||
{ | |||||
setVisible (false); | |||||
} | |||||
private: | |||||
JUCE_DECLARE_NON_COPYABLE (TempDialogWindow); | |||||
}; | |||||
TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton); | ||||
dw.setContentComponent (contentComponent, true, true); | dw.setContentComponent (contentComponent, true, true); | ||||