Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
45b2d8a0ce
2 changed files with 18 additions and 15 deletions
  1. +9
    -8
      src/juce_appframework/gui/components/windows/juce_DialogWindow.cpp
  2. +9
    -7
      src/juce_appframework/gui/components/windows/juce_DialogWindow.h

+ 9
- 8
src/juce_appframework/gui/components/windows/juce_DialogWindow.cpp View File

@@ -91,21 +91,22 @@ private:
};
void DialogWindow::showModalDialog (const String& dialogTitle,
Component* contentComponent,
Component* componentToCentreAround,
const Colour& colour,
const bool escapeKeyTriggersCloseButton,
const bool shouldBeResizable,
const bool useBottomRightCornerResizer)
int DialogWindow::showModalDialog (const String& dialogTitle,
Component* contentComponent,
Component* componentToCentreAround,
const Colour& colour,
const bool escapeKeyTriggersCloseButton,
const bool shouldBeResizable,
const bool useBottomRightCornerResizer)
{
TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton);
dw.setContentComponent (contentComponent, true, true);
dw.centreAroundComponent (componentToCentreAround, dw.getWidth(), dw.getHeight());
dw.setResizable (shouldBeResizable, useBottomRightCornerResizer);
dw.runModalLoop();
const int result = dw.runModalLoop();
dw.setContentComponent (0, false);
return result;
}


+ 9
- 7
src/juce_appframework/gui/components/windows/juce_DialogWindow.h View File

@@ -88,6 +88,8 @@ public:
This will open and display a DialogWindow containing a given component, returning
when the user clicks its close button.
It returns the value that was returned by the dialog box's runModalLoop() call.
@param dialogTitle the dialog box's title
@param contentComponent the content component for the dialog box. Make sure
that this has been set to the size you want it to
@@ -106,13 +108,13 @@ public:
@param useBottomRightCornerResizer if shouldBeResizable is true, this indicates whether
to use a border or corner resizer component. See ResizableWindow::setResizable()
*/
static void showModalDialog (const String& dialogTitle,
Component* contentComponent,
Component* componentToCentreAround,
const Colour& backgroundColour,
const bool escapeKeyTriggersCloseButton,
const bool shouldBeResizable = false,
const bool useBottomRightCornerResizer = false);
static int showModalDialog (const String& dialogTitle,
Component* contentComponent,
Component* componentToCentreAround,
const Colour& backgroundColour,
const bool escapeKeyTriggersCloseButton,
const bool shouldBeResizable = false,
const bool useBottomRightCornerResizer = false);
//==============================================================================
juce_UseDebuggingNewOperator


Loading…
Cancel
Save