コード例 #1
0
ファイル: GUIManager.cpp プロジェクト: zhuofanxu/FightClub
	bool GUIManager::loadWindow(const std::string &windowName)
	{
		bool flag = false;
		// 检测给定layout的文件是否加载,没有加载则加载
		if(!getWindowManager()->isWindowPresent(windowName))
		{
			// 从 .layout脚本文件读取一个UI布局设计,并将其放置到GUI资源组中。
			CEGUI::Window *editorGuiSheet = getWindowManager()->loadWindowLayout(windowName + ".layout");
			// 接下来我们告诉CEGUI显示哪份UI布局。当然我们可以随时更换显示的UI布局。
			CEGUI::System &sys = CEGUI::System::getSingleton();
			sys.setGUISheet(editorGuiSheet);
			//getSingletonPtr()->getGUISystem()->setGUISheet(editorGuiSheet);
			editorGuiSheet->setVisible(true);
			editorGuiSheet->setMousePassThroughEnabled(true);

			flag = true;
		}
		else
		{	
			assert(0);
			//// 如果已经加载则直接显示
			//CEGUI::Window *window = getWindowManager()->getWindow(windowName);
			//getSingletonPtr()->getGUISystem()->setGUISheet(window);
			//window->show();
		}

		return flag;
	}
コード例 #2
0
	void CloudAtlasControlWindow::showWindow(osgWidget::Point p)
	{
		if (!_obWM.valid() || getWindowManager() != NULL)
			return;
		setPosition(p);
		_obWM->addChild(this);
		setEventCallback(new CloudAtlasEventCallback);
	}
コード例 #3
0
ファイル: example-application.cpp プロジェクト: cjhoward/ogf
ExampleApplication::ExampleApplication(const std::string& caption, int argc, const char* argv[])
{
	std::string title = caption + " - Open Graphics Framework";
	bool fullscreen = false;
	int width = 800;
	int height = 600;
	int samples = 0;
	
	for (int i = 1; i < argc; ++i)
	{
		if (std::strcmp(argv[i], "--fullscreen") == 0 || std::strcmp(argv[i], "-f") == 0)
		{
			fullscreen = true;
			continue;
		}
		
		if (std::sscanf(argv[i], "--width=%d", &width) == 1)
			continue;
		
		if (std::sscanf(argv[i], "-w=%d", &width) == 1)
			continue;
		
		if (std::sscanf(argv[i], "--height=%d", &height) == 1)
			continue;
		
		if (std::sscanf(argv[i], "-h=%d", &height) == 1)
			continue;
		
		if (std::sscanf(argv[i], "--samples=%d", &samples) == 1)
			continue;
		
		std::sscanf(argv[i], "-s=%d", &samples);
	}
	
	WindowManager* windowManager = getWindowManager();
	windowManager->setWindowHint(WindowHint::RESIZABLE, 1);
	windowManager->setWindowHint(WindowHint::SAMPLES, samples);

	const Display* display = windowManager->getDisplay(0);
	window = windowManager->createWindow(title, width, height);
	window->setDisplayMode(display->getMode(0));
	window->setSwapInterval(1);
	
	graphicsContext = window->getGraphicsContext();
	
	resourceContext = new ResourceContext(graphicsContext);
	
	// Create renderer
	renderer = new Renderer(graphicsContext);
	
	// Setup screen recording
	screenRecorder.setGraphicsContext(graphicsContext);
		
	window->addObserver(this);
	getInputManager()->getKeyboard(0)->addObserver(this);
}
コード例 #4
0
ファイル: GUIManager.cpp プロジェクト: zhuofanxu/FightClub
	void GUIManager::hideWindow(const std::string &windowName)
	{
		getWindowManager()->getWindow(windowName)->hide();
	}
コード例 #5
0
ファイル: GUIManager.cpp プロジェクト: zhuofanxu/FightClub
	void GUIManager::destoryWindow(const std::string &windowName)
	{
		getWindowManager()->destroyWindow(windowName);
	}
コード例 #6
0
ファイル: GUIManager.cpp プロジェクト: zhuofanxu/FightClub
	CEGUI::Window* GUIManager::createWindow(const std::string &type, const std::string &name)
	{
		return getWindowManager()->createWindow(type, name);
	}
コード例 #7
0
ファイル: GUIManager.cpp プロジェクト: zhuofanxu/FightClub
	CEGUI::Window* GUIManager::getWindow(const std::string &windowName)
	{
		return getWindowManager()->getWindow(windowName);
		//return CEGUI::WindowManager::getSingletonPtr()->getWindow(windowName);
	}
コード例 #8
0
ファイル: mainwnd.cpp プロジェクト: lunohod-1/boox-opensource
/// returns true if command is processed
bool V3DocViewWin::onCommand( int command, int params )
{
    CRLog::info("V3DocViewWin::onCommand(%d [%s], %d)", command, getCommandName(command, params), params );
    switch ( command ) {
    case MCMD_QUIT:
        getWindowManager()->closeAllWindows();
        return true;
    case MCMD_MAIN_MENU:
        showMainMenu();
        return true;
    case MCMD_SETTINGS_FONTSIZE:
        showFontSizeMenu();
        return true;
#if CR_INTERNAL_PAGE_ORIENTATION==1
    case MCMD_SETTINGS_ORIENTATION:
        showOrientationMenu();
        return true;
#endif
    case MCMD_SETTINGS:
        showSettingsMenu();
        return true;
    case MCMD_RECENT_BOOK_LIST:
        showRecentBooksMenu();
        return true;
    case MCMD_OPEN_RECENT_BOOK:
        _docview->swapToCache();
        _docview->getDocument()->updateMap();
        openRecentBook( params );
        return true;
    case MCMD_SWITCH_TO_RECENT_BOOK:
        _docview->swapToCache();
        _docview->getDocument()->updateMap();
        openRecentBook( 1 );
        return true;
    case MCMD_ABOUT:
        showAboutDialog();
        return true;
    case MCMD_CITE:
        activate_cite( _wm, this);
        return true;
    case MCMD_GO_PAGE_APPLY:
        _docview->doCommand( DCMD_GO_PAGE, params-1 );
        return true;
    case MCMD_GO_PERCENT_APPLY:
        _docview->doCommand( DCMD_GO_POS, params * _docview->GetFullHeight() / 100 );
        return true;
    case MCMD_SETTINGS_APPLY:
#if CR_INTERNAL_PAGE_ORIENTATION==1
    case mm_Orientation:
#endif
    case mm_FontSize:
        applySettings();
        saveSettings( lString16() );
        _wm->getSkin()->gc();
        return true;
    case DCMD_SAVE_HISTORY:
        saveHistory( lString16() );
        saveSettings( lString16() );
        return true;
    case DCMD_SAVE_TO_CACHE:
        _docview->swapToCache();
        _docview->getDocument()->updateMap();
        return true;
    case MCMD_BOOKMARK_LIST:
        showBookmarksMenu(false);
        return true;
    case MCMD_BOOKMARK_LIST_GO_MODE:
        showBookmarksMenu(true);
        return true;
    case DCMD_ZOOM_IN:
    case DCMD_ZOOM_OUT:
        showWaitIcon();
		CRViewDialog::onCommand( command, params );
        _props->setInt( PROP_FONT_SIZE, _docview->getFontSize() );
        saveSettings( lString16() );
        return true;
    case MCMD_HELP:
        showHelpDialog();
        return true;
    case DCMD_BOOKMARK_SAVE_N:
        _docview->doCommand( DCMD_BOOKMARK_SAVE_N, params );
        if ( _props->getBoolDef( PROP_AUTOSAVE_BOOKMARKS, true ) )
            saveHistory( lString16() );
        return true;
    default:
        // do nothing
        ;
    }
    return CRViewDialog::onCommand( command, params );
}
コード例 #9
0
	bool CloudAtlasControlWindow::isHide()
	{
		return getWindowManager() == NULL;
	}
コード例 #10
0
	void CloudAtlasControlWindow::hideWindow()
	{
		if (!_obWM.valid() || getWindowManager() == NULL)
			return;
		_obWM->removeChild(this);
	}