ThreadWithProgressWindow position


#1

Hi Jules,

could you make the following changes to ThreadWithProgressWindow to pass an associated compoent to its AlertWindow:

//juce_ThreadWithProgressWindow.h:
ThreadWithProgressWindow (const String& windowTitle,
                          bool hasProgressBar,
                          bool hasCancelButton,
                          int timeOutMsWhenCancelling = 10000,
                          const String& cancelButtonText = "Cancel",
                          Component* associatedComponent = 0);


//juce_ThreadWithProgressWindow.cpp:
ThreadWithProgressWindow::ThreadWithProgressWindow (const String& title,
                                                    const bool hasProgressBar,
                                                    const bool hasCancelButton,
                                                    const int timeOutMsWhenCancelling_,
                                                    const String& cancelButtonText,
                                                    Component* associatedComponent)
: Thread ("Juce Progress Window"),
  progress (0.0),
  timeOutMsWhenCancelling (timeOutMsWhenCancelling_)
{
  alertWindow = LookAndFeel::getDefaultLookAndFeel()
                  .createAlertWindow (title, String::empty, cancelButtonText,
                  String::empty, String::empty,
                  AlertWindow::NoIcon, hasCancelButton ? 1 : 0, associatedComponent);
//[...]

At the moment the progress window always appears on the first screen’s center.

Chris


#2

Seems like a sensible suggestion, thanks!