本文整理汇总了C++中ApplicationCommandInfo::setInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ ApplicationCommandInfo::setInfo方法的具体用法?C++ ApplicationCommandInfo::setInfo怎么用?C++ ApplicationCommandInfo::setInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationCommandInfo
的用法示例。
在下文中一共展示了ApplicationCommandInfo::setInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCommandInfo
void JucerDocumentEditor::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
{
ComponentLayout* const currentLayout = getCurrentLayout();
PaintRoutine* const currentPaintRoutine = getCurrentPaintRoutine();
const int cmd = ModifierKeys::commandModifier;
const int shift = ModifierKeys::shiftModifier;
if (commandID >= JucerCommandIDs::newComponentBase
&& commandID < JucerCommandIDs::newComponentBase + ObjectTypes::numComponentTypes)
{
const int index = commandID - JucerCommandIDs::newComponentBase;
result.setInfo ("New " + ObjectTypes::componentTypeHandlers [index]->getTypeName(),
"Creates a new " + ObjectTypes::componentTypeHandlers [index]->getTypeName(),
CommandCategories::editing, 0);
return;
}
if (commandID >= JucerCommandIDs::newElementBase
&& commandID < JucerCommandIDs::newElementBase + ObjectTypes::numElementTypes)
{
const int index = commandID - JucerCommandIDs::newElementBase;
result.setInfo (String ("New ") + ObjectTypes::elementTypeNames [index],
String ("Adds a new ") + ObjectTypes::elementTypeNames [index],
CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != nullptr);
return;
}
switch (commandID)
{
case JucerCommandIDs::toFront:
result.setInfo (TRANS("Bring to front"), TRANS("Brings the currently selected component to the front."), CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress ('f', cmd, 0));
break;
case JucerCommandIDs::toBack:
result.setInfo (TRANS("Send to back"), TRANS("Sends the currently selected component to the back."), CommandCategories::editing, 0);
result.setActive (isSomethingSelected());
result.defaultKeypresses.add (KeyPress ('b', cmd, 0));
break;
case JucerCommandIDs::group:
result.setInfo (TRANS("Group selected items"), TRANS("Turns the currently selected elements into a single group object."), CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != nullptr && currentPaintRoutine->getSelectedElements().getNumSelected() > 1);
result.defaultKeypresses.add (KeyPress ('k', cmd, 0));
break;
case JucerCommandIDs::ungroup:
result.setInfo (TRANS("Ungroup selected items"), TRANS("Turns the currently selected elements into a single group object."), CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != nullptr
&& currentPaintRoutine->getSelectedElements().getNumSelected() == 1
&& currentPaintRoutine->getSelectedElements().getSelectedItem (0)->getTypeName() == "Group");
result.defaultKeypresses.add (KeyPress ('k', cmd | shift, 0));
break;
case JucerCommandIDs::test:
result.setInfo (TRANS("Test component..."), TRANS("Runs the current component interactively."), CommandCategories::view, 0);
result.defaultKeypresses.add (KeyPress ('t', cmd, 0));
break;
case JucerCommandIDs::enableSnapToGrid:
result.setInfo (TRANS("Enable snap-to-grid"), TRANS("Toggles whether components' positions are aligned to a grid."), CommandCategories::view, 0);
result.setTicked (document != nullptr && document->isSnapActive (false));
result.defaultKeypresses.add (KeyPress ('g', cmd, 0));
break;
case JucerCommandIDs::showGrid:
result.setInfo (TRANS("Show snap-to-grid"), TRANS("Toggles whether the snapping grid is displayed on-screen."), CommandCategories::view, 0);
result.setTicked (document != nullptr && document->isSnapShown());
result.defaultKeypresses.add (KeyPress ('g', cmd | shift, 0));
break;
case JucerCommandIDs::editCompLayout:
result.setInfo (TRANS("Edit sub-component layout"), TRANS("Switches to the sub-component editor view."), CommandCategories::view, 0);
result.setTicked (currentLayout != nullptr);
result.defaultKeypresses.add (KeyPress ('n', cmd, 0));
break;
case JucerCommandIDs::editCompGraphics:
result.setInfo (TRANS("Edit background graphics"), TRANS("Switches to the background graphics editor view."), CommandCategories::view, 0);
result.setTicked (currentPaintRoutine != nullptr);
result.defaultKeypresses.add (KeyPress ('m', cmd, 0));
break;
case JucerCommandIDs::bringBackLostItems:
result.setInfo (TRANS("Retrieve offscreen items"), TRANS("Moves any items that are lost beyond the edges of the screen back to the centre."), CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != nullptr || currentLayout != nullptr);
result.defaultKeypresses.add (KeyPress ('m', cmd, 0));
break;
case JucerCommandIDs::zoomIn:
result.setInfo (TRANS("Zoom in"), TRANS("Zooms in on the current component."), CommandCategories::editing, 0);
result.setActive (currentPaintRoutine != nullptr || currentLayout != nullptr);
result.defaultKeypresses.add (KeyPress (']', cmd, 0));
break;
//.........这里部分代码省略.........
示例2: getCommandInfo
void ProjectContentComponent::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
{
String documentName;
if (currentDocument != nullptr)
documentName = " '" + currentDocument->getName().substring (0, 32) + "'";
#if JUCE_MAC
const ModifierKeys cmdCtrl (ModifierKeys::ctrlModifier | ModifierKeys::commandModifier);
#else
const ModifierKeys cmdCtrl (ModifierKeys::ctrlModifier | ModifierKeys::altModifier);
#endif
switch (commandID)
{
case CommandIDs::saveProject:
result.setInfo ("Save Project",
"Saves the current project",
CommandCategories::general, 0);
result.setActive (project != nullptr);
break;
case CommandIDs::closeProject:
result.setInfo ("Close Project",
"Closes the current project",
CommandCategories::general, 0);
result.setActive (project != nullptr);
break;
case CommandIDs::saveDocument:
result.setInfo ("Save" + documentName,
"Saves the current document",
CommandCategories::general, 0);
result.setActive (currentDocument != nullptr || project != nullptr);
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier, 0));
break;
case CommandIDs::saveDocumentAs:
result.setInfo ("Save As...",
"Saves the current document to a new location",
CommandCategories::general, 0);
result.setActive (currentDocument != nullptr);
result.defaultKeypresses.add (KeyPress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case CommandIDs::closeDocument:
result.setInfo ("Close" + documentName,
"Closes the current document",
CommandCategories::general, 0);
result.setActive (contentView != nullptr);
result.defaultKeypresses.add (KeyPress ('w', cmdCtrl, 0));
break;
case CommandIDs::goToPreviousDoc:
result.setInfo ("Previous Document", "Go to previous document", CommandCategories::general, 0);
result.setActive (recentDocumentList.canGoToPrevious());
result.defaultKeypresses.add (KeyPress (KeyPress::leftKey, cmdCtrl, 0));
break;
case CommandIDs::goToNextDoc:
result.setInfo ("Next Document", "Go to next document", CommandCategories::general, 0);
result.setActive (recentDocumentList.canGoToNext());
result.defaultKeypresses.add (KeyPress (KeyPress::rightKey, cmdCtrl, 0));
break;
case CommandIDs::goToCounterpart:
result.setInfo ("Open corresponding header or cpp file", "Open counterpart file", CommandCategories::general, 0);
result.setActive (canGoToCounterpart());
result.defaultKeypresses.add (KeyPress (KeyPress::upKey, cmdCtrl, 0));
break;
case CommandIDs::openInIDE:
result.setInfo ("Open in IDE...",
"Launches the project in an external IDE",
CommandCategories::general, 0);
result.setActive (ProjectExporter::canProjectBeLaunched (project));
break;
case CommandIDs::saveAndOpenInIDE:
result.setInfo ("Save Project and Open in IDE...",
"Saves the project and launches it in an external IDE",
CommandCategories::general, 0);
result.setActive (ProjectExporter::canProjectBeLaunched (project));
result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
break;
case CommandIDs::createNewExporter:
result.setInfo ("Create New Exporter...",
"Creates a new exporter for a compiler type",
CommandCategories::general, 0);
result.setActive (project != nullptr);
break;
case CommandIDs::showFilePanel:
result.setInfo ("Show File Panel",
"Shows the tree of files for this project",
CommandCategories::general, 0);
result.setActive (project != nullptr);
result.defaultKeypresses.add (KeyPress ('p', ModifierKeys::commandModifier, 0));
//.........这里部分代码省略.........
示例3: getCommandInfo
void ScumblerComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& result)
{
String category = "General";
switch (commandID)
{
#if 0
case CommandIds::kNew:
{
result.setInfo("New",
"Create a new (empty) Scumbler file", category, 0);
result.defaultKeypresses.add(KeyPress('n', ModifierKeys::commandModifier, 0));
}
break;
case CommandIds::kOpen:
{
result.setInfo("Open...",
"Open a Scumbler file",
category, 0);
result.defaultKeypresses.add (KeyPress('o', ModifierKeys::commandModifier, 0));
}
break;
case CommandIds::kSave:
{
result.setInfo("Save",
"Save the current Scumbler setup to a file",
category, 0);
result.defaultKeypresses.add(KeyPress('s', ModifierKeys::commandModifier, 0));
}
break;
case CommandIds::kSaveAs:
{
result.setInfo("Save As...",
"Save a copy of the current Scumbler setup to a file",
category, 0);
result.defaultKeypresses.add(KeyPress('s',
ModifierKeys::shiftModifier | ModifierKeys::commandModifier, 0));
}
break;
#endif
case CommandIds::kPlay:
{
if (fScumbler->IsPlaying())
{
result.setInfo("Pause", "Pause audio playback", category, 0);
}
else
{
result.setInfo("Play", "Start audio playback", category, 0);
}
result.defaultKeypresses.add(KeyPress('p', ModifierKeys::commandModifier, 0));
}
break;
case CommandIds::kAddTrack:
{
result.setInfo("Add Track", "Add a new audio track to the scumbler",
"Audio", 0);
result.defaultKeypresses.add(KeyPress('a', ModifierKeys::commandModifier, 0));
}
break;
#ifdef qUnitTests
case CommandIds::kRunUnitTests:
{
result.setInfo("Run unit tests", "Run all unit tests", "Development", 0);
result.defaultKeypresses.add(KeyPress('t', ModifierKeys::commandModifier, 0));
}
break;
#endif
}
}
示例4: getCommandInfo
void UIComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& result)
{
bool acquisitionStarted = getAudioComponent()->callbacksAreActive();
switch (commandID)
{
case openConfiguration:
result.setInfo("Open...", "Load a saved processor graph.", "General", 0);
result.addDefaultKeypress('O', ModifierKeys::commandModifier);
result.setActive(!acquisitionStarted);
break;
case saveConfiguration:
result.setInfo("Save", "Save the current processor graph.", "General", 0);
result.addDefaultKeypress('S', ModifierKeys::commandModifier);
break;
case saveConfigurationAs:
result.setInfo("Save as...", "Save the current processor graph with a new name.", "General", 0);
result.addDefaultKeypress('S', ModifierKeys::commandModifier | ModifierKeys::shiftModifier);
break;
case reloadOnStartup:
result.setInfo("Reload on startup", "Load the last used configuration on startup.", "General", 0);
result.setActive(!acquisitionStarted);
result.setTicked(mainWindow->shouldReloadOnStartup);
break;
case undo:
result.setInfo("Undo", "Undo the last action.", "General", 0);
result.addDefaultKeypress('Z', ModifierKeys::commandModifier);
result.setActive(false);
break;
case redo:
result.setInfo("Redo", "Undo the last action.", "General", 0);
result.addDefaultKeypress('Y', ModifierKeys::commandModifier);
result.setActive(false);
break;
case copySignalChain:
result.setInfo("Copy", "Copy a portion of the signal chain.", "General", 0);
result.addDefaultKeypress('C', ModifierKeys::commandModifier);
result.setActive(false);
break;
case pasteSignalChain:
result.setInfo("Paste", "Paste a portion of the signal chain.", "General", 0);
result.addDefaultKeypress('V', ModifierKeys::commandModifier);
result.setActive(false);
break;
case clearSignalChain:
result.setInfo("Clear signal chain", "Clear the current signal chain.", "General", 0);
result.addDefaultKeypress(KeyPress::backspaceKey, ModifierKeys::commandModifier);
result.setActive(!getEditorViewport()->isSignalChainEmpty() && !acquisitionStarted);
break;
case toggleProcessorList:
result.setInfo("Processor List", "Show/hide Processor List.", "General", 0);
result.addDefaultKeypress('P', ModifierKeys::shiftModifier);
result.setTicked(processorList->isOpen());
break;
case toggleSignalChain:
result.setInfo("Signal Chain", "Show/hide Signal Chain.", "General", 0);
result.addDefaultKeypress('S', ModifierKeys::shiftModifier);
result.setTicked(editorViewportButton->isOpen());
break;
case toggleFileInfo:
result.setInfo("File Info", "Show/hide File Info.", "General", 0);
result.addDefaultKeypress('F', ModifierKeys::shiftModifier);
result.setTicked(controlPanel->isOpen());
break;
case showHelp:
result.setInfo("Show help...", "Take me to the GUI wiki.", "General", 0);
result.setActive(true);
break;
case resizeWindow:
result.setInfo("Reset window bounds", "Reset window bounds", "General", 0);
break;
default:
break;
};
}
示例5: getCommandInfo
void GuiApp::getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
{
if (Commands::devicePadPress <= commandID && (Commands::devicePadPress + 13) > commandID)
{
result.setInfo (("Pad Press"), "Triggers sounds.", "Beat Thang Hardware", ApplicationCommandInfo::dontTriggerVisualFeedback);
result.addDefaultKeypress ('A', ModifierKeys::noModifiers);
}
else if (Commands::devicePadRelease <= commandID && (Commands::devicePadRelease + 13) > commandID)
result.setInfo (("Pad Release"), "Ends playing sounds.", "Beat Thang Hardware", 0);
if (result.description.isNotEmpty())
return;
if (Commands::getDeviceTrackInfo (commandID, result))
return;
switch (commandID)
{
case Commands::exportAudio:
result.setInfo ("Export Audio", "Export to an audio file", "Exporting", 0);
break;
case Commands::exportMidi:
result.setInfo ("Exort MIDI", "Export to a MIDI file", "Exporting", 0);
break;
case Commands::mediaClose:
result.setInfo ("Close Media", "Close the current media", "Application", 0);
break;
case Commands::sessionClose:
result.addDefaultKeypress ('w', ModifierKeys::commandModifier);
result.setInfo ("Close Session", "Close the current session", "Session", 0);
break;
case Commands::sessionNew:
result.addDefaultKeypress ('n', ModifierKeys::commandModifier);
result.setInfo ("New Session", "Create a new session", "Session", 0);
break;
case Commands::sessionOpen:
result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
result.setInfo ("Open Session", "Open an existing session", "Session", 0);
break;
case Commands::sessionSave:
//result.addDefaultKeypress ('s', ModifierKeys::commandModifier);
result.setInfo ("Save Session", "Save the current session", "Session", 0);
break;
case Commands::sessionSaveAs:
result.addDefaultKeypress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier);
result.setInfo ("Save Session As", "Save the current session with a new name", "Session", 0);
break;
case Commands::showPreferences:
result.addDefaultKeypress (',', ModifierKeys::commandModifier);
result.setInfo ("Show Preferences", "BTV Preferences", "Application", 0);
break;
case Commands::showAbout:
result.setInfo ("Show About", "About this program", "Application", 0);
break;
case Commands::showLegacyView:
result.setInfo ("Legacy View", "Shows the legacy Beat Thang Virtual GUI", "Interfaces", 0);
break;
case Commands::showPluginManager:
result.setInfo ("Plugin Manager", "Element Plugin Management", "Application", 0);
break;
case StandardApplicationCommandIDs::undo:
result.setInfo ("Undo", "Element Plugin Management", "Application", 0);
break;
case StandardApplicationCommandIDs::redo:
result.setInfo ("Redo", "Element Plugin Management", "Application", 0);
break;
case StandardApplicationCommandIDs::cut:
result.setInfo ("Cut", "Element Plugin Management", "Application", 0);
break;
case StandardApplicationCommandIDs::copy:
result.setInfo ("Copy", "Element Plugin Management", "Application", 0);
break;
case StandardApplicationCommandIDs::paste:
result.setInfo ("Paste", "Element Plugin Management", "Application", 0);
break;
case StandardApplicationCommandIDs::selectAll:
result.setInfo ("Select All", "Element Plugin Management", "Application", 0);
break;
case Commands::mediaSave:
result.addDefaultKeypress ('s', ModifierKeys::commandModifier);
result.setInfo ("Close Media", "Closes the currently edited object", "Session Media", 0);
break;
case Commands::transportRewind:
result.setInfo ("Rewind", "Transport Rewind", "Playback", 0);
result.addDefaultKeypress ('j', 0);
break;
case Commands::transportForward:
result.setInfo ("Forward", "Transport Fast Forward", "Playback", 0);
result.addDefaultKeypress ('l', 0);
break;
case Commands::transportPlay:
result.setInfo ("Play", "Transport Play", "Playback", 0);
result.addDefaultKeypress (KeyPress::spaceKey, 0);
break;
case Commands::transportRecord:
result.setInfo ("Record", "Transport Record", "Playback", 0);
break;
case Commands::transportSeekZero:
result.setInfo ("Seek Start", "Seek to Beginning", "Playback", 0);
//.........这里部分代码省略.........