//------------------------------------------------------------------------------
void PreferencesDialog::textEditorFocusLost(TextEditor &editor)
{
	if(editor.getName() == "oscPortEditor")
	{
		currentPort = editor.getText();
		mainPanel->setSocketPort(currentPort);
	}
	else if(editor.getName() == "oscMulticastEditor")
	{
		currentMulticast = editor.getText();
		mainPanel->setSocketMulticast(currentMulticast);
	}
}
示例#2
0
//------------------------------------------------------------------------------
void MappingsDialog::textEditorTextChanged(TextEditor &editor)
{
	BypassableInstance *proc = dynamic_cast<BypassableInstance *>(pluginNode->getProcessor());

	if(proc)
		oscManager->registerMIDIProcessor(editor.getText(), proc);
}
示例#3
0
void FindAndReplaceDialog::buttonClicked (Button* buttonThatWasClicked)
{
  TextEditorWindow* win=TextEditorWindow::getFocusTextEditor();

  if (!win)  // no editor open
    {
      PlatformUtilities::beep();
      return;
    }
  TextBuffer* buf=win->getTextBuffer();
  // no find string
  String str=textEditor1->getText();
  if (str.isEmpty())
    {
      PlatformUtilities::beep();
      textEditor1->grabKeyboardFocus();
      return;
    }

  if (buttonThatWasClicked == textButton1)       // Replace All
    {
      if (!buf->replaceAll(str, textEditor2->getText()))
	PlatformUtilities::beep();
    }
  else if (buttonThatWasClicked == textButton2)  // Replace
    {
      if (!buf->replace(textEditor2->getText()))
	PlatformUtilities::beep();
    }
  else if (buttonThatWasClicked == textButton3) // Find & Replace
    {
      if (!buf->replaceAndFind(str, textEditor2->getText()))
	PlatformUtilities::beep();	
    }
  else if (buttonThatWasClicked == textButton4) // Previous
    {
      if (!buf->findPrevious(str))
	PlatformUtilities::beep();
    }
  else if (buttonThatWasClicked == textButton5) // Next
    {
      if (!buf->findNext(str))
	PlatformUtilities::beep();
    }
}
示例#4
0
void HadronLabel::textEditorReturnKeyPressed(TextEditor& editor)
{
    if (use_modal_editor_) {
        setText(editor.getText(), true);
        editor.exitModalState(0);
    }
    else {
        Label::textEditorReturnKeyPressed(editor);
    }
}
void NodeComponent::textEditorReturnKeyPressed(TextEditor& editor) {
	if (&editor == &pluginName) {
		editorWindow = nullptr;
		bool success = engine()->addRemovePlugin(editor.getText(), 105482);
		if (success) {
			engine()->addConnection(2, 4096, 105482, 4096);
			engine()->addConnection(105482, 0, 1, 0);
			engine()->addConnection(105482, 1, 1, 1);
		}
	} else if (&editor == &connectionSpec) {
		DBG("connection specification");
	} else if (&editor == &dllPath) {
		DBG("dll path");
	}
}
示例#6
0
bool Label::updateFromTextEditorContents (TextEditor& ed)
{
    const String newText (ed.getText());

    if (textValue.toString() != newText)
    {
        lastTextValue = newText;
        textValue = newText;
        repaint();

        textWasChanged();

        if (ownerComponent != nullptr)
            componentMovedOrResized (*ownerComponent, true, true);

        return true;
    }

    return false;
}
示例#7
0
void SettingsPanel::textEditorReturnKeyPressed (TextEditor &editor)
{
    String newPrefix = editor.getText();
    pluginUI->setGlobalSetting(GlobalSettings::sOSCPrefix, &newPrefix);
    DBG(newPrefix);
}
示例#8
0
 void updateCreateButton()
 {
     createButton.setEnabled (projectName.getText().trim().isNotEmpty());
 }
示例#9
0
void DexedAudioProcessorEditor::storeProgram() {
    String currentName = Cartridge::normalizePgmName((const char *) processor->data+145);
    Cartridge destSysex = processor->currentCart;
    File *externalFile = NULL;

    bool activeCartridgeFound = processor->activeFileCartridge.exists();
    
    while (true) {
        String msg;
        
        if ( externalFile == NULL ) {
            if ( activeCartridgeFound )
                msg = "Store program to current (" + processor->activeFileCartridge.getFileName() + ") / new cartridge";
            else
                msg = "Store program to current / new cartridge";
        } else {
            msg = "Store program to " + externalFile->getFileName();
        }
        
        AlertWindow dialog("Store Program", msg, AlertWindow::NoIcon, this);
        dialog.addTextEditor("Name", currentName, String("Name"), false);
        // TODO: fix the name length to 10

        StringArray programs;
        destSysex.getProgramNames(programs);
        dialog.addComboBox("Dest", programs, "Program Destination");


        if ( externalFile == NULL ) {
            StringArray saveAction;
            saveAction.add("Store program to DAW plugin song state");
            saveAction.add("Store program and create a new copy of the .syx cartridge");
            if ( activeCartridgeFound )
                saveAction.add("Store program and overwrite current .syx cartridge");
        
            dialog.addComboBox("SaveAction", saveAction, "Store Action");
        }
                
        dialog.addButton("OK", 0, KeyPress(KeyPress::returnKey));
        dialog.addButton("CANCEL", 1, KeyPress(KeyPress::escapeKey));
        dialog.addButton("EXTERNAL FILE", 2, KeyPress());
        int response = dialog.runModalLoop();

        if ( response == 2 ) {
            FileChooser fc("Destination Sysex", processor->dexedCartDir, "*.syx;*.SYX;*.*", 1);

            if ( fc.browseForFileToOpen() ) {
                if ( externalFile != NULL ) 
                    delete externalFile;

                externalFile = new File(fc.getResults().getReference(0));
                if ( destSysex.load(*externalFile) )
                    continue;
                AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Read error", "Unable to read file");
            }
        }

        if ( response == 0 ) {
            TextEditor *name = dialog.getTextEditor("Name");
            ComboBox *dest = dialog.getComboBoxComponent("Dest");
            
            int programNum = dest->getSelectedItemIndex();
            String programName(name->getText());
            if ( programName.length() > 10 ) {
                int toStrip = programName.length() - 10;
                programName = programName.dropLastCharacters(toStrip);
            }

            if ( externalFile == NULL ) {
                processor->currentCart.packProgram((uint8_t *) processor->data, programNum, programName);
                rebuildProgramCombobox();
                processor->setCurrentProgram(programNum);
                processor->updateHostDisplay();
                
                int action = dialog.getComboBoxComponent("SaveAction")->getSelectedItemIndex();
                if ( action > 0 ) {                  
                    File destination = processor->activeFileCartridge;
                    if ( ! destination.exists() ) {
                        FileChooser fc("Destination Sysex", processor->dexedCartDir, "*.syx", 1);
                        if ( ! fc.browseForFileToSave(true) )
                            break;
                        destination = fc.getResult();
                    }
                    
                    processor->currentCart.saveVoice(destination);
                    processor->activeFileCartridge = destination;
                }
            } else {
                destSysex.packProgram((uint8_t *) processor->data, programNum, programName);
                if ( ! destSysex.saveVoice(*externalFile)) {
                    AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Write error", "Unable to write file");
                }
            }
        }
        break;
    }

    if ( externalFile != NULL )
        delete externalFile;
    cartManager.resetActiveSysex();
}