Exemple #1
0
    // this is the ApplicationCommandTarget method that is used to actually perform one of our commands..
    bool perform (const InvocationInfo& info)
    {
        switch (info.commandID)
        {
        case showRendering:
            showDemo (createRenderingDemo());
            currentDemoId = showRendering;
            break;

        case showFontsAndText:
            showDemo (createFontsAndTextDemo());
            currentDemoId = showFontsAndText;
            break;

        case showWidgets:
            showDemo (createWidgetsDemo());
            currentDemoId = showWidgets;
            break;

        case showThreading:
            showDemo (createThreadingDemo());
            currentDemoId = showThreading;
            break;

        case showTreeView:
            showDemo (createTreeViewDemo());
            currentDemoId = showTreeView;
            break;

        case showTable:
            showDemo (createTableDemo());
            currentDemoId = showTable;
            break;

        case showAudio:
            showDemo (createAudioDemo());
            currentDemoId = showAudio;
            break;

        case showDragAndDrop:
            showDemo (createDragAndDropDemo());
            currentDemoId = showDragAndDrop;
            break;

        case showOpenGL:
           #if JUCE_OPENGL
            setUsingOpenGLRenderer (false);
            showDemo (createOpenGLDemo());
            currentDemoId = showOpenGL;
           #endif
            break;

        case showQuicktime:
           #if JUCE_QUICKTIME && ! JUCE_LINUX
            setUsingOpenGLRenderer (false);
            showDemo (createQuickTimeDemo());
            currentDemoId = showQuicktime;
           #endif
            break;

        case showDirectShow:
           #if JUCE_DIRECTSHOW
            setUsingOpenGLRenderer (false);
            showDemo (createDirectShowDemo());
            currentDemoId = showDirectShow;
           #endif
            break;

        case showCamera:
           #if JUCE_USE_CAMERA
            setUsingOpenGLRenderer (false);
            showDemo (createCameraDemo());
            currentDemoId = showCamera;
           #endif
            break;

        case showWebBrowser:
           #if JUCE_WEB_BROWSER
            setUsingOpenGLRenderer (false);
            showDemo (createWebBrowserDemo());
            currentDemoId = showWebBrowser;
           #endif
            break;

        case showCodeEditor:
            showDemo (createCodeEditorDemo());
            currentDemoId = showCodeEditor;
            break;

        case showInterprocessComms:
            showDemo (createInterprocessCommsDemo());
            currentDemoId = showInterprocessComms;
            break;

        case setDefaultLookAndFeel:
            LookAndFeel::setDefaultLookAndFeel (nullptr);
            break;

        case setOldSchoolLookAndFeel:
            LookAndFeel::setDefaultLookAndFeel (&oldLookAndFeel);
            break;

        case useNativeTitleBar:
            mainWindow.setUsingNativeTitleBar (! mainWindow.isUsingNativeTitleBar());
            break;

       #if JUCE_MAC
        case useNativeMenus:
            if (MenuBarModel::getMacMainMenu() != 0)
            {
                MenuBarModel::setMacMainMenu (0);
                mainWindow.setMenuBar ((ContentComp*) mainWindow.getContentComponent());
            }
            else
            {
                MenuBarModel::setMacMainMenu ((ContentComp*) mainWindow.getContentComponent());
                mainWindow.setMenuBar (0);
            }

            break;
       #endif

       #if ! JUCE_LINUX
        case goToKioskMode:
            {
                Desktop& desktop = Desktop::getInstance();

                if (desktop.getKioskModeComponent() == nullptr)
                    desktop.setKioskModeComponent (getTopLevelComponent());
                else
                    desktop.setKioskModeComponent (nullptr);

                break;
            }
       #endif

        default:
            return false;
        };

        return true;
    }
Exemple #2
0
void Ventana::crearMenu() {
    Juego = menuBar()->addMenu(tr("&Juego"));
        nuevoJuego = new QAction(tr("&Empezar partida nueva"), this);
        nuevoJuego->setStatusTip(tr("Empezar partida nueva"));
        connect(nuevoJuego, SIGNAL(triggered()), this, SLOT(empezarPartida()));
        Juego->addAction(nuevoJuego);

        pausar = new QAction(tr("&Pausar partida"), this);
        pausar->setStatusTip(tr("Pausar partida"));
        connect(pausar, SIGNAL(triggered()), this, SLOT(pausarPartida()));
        Juego->addAction(pausar);

        terminar = new QAction(tr("&Finalizar Partida"), this);
        terminar->setStatusTip(tr("Finalizar Partida"));
        connect(terminar, SIGNAL(triggered()), this, SLOT(terminarPartida()));
        Juego->addAction(terminar);

        Juego->addSeparator();

        salir = new QAction(tr("&Salir"), this);
        salir->setStatusTip(tr("Salir"));
        connect(salir, SIGNAL(triggered()), this, SLOT(close()));
        Juego->addAction(salir);

    Opciones = menuBar()->addMenu(tr("&Opciones"));
        NJugadores = new QAction(tr("&Elegir número de jugadores"), this);
        NJugadores->setStatusTip(tr("Elegir número de jugadores"));
        connect(NJugadores, SIGNAL(triggered()), this, SLOT(elegirNJugadores()));
        Opciones->addAction(NJugadores);

        TamTablero = new QAction(tr("&Elegir el tamaño del tablero"), this);
        TamTablero->setStatusTip(tr("Elegir el tamaño del tablero"));
        connect(TamTablero, SIGNAL(triggered()), this, SLOT(elegirTamTablero()));
        Opciones->addAction(TamTablero);

        Velocidad = new QAction(tr("&Elegir velocidad de las motos"), this);
        Velocidad->setStatusTip(tr("Elegir velocidad de las motos"));
        connect(Velocidad, SIGNAL(triggered()), this, SLOT(setVelocidad()));
        Opciones->addAction(Velocidad);

    ModosVisualizacion = menuBar()->addMenu(tr("&Modos de Visualización"));
        Reflejos = new QAction(tr("&Activar/Desactivar reflejos"), this);
        Reflejos->setStatusTip(tr("Activar/Desactivar reflejos"));
        connect(Reflejos, SIGNAL(triggered()), this, SLOT(elegirReflejos()));
        ModosVisualizacion->addAction(Reflejos);

        Ejes = new QAction(tr("&Mostrar/Ocultar ejes"), this);
        Ejes->setStatusTip(tr("Mostrar/Ocultar ejes"));
        connect(Ejes, SIGNAL(triggered()), this, SLOT(elegirEjes()));
        ModosVisualizacion->addAction(Ejes);

        ModosVisualizacion->addSeparator();

        CamaraLibre = new QAction(tr("&Cámara Libre"), this);
        CamaraLibre->setStatusTip(tr("Cámara Libre"));
        connect(CamaraLibre, SIGNAL(triggered()), this, SLOT(setCamaraLibre()));
        ModosVisualizacion->addAction(CamaraLibre);

        ModosVisualizacion->addSeparator();

        Puntos = new QAction(tr("&Puntos"), this);
        Puntos->setStatusTip(tr("Puntos"));
        connect(Puntos, SIGNAL(triggered()), this, SLOT(modoPuntos()));
        ModosVisualizacion->addAction(Puntos);

        Lineas = new QAction(tr("&Lineas"), this);
        Lineas->setStatusTip(tr("Lineas"));
        connect(Lineas, SIGNAL(triggered()), this, SLOT(modoLineas()));
        ModosVisualizacion->addAction(Lineas);

        Solido = new QAction(tr("&Solido"), this);
        Solido->setStatusTip(tr("Solido"));
        connect(Solido, SIGNAL(triggered()), this, SLOT(modoSolido()));
        ModosVisualizacion->addAction(Solido);

        Ajedrez = new QAction(tr("&Ajedrez"), this);
        Ajedrez->setStatusTip(tr("Ajedrez"));
        connect(Ajedrez, SIGNAL(triggered()), this, SLOT(modoAjedrez()));
        ModosVisualizacion->addAction(Ajedrez);

        this->Flat = new QAction(tr("&Suavizado Flat"), this);
        this->Flat->setStatusTip(tr("Suavizado Flat"));
        connect(this->Flat, SIGNAL(triggered()), this, SLOT(modoFlat()));
        ModosVisualizacion->addAction(this->Flat);

        Smooth = new QAction(tr("&Suavizado Smooth"), this);
        Smooth->setStatusTip(tr("Suavizado Smooth"));
        connect(Smooth, SIGNAL(triggered()), this, SLOT(modoSmooth()));
        ModosVisualizacion->addAction(Smooth);

    fullScreen = menuBar()->addMenu(tr("&Pantalla"));
        pantCompleta = new QAction(tr("&Completa"), this);
        pantCompleta->setStatusTip(tr("Completa"));
        connect(pantCompleta, SIGNAL(triggered()), this, SLOT(showFullScreen()));
        fullScreen->addAction(pantCompleta);

        pantNormal = new QAction(tr("&Ventana"), this);
        pantNormal->setStatusTip(tr("Ventana"));
        connect(pantNormal, SIGNAL(triggered()), this, SLOT(showNormal()));
        fullScreen->addAction(pantNormal);

    Extra = menuBar()->addMenu(tr("&Extra"));
        Ayuda = new QAction(tr("&Ayuda"), this);
        Ayuda->setStatusTip(tr("Ayuda"));
        connect(Ayuda, SIGNAL(triggered()), this, SLOT(showAyuda()));
        Extra->addAction(Ayuda);

        Acerca = new QAction(tr("&Acerca"), this);
        Acerca->setStatusTip(tr("Acerca"));
        connect(Acerca, SIGNAL(triggered()), this, SLOT(showAcerca()));
        Extra->addAction(Acerca);

        Extra->addSeparator();

        Demo = new QAction(tr("&Demo"), this);
        Demo->setStatusTip(tr("Demo"));
        connect(Demo, SIGNAL(triggered()), this, SLOT(showDemo()));
        Extra->addAction(Demo);
}