Пример #1
0
bool FileChooserDialogBox::showAt (int x, int y, int w, int h)
{
    if (w <= 0)  w = getDefaultWidth();
    if (h <= 0)  h = 500;

    if (x < 0 || y < 0)
        centreWithSize (w, h);
    else
        setBounds (x, y, w, h);

    const bool ok = (runModalLoop() != 0);
    setVisible (false);
    return ok;
}
//==============================================================================
bool FileChooserDialogBox::show (int w, int h)
{
    if (w <= 0)
    {
        Component* const previewComp = content->chooserComponent->getPreviewComponent();
        if (previewComp != 0)
            w = 400 + previewComp->getWidth();
        else
            w = 600;
    }

    if (h <= 0)
        h = 500;

    centreWithSize (w, h);

    const bool ok = (runModalLoop() != 0);
    setVisible (false);
    return ok;
}
bool FileChooserDialogBox::showAt (int x, int y, int w, int h)
{
    if (w <= 0)
    {
        Component* const previewComp = content->chooserComponent.getPreviewComponent();

        if (previewComp != nullptr)
            w = 400 + previewComp->getWidth();
        else
            w = 600;
    }

    if (h <= 0)
        h = 500;

    if (x < 0 || y < 0)
        centreWithSize (w, h);
    else
        setBounds (x, y, w, h);

    const bool ok = (runModalLoop() != 0);
    setVisible (false);
    return ok;
}