当前位置: 首页>>代码示例>>C++>>正文


C++ ApplicationCommandInfo::setTicked方法代码示例

本文整理汇总了C++中ApplicationCommandInfo::setTicked方法的典型用法代码示例。如果您正苦于以下问题:C++ ApplicationCommandInfo::setTicked方法的具体用法?C++ ApplicationCommandInfo::setTicked怎么用?C++ ApplicationCommandInfo::setTicked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApplicationCommandInfo的用法示例。


在下文中一共展示了ApplicationCommandInfo::setTicked方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getCommandInfo

// This method is used when something needs to find out the details about one of the commands
// that this object can perform..
void MainContentComponent::getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
{
    const String generalCategory ("General");

    switch (commandID)
    {
    case newProject:
        result.setInfo ("New Project", "Shows the new project wizard dialog", generalCategory, 0);
        result.setTicked (false);
        result.addDefaultKeypress ('n', ModifierKeys::ctrlModifier);
        break;
	case quickSave:
        result.setInfo ("Quick Design Save", "Save current design", generalCategory, 0);
        result.setTicked (false);
        result.addDefaultKeypress ('s', ModifierKeys::ctrlModifier);
        break;
	case quickLoad:
        result.setInfo ("Quick Design Load", "Load design from last quick save", generalCategory, 0);
        result.setTicked (false);
        result.addDefaultKeypress ('l', ModifierKeys::ctrlModifier);
        break;
	case openProject:
        result.setInfo ("Open Project", "Load project from last quick save", generalCategory, 0);
        result.setTicked (false);
        result.addDefaultKeypress ('o', ModifierKeys::ctrlModifier);
        break;

    default:
        break;
    };
}
开发者ID:Theadd,项目名称:juced,代码行数:33,代码来源:MainComponent.cpp

示例2: getCommandInfo

//-------------------------------------------------------------------------------
// This method is used when something needs to find out the details about one of the commands
// that this object can perform..
void GuidoViewer::getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
{
	const String generalCategory ("General");
	switch (commandID)
	{
		case kOpen:
			result.setInfo ("Open", "Open a GMN file", generalCategory, 0);
			result.setTicked (false);
			result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
			break;

//		case kPrint:
//			result.setInfo ("Print", "Print the current score", generalCategory, 0);
//			result.setTicked (false);
//			result.addDefaultKeypress ('p', ModifierKeys::commandModifier);
//			break;

		case kExport:
			result.setInfo ("Export", "Export the current score", generalCategory, 0);
			result.setTicked (false);
			result.addDefaultKeypress ('e', ModifierKeys::commandModifier);
			break;

		case kReload:
			result.setInfo ("Reload", "Reload the current file", generalCategory, 0);
			result.setTicked (false);
			result.addDefaultKeypress ('r', ModifierKeys::commandModifier);
			break;

		default:
			break;
	};
}
开发者ID:EQ4,项目名称:guido-engine,代码行数:36,代码来源:GuidoViewer.cpp

示例3: getCommandInfo

//==============================================================================
void MainContentComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo &result)
{
    switch (commandID)
    {
    case MainWindow::fileOpen:
        result.setInfo("Open Image", "Open an image file to be showed", "Files", 0);
        result.addDefaultKeypress('o', ModifierKeys::ctrlModifier);
        break;
    case MainWindow::useLookAndFeelV1:
        result.setInfo("Use LookAndFeel_V1", String::empty, "LookAndFeel", 0);
        result.addDefaultKeypress('j', ModifierKeys::ctrlModifier);
        result.setTicked(isLookAndFeelSelected<LookAndFeel_V1>());
        break;
    case MainWindow::useLookAndFeelV2:
        result.setInfo("Use LookAndFeel_V2", String::empty, "LookAndFeel", 0);
        result.addDefaultKeypress('k', ModifierKeys::ctrlModifier);
        result.setTicked(isLookAndFeelSelected<LookAndFeel_V2>());
        break;
    case MainWindow::useLookAndFeelV3:
        result.setInfo("Use LookAndFeel_V3", String::empty, "LookAndFeel", 0);
        result.addDefaultKeypress('l', ModifierKeys::ctrlModifier);
        result.setTicked(isLookAndFeelSelected<LookAndFeel_V3>());
        break;
    case MainWindow::useNativeStyle:
    {
        result.setInfo("Use Native Style", String::empty, "LookAndFeel", 0);
        result.addDefaultKeypress('h', ModifierKeys::ctrlModifier);
        bool isNativeStyle = false;

        if (MainWindow *mw = MainWindow::getMainWindow())
        {
            isNativeStyle = mw->isUsingNativeTitleBar();
        }

        result.setTicked(isNativeStyle);
        break;
    }
    case MainWindow::showFileTreeView:
        result.setInfo("File Tree View", "Show File Tree View", "View", 0);
        result.addDefaultKeypress('m', ModifierKeys::ctrlModifier);
        result.setTicked(mFileTreeVisible);
        break;
    default:
        break;
    }
}
开发者ID:terracotta-ko,项目名称:JUCE_ImageViewer,代码行数:47,代码来源:MainComponent.cpp

示例4: getCommandInfo

void MainWindow::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
{
    if (commandID >= CommandIDs::newDocumentBase
         && commandID < CommandIDs::newDocumentBase + ObjectTypes::numDocumentTypes)
    {
        const int index = commandID - CommandIDs::newDocumentBase;

        result.setInfo ("New " + String (ObjectTypes::documentTypeNames [index]),
                        "Creates a new " + String (ObjectTypes::documentTypeNames[index]),
                        CommandCategories::general, 0);

        return;
    }

    const int cmd = ModifierKeys::commandModifier;

    switch (commandID)
    {
    case CommandIDs::open:
        result.setInfo ("Open...",
                        "Opens a Jucer .cpp component file for editing.",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress ('o', cmd, 0));
        break;

    case CommandIDs::showPrefs:
        result.setInfo ("Preferences...",
                        "Shows the preferences panel.",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress (',', cmd, 0));
        break;

    case CommandIDs::useTabbedWindows:
        result.setInfo ("Use tabs to show windows",
                        "Flips between a tabbed component and separate windows",
                        CommandCategories::general, 0);
        result.setTicked (multiDocHolder->getLayoutMode() == MultiDocumentPanel::MaximisedWindowsWithTabs);
        break;

    default:
        break;
    }
}
开发者ID:Frongo,项目名称:JUCE,代码行数:43,代码来源:jucer_MainWindow.cpp

示例5: 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;
	};

}
开发者ID:LabPF,项目名称:plugin-GUI,代码行数:91,代码来源:UIComponent.cpp

示例6: getCommandInfo

    // This method is used when something needs to find out the details about one of the commands
    // that this object can perform..
    void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
    {
        const String generalCategory ("General");
        const String demosCategory ("Demos");

        switch (commandID)
        {
        case showRendering:
            result.setInfo ("Graphics Rendering", "Shows the graphics demo", demosCategory, 0);
            result.setTicked (currentDemoId == showRendering);
            result.addDefaultKeypress ('1', ModifierKeys::commandModifier);
            break;

        case showFontsAndText:
            result.setInfo ("Fonts and Text", "Shows the fonts & text demo", demosCategory, 0);
            result.setTicked (currentDemoId == showFontsAndText);
            result.addDefaultKeypress ('2', ModifierKeys::commandModifier);
            break;

        case showWidgets:
            result.setInfo ("Widgets", "Shows the widgets demo", demosCategory, 0);
            result.setTicked (currentDemoId == showWidgets);
            result.addDefaultKeypress ('3', ModifierKeys::commandModifier);
            break;

        case showThreading:
            result.setInfo ("Multithreading", "Shows the threading demo", demosCategory, 0);
            result.setTicked (currentDemoId == showThreading);
            result.addDefaultKeypress ('4', ModifierKeys::commandModifier);
            break;

        case showTreeView:
            result.setInfo ("Treeviews", "Shows the treeviews demo", demosCategory, 0);
            result.setTicked (currentDemoId == showTreeView);
            result.addDefaultKeypress ('5', ModifierKeys::commandModifier);
            break;

        case showTable:
            result.setInfo ("Table Components", "Shows the table component demo", demosCategory, 0);
            result.setTicked (currentDemoId == showTable);
            result.addDefaultKeypress ('6', ModifierKeys::commandModifier);
            break;

        case showAudio:
            result.setInfo ("Audio", "Shows the audio demo", demosCategory, 0);
            result.setTicked (currentDemoId == showAudio);
            result.addDefaultKeypress ('7', ModifierKeys::commandModifier);
            break;

        case showDragAndDrop:
            result.setInfo ("Drag-and-drop", "Shows the drag & drop demo", demosCategory, 0);
            result.setTicked (currentDemoId == showDragAndDrop);
            result.addDefaultKeypress ('8', ModifierKeys::commandModifier);
            break;

        case showOpenGL:
            result.setInfo ("OpenGL", "Shows the OpenGL demo", demosCategory, 0);
            result.addDefaultKeypress ('9', ModifierKeys::commandModifier);
            result.setTicked (currentDemoId == showOpenGL);
           #if ! JUCE_OPENGL
            result.setActive (false);
           #endif
            break;

        case showQuicktime:
            result.setInfo ("Quicktime", "Shows the Quicktime demo", demosCategory, 0);
            result.addDefaultKeypress ('b', ModifierKeys::commandModifier);
            result.setTicked (currentDemoId == showQuicktime);
           #if ! (JUCE_QUICKTIME && ! JUCE_LINUX)
            result.setActive (false);
           #endif
            break;

        case showDirectShow:
            result.setInfo ("DirectShow", "Shows the DirectShow demo", demosCategory, 0);
            result.addDefaultKeypress ('b', ModifierKeys::commandModifier);
            result.setTicked (currentDemoId == showDirectShow);
           #if ! JUCE_DIRECTSHOW
            result.setActive (false);
           #endif
            break;

        case showCamera:
            result.setInfo ("Camera Capture", "Shows the camera demo", demosCategory, 0);
            result.addDefaultKeypress ('c', ModifierKeys::commandModifier);
            result.setTicked (currentDemoId == showCamera);
           #if ! JUCE_USE_CAMERA
            result.setActive (false);
           #endif
            break;

        case showWebBrowser:
            result.setInfo ("Web Browser", "Shows the web browser demo", demosCategory, 0);
            result.addDefaultKeypress ('i', ModifierKeys::commandModifier);
            result.setTicked (currentDemoId == showWebBrowser);
           #if (! JUCE_WEB_BROWSER) || JUCE_LINUX
            result.setActive (false);
           #endif
//.........这里部分代码省略.........
开发者ID:Crazybond,项目名称:JUCE,代码行数:101,代码来源:MainDemoWindow.cpp

示例7: 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;
//.........这里部分代码省略.........
开发者ID:Xaetrz,项目名称:AddSyn,代码行数:101,代码来源:jucer_JucerDocumentEditor.cpp

示例8: getCommandInfo

void SAMApplication::getCommandInfo (CommandID commandID, ApplicationCommandInfo& result)
{
    switch (commandID)
    {
    case CommandIDs::newFile:
        result.setInfo(TRANS("New"), TRANS("Create new *.mdl file."),
                       CommandCategories::general, 0);
        result.addDefaultKeypress('n', ModifierKeys::commandModifier);
        break;
    case CommandIDs::open:
        result.setInfo(TRANS("Open"), TRANS("Open *.mdl file."),
                       CommandCategories::general, 0);
        result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
        break;
    case CommandIDs::showPrefs:
        result.setInfo(TRANS("Preferences..."),
                       TRANS("Open preferences window"),
                       CommandCategories::general, 0);
    	result.addDefaultKeypress(',', ModifierKeys::commandModifier);
    	break;
    case CommandIDs::clearOutputConsole:
        result.setInfo(TRANS("Clear Output Window"),
                       TRANS("Delete text in the output window"),
                       CommandCategories::tools, 0);
        result.addDefaultKeypress('k', ModifierKeys::commandModifier | ModifierKeys::shiftModifier);
    	break;
    case CommandIDs::openDataDir:
        result.setInfo(TRANS("Open Data Directory"),
                       TRANS("Open data directory in file manager"),
                       CommandCategories::tools, 0);
        result.addDefaultKeypress('l', ModifierKeys::commandModifier);
    	break;
    case CommandIDs::showHelp:
        result.setInfo(TRANS("Online Help"),
                       TRANS("Open online help in web browser."),
                       CommandCategories::help, 0);
        break;
    case CommandIDs::showPostWindow:
        result.setInfo(TRANS("Toggle Post Window"),
                       TRANS("Show/hide post window"),
                       CommandCategories::tools, 0);
    	result.addDefaultKeypress('k', ModifierKeys::commandModifier);
    	break;
    case CommandIDs::showPropertiesWindow:
        result.setInfo(TRANS("Show Properties Window"),
                       TRANS("Show properties window"),
                       CommandCategories::windows, 0);
    	result.addDefaultKeypress('i', ModifierKeys::commandModifier);
    	break;
    case CommandIDs::propertiesWindowOnTop:
        result.setInfo(TRANS("Properties Window Always On Top"),
                       TRANS("Toggle always on top"),
                       CommandCategories::windows, 0);
        result.setTicked(StoredSettings::getInstance()->getIsPropertiesWindowAlwaysOnTop());
        break;
    case CommandIDs::showPreviousWindow:
        result.setInfo(TRANS("Previous Window"),
                       TRANS("Display previous window"),
                       CommandCategories::windows, 0);
#ifdef JUCE_MAC
        result.addDefaultKeypress(KeyPress::leftKey, ModifierKeys::commandModifier | ModifierKeys::altModifier);
#else
        result.addDefaultKeypress(KeyPress::pageUpKey, ModifierKeys::commandModifier);
#endif
        break;
    case CommandIDs::showNextWindow:
        result.setInfo(TRANS("Next Window"),
                       TRANS("Display next window"),
                       CommandCategories::windows, 0);
#ifdef JUCE_MAC
        result.addDefaultKeypress(KeyPress::rightKey, ModifierKeys::commandModifier | ModifierKeys::altModifier);
#else
        result.addDefaultKeypress(KeyPress::pageDownKey, ModifierKeys::commandModifier);
#endif
        break;
    default:
        JUCEApplication::getCommandInfo (commandID, result);
        break;
    }
}
开发者ID:ptrv,项目名称:SaM-Designer,代码行数:80,代码来源:Application.cpp

示例9: getCommandInfo


//.........这里部分代码省略.........
                        CommandCategories::general, 0);
        result.setActive (project != nullptr);
        break;

    case CommandIDs::deleteSelectedItem:
        result.setInfo ("Delete Selected File",
                        String(),
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0));
        result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0));
        result.setActive (sidebarTabs.getCurrentTabIndex() == 0);
        break;

    case CommandIDs::showTranslationTool:
        result.setInfo ("Translation File Builder",
                        "Shows the translation file helper tool",
                        CommandCategories::general, 0);
        break;

    case CommandIDs::cleanAll:
        result.setInfo ("Clean All",
                        "Cleans all intermediate files",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress ('k', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
        result.setActive (project != nullptr);
        break;

    case CommandIDs::toggleBuildEnabled:
        result.setInfo ("Enable Compilation",
                        "Enables/disables the compiler",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress ('b', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0));
        result.setActive (project != nullptr);
        result.setTicked (childProcess != nullptr);
        break;

    case CommandIDs::buildNow:
        result.setInfo ("Build Now",
                        "Recompiles any out-of-date files and updates the JIT engine",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress ('b', ModifierKeys::commandModifier, 0));
        result.setActive (childProcess != nullptr);
        break;

    case CommandIDs::toggleContinuousBuild:
        result.setInfo ("Enable Continuous Recompiling",
                        "Continuously recompiles any changes made in code editors",
                        CommandCategories::general, 0);
        result.setActive (childProcess != nullptr);
        result.setTicked (isContinuousRebuildEnabled());
        break;

    case CommandIDs::launchApp:
        result.setInfo ("Launch Application",
                        "Invokes the app's main() function",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress ('r', ModifierKeys::commandModifier, 0));
        result.setActive (childProcess != nullptr && childProcess->canLaunchApp());
        break;

    case CommandIDs::killApp:
        result.setInfo ("Stop Application",
                        "Kills the app if it's running",
                        CommandCategories::general, 0);
        result.defaultKeypresses.add (KeyPress ('.', ModifierKeys::commandModifier, 0));
        result.setActive (childProcess != nullptr && childProcess->canKillApp());
开发者ID:bacchus,项目名称:JUCE,代码行数:67,代码来源:jucer_ProjectContentComponent.cpp

示例10: getCommandInfo

// This method is used when something needs to find out the details about one of the commands
// that this object can perform..
void HostFilterComponent::getCommandInfo (const CommandID commandID, ApplicationCommandInfo& result)
{
    const int none = 0;
    const int cmd = ModifierKeys::commandModifier;
    // const int shift = ModifierKeys::shiftModifier;

    GraphComponent* graph = main->getGraph ();
    Transport* transport = getFilter()->getTransport();

    switch (commandID)
    {
    //----------------------------------------------------------------------------------------------
    case CommandIDs::pluginOpen:
        result.setInfo (T("Open Plugin..."), T("Open a plugin"), CommandCategories::file, 0);
        result.addDefaultKeypress (T('l'), cmd);
        result.setActive (true);
        break;
    case CommandIDs::pluginClose:
        {
        result.setInfo (T("Close Plugins"), T("Close selected plugins"), CommandCategories::file, 0);
        result.addDefaultKeypress (T('k'), cmd);
        // TODO - have to update this !
//        GraphComponent* track = tracks.getUnchecked (0);
//        result.setActive ((track ? (track->getSelectedPlugin () != -1) : false));
        result.setActive (false);
        break;
        }
    case CommandIDs::pluginClear:
        {
        result.setInfo (T("Clear Plugins"), T("Close all plugins"), CommandCategories::file, 0);
        result.addDefaultKeypress (T('j'), cmd);
        result.setActive ((graph ? (graph->getPluginsCount () > 2) : false));
        break;
        }
    case CommandIDs::showPluginListEditor:
        {
        result.setInfo (T("Show Plugin List"), T("Show plugin list window"), CommandCategories::file, 0);
        result.addDefaultKeypress (T('p'), cmd);
        result.setActive (true);
        break;
        }
    //----------------------------------------------------------------------------------------------
#ifndef JOST_VST_PLUGIN
    case CommandIDs::audioOptions:
        {
        result.setInfo (T("Audio & MIDI Settings..."), T("Show device manager"), CommandCategories::audio, 0);
        // result.addDefaultKeypress (KeyPress::backspaceKey, none);
        result.setActive (true);
        break;
        }
#endif
    case CommandIDs::audioPlay:
        {
        result.setInfo (T("Play"), T("Play sequencers"), CommandCategories::audio, 0);
        if (! transport->isPlaying())
            result.addDefaultKeypress (KeyPress::spaceKey, none);
        result.setActive (! transport->isPlaying());
        break;
        }
    case CommandIDs::audioPlayPause:
        {
        if (transport->isPlaying())
            result.setInfo (T("Pause"), T("Pause sequencers"), CommandCategories::audio, 0);
        else
            result.setInfo (T("Play"), T("Play sequencers"), CommandCategories::audio, 0);
         result.addDefaultKeypress (KeyPress::spaceKey, none);
        break;
        }
    case CommandIDs::audioStop:
        {
        result.setInfo (T("Stop"), T("Stop sequencers"), CommandCategories::audio, 0);
        if (transport->isPlaying())
            result.addDefaultKeypress (KeyPress::spaceKey, none);
        result.setActive (transport->isPlaying());
        break;
        }
    case CommandIDs::audioRecord:
        {
        result.setInfo (T("Record"), T("Activate recording"), CommandCategories::audio, 0);
        result.addDefaultKeypress (T('r'), cmd);
        result.setTicked (transport->isRecording());
        result.setActive (true);
        break;
        }
    case CommandIDs::audioRewind:
        {
        result.setInfo (T("Rewind"), T("Rewind sequencers"), CommandCategories::audio, 0);
        result.addDefaultKeypress (KeyPress::backspaceKey, none);
        result.setActive (transport->getPositionInFrames() != 0);
        break;
        }
    case CommandIDs::audioLoop:
        {
        result.setInfo (T("Looping"), T("Loop sequencers"), CommandCategories::audio, 0);
        result.addDefaultKeypress (T('l'), cmd);
        result.setTicked (transport->isLooping());
        result.setActive (true);
        break;
//.........这里部分代码省略.........
开发者ID:christianscheuer,项目名称:jivemodular,代码行数:101,代码来源:HostFilterComponent.cpp

示例11: getCommandInfo

void CtrlrEditor::getCommandInfo (CommandID commandID, ApplicationCommandInfo &result)
{
	const String globalCategory ("Global");
	const String panelCategory ("Panel");

	switch (commandID)
	{
		case doSaveState:
			result.setInfo ("Save CTRLR state", "Saves the CTRLR state to disk", globalCategory, 0);
			result.addDefaultKeypress ('s', ModifierKeys::commandModifier | ModifierKeys::altModifier);
			break;

		case doOpenPanel:
			result.setInfo ("Open Panel", "Open a panel from a file", globalCategory, 0);
			result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
			break;

		case doNewPanel:
			result.setInfo ("New Panel", "Create a new empty panel", globalCategory, 0);
			result.addDefaultKeypress ('n', ModifierKeys::commandModifier);
			break;

		case showGlobalSettingsDialog:
			result.setInfo ("Preferences", "Show global CTRLR preferences", globalCategory, 0);
			result.addDefaultKeypress ('p', ModifierKeys::commandModifier);
			break;

		case showMidiMonitor:
			result.setInfo ("MIDI Monitor", "A small MIDI monitor that will display received and sent data", globalCategory, 0);
			result.addDefaultKeypress ('m', ModifierKeys::commandModifier);
			break;

		case showLogViewer:
			result.setInfo ("Log viewer", "You can view diagnostic messages here, useful when debugging problems", globalCategory, 0);
			result.addDefaultKeypress ('l', ModifierKeys::commandModifier);
			break;

		case showMidiCalculator:
			result.setInfo ("MIDI Calculator", "A useful tool to translate Heximal, Binary, Decimal values", globalCategory, 0);
			result.addDefaultKeypress ('j', ModifierKeys::commandModifier);
			break;

		case showAboutDialog:
			result.setInfo ("About", "About CTRLR", globalCategory, 0);
			result.addDefaultKeypress ('a', ModifierKeys::commandModifier);
			break;

		case showKeyboardMappingDialog:
			result.setInfo ("Keyboard mapping", "Change default keyboard mappings", globalCategory, 0);
			result.addDefaultKeypress ('k', ModifierKeys::commandModifier);
			break;

		case doViewPropertyDisplayIDs:
			result.setInfo ("Property IDs/Names", "View property names or property IDs", panelCategory, 0);
			result.setTicked (isPanelActive() ? (bool)getActivePanel()->getProperty(Ids::panelPropertyDisplayIDs) : false);
			result.setActive (isPanelActive());
			break;

		case doZoomIn:
			result.setInfo ("Zoom In", "Zoom in the panel", panelCategory, 0);
			result.addDefaultKeypress ('+', ModifierKeys::commandModifier);
			result.setActive (isPanelActive());
			break;

		case doZoomOut:
			result.setInfo ("Zoom Out", "Zoom out the panel", panelCategory, 0);
			result.addDefaultKeypress ('-', ModifierKeys::commandModifier);
			result.setActive (isPanelActive());
			break;

		case doCopy:
			result.setInfo ("Copy", "Copy selected components to clipboard", panelCategory, 0);
			result.addDefaultKeypress ('c', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doCut:
			result.setInfo ("Cut", "Cut selected components to clipboard", panelCategory, 0);
			result.addDefaultKeypress ('x', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doPaste:
			result.setInfo ("Paste", "Paste components from clipboard", panelCategory, 0);
			result.addDefaultKeypress ('v', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doUndo:
			result.setInfo ("Undo", "Undo last transaction", panelCategory, 0);
			result.addDefaultKeypress ('z', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doRedo:
			result.setInfo ("Redo", "Redo last transaction", panelCategory, 0);
			result.addDefaultKeypress ('y', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

//.........这里部分代码省略.........
开发者ID:RomanKubiak,项目名称:ctrlr,代码行数:101,代码来源:CtrlrEditorApplicationCommands.cpp

示例12: getCommandInfo

    void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override
    {
        const String generalCategory ("General");
        const String demosCategory ("Demos");

        switch (commandID)
        {
            case MainAppWindow::showPreviousDemo:
                result.setInfo ("Previous Demo", "Shows the previous demo in the list", demosCategory, 0);
                result.addDefaultKeypress ('-', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::showNextDemo:
                result.setInfo ("Next Demo", "Shows the next demo in the list", demosCategory, 0);
                result.addDefaultKeypress ('=', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::welcome:
                result.setInfo ("Welcome Demo", "Shows the 'Welcome' demo", demosCategory, 0);
                result.addDefaultKeypress ('1', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsAnimation:
                result.setInfo ("Animation Demo", "Shows the 'Animation' demo", demosCategory, 0);
                result.addDefaultKeypress ('2', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsDialogBoxes:
                result.setInfo ("Dialog Boxes Demo", "Shows the 'Dialog Boxes' demo", demosCategory, 0);
                result.addDefaultKeypress ('3', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsKeyMappings:
                result.setInfo ("Key Mappings Demo", "Shows the 'Key Mappings' demo", demosCategory, 0);
                result.addDefaultKeypress ('4', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsMDI:
                result.setInfo ("Multi-Document Demo", "Shows the 'Multi-Document' demo", demosCategory, 0);
                result.addDefaultKeypress ('5', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsPropertyEditors:
                result.setInfo ("Property Editor Demo", "Shows the 'Property Editor' demo", demosCategory, 0);
                result.addDefaultKeypress ('6', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsTransforms:
                result.setInfo ("Component Transforms Demo", "Shows the 'Transforms' demo", demosCategory, 0);
                result.addDefaultKeypress ('7', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsWebBrowsers:
                result.setInfo ("Web Browser Demo", "Shows the 'Web Browser' demo", demosCategory, 0);
                result.addDefaultKeypress ('8', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::componentsWidgets:
                result.setInfo ("Widgets Demo", "Shows the 'Widgets' demo", demosCategory, 0);
                result.addDefaultKeypress ('9', ModifierKeys::commandModifier);
                break;

            case MainAppWindow::renderingEngineOne:
            case MainAppWindow::renderingEngineTwo:
            case MainAppWindow::renderingEngineThree:
            {
                MainAppWindow& mainWindow = *MainAppWindow::getMainAppWindow();
                const StringArray engines (mainWindow.getRenderingEngines());
                const int index = commandID - MainAppWindow::renderingEngineOne;

                result.setInfo ("Use " + engines[index], "Uses the " + engines[index] + " engine to render the UI", generalCategory, 0);
                result.setTicked (mainWindow.getActiveRenderingEngine() == index);

                result.addDefaultKeypress ('1' + index, ModifierKeys::noModifiers);
                break;
            }

            case MainAppWindow::useLookAndFeelV1:
                result.setInfo ("Use LookAndFeel_V1", String(), generalCategory, 0);
                result.addDefaultKeypress ('i', ModifierKeys::commandModifier);
                result.setTicked (isLookAndFeelSelected<LookAndFeel_V1>());
                break;

            case MainAppWindow::useLookAndFeelV2:
                result.setInfo ("Use LookAndFeel_V2", String(), generalCategory, 0);
                result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
                result.setTicked (isLookAndFeelSelected<LookAndFeel_V2>());
                break;

            case MainAppWindow::useLookAndFeelV3:
                result.setInfo ("Use LookAndFeel_V3", String(), generalCategory, 0);
                result.addDefaultKeypress ('p', ModifierKeys::commandModifier);
                result.setTicked (isLookAndFeelSelected<LookAndFeel_V3>());
                break;

            case MainAppWindow::toggleRepaintDebugging:
                result.setInfo ("Toggle repaint display", String(), generalCategory, 0);
                result.addDefaultKeypress ('r', ModifierKeys());
                result.setTicked (juceDemoRepaintDebuggingActive);
                break;
//.........这里部分代码省略.........
开发者ID:0x4d52,项目名称:JUCE,代码行数:101,代码来源:MainWindow.cpp


注:本文中的ApplicationCommandInfo::setTicked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。