From: <man...@us...> - 2015-06-01 10:02:41
|
Revision: 5226 http://sourceforge.net/p/modplug/code/5226 Author: manxorist Date: 2015-06-01 10:02:36 +0000 (Mon, 01 Jun 2015) Log Message: ----------- [Mod] Microsoft Windows desktop user interface guidelines recommend against using any splash screen at all. Even when using a splash screen, its primary goal is to make the application feel to start up faster. Keeping the splash screen visible even after all startup and initialization has already been completed has the totally opposite effect: the user thinks the application is still doing initialization work. Avoid the arbitrary 1 second delay after startup has finished and show the splash screen only as long as we are actually doing work. In order to avoid distracting flicker introduced by showing a window for too short time, the splash screen is kept visible for at least 100ms (counted from its own startup), which should be a good compromise between fast experienced application startup and avoiding distraction caused by flashing the splash screen visible for only a few milliseconds. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-01 09:40:40 UTC (rev 5225) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-01 10:02:36 UTC (rev 5226) @@ -369,6 +369,7 @@ static void StartSplashScreen(); static void StopSplashScreen(); +static void TimeoutSplashScreen(); ///////////////////////////////////////////////////////////////////////////// @@ -1074,7 +1075,6 @@ pMainFrame->ShowWindow(m_nCmdShow); pMainFrame->UpdateWindow(); - m_dwTimeStarted = timeGetTime(); m_bInitialized = TRUE; @@ -1358,6 +1358,9 @@ static CSplashScreen *gpSplashScreen = NULL; +static DWORD gSplashScreenStartTime = 0; + + CSplashScreen::CSplashScreen(CWnd *parent) //---------------------------------------- { @@ -1443,6 +1446,7 @@ gpSplashScreen->ShowWindow(SW_SHOW); gpSplashScreen->UpdateWindow(); gpSplashScreen->BeginWaitCursor(); + gSplashScreenStartTime = GetTickCount(); } } @@ -1459,6 +1463,19 @@ } +static void TimeoutSplashScreen() +//------------------------------- +{ + if(gpSplashScreen) + { + if(GetTickCount() - gSplashScreenStartTime > 100) + { + StopSplashScreen(); + } + } +} + + ///////////////////////////////////////////////////////////////////////////// // Idle-time processing @@ -1467,18 +1484,13 @@ { BOOL b = CWinApp::OnIdle(lCount); + TimeoutSplashScreen(); + if(CMainFrame::GetMainFrame()) { CMainFrame::GetMainFrame()->IdleHandlerSounddevice(); } - if ((gpSplashScreen) && (m_bInitialized)) - { - if (timeGetTime() - m_dwTimeStarted > 1000) //Set splash screen duration here -rewbs - { - StopSplashScreen(); - } - } if (CRippleBitmap::instance) { if (CRippleBitmap::instance->Animate()) return TRUE; Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2015-06-01 09:40:40 UTC (rev 5225) +++ trunk/OpenMPT/mptrack/Mptrack.h 2015-06-01 10:02:36 UTC (rev 5226) @@ -212,7 +212,7 @@ CVstPluginManager *m_pPluginManager; SoundDevice::Manager *m_pSoundDevicesManager; BOOL m_bInitialized; - DWORD m_dwTimeStarted, m_dwLastPluginIdleCall; + DWORD m_dwLastPluginIdleCall; // Default macro configuration MIDIMacroConfig m_MidiCfg; mpt::PathString m_szExePath; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |