本文整理汇总了C++中MainWindow::CenterOnScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ MainWindow::CenterOnScreen方法的具体用法?C++ MainWindow::CenterOnScreen怎么用?C++ MainWindow::CenterOnScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow
的用法示例。
在下文中一共展示了MainWindow::CenterOnScreen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInit
//.........这里部分代码省略.........
wxLogError(_("Failed to initialize settings."));
return false;
}
SetAppName(_("MultiMC"));
InstallLangFiles();
localeHelper.UpdateLangList();
// Load language.
long langID = wxLANGUAGE_UNKNOWN;
if (settings->GetUseSystemLang())
langID = wxLocale::GetSystemLanguage();
else
langID = settings->GetLanguageID();
langID = localeHelper.FindClosestMatch(langID);
// If no matching language is found, use English.
if (langID == wxLANGUAGE_UNKNOWN)
{
langID = wxLANGUAGE_ENGLISH_US;
}
if (!localeHelper.SetLanguage((wxLanguage)langID))
{
localeHelper.SetLanguage(wxLANGUAGE_ENGLISH_US);
wxLogError(_("Failed to set language. Language set to English."));
}
wxString cwd = wxGetCwd();
if(cwd.Contains("!"))
{
wxLogError(_("MultiMC has been started from a path that contains '!':\n%s\nThis would break Minecraft. Please move it to a different place."), cwd.c_str());
return false;
}
wxInitAllImageHandlers();
wxSocketBase::Initialize();
wxMemoryInputStream iconInput16(multimc16, sizeof(multimc16));
wxMemoryInputStream iconInput32(multimc32, sizeof(multimc32));
wxMemoryInputStream iconInput64(multimc64, sizeof(multimc64));
wxMemoryInputStream iconInput128(multimc128, sizeof(multimc128));
wxIcon icon16,icon32,icon64,icon128;
icon16.CopyFromBitmap(wxBitmap(wxImage(iconInput16)));
icon32.CopyFromBitmap(wxBitmap(wxImage(iconInput32)));
icon64.CopyFromBitmap(wxBitmap(wxImage(iconInput64)));
icon128.CopyFromBitmap(wxBitmap(wxImage(iconInput128)));
AppIcons.AddIcon(icon16);
AppIcons.AddIcon(icon32);
AppIcons.AddIcon(icon64);
AppIcons.AddIcon(icon128);
wxFileSystem::AddHandler(new wxArchiveFSHandler);
// wxFileSystem::AddHandler(new wxMemoryFSHandler);
if (!settings->GetInstDir().DirExists())
settings->GetInstDir().Mkdir();
if (!settings->GetModsDir().DirExists())
settings->GetModsDir().Mkdir();
if (!settings->GetLwjglDir().DirExists())
settings->GetLwjglDir().Mkdir();
switch (startMode)
{
case START_NORMAL:
{
MainWindow *mainWin = new MainWindow();
mainWin->SetName(wxT("MainWindow"));
if (!wxPersistenceManager::Get().RegisterAndRestore(mainWin))
{
mainWin->CenterOnScreen();
}
SetTopWindow(mainWin);
mainWin->Show();
mainWin->OnStartup();
return true;
}
case START_LAUNCH_INSTANCE:
{
MainWindow *mainWin = new MainWindow();
mainWin->SetName(wxT("MainWindow"));
if (!wxPersistenceManager::Get().RegisterAndRestore(mainWin))
{
mainWin->CenterOnScreen();
}
SetTopWindow(mainWin);
mainWin->launchInstance = launchInstance;
mainWin->OnStartup();
mainWin->Hide();
return true;
}
case START_INSTALL_UPDATE:
InstallUpdate();
return false;
}
return false;
}