int mainMenu(Engine* engine)
{
	int ret = 0;
	PlaceList* pickedPlace;
	int selectNum;
	bool isPlaceChanged = false;
		
	system("cls");
	printf("\n\n** Lunch Place Picker **\n");
	printf(" [] Select Menu\n");
	printf("   1. Pick lunch place\n");
	printf("   2. Show all lunch places\n");
	printf("   3. Settings\n");
	printf("   4. Exit\n");
	printf(" [] input : ");
	scanf("	 %d",&selectNum);
	clearEnter();
	system("cls");
	switch (selectNum)
	{
	case 1:
		pickedPlace = engine->pickPlace();
		if(pickPlaceMenu(pickedPlace))
		{
			if(selectPlaceMenu())
			{
				pickedPlace->mFreq++;
				isPlaceChanged = true;
			}
		}
		break;
	case 2:
		printf("\n");
		printNode(engine->mPlaceListHead);
		break;
	case 3:
		while(1 >= (ret = settingsMenu(engine))) {}
		isPlaceChanged = true;
		break;
	case 4:
		if(isPlaceChanged)
			engine->savePlaceListToFile();
		ret = 1;
		break;
	default:
		printf("\n");
		printf(" [] Invalid number\n");
		break;
	}
	printf("\n");
	if(0 == ret)
		system("pause");
	
	return ret;
}
예제 #2
0
void LLDBPlugin::CreatePluginMenu(wxMenu* pluginsMenu)
{
    // We want to add an entry in the global settings menu
    // Menu Bar > Settings > LLDB Settings

    // Get the main frame's menubar
    wxMenuBar* mb = pluginsMenu->GetMenuBar();
    if(mb) {
        wxMenu* settingsMenu(NULL);
        int menuPos = mb->FindMenu(_("Settings"));
        if(menuPos != wxNOT_FOUND) {
            settingsMenu = mb->GetMenu(menuPos);
            if(settingsMenu) { settingsMenu->Append(XRCID("lldb_settings"), _("LLDB Settings...")); }
        }
    }
}
예제 #3
0
QMenu *Actions::channelContextMenu(QWidget *parent) const
{
    QMenu *menu = new QMenu("チャンネルコンテキストメニュー", parent);

    connect(menu, SIGNAL(aboutToShow()), this, SLOT(contextMenuAboutToShow()));
    connect(menu, SIGNAL(aboutToHide()), this, SLOT(contextMenuAboutToHide()));

    if (m_mainWindow->menuBar()->isHidden() && m_mainWindow->toolBar()->isHidden()) {
        menu->addAction(m_updateYellowPageAction);
        menu->addAction(m_toggleAutoUpdateAction);
        menu->addSeparator();
    }
    menu->addAction(m_playChannelAction);
    menu->addAction(m_openContactUrlAction);
    menu->addSeparator();
    menu->addAction(m_addToFavoritesAction);
    menu->addAction(m_unfavoriteAction);
    menu->addAction(m_addToNGAction);
    menu->addSeparator();
    menu->addAction(m_copyChannelInfoAction);
    menu->addAction(m_copyStreamUrlAction);
    menu->addAction(m_copyContactUrlAction);
    if (m_mainWindow->menuBar()->isHidden() && m_mainWindow->toolBar()->isHidden()) {
        menu->addSeparator();
        menu->addAction(m_findChannelAction);
    }
#ifndef Q_WS_MAC
    if (m_mainWindow->menuBar()->isHidden()) {
        menu->addSeparator();
        menu->addMenu(settingsMenu(menu));
        menu->addSeparator();
        menu->addAction(m_quitAction);
    }
#endif
    return menu;
}
예제 #4
0
int aboutMenu()
{
	aboutBg = sf2d_create_texture_mem_RGBA8(about_img.pixel_data, about_img.width, about_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	highlight = sf2d_create_texture_mem_RGBA8(highlight_img.pixel_data, highlight_img.width, highlight_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	
	sf2d_set_clear_color(RGBA8(0, 0, 0, 0));
	
	while (aptMainLoop())
	{
		hidScanInput();

		u32 kDown = hidKeysDown();
		
		sf2d_start_frame(GFX_TOP, GFX_LEFT);
		
		sf2d_draw_texture(aboutBg, 0, 0);
		
		sftd_draw_textf(roboto, 20, 68, RGBA8(0, 0, 0, 255), 12, "%s", lang_settingsAbout[language][0]);
		sftd_draw_textf(roboto, 20, 83, RGBA8(0, 0, 0, 255), 12, "%s", lang_settingsAbout[language][1]);
		sftd_draw_textf(roboto, 20, 116, RGBA8(0, 0, 0, 255), 12, "%s", lang_settingsAbout[language][2]);
		//sftd_draw_textf(roboto, 20, 132, RGBA8(0, 0, 0, 255), 12, "Model = NULL");
		sftd_draw_textf(roboto, 20, 168, RGBA8(0, 0, 0, 255), 12, "%s", lang_settingsAbout[language][5]);
		//sftd_draw_textf(roboto, 20, 183, RGBA8(0, 0, 0, 255), 12, "NinjaHax version: NULL");
		
		if (touch.px  >= 0 && touch.px  <= 480 && touch.py >= 58 && touch.py <= 105)
		{
			sf2d_draw_texture(highlight, 0, 56);
			sftd_draw_textf(roboto, 20, 68, RGBA8(0, 0, 0, 255), 12, "Cyanogen3DS Updates");
			sftd_draw_textf(roboto, 20, 83, RGBA8(0, 0, 0, 255), 12, "Click for, view or isntall available updates");
		}
		else if (touch.px  >= 0 && touch.px  <= 480 && touch.py >= 106 && touch.py <= 157)
		{
			sf2d_draw_texture(highlight, 0, 105);
			sftd_draw_textf(roboto, 20, 116, RGBA8(0, 0, 0, 255), 12, "Cyanogen3DS version: 0.01-20151019-UNOFFICIAL");
			sftd_draw_textf(roboto, 20, 132, RGBA8(0, 0, 0, 255), 12, "Model = NULL");
		}
		 
		digitalTime(350, 2); 
		batteryStatus(316, 2); 
		androidQuickSettings();
		cursorController();
		
		sf2d_end_frame();
		
		navbarControls(1);
		
		if (kDown & KEY_Y)
			powerMenu(); 
		
		if (kDown & KEY_L)
			lockScreen();
		
		if (kDown & KEY_B)
		{
			sf2d_free_texture(aboutBg);
			sf2d_free_texture(highlight);
			settingsMenu();
		}
		
		if ((touch.px  >= 44 && touch.px  <= 119 && touch.py >= 201 && touch.py <= 240) && (kDown & KEY_A))
		{
			sf2d_free_texture(aboutBg);
			sf2d_free_texture(highlight);
			settingsMenu();
		}
		
		else if ((touch.px  >= 120 && touch.px  <= 195 && touch.py >= 201 && touch.py <= 240) && (kDown & KEY_A))
		{
			sf2d_free_texture(aboutBg);
			sf2d_free_texture(highlight);
			home();
		}
		
		sf2d_swapbuffers();
	}
	
	sf2d_free_texture(aboutBg);
	sf2d_free_texture(highlight);

	return 0;
}
예제 #5
0
int home()
{
	sf2d_set_clear_color(RGBA8(0, 0, 0, 0));

	ic_allapps_pressed = sf2d_create_texture_mem_RGBA8(ic_allapps_pressed_img.pixel_data, ic_allapps_pressed_img.width, ic_allapps_pressed_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	
	ic_launcher_browser = sf2d_create_texture_mem_RGBA8(ic_launcher_browser_img.pixel_data, ic_launcher_browser_img.width, ic_launcher_browser_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	ic_launcher_messenger = sf2d_create_texture_mem_RGBA8(ic_launcher_messenger_img.pixel_data, ic_launcher_messenger_img.width, ic_launcher_messenger_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	ic_launcher_apollo = sf2d_create_texture_mem_RGBA8(ic_launcher_apollo_img.pixel_data, ic_launcher_apollo_img.width, ic_launcher_apollo_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	ic_launcher_settings = sf2d_create_texture_mem_RGBA8(ic_launcher_settings_img.pixel_data, ic_launcher_settings_img.width, ic_launcher_settings_img.height, TEXFMT_RGBA8, SF2D_PLACE_RAM);
	
	// Main loop
	while (aptMainLoop())
	{

		//Scan all the inputs. This should be done once for each frame
		hidScanInput();
		
		//hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
		u32 kDown = hidKeysDown();
		//hidKeysUp returns information about which buttons have been just released
		//u32 kUp = hidKeysUp();
		
		sf2d_start_frame(GFX_TOP, GFX_LEFT);
		
		sf2d_draw_texture(background, 0, 0);
		
		sf2d_draw_texture(ic_launcher_browser, 49, 145);
		sf2d_draw_texture(ic_launcher_messenger, 114, 145);
		sf2d_draw_texture(ic_launcher_apollo, 241, 145);
		sf2d_draw_texture(ic_launcher_settings, 306, 145);
		appDrawerIcon();

		dayNightWidget();
		
		navbarControls(0); //Displays navbar
		digitalTime(350, 2); //Displays digital time
		batteryStatus(316, 2); //Displays battery status
		cursorController();
		
		sf2d_end_frame();
		
		if ((touch.px  >= 170 && touch.px  <= 210 && touch.py >= 148 && touch.py <= 190) && (kDown & KEY_A))
		{
			sf2d_free_texture(ic_allapps_pressed);
			appDrawer(); //Open app drawer
		}
		
		if ((touch.px  >= 306 && touch.px  <= 351 && touch.py >= 145 && touch.py <= 190) && (kDown & KEY_A))
		{
			sf2d_free_texture(ic_allapps_pressed);
			settingsMenu(); //Open settings menu
		}
		
		if (kDown & KEY_Y)
			powerMenu(); //Open power menu
		
		if (kDown & KEY_L)
			lockScreen(); //Locks the screen

		// Flush and swap framebuffers
		sf2d_swapbuffers();
	}

	sf2d_free_texture(ic_allapps_pressed);
	
	return 0;
}
예제 #6
0
파일: tomatime.cpp 프로젝트: aancw/tomatime
Tomatime::Tomatime(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Tomatime)
{
    QCoreApplication::setOrganizationName("Tomatime");
    QCoreApplication::setOrganizationDomain("github.com");
    QCoreApplication::setApplicationName("tomatime");

    ui->setupUi(this);

    // Don't forget to define this
    timer = new QTimer(this);
    timeValue = new QTime();
    restoreAction = new QAction(this);
    quitAction = new QAction(this);
    trayIcon = new QSystemTrayIcon(this);
    trayIconMenu = new QMenu(this);

    // Init Child Dialog
    settingDialog = new Settings(this);
    aboutWidget = new About(this);

    // Initialize value from setting
    QSettings setting;

    setWorkingTime( (setting.value("time/working").isNull() == true ) ? setting.value("time/break", 25).toInt() : setting.value("time/working").toInt() );
    setBreakTime( (setting.value("time/break").isNull() == true ) ? setting.value("time/break", 5).toInt() : setting.value("time/break").toInt() );
    setLongBreakTime( (setting.value("time/longbreak").isNull() ) ? setting.value("time/longbreak", 10).toInt() : setting.value("time/longbreak").toInt() );


    connect(ui->start_button, SIGNAL(clicked()),this, SLOT(clickedStartButton()));
    connect(ui->settings_button, SIGNAL(clicked()),this, SLOT(clickedSettingsButton()));
    connect(ui->stop_button, SIGNAL(clicked()),this, SLOT(clickedStopButton()));

    connect(ui->actionSettings, SIGNAL(triggered()),this,SLOT(settingsMenu()));
    connect(ui->actionAbout, SIGNAL(triggered()),this,SLOT(aboutMenu()));

    // Listen signal from setting
    connect(settingDialog,SIGNAL(emitWorkingTimeValue(int)),this,SLOT(setWorkingTime(int)));
    connect(settingDialog,SIGNAL(emitBreakTimeValue(int)),this,SLOT(setBreakTime(int)));
    connect(settingDialog,SIGNAL(emitLongBreakTimeValue(int)),this,SLOT(setLongBreakTime(int)));
    connect(settingDialog,SIGNAL(emitSetTimer(int,int)),this,SLOT(setTimer(int,int)));

    // Recenter form
    QRect position = frameGeometry();
    position.moveCenter(QDesktopWidget().availableGeometry().center());
    move(position.topLeft());

    // Init LCD
    ui->lcdNumber->display(QTime(0,getWorkingTime(),0).toString());

    // Init working count
    workingCount = 0;

    // Init Timer mode
    // 0 = Working
    // 1 = Short Break
    // 2 = Long Break
    timerMode = 0;

    // Init System tray
    createActions();
    createTrayIcon();
    trayIcon->show();

}
예제 #7
0
int appdrawer()
{	
	int browser_x = 30;
	int browser_text_x = 52;
	int calc_x = 105;
	int calc_text_x = 127;
	int clock_x = 180;
	int clock_text_x = 202;
	int fm_x = 255;
	int fm_text_x = 277;
	int gallery_x = 330;
	int gallery_text_x = 352;
	int game_icon = 405;
	int game_text_icon = 427;
	int messenger_x = 30;
	int messenger_text_x = 52; 
	int music_x = 105;
	int music_text_x = 127;
	int settings_x = 180;
	int settings_test_x = 202;
	int umd_x = 255;
	int umd_text_x = 277;

	//loads appdrawer icons
	appdrawer_loadImages();
	
	if (!ic_launcher_clock || !backdrop)
		debugDisplay();

	oslSetFont(Roboto);
		
	while (!osl_quit)
	{
		LowMemExit();
		
		oslStartDrawing();

		controls();	
		
		oslDrawImage(background);
		
		if (eDesktopActivator == 1)
		{
			navbarButtons(1);
			battery(370,2,3);
			if ((cursor->y <= 16) || (cursor->y >= 226))
			{
				digitaltime(420,4,0,hrTime);
			}
			else if (cursor->y >= 16 && cursor->y <= 226)
			{
				digitaltime(420,-10,0,hrTime);
			}	
		}
		else if (eDesktopActivator == 0)
		{
			navbarButtons(0);
			battery(370,2,1);
			digitaltime(420,4,0,hrTime);
		}
		
		if (DARK == 0)
			oslIntraFontSetStyle(Roboto, fontSize, BLACK, 0, INTRAFONT_ALIGN_CENTER);
		else
			oslIntraFontSetStyle(Roboto, fontSize, WHITE, 0, INTRAFONT_ALIGN_CENTER);
			
		oslDrawImageXY(backdrop, 1, 15);
		oslDrawImageXY(ic_launcher_browser, browser_x, 40);
		oslDrawStringf(browser_text_x, 90, "%s", lang_appDrawer[language][0]);
		oslDrawImageXY(ic_launcher_calculator, calc_x, 40);
		oslDrawStringf(calc_text_x, 90, "%s", lang_appDrawer[language][1]);
		oslDrawImageXY(ic_launcher_clock, clock_x, 40);
		oslDrawStringf(clock_text_x, 90, "%s", lang_appDrawer[language][2]);
		oslDrawImageXY(ic_launcher_filemanager, fm_x, 40);
		oslDrawStringf(fm_text_x, 90,"%s", lang_appDrawer[language][3]);
		oslDrawImageXY(ic_launcher_gallery, gallery_x, 40);
		oslDrawStringf(gallery_text_x, 90, "%s", lang_appDrawer[language][4]);
		oslDrawImageXY(ic_launcher_game, game_icon, 40);
		oslDrawStringf(game_text_icon, 90, "%s", lang_appDrawer[language][5]);
		oslDrawImageXY(ic_launcher_messenger, messenger_x, 130);
		oslDrawStringf(messenger_text_x, 185, "%s", lang_appDrawer[language][6]);
		oslDrawImageXY(ic_launcher_apollo, music_x, 130);
		oslDrawStringf(music_text_x, 185, "%s", lang_appDrawer[language][7]);
		oslDrawImageXY(ic_launcher_settings, settings_x, 130);
		oslDrawStringf(settings_test_x, 185, "%s", lang_appDrawer[language][8]);
		oslDrawImageXY(ic_launcher_umd, umd_x, 132);
		oslDrawStringf(umd_text_x, 185, "%s", lang_appDrawer[language][9]);

		androidQuickSettings();
		volumeController();
		appHighlight(1);
		oslDrawImage(cursor);
		
		if (osl_keys->pressed.square)
		{ 
			powermenu();
		}
		
		if (osl_keys->pressed.L)
		{
			oslPlaySound(Lock, 1);  
			lockscreen();
        }
		
		if (osl_keys->pressed.circle)
		{
			appdrawer_deleteImages();
			home();
		}
		
		if (cursor->x >= 15 && cursor->x <= 75 && cursor->y >= 25 && cursor->y <= 85 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			internet();
		}
		
		if (experimentalF == 1)
		{	// WIP calculator
			if (cursor->x >= 100 && cursor->x <= 140 && cursor->y >= 25 && cursor->y <= 85 && osl_keys->pressed.cross)
			{
				oslPlaySound(KeypressStandard, 1); 
				appdrawer_deleteImages();
				calculator();
			}
		}
		
		if (cursor->x >= 160 && cursor->x <= 225 && cursor->y >= 25 && cursor->y <= 85 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			pspclock();
		}
		
		if (cursor->x >= 245 && cursor->x <= 295 && cursor->y >= 25 && cursor->y <= 85 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1);  
			appdrawer_deleteImages();
			filemanage();
		}
		
		if (cursor->x >= 320 && cursor->x <= 370 && cursor->y >= 25 && cursor->y <= 85 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			galleryApp();
		}
		
		if (cursor->x >= 390 && cursor->x <= 450 && cursor->y >= 25 && cursor->y <= 85 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			gameApp();
		}

		if (experimentalF == 1)
		{	//WIP ad-hoc messenger application
			if (cursor->x >= 15 && cursor->x <= 75 && cursor->y >= 115 && cursor->y <= 180 && osl_keys->pressed.cross)
			{
				oslPlaySound(KeypressStandard, 1); 
				appdrawer_deleteImages();
				messenger();
			}
		}
		
		if (cursor->x >= 100 && cursor->x <= 140 && cursor->y >= 115 && cursor->y <= 180 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			mp3player();
		}
		
		if (cursor->x >= 160 && cursor->x <= 225 && cursor->y >= 115 && cursor->y <= 180 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			settingsMenu();
		}
		
		if (cursor->x >= 245 && cursor->x <= 295 && cursor->y >= 115 && cursor->y <= 180 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			launchUMD("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN");
		}
		
		if (cursor->x >= 137 && cursor->x <= 200 && cursor->y >= 237 && cursor->y <= 271 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			home();
		}
		
		if (cursor->x >= 200 && cursor->x <= 276 && cursor->y >= 237 && cursor->y <= 271 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			appdrawer_deleteImages();
			home();
		}
		
		if (cursor->x >= 276 && cursor->x <= 340 && cursor->y >= 237 && cursor->y <= 271 && osl_keys->pressed.cross)
		{
			oslPlaySound(KeypressStandard, 1); 
			multitask();
		}
		
		captureScreenshot();
				
		oslEndDrawing(); 
        oslEndFrame(); 
		oslSyncFrame();	
	}
	return 0;
}