Hopeful fix for splash screen

Originally committed to SVN as r675.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-01 23:08:26 +00:00
parent 17d2ba4f1d
commit af78223810
1 changed files with 10 additions and 5 deletions

View File

@ -56,11 +56,16 @@ SplashScreen::SplashScreen(wxWindow *parent)
#if wxUSE_DISPLAY == 1 #if wxUSE_DISPLAY == 1
// Center on current display // Center on current display
wxDisplay display(wxDisplay::GetFromPoint(parent->GetScreenPosition())); if (wxDisplay::GetCount() < 1) CentreOnParent();
wxRect dr = display.GetGeometry(); else {
wxRect window = GetScreenRect(); int point = wxDisplay::GetFromPoint(parent->GetScreenPosition());
window = window.CenterIn(dr); if (point == wxNOT_FOUND) point = 0;
Move(window.GetLeft(),window.GetTop()); wxDisplay display(point);
wxRect dr = display.GetGeometry();
wxRect window = GetScreenRect();
window = window.CenterIn(dr);
Move(window.GetLeft(),window.GetTop());
}
#else #else
// Center on window // Center on window
CentreOnParent(); CentreOnParent();