コード例 #1
0
ファイル: ModulatorSamplerSound.cpp プロジェクト: azeteg/HISE
    void resultButtonClicked(const String &name) override
    {
        if(name == "Search in Finder")
        {
            String file = getTextEditor("fileNames")->getText();
            
            file.replace("\\", "/");
            
            String fileName = file.fromLastOccurrenceOf("/", false, false);
            String pathName = file.upToLastOccurrenceOf("/", true, false);
            
#if JUCE_WINDOWS
            String dialogName = "Explorer";
#else
            String dialogName = "Finder";
#endif
            
            PresetHandler::showMessageWindow("Search file", "Search for the sample:\n\n"+fileName +"\n\nPress OK to open the " + dialogName, PresetHandler::IconType::Info);
            
            FileChooser fc("Search sample location " + fileName);
            
            if(fc.browseForFileToOpen())
            {
                File f = fc.getResult();

				
                
                String newPath = f.getFullPathName().replaceCharacter('\\', '/').upToLastOccurrenceOf("/", true, false);;
                
                getTextEditor("search")->setText(pathName);
                getTextEditor("replace")->setText(newPath);
            }
        }
    };
コード例 #2
0
String AlertWindow::getTextEditorContents (const String& nameOfTextEditor) const
{
    if (TextEditor* const t = getTextEditor (nameOfTextEditor))
        return t->getText();

    return String();
}
コード例 #3
0
ファイル: juce_AlertWindow.cpp プロジェクト: Amcut/pizmidi
String AlertWindow::getTextEditorContents (const String& nameOfTextEditor) const
{
    TextEditor* const t = getTextEditor (nameOfTextEditor);
    return t != nullptr ? t->getText() : String::empty;
}