Пример #1
0
void MainMenuBar::AddMenus()
{
  Append(CreateFileMenu(), _("&File"));
  Append(CreateEmulationMenu(), _("&Emulation"));
  Append(CreateMovieMenu(), _("&Movie"));
  Append(CreateOptionsMenu(), _("&Options"));
  Append(CreateToolsMenu(), _("&Tools"));
  Append(CreateViewMenu(), _("&View"));

  if (m_type == MenuType::Debug)
  {
    Append(CreateJITMenu(), _("&JIT"));
    Append(CreateDebugMenu(), _("&Debug"));
    Append(CreateSymbolsMenu(), _("&Symbols"));
    Append(CreateProfilerMenu(), _("&Profiler"));
  }

  Append(CreateHelpMenu(), _("&Help"));
}
Пример #2
0
void SjMainFrame::InitMainMenu()
{
	// Add the menu entries to the menu titles allocated in AllocMainMenu().

	if( m_menuBar )
	{
		// mac specific

		#ifdef __WXMAC__
		wxApp::s_macHelpMenuTitleName = _("Help");
		wxApp::s_macAboutMenuItemId = IDO_ABOUT_SILVERJUKE;
		wxApp::s_macExitMenuItemId = IDT_QUIT;
		#endif

		// file menu - do not update as there are problems with the MAC-specific items

		if( !m_menuBarComplete )
		{
			bool enableQueue = m_player.m_queue.GetCount()!=0;

			m_fileMenu->Append(IDO_SETTINGS_ADDFILES, _("Add folders and files")+wxString(wxT("..."))); // just a second menu entry with the same funktionality to make things clearer
			m_fileMenu->Append(IDT_UPDATE_INDEX);

			m_fileMenu->AppendSeparator();

			m_fileMenu->Append(IDT_OPEN_FILES);
			m_fileMenu->Append(IDT_SAVE_PLAYLIST);
			m_fileMenu->Enable(IDT_SAVE_PLAYLIST, enableQueue);

			m_fileMenu->Append(IDT_UNQUEUE_ALL);
			m_fileMenu->Enable(IDT_UNQUEUE_ALL, enableQueue);

			m_fileMenu->AppendSeparator();

			m_fileMenu->Append(IDT_SETTINGS_JUKEBOX);

			m_fileMenu->AppendSeparator();

			m_fileMenu->Append(IDT_QUIT);
		}

		// edit menu

		m_editMenu->Clear();
		m_playbackMenu->Clear(); // clear here as partly initalized with m_libraryModule->CreateMenu()

		m_libraryModule->CreateMenu(m_playbackMenu, m_editMenu, TRUE);
		m_libraryModule->UpdateMenuBar();

		m_editMenu->AppendSeparator();

		m_editMenu->Append(IDO_SELECTALL);

		m_editMenu->AppendSeparator();

		m_editMenu->Append(IDT_SEARCH_BUTTON);

		m_editMenu->Append(IDT_ADV_SEARCH);

		m_editMenu->Append(IDO_REALLYENDSEARCH, _("End search"));
		m_editMenu->Enable(IDO_REALLYENDSEARCH, HasAnySearch());

		m_editMenu->AppendSeparator();

		m_editMenu->Append(IDT_SETTINGS_JUKEBOX);

		// view menu

		m_viewMenu->Clear();

		CreateViewMenu(m_viewMenu, TRUE);

		// playback menu

		m_playbackMenu->AppendSeparator();

		CreatePlaybackMenu(m_playbackMenu, TRUE);

		// kiosk menu
		if( !m_menuBarComplete )
		{
			CreateKioskMenu(m_kioskMenu);
		}

		// extras menu
		m_extrasMenu->Clear();
		CreateExtrasMenu(m_extrasMenu);

		// help menu - do not update as there are problems with the MAC-specific items

		if( !m_menuBarComplete )
		{
			m_helpMenu->Append(IDO_ABOUT_OPEN_WWW, wxString::Format(_("%s on the web"), SJ_PROGRAM_NAME)+wxString(wxT("...")));
			m_helpMenu->Append(IDO_ONLINE_HELP, _("Online help")+wxString(wxT("...")));
			m_helpMenu->AppendSeparator();
			m_helpMenu->Append(IDO_ABOUT, wxString::Format(_("About %s"), SJ_PROGRAM_NAME)+wxString(wxT("...")));
		}

		#ifdef __WXMAC__
		if( !m_menuBarComplete )
		{
			SetMenuBar(m_menuBar);
		}
		#endif

		m_menuBarComplete = TRUE;

		m_libraryModule->UpdateMenuBar();

		UpdateMenuBarQueue();
	}
}
Пример #3
0
//--------------------------------------------------------------------
int CFKCocos2dxAppWrapper::Run()
{
	bool bRet = 0;

	// first ,load project config
	LoadProjectConfig();

	// create consle
	HWND hwndConsole = NULL;
	if (m_tagAppConfig.IsShowConsole())
	{
		AllocConsole();
		freopen("CONOUT$", "wt", stdout);
		freopen("CONOUT$", "wt", stderr);

		// disable close console
		hwndConsole = GetConsoleWindow();
		if (hwndConsole != NULL)
		{
			HMENU hMenu = GetSystemMenu(hwndConsole, FALSE);
			if (hMenu != NULL) DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND);

			ShowWindow(hwndConsole, SW_SHOW);
			BringWindowToTop(hwndConsole);
		}
	}

	// create log file
	if (m_tagAppConfig.IsWriteDebugLogToFile())
	{
		const string debugLogFilePath = m_tagAppConfig.GetDebugLogFilePath();
		m_pWriteDebugLogFile = fopen(debugLogFilePath.c_str(), "w");
		if ( m_pWriteDebugLogFile == NULL )
		{
			FKLOG("Cannot create debug log file %s", debugLogFilePath.c_str());
		}
	}

	// MainLoop
	do
	{
		m_bIsExit = TRUE;

		// create app
		m_pApp = new AppDelegate();
		if( m_pApp == NULL )
		{
			bRet = false;
			break;
		}

		// set some environments
		m_pApp->SetProjectConfig( m_tagAppConfig );
		CCFileUtils::sharedFileUtils()->addSearchPath( m_tagAppConfig.GetProjectDir().c_str() );

		// create openGL view
		CCEGLView* eglView = CCEGLView::sharedOpenGLView();
		eglView->setMenuResource(MAKEINTRESOURCE(IDC_LUAHOSTWIN32));
		eglView->setWndProc (WindowProc );
		eglView->setFrameSize( m_tagAppConfig.GetFrameSize().width, m_tagAppConfig.GetFrameSize().height );
		eglView->setFrameZoomFactor( m_tagAppConfig.GetFrameScale() );

		// set window actived
		m_hWnd = eglView->getHWnd();
		BringWindowToTop(m_hWnd);
		SetWindowTextA(m_hWnd, "FKCocos2dxAppWrapper Project");

		// center window position
		eglView->centerWindow();

		// set icon
		HICON icon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_LUAHOSTWIN32));
		SendMessage( m_hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon);
		if (hwndConsole)
		{
			SendMessage(hwndConsole, WM_SETICON, ICON_BIG, (LPARAM)icon);
		}

		// set menu
		CreateViewMenu();
		UpdateViewMenu();

		// run games 
		m_pApp->run();

		// clean up
		CocosDenshion::SimpleAudioEngine::end();

		delete m_pApp;
		m_pApp = NULL;

	}while( !m_bIsExit );

	// ready exit
	FreeConsole();
	if( m_pWriteDebugLogFile != NULL )
	{
		fclose(m_pWriteDebugLogFile);
	}

	return bRet;
}