示例#1
0
/* SplashWindow::show
 * Shows the splash window with [message]. If [progress] is true, a
 * progress bar will also be shown
 *******************************************************************/
void SplashWindow::show(string message, bool progress, wxWindow* parent)
{
	// Setup progress bar
	int rheight = height;
	if (progress)
	{
		show_progress = true;
		setProgress(0.0f);
		rheight += 10;
	}
	else
		show_progress = false;

	// Set parent
	if (!parent && theApp->isInitialised())
		SetParent(theMainWindow);
	else
		SetParent(parent);

	// Show & init window
#ifndef __WXGTK__
	SetInitialSize(wxSize(width, rheight));
#else
	SetInitialSize(wxSize(width + 6, rheight + 6));
#endif
	setMessage(message);
	Show();
	CentreOnParent();
	forceRedraw();
}
void VirtualKeyboardGUI::run() {
	if (_firstRun) {
		_firstRun = false;
		moveToDefaultPosition();
	}

	if (!g_gui.isActive()) {
		_system->showOverlay();
		_system->clearOverlay();
	}
	_overlayBackup.create(_screenW, _screenH, sizeof(OverlayColor));
	_system->grabOverlay((OverlayColor*)_overlayBackup.pixels, _overlayBackup.w);

	setupCursor();

	forceRedraw();
	_displaying = true;
	mainLoop();

	removeCursor();

	_system->copyRectToOverlay((OverlayColor*)_overlayBackup.pixels, _overlayBackup.w, 0, 0, _overlayBackup.w, _overlayBackup.h);
	if (!g_gui.isActive()) _system->hideOverlay();

	_overlayBackup.free();
	_dispSurface.free();
}
示例#3
0
/* SplashWindow::setProgress
 * Sets the progress bar level, where 0.0f is 0% and 1.0f is 100%.
 * A negative value indicates 'indefinite' progress. It is safe to
 * call this very rapidly as it will only redraw the window once
 * every 20ms no matter how often it is called
 *******************************************************************/
void SplashWindow::setProgress(float progress)
{
	this->progress = progress;

	// Refresh if last redraw was > 20ms ago
	if (timer.Time() >= 20)
		forceRedraw();
}
void GuiDecalEditorCtrl::retargetDecalDatablock( String dbFrom, String dbTo )
{
	DecalData * ptrFrom = dynamic_cast<DecalData*> ( Sim::findObject(dbFrom.c_str()) );
	DecalData * ptrTo = dynamic_cast<DecalData*> ( Sim::findObject(dbTo.c_str()) );
	
	if( !ptrFrom || !ptrTo )
		return;
	
	// Grab the mission editor undo manager.
	UndoManager *undoMan = NULL;
	if ( !Sim::findObject( "EUndoManager", undoMan ) )
	{
		Con::errorf( "GuiMeshRoadEditorCtrl::on3DMouseDown() - EUndoManager not found!" );
		return;           
	}

	// Create the UndoAction.
	DBRetargetUndoAction *action = new DBRetargetUndoAction("Retarget Decal Datablock");
	action->mEditor = this;
	action->mDBFromId = ptrFrom->getId();
	action->mDBToId = ptrTo->getId();

	Vector<DecalInstance*> mDecalQueue;
	Vector<DecalInstance *>::iterator iter;
	mDecalQueue.clear();
	const Vector<DecalSphere*> &grid = gDecalManager->getDecalDataFile()->getSphereList();
	for ( U32 i = 0; i < grid.size(); i++ )
	{
		const DecalSphere *decalSphere = grid[i];
		mDecalQueue.merge( decalSphere->mItems );
	}

	for ( iter = mDecalQueue.begin();iter != mDecalQueue.end();iter++ )
	{	
		if( !(*iter) )
			continue;

		if( (*iter)->mDataBlock->lookupName.compare( dbFrom ) == 0 )
		{
			if( (*iter)->mId != -1 )
			{
				action->retargetDecal((*iter));	
				(*iter)->mDataBlock = ptrTo;
				forceRedraw((*iter));
			}
		}
	}

	undoMan->addAction( action );
}
void SplashScreen::draw (void)
{
    // Create the splash screen overlay
    splashOverlay = Ogre::OverlayManager::getSingleton().create("OVERLAY_SPLASH");
    splashOverlay->setZOrder(500);
    splashOverlay->show();

    // Create an overlay container and add the splash screen to it.
    splashContainer = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "SplashScreen"));
    splashContainer->setMetricsMode(Ogre::GMM_PIXELS);
    splashContainer->setHorizontalAlignment(Ogre::GHA_LEFT);
    splashContainer->setVerticalAlignment(Ogre::GVA_TOP);
    splashContainer->setDimensions(640, 480);
    splashContainer->setMaterialName("CollisionDomain/ServerSplash");
    splashContainer->setPosition(0, 0);
    splashOverlay->add2D(splashContainer);
    
    // Add the loading bar text to the splash screen.
    loadingText = Ogre::OverlayManager::getSingleton().createOverlayElement("TextArea", "LoadingText");
    loadingText->setMetricsMode(Ogre::GMM_PIXELS);
    loadingText->setDimensions(500, 50);
    loadingText->setPosition(320, 290);
    loadingText->setParameter("font_name", "DejaVuSans");
    loadingText->setParameter("char_height", "12");
    loadingText->setParameter("alignment", "center");
    loadingText->setColour(Ogre::ColourValue(1, 1, 1));
    loadingText->setCaption("");
    splashContainer->addChild(loadingText);

    // Add the loading bar to the splash screen.
    loadingBar = Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "LoadingBar");
    loadingBar->setMetricsMode(Ogre::GMM_PIXELS);
    loadingBar->setDimensions(500, 20);
    loadingBar->setMaterialName("CollisionDomain/ServerLoadingBar");
    loadingBar->setPosition(70, 310);
    splashContainer->addChild(loadingBar);

    // Render the screen.
    forceRedraw();
}
示例#6
0
 void LayerManager::removeZoomImage()
 {
     zoomImage.fill(Qt::white);
     forceRedraw();
 }
示例#7
0
/* SplashWindow::setProgressMessage
 * Changes the progress bar message
 *******************************************************************/
void SplashWindow::setProgressMessage(string message)
{
	message_progress = message;
	forceRedraw();
}
示例#8
0
/* SplashWindow::setMessage
 * Changes the splash window message
 *******************************************************************/
void SplashWindow::setMessage(string message)
{
	this->message = message;
	forceRedraw();
}
void SplashScreen::updateProgressBar (int percent)
{
    loadingBar->setDimensions(percent*5, 20);
    forceRedraw();
}