Esempio n. 1
0
void exitGame()
{
	exitMenu = 1;
	newMenu(100, 370, 30.0, 100.0, 1, exitCustomFunc);
	addMenuItem("Nao", mainMenu);
	addMenuItem("Sim", exit);
}
Esempio n. 2
0
void BtMenuView::buildMenu(QMenu *parentMenu, const QModelIndex &parentIndex) {
    Q_ASSERT(m_model != 0);
    Q_ASSERT(m_actions != 0);

    int children = m_model->rowCount(parentIndex);
    for (int i = 0; i < children; i++) {
        QModelIndex childIndex(m_model->index(i, 0, parentIndex));

        if (m_model->rowCount(childIndex) > 0) {
            QMenu *childMenu = newMenu(parentMenu, childIndex);

            if (childMenu != 0) {
                // Add the child menu and populate it:
                parentMenu->addMenu(childMenu);
                buildMenu(childMenu, childIndex);
            }
        } else {
            QAction *childAction = newAction(parentMenu, childIndex);

            if (childAction != 0) {
                // Map index
                m_indexMap.insert(childAction, childIndex);

                // Add action to action group:
                childAction->setActionGroup(m_actions);

                // Add action to menu:
                parentMenu->addAction(childAction);
            }
        }
    }
}
//========PRIVATE FUNCTIONS==========
//--menus--
void Interface::addCompOrPerson()
{
    newMenu("ADD VIEW");

    char ch = ' ';

    cout << "(1) to add a computer scientist\n"
            "(2) to add a computer\n"
            "enter anything else to go to main menu \n";
    printLines();

    cout << "Choice: ";
    cin.ignore(1, '\n');
    ch = cin.get();

    switch(ch)
    {
    case '1':
        addPerson();
        break;
    case '2':
        addComputer();
        break;
    default:
        break;
    }
}
void Interface::viewCompsOrPersons()
{
    newMenu("VIEW");

    char ch = ' ';

    cout << "(1) utility menu for computer scientists\n"
            "(2) utility menu for computers\n"
            "enter anything else to go to main menu \n";
    printLines();

    cout << "Choice: ";
    cin.ignore(1, '\n');
    ch = cin.get();

    switch(ch)
    {
    case '1':
        viewPersons();
        break;
    case '2':
        viewComputers();
        break;
    default:
        break;
    }


}
Esempio n. 5
0
//**************************************Slots
// Контекстное меню
void sTreeWidget::ContextMenu(const QPoint &point){
    QMenu* menu;
    sTreeWidgetItem *it = (sTreeWidgetItem*) this->itemAt(point);
    xmlItem xm = it->GetXmlItem();
    menu = newMenu(xm);

    menu->exec(QCursor::pos());
}
Esempio n. 6
0
void mainMenu()
{
	exitMenu = 0;
	newMenu(100, 400, 30.0, 100.0, 1, customFunction);
	addMenuItem("Comecar Simulacao", startGame);
	addMenuItem("Controles", controlsMenu);
	addMenuItem("Sobre", about);
	addMenuItem("Ajuda", helpMenu);
	addMenuItem("Sair", exitGame);
}
Esempio n. 7
0
void resoultionMenu() 
{
	newMenu(100, 400, 30.0, 100.0, 1, customFunction);
	addMenuItem("768x480", changeRes768x480);
	addMenuItem("1024x640", changeRes1024x640);
	addMenuItem("1152x720", changeRes1152x720);
	addMenuItem("1280x800", changeRes1280x800);
	addMenuItem("1440x900", changeRes1440x900);
	addMenuItem("1920x1200", changeRes1920x1200);
	addMenuItem("Tela Inteira", fullScreenMode);
	addMenuItem("Voltar", mainMenu);
}
Esempio n. 8
0
SubMenu::SubMenu(SDL_Setup* passed_SDL_Setup, int *passed_MouseX, int *passed_MouseY, int kind) //Constructor
{

    sdl_setup = passed_SDL_Setup;
    MouseX = passed_MouseX;
    MouseY = passed_MouseY;

    selectedI = 0;
    opSelected = false;
    buttonPressed = false;

    //Buttons
    newHouse = MenuOption(1,100, "images/house.png", false);
    newBarracks = MenuOption(2,250, "images/barracks.png", false);
    newVillager = MenuOption(3, 50, "images/villagerButton.png", true);
    newMilitia = MenuOption(5, 50, "images/militiaButton.png", true);
    newChampion = MenuOption(7, 150, "images/championButton.png", true);

    //Menu Options
    villagerOptions.push_back(newHouse);
    villagerOptions.push_back(newBarracks);
    TownCenterOptions.push_back(newVillager);
    barracksOptions.push_back(newMilitia);
    barracksOptions.push_back(newChampion);

    bar = new Sprite(sdl_setup->GetRenderer(), "images/optionsmenu.png", 0, 675, 1024, 100, CollisionRectangle(0,0,1024,100));

    //Sprite menus
    main = newMenu(mainOptions);
    house = newMenu(houseOptions);
    barracks = newMenu(barracksOptions);
    villager = newMenu(villagerOptions);
    townCenter = newMenu(TownCenterOptions);
    displayed = main;

    type = kind;
}
Esempio n. 9
0
File: i3.c Progetto: ifbyair/input
int main(int ac, char *av[]){
    static struct termios origt,newt;
    volatile char c;

    printf("Welcome to the menu system\n");

    if( tcgetattr(STDIN_FILENO,&origt) < 0 )
        gtfo("tcgetattr failed!\n");

    newt = origt;

    newt.c_lflag &= ~(ICANON);

    if( tcsetattr(STDIN_FILENO, TCSANOW, &newt) < 0 ){
        tcsetattr(STDIN_FILENO, TCSANOW, &origt);
        gtfo("tcsetattr failed!\n");
    }

    menu *m1 = newMenu("Ultimate control",3);
    m1->items[0] = *newItem("Item 1", &item1);
    m1->items[1] = *newItem("Item 2", &item2);
    m1->items[2] = *newItem("Item 3", &item3);

// Do some useful shit
    while(1){
        c = getchar();
        if( c == 'q' )
            break;
        switch(c){
            case 'j':
                menu_down(m1);
                break;
            case 'k':
                menu_up(m1);
                break;
            case 'e':  // execute
                menu_execute(m1);
                break;
        }
    }
// Done with useful shit
    
    tcsetattr(STDIN_FILENO, TCSANOW, &origt);
    printf("We're done, bye!\n");
}
Esempio n. 10
0
berry::SmartPointer<berry::MenuManager> QmitkExtActionBarAdvisor::CreateFileMenu()
{
  berry::MenuManager::Pointer menu(new berry::MenuManager("&File",
                                                          berry::WorkbenchActionConstants::M_FILE));

  menu->Add(berry::IContributionItem::Pointer(new berry::GroupMarker(berry::WorkbenchActionConstants::FILE_START)));
  {
    // create the New submenu, using the same id for it as the New action
    QString newText = "&New";
    QString newId = "org.blueberry.ui.newWizard";
    berry::MenuManager::Pointer newMenu(new berry::MenuManager(newText, newId));
    newMenu->SetCommandId("org.blueberry.ui.file.newQuickMenu");
    newMenu->Add(berry::IContributionItem::Pointer(new berry::Separator(newId)));
    //this.newWizardMenu = new NewWizardMenu(getWindow());
    //newMenu.add(this.newWizardMenu);
    newMenu->Add(berry::IContributionItem::Pointer(new berry::Separator(berry::WorkbenchActionConstants::MB_ADDITIONS)));
    menu->Add(newMenu);
  }

  menu->Add(this->GetAction(berry::IWorkbenchCommandConstants::FILE_OPEN),
            berry::IWorkbenchCommandConstants::FILE_OPEN);

  menu->Add(berry::IContributionItem::Pointer(new berry::GroupMarker(berry::WorkbenchActionConstants::NEW_EXT)));
  menu->Add(berry::IContributionItem::Pointer(new berry::Separator()));

  //menu.add(closeAction);
  //menu.add(closeAllAction);
  // // menu.add(closeAllSavedAction);

  menu->Add(this->GetAction(mitk::WorkbenchCommandConstants::PROJECT_CLOSE),
            mitk::WorkbenchCommandConstants::PROJECT_CLOSE);
  menu->Add(berry::IContributionItem::Pointer(new berry::GroupMarker(berry::WorkbenchActionConstants::CLOSE_EXT)));
  menu->Add(berry::IContributionItem::Pointer(new berry::Separator()));

  menu->Add(this->GetAction(berry::IWorkbenchCommandConstants::FILE_SAVE),
            berry::IWorkbenchCommandConstants::FILE_SAVE);
  menu->Add(this->GetAction(mitk::WorkbenchCommandConstants::PROJECT_SAVE),
            mitk::WorkbenchCommandConstants::PROJECT_SAVE);
  menu->Add(berry::IContributionItem::Pointer(new berry::GroupMarker(berry::WorkbenchActionConstants::SAVE_EXT)));
  menu->Add(berry::IContributionItem::Pointer(new berry::Separator()));
  menu->Add(berry::IContributionItem::Pointer(new berry::Separator(berry::WorkbenchActionConstants::MB_ADDITIONS)));

  menu->Add(berry::IContributionItem::Pointer(new berry::Separator()));

  menu->Add(berry::ContributionItemFactory::REOPEN_EDITORS->Create(window));
  menu->Add(berry::IContributionItem::Pointer(new berry::GroupMarker(berry::WorkbenchActionConstants::MRU)));
  menu->Add(berry::IContributionItem::Pointer(new berry::Separator()));

  // If we're on OS X we shouldn't show this command in the File menu. It
  // should be invisible to the user. However, we should not remove it -
  // the carbon UI code will do a search through our menu structure
  // looking for it when Cmd-Q is invoked (or Quit is chosen from the
  // application menu.
  //ActionContributionItem quitItem = new ActionContributionItem(quitAction);
  //quitItem.setVisible(!Util.isMac());
  //menu.add(quitItem);
  menu->Add(GetItem(berry::IWorkbenchCommandConstants::FILE_EXIT, "Exit"));
  menu->Add(berry::IContributionItem::Pointer(new berry::GroupMarker(berry::WorkbenchActionConstants::FILE_END)));

  return menu;
}
void Interface::viewComputers()
{
    newMenu("COMPUTER UTILITY");
    cout << "'*' to view all\n"
            "Search syntax: \"searchtype searchquery\"\n"
            "Available search types:\n"
            "'name'   -- searches for names containing query\n"
            "'year'   -- searches for year when built\n"
            "'type'   -- searches for specific types\n"
            "'id'     -- searches for for computer with specified id\n"
            "Command syntax: \"command id\"\n"
            "'edit'   -- edits a computer via id number\n"
            "'delete' -- deletes a computer via id number\n"
            "'addr'   -- pick a computer to add relations to via id\n"
            "            and then pick the related person with 'addr id'\n"
            "'viewr'  -- view relations via id number\n"
            "Search results follow current settings\n";
    printSimpleLines();
    printStatus();

    if(!second_view)
    {
        cin.ignore(1000, '\n');
    }
    else
    {
        second_view = false;
    }

    while(1)
    {

        cout << "Query(empty to exit to main menu): ";
        char ch = ' ';
        string search_string = "";

        do
        {
            ch = cin.get();
            if(ch != '\n')
            {
                search_string += ch;
            }
        }while(ch != '\n');

        if(search_string == "")
        {
           return;
        }

        if(request.isCommand(QString::fromStdString(search_string)))
        {
            doCommand(QString::fromStdString(search_string), 'c');
            return;
        }
        else
        {
            searchResultsComputers(search_string);
        }
    }
}
Esempio n. 12
0
void
main(int argc, char **argv)
{
    void *chain;
    int st;
    char check1 = 0, check2 = 1;
    char name[20];
    char password[20];
    char message[80];
    LIA foo;

    static char msg[] = "This is some text\n"
			"That can be found\n"
			"In a text object\n"
			"At the bottom of the sea\n";

    static ListItem menu[] = {
	/* menuitems need hotkeys */
	{ "A", "Choice A" },
	{ "B", "Choice B" },
	{ "C", "Choice C" },
	{ "D", "Choice D" },
	{ "E", "Choice E" },
	{ "F", "Choice F" },
	{ "G", "Choice G" },
	{ "H", "Choice H" },
    };
    #define NR_MENU	(sizeof menu / sizeof menu[0])

    static ListItem list[] = {
	{ "A", "Choice A", 0, 1 },
	{ "B", "Choice B", 0, 0 },
	{ "C", "Choice C", 0, 0 },
    } ;
    #define NR_LIST	(sizeof list / sizeof list[0])

    strcpy(name, "Fernando Poo");
    name[0] = 0xff;
    strcpy(password, "Sekret");
    strcpy(message, "A MESSAGE");

    setHelpRoot(".");

    chain = ObjChain(newOKButton(1,"OK", 0, 0),
		     newCheck(0,0,"A CHECK ITEM GOES PLONK",0,&check1,0,"demo.html"));
    chain = ObjChain(chain, newCancelButton(2,"CANCEL", 0, "demo.html"));
    chain = ObjChain(chain, newCheck(0,2,0,"Check | your hat?",&check2,0,"demo.html"));
    chain = ObjChain(chain, newString(4,3,10, sizeof name, name,
				      "Name", "Your name", 0, "demo.html"));
    chain = ObjChain(chain, newPWString(0,7,10, sizeof password, password,
				      0, "Your password", 0, "demo.html"));
    chain = ObjChain(chain, newString(0,10,10, sizeof message, message,
				      "String Title", 0, 0, "demo.html"));

    chain = ObjChain(chain, newMenu(30,0,-1,-1,
				    NR_MENU,menu,"A MENU","",
				    MENU_SELECTION, menucallback,"demo.html"));
    chain = ObjChain(chain, list_ying = newList(40,0,-1,-1,
				    NR_LIST,list,"A LIST","",
				    CHECK_SELECTED,0,"demo.html"));
    chain = ObjChain(chain, list_yang = newRadioList(54,0,-1,-1,
					 NR_LIST,list,"SAME LIST","",
					 HIGHLIGHT_SELECTED,0,"demo.html"));

    chain = ObjChain(chain, newText(40,7,20,3,strlen(msg),"Text",0,msg,0,"demo.html"));

    init_dialog();
    if (argc > 1) {
	switch (atoi(argv[1])) {
	default:
		use_helpline("[TAB] to move, [ESC] to exit");
		st = MENU(chain, 0, 0, "title",
		   "SCIENTIFIC PROGRESS\nGOES BONK", FANCY_MENU|ALIGN_RIGHT);
		if (st == MENU_ERROR)
		    perror("MENU");
		break;

	case 1:
		use_helpline("This is an error message");
		Error("Nothing in particular");
		break;

	case 2:
		use_helpline("Counting down");
		errno = 0;
		MENU(0,-1,-1 ,0, " ONE ", 0);
		usleep(400000);
		use_helpline("tick");
		MENU(0,-1,-1, 0, " TWO ", 0);
		usleep(400000);
		use_helpline("tick");
		MENU(0,-1,-1, 0, "THREE", 0);
		usleep(400000);
		break;
	case 4:
		foo = newLIA(0,0);
		addToLIA(foo, "1", "first", 0);
		addToLIA(foo, "2", "second", 0);
		addToLIA(foo, "3", "third", 0);
		addToLIA(foo, "4", "forth", 0);
		addToLIA(foo, "5", "fifth", 0);

		chain = newListWidget(0,0,18,3,foo,"title", 0,0,0,0);
		chain = ObjChain(chain, newCancelButton(0, "Done", 0, 0));

		st = MENU(chain, -1, -1, "list widget", 0, 0);
		if (st == MENU_ERROR)
		    perror("MENU");
		break;
	}
    }
    else {
	use_helpline("[TAB] or the mouse to navigate, [ESC] to exit");
	st = MENU(chain, -1, -1, "title",
		    "SCIENTIFIC PROGRESS\nGOES BONK", ALIGN_RIGHT);
	if (st == MENU_ERROR)
	    perror("MENU");
    }
    end_dialog();
    adump();
}
Esempio n. 13
0
 MenuItem * MenuItem::addMenuItem(const char *addMe, byte functionIndex){
     MenuItem * ret = addMenuItem(newMenu(addMe));
     ret->m_functionIndex = functionIndex;
 }
Esempio n. 14
0
void CorePlugin::initializePlugin(QMainWindow *pMainWindow)
{
    // Keep track of our main window

    mMainWindow = pMainWindow;

    // Create our central widget

    mCentralWidget = new CentralWidget(pMainWindow);

    // Create our different File actions

    mFileOpenAction = newAction(QIcon(":/oxygen/actions/document-open.png"),
                                QKeySequence::Open, pMainWindow);
    mFileOpenRemoteAction = newAction(QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_O),
                                      pMainWindow);

    mFileReloadAction = new QAction(pMainWindow);

    mFileDuplicateAction = newAction(QKeySequence(Qt::CTRL|Qt::Key_D),
                                     pMainWindow);

    mFileLockedAction = newAction(true, QKeySequence(Qt::CTRL|Qt::Key_L),
                                  pMainWindow);

    mFileSaveAction    = newAction(QIcon(":/oxygen/actions/document-save.png"),
                                   QKeySequence::Save, pMainWindow);
    mFileSaveAsAction  = newAction(QIcon(":/oxygen/actions/document-save-as.png"),
                                   QKeySequence::SaveAs, pMainWindow);
    mFileSaveAllAction = newAction(QIcon(":/oxygen/actions/document-save-all.png"),
                                   pMainWindow);

    // Note: for mFilePreviousAction and mFileNextAction, we would normally use
    //       QKeySequence::PreviousChild and QKeySequence::NextChild,
    //       respectively, but for Qt this means using Ctrl+Shift+BackTab and
    //       Ctrl+Tab, respectively, on Windows/Linux, and Ctrl+{ and Ctrl+},
    //       respectively, on OS X. On Windows, Ctrl+Shift+BackTab just doesn't
    //       work, on OS X those key sequences are not the most natural ones.
    //       So, instead, it would be more natural to use Ctrl+Shift+Tab and
    //       Ctr+Tab, respectively, on Windows/Linux, and Meta+Shift+Tab and
    //       Meta+Tab, respectively, on OS X. The original plan was therefore to
    //       use QKeySequence::PreviousChild and QKeySequence::NextChild, as
    //       well as our preferred key sequences, but Qt ended up 'allowing'
    //       only using one of them. So, in the end, we only use our preferred
    //       key sequences...

    mFilePreviousAction = newAction(QIcon(":/oxygen/actions/go-previous.png"),
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
                                    QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_Tab),
#elif defined(Q_OS_MAC)
                                    QKeySequence(Qt::META|Qt::SHIFT|Qt::Key_Tab),
#else
    #error Unsupported platform
#endif
                                    pMainWindow);
    mFileNextAction     = newAction(QIcon(":/oxygen/actions/go-next.png"),
#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
                                    QKeySequence(Qt::CTRL|Qt::Key_Tab),
#elif defined(Q_OS_MAC)
                                    QKeySequence(Qt::META|Qt::Key_Tab),
#else
    #error Unsupported platform
#endif
                                    pMainWindow);

    mFileCloseAction    = newAction(QIcon(":/oxygen/actions/document-close.png"),
#if defined(Q_OS_WIN)
                                    QList<QKeySequence>() << QKeySequence::Close << QKeySequence(Qt::CTRL|Qt::Key_W),
#elif defined(Q_OS_LINUX) || defined(Q_OS_MAC)
                                    QKeySequence::Close,
#else
    #error Unsupported platform
#endif
                                    pMainWindow);
    mFileCloseAllAction = new QAction(pMainWindow);

    // Create the separator before which we will insert our Reopen sub-menu

    mOpenReloadSeparator = new QAction(pMainWindow);

    mOpenReloadSeparator->setSeparator(true);

    // Create our Reopen sub-menu

    mFileReopenSubMenu = newMenu(QIcon(":/oxygen/actions/document-open-recent.png"),
                                 pMainWindow);

    mFileReopenMostRecentFileAction = newAction(QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_T),
                                                pMainWindow);
    mFileReopenSubMenuSeparator1 = new QAction(pMainWindow);
    mFileReopenSubMenuSeparator2 = new QAction(pMainWindow);
    mFileClearReopenSubMenuAction = new QAction(pMainWindow);

    mFileReopenSubMenuSeparator1->setSeparator(true);
    mFileReopenSubMenuSeparator2->setSeparator(true);

    mFileReopenSubMenu->addAction(mFileReopenMostRecentFileAction);
    mFileReopenSubMenu->addAction(mFileReopenSubMenuSeparator1);
    mFileReopenSubMenu->addAction(mFileReopenSubMenuSeparator2);
    mFileReopenSubMenu->addAction(mFileClearReopenSubMenuAction);

    // Some connections to handle our different File actions

    connect(mFileOpenAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(openFile()));
    connect(mFileOpenRemoteAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(openRemoteFile()));

    connect(mFileReloadAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(reloadFile()));

    connect(mFileDuplicateAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(duplicateFile()));

    connect(mFileLockedAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(toggleLockedFile()));

    connect(mFileSaveAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(saveFile()));
    connect(mFileSaveAsAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(saveFileAs()));
    connect(mFileSaveAllAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(saveAllFiles()));

    connect(mFilePreviousAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(previousFile()));
    connect(mFileNextAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(nextFile()));

    connect(mFileCloseAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(closeFile()));
    connect(mFileCloseAllAction, SIGNAL(triggered(bool)),
            mCentralWidget, SLOT(closeAllFiles()));

    // Some connections to update the enabled state of our various actions

    connect(mCentralWidget, SIGNAL(atLeastOneView(const bool &)),
            mFileOpenAction, SLOT(setEnabled(bool)));
    connect(mCentralWidget, SIGNAL(atLeastOneView(const bool &)),
            mFileOpenRemoteAction, SLOT(setEnabled(bool)));
    connect(mCentralWidget, SIGNAL(atLeastOneView(const bool &)),
            this, SLOT(updateFileReopenMenu(const bool &)));

    connect(mCentralWidget, SIGNAL(canSave(const bool &)),
            mFileSaveAction, SLOT(setEnabled(bool)));
    connect(mCentralWidget, SIGNAL(canSaveAs(const bool &)),
            mFileSaveAsAction, SLOT(setEnabled(bool)));
    connect(mCentralWidget, SIGNAL(canSaveAll(const bool &)),
            mFileSaveAllAction, SLOT(setEnabled(bool)));

    connect(mCentralWidget, SIGNAL(atLeastTwoFiles(const bool &)),
            mFilePreviousAction, SLOT(setEnabled(bool)));
    connect(mCentralWidget, SIGNAL(atLeastTwoFiles(const bool &)),
            mFileNextAction, SLOT(setEnabled(bool)));

    connect(mCentralWidget, SIGNAL(atLeastOneFile(const bool &)),
            mFileCloseAction, SLOT(setEnabled(bool)));
    connect(mCentralWidget, SIGNAL(atLeastOneFile(const bool &)),
            mFileCloseAllAction, SLOT(setEnabled(bool)));

    // A connection related to our Reopen sub-menu

    connect(mFileReopenMostRecentFileAction, SIGNAL(triggered(bool)),
            this, SLOT(reopenMostRecentFile()));
    connect(mFileClearReopenSubMenuAction, SIGNAL(triggered(bool)),
            this, SLOT(clearReopenSubMenu()));
}
Esempio n. 15
0
void helpMenu()
{
	newMenu(20, 20, 30.0, 100.0, 1, helpMenuCustom);
	addMenuItem("Voltar", mainMenu);
}
Esempio n. 16
0
 MenuItem * MenuItem::addMenuItem(const char *addMe){
      return addMenuItem(newMenu(addMe));
  }
Esempio n. 17
0
void about()
{
	newMenu(20, 20, 30.0, 100.0, 1, aboutCustom);
	addMenuItem("Voltar", mainMenu);
}
Esempio n. 18
0
void options()
{
	newMenu(100, 400, 30.0, 100.0, 1, customFunction);
	addMenuItem("Controles", controlsMenu);
	addMenuItem("Voltar", mainMenu);
}
Esempio n. 19
0
void controlsMenu()
{
	newMenu(20, 20, 30.0, 100.0, 1, controlsCustom);
	addMenuItem("Voltar", mainMenu);

}
void Interface::viewPersons()
{
    newMenu("PERSON UTILITY");
    cout << "'*' to view all\n"
            "Search syntax: \"searchtype searchquery\"\n"
            "Available search types:\n"
            "'name'   -- searches for names containing query\n"
            "'dob'    -- searches for dates of birth containing query (DD/MM/YYYY)\n"
            "'dod'    -- searches for dates of death containing query - also accepts 'alive'\n"
            "'id'     -- searches for for computer with specified id\n"
            "Command syntax: \"command id\"\n"
            "'edit'   -- edits a person via id number\n"
            "'delete' -- deletes a person via id number\n"
            "'addr'   -- pick a person to add relations to via id\n"
            "            and then pick the related computer with 'addr id'\n"
            "'viewr'  -- view relations via id number\n"
            "Search results follow current settings\n";
    printSimpleLines();
    printStatus();

    if(!second_view)
    {
        cin.ignore(1000, '\n');
    }
    else
    {
        second_view = false;
    }

    while(1)
    {

        cout << "Query(empty to exit to main menu): ";
        char ch = ' ';
        string search_string = "";

        do
        {
            ch = cin.get();
            if(ch != '\n')
            {
                search_string += ch;
            }
        }while(ch != '\n');

         if(search_string == "")
         {
            return;
         }

         if(request.isCommand(QString::fromStdString(search_string)))
         {
             doCommand(QString::fromStdString(search_string), 'p');
             return;
         }
         else
         {
             searchResultsPersons(search_string);
         }
    }
}
Esempio n. 21
0
void CoreEditingPlugin::initialize()
{
    // Create our Edit menu

    mEditMenu = newMenu(mMainWindow, EditGroup);

    // Create our different Edit actions, and add them to our Edit menu

    mEditUndoAction = newAction(mMainWindow, false,
                                ":/oxygen/actions/edit-undo.png",
                                QKeySequence::Undo);
    mEditRedoAction = newAction(mMainWindow, false,
                                ":/oxygen/actions/edit-redo.png",
                                QKeySequence::Redo);

    mEditCutAction    = newAction(mMainWindow, false,
                                  ":/oxygen/actions/edit-cut.png",
                                  QKeySequence::Cut);
    mEditCopyAction   = newAction(mMainWindow, false,
                                  ":/oxygen/actions/edit-copy.png",
                                  QKeySequence::Copy);
    mEditPasteAction  = newAction(mMainWindow, false,
                                  ":/oxygen/actions/edit-paste.png",
                                  QKeySequence::Paste);
    mEditDeleteAction = newAction(mMainWindow, false,
                                  ":/oxygen/actions/edit-delete.png",
                                  QKeySequence::Delete);

    mEditFindAction     = newAction(mMainWindow, false,
                                    ":/oxygen/actions/edit-find.png",
                                    QKeySequence::Find);
    mEditFindNextAction = newAction(mMainWindow, false, "",
                                    QKeySequence::FindNext);
    mEditPreviousAction = newAction(mMainWindow, false, "",
                                    QKeySequence::FindPrevious);
    mEditReplaceAction  = newAction(mMainWindow, false, "",
                                    QKeySequence::Replace);

    mEditSelectAllAction = newAction(mMainWindow, false, "",
                                     QKeySequence::SelectAll);

    mEditMenu->addAction(mEditUndoAction);
    mEditMenu->addAction(mEditRedoAction);
    mEditMenu->addSeparator();
    mEditMenu->addAction(mEditCutAction);
    mEditMenu->addAction(mEditCopyAction);
    mEditMenu->addAction(mEditPasteAction);
    mEditMenu->addAction(mEditDeleteAction);
    mEditMenu->addSeparator();
    mEditMenu->addAction(mEditFindAction);
    mEditMenu->addAction(mEditFindNextAction);
    mEditMenu->addAction(mEditPreviousAction);
    mEditMenu->addAction(mEditReplaceAction);
    mEditMenu->addSeparator();
    mEditMenu->addAction(mEditSelectAllAction);

    // Set our settings

/*---GRY--- DISABLED FOR VERSION 0.1.x...
    mGuiSettings->addMenu(GuiMenuSettings::View, mEditMenu);
*/
}