⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 splashscreen.cpp

📁 这是VCF框架的代码
💻 CPP
字号:
//SplashScreen.h#include "vcf/ApplicationKit/ApplicationKit.h"#include "SplashScreen.h"using namespace VCF;SplashScreen::SplashScreen(){	setTop( 400 );	setLeft( 300 );	m_splashImage = Application::getRunningInstance()->getResourceBundle()->getImage( "SPLASH" );	if ( NULL != m_splashImage ) {		setHeight( m_splashImage->getHeight() );		setWidth( m_splashImage->getWidth() );	}	else {		setWidth( 250 );		setHeight( 300 );	}	setVisible( true );		setFrameStyle( fstNoBorderFixed );	setFrameTopmost( true );	setColor( Color::getColor( "white" ) );	TimerComponent* tc = new TimerComponent();	addComponent( tc );	tc->setTimeoutInterval( 500 ); //set timeout interval in milliseconds	tc->TimerPulse += new GenericEventHandler<SplashScreen>( this, &SplashScreen::onTimer, "SplashScreen::onTimer" );	tc->setActivated( true );}SplashScreen::~SplashScreen(){	if ( NULL != m_splashImage ) {		delete m_splashImage;		m_splashImage = NULL;	}}void SplashScreen::onTimer( Event* e ){	static int count = 0;	count ++;	repaint();	if ( count >= 6 ) {		close();	}}void SplashScreen::paint( GraphicsContext* context ){	Window::paint( context );	Rect bounds(0,0,getWidth(), getHeight() );	context->rectangle( &bounds );	context->fillPath();	if ( NULL != m_splashImage ) {		context->drawImage( 0, 0, m_splashImage );	}	context->textAt( bounds.getWidth()/2-50, bounds.getHeight()/2.0, "Welcome to the [!output PROJECT_NAME] Application..." );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -