Esempio n. 1
0
bool ProjucerApplication::checkEULA()
{
    if (currentEULAHasBeenAcceptedPreviously()
          || ! ProjucerLicences::getInstance()->isDLLPresent())
        return true;

    ScopedPointer<AlertWindow> eulaDialogue (new EULADialogue());
    bool hasBeenAccepted = (eulaDialogue->runModalLoop() == EULADialogue::accepted);
    setCurrentEULAAccepted (hasBeenAccepted);
    return hasBeenAccepted;
}
Esempio n. 2
0
void HadronLabel::mouseDoubleClick(const MouseEvent& e) 
{
    if (use_modal_editor_) {
        
        if (isEditableOnDoubleClick() && ! e.mods.isPopupMenu()) {
            
            ModalComponentManager::Callback* userCallback = 0;
            ScopedPointer<ModalComponentManager::Callback> userCallbackDeleter (userCallback);
            Component::SafePointer<Component> prevFocused (Component::getCurrentlyFocusedComponent());
            Component::SafePointer<Component> prevTopLevel ((prevFocused != 0) ? prevFocused->getTopLevelComponent() : 0);
            
            ScopedPointer <TextEditor> texteditor (createEditorComponent());
            texteditor->setColour(TextEditor::backgroundColourId, Colours::white);
            texteditor->setWantsKeyboardFocus (true);
            texteditor->setAlwaysOnTop (true);
            
            // Find screen position
            Rectangle<int> sr (getBounds ());
            sr.setPosition (getScreenX(), getScreenY());
            int fontheight = static_cast<int>(texteditor->getFont().getHeight()) + 4;
            if (sr.getHeight() > fontheight) {
                sr.translate (0, (sr.getHeight() - fontheight)/2);
                sr.setHeight (fontheight);
            }
            texteditor->setBounds(sr);
            
            texteditor->setText(getText(),false);
            texteditor->setHighlightedRegion (Range <int> (0, getText().length ()));
            texteditor->setVisible (true);
            texteditor->grabKeyboardFocus();
            texteditor->addToDesktop (ComponentPeer::windowIsTemporary, 0);
            
            texteditor->addListener (this);
            texteditor->enterModalState (false);
            texteditor->grabKeyboardFocus();
            
            texteditor->runModalLoop();
            
            if (prevTopLevel != 0)
                prevTopLevel->toFront (true);
            if (prevFocused != 0)
                prevFocused->grabKeyboardFocus();
        }
    }
    else {
        Label::mouseDoubleClick(e);
    }
}
Esempio n. 3
0
    void show()
    {
        LookAndFeel& lf = associatedComponent != nullptr ? associatedComponent->getLookAndFeel()
                                                         : LookAndFeel::getDefaultLookAndFeel();

        ScopedPointer <Component> alertBox (lf.createAlertWindow (title, message, button1, button2, button3,
                                                                  iconType, numButtons, associatedComponent));

        jassert (alertBox != nullptr); // you have to return one of these!

       #if JUCE_MODAL_LOOPS_PERMITTED
        if (modal)
        {
            returnValue = alertBox->runModalLoop();
        }
        else
       #endif
        {
            alertBox->enterModalState (true, callback, true);
            alertBox.release();
        }
    }