splashscreen.cpp
来自「这是VCF框架的代码」· C++ 代码 · 共 76 行
CPP
76 行
//SplashScreen.h#include "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" ) ); m_thread = new ThreadLooper( this ); m_thread->start();}SplashScreen::~SplashScreen(){ if ( NULL != m_splashImage ) { delete m_splashImage; m_splashImage = NULL; }}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->drawString( bounds.getWidth()/2-50, bounds.getHeight()/2.0, "Welcome to the $$Root$$..." );}static int sleepCount = 0;bool SplashScreen::run(){ repaint(); m_thread->sleep( 500 ); sleepCount ++; if ( sleepCount == 6 ) { setVisible( false ); close(); delete this; return false; } return true;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?