本文整理汇总了C++中TextEditor::getText方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEditor::getText方法的具体用法?C++ TextEditor::getText怎么用?C++ TextEditor::getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEditor
的用法示例。
在下文中一共展示了TextEditor::getText方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: textEditorFocusLost
//------------------------------------------------------------------------------
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: textEditorTextChanged
//------------------------------------------------------------------------------
void MappingsDialog::textEditorTextChanged(TextEditor &editor)
{
BypassableInstance *proc = dynamic_cast<BypassableInstance *>(pluginNode->getProcessor());
if(proc)
oscManager->registerMIDIProcessor(editor.getText(), proc);
}
示例3: buttonClicked
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: textEditorReturnKeyPressed
void HadronLabel::textEditorReturnKeyPressed(TextEditor& editor)
{
if (use_modal_editor_) {
setText(editor.getText(), true);
editor.exitModalState(0);
}
else {
Label::textEditorReturnKeyPressed(editor);
}
}
示例5: textEditorReturnKeyPressed
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: updateFromTextEditorContents
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: textEditorReturnKeyPressed
void SettingsPanel::textEditorReturnKeyPressed (TextEditor &editor)
{
String newPrefix = editor.getText();
pluginUI->setGlobalSetting(GlobalSettings::sOSCPrefix, &newPrefix);
DBG(newPrefix);
}
示例8: updateCreateButton
void updateCreateButton()
{
createButton.setEnabled (projectName.getText().trim().isNotEmpty());
}
示例9: storeProgram
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();
//.........这里部分代码省略.........