本文整理汇总了C++中SetAppName函数的典型用法代码示例。如果您正苦于以下问题:C++ SetAppName函数的具体用法?C++ SetAppName怎么用?C++ SetAppName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetAppName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAppName
bool App::OnInit() {
SetAppName(u8"flutterrust");
SetAppDisplayName(u8"flutterrust");
const wxFileName exeFileName{wxStandardPaths::Get().GetExecutablePath()};
const std::string exePath = exeFileName.GetPath().ToStdString();
try {
Creature::loadTypes(exePath + static_cast<char>(wxFileName::GetPathSeparator()) +
u8"CreatureTable.txt");
mainFrame = new MainFrame{exePath};
} catch (const std::exception& e) {
wxMessageDialog dialog{nullptr, u8"Exception caught. Terminating.\n",
u8"Fatal error", wxICON_ERROR | wxOK};
dialog.SetExtendedMessage(std::string{typeid(e).name()} + ": \"" + e.what() + '"');
dialog.ShowModal();
return false; // Exit the application immediately.
} catch (...) {
wxMessageDialog(nullptr, u8"Unknown exception caught. Terminating.",
u8"Fatal error", wxICON_ERROR | wxOK)
.ShowModal();
return false;
}
mainFrame->Show(true);
SetTopWindow(mainFrame);
return true; // Continue processing.
}
示例2: SetAppName
bool KMPackageBuilderApp::OnInit()
{
SetAppName(wxT("KaraokeMachine Package Builder"));
// create default config file
wxConfigBase::Get(true);
wxImage::AddHandler(new wxJPEGHandler);
//// Create a document manager
docManager_ = new wxDocManager;
docManager_->FileHistoryLoad(*wxConfigBase::Get());
//// Template: Song
(void) new wxDocTemplate((wxDocManager *) docManager_, wxT("Song Packages"), wxT("*.kms"), wxT(""), wxT("kms"),wxT("Songs Doc"), wxT("Songs View"),
CLASSINFO(PBSongDocument), CLASSINFO(PBSongView));
//// Template: Image
(void) new wxDocTemplate(docManager_, wxT("Image Packages"), wxT("*.kmi"), wxT(""), wxT("kmi"), wxT("Images Doc"), wxT("Images View"),
CLASSINFO(PBImageDocument), CLASSINFO(PBImageView));
KMPackageBuilderFrame* frame = new KMPackageBuilderFrame((wxDocManager *) docManager_, (wxFrame *) NULL,
wxT("KaraokeMachine Package Builder"), wxPoint(0, 0), wxSize(500, 400),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
#ifdef __WXMSW__
frame->SetIcon(wxICON(aaaa)); // To Set App Icon
#endif
frame->Show(true);
SetTopWindow(frame);
return true;
}
示例3: wxSetEnv
bool Springsettings::OnInit()
{
wxSetEnv( _T("UBUNTU_MENUPROXY"), _T("0") );
//this triggers the Cli Parser amongst other stuff
if (!wxApp::OnInit())
return false;
SetAppName(_T("SpringSettings"));
const wxString configdir = TowxString(SlPaths::GetConfigfileDir());
if ( !wxDirExists(configdir) )
wxMkdir(configdir);
if (!m_crash_handle_disable) {
#if wxUSE_ON_FATAL_EXCEPTION
wxHandleFatalExceptions( true );
#endif
#if defined(__WXMSW__) && defined(ENABLE_DEBUG_REPORT)
//this undocumented function acts as a workaround for the dysfunctional
// wxUSE_ON_FATAL_EXCEPTION on msw when mingw is used (or any other non SEH-capable compiler )
SetUnhandledExceptionFilter(filter);
#endif
}
//initialize all loggers
//TODO non-constant parameters
wxLogChain* logchain = 0;
wxLogWindow* loggerwin = InitializeLoggingTargets( 0, m_log_console, m_log_file_path, m_log_window_show, m_log_verbosity, logchain );
//this needs to called _before_ mainwindow instance is created
#ifdef __WXMSW__
wxString path = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) + wxFileName::GetPathSeparator() + _T("locale");
#else
#if defined(LOCALE_INSTALL_DIR)
wxString path ( _T(LOCALE_INSTALL_DIR) );
#else
// use a dummy name here, we're only interested in the base path
wxString path = wxStandardPaths::Get().GetLocalizedResourcesDir(_T("noneWH"),wxStandardPaths::ResourceCat_Messages);
path = path.Left( path.First(_T("noneWH") ) );
#endif
#endif
m_translationhelper = new wxTranslationHelper( GetAppName().Lower(), path );
SetSettingsStandAlone( true );
// configure unitsync paths before trying to load
SlPaths::ReconfigureUnitsync();
//unitsync first load, NEEDS to be blocking
LSL::usync().ReloadUnitSyncLib();
settings_frame* frame = new settings_frame(NULL,GetAppName());
SetTopWindow(frame);
frame->Show();
if ( loggerwin ) { // we got a logwindow, lets set proper parent win
loggerwin->GetFrame()->SetParent( frame );
}
return true;
}
示例4: SetAppName
bool App::OnInit()
{
SetAppName(u8"TrackHack");
SetAppDisplayName(u8"TrackHack");
wxFileName localFileName = wxFileConfig::GetLocalFile("track_hack.ini",
wxCONFIG_USE_SUBDIR);
if (!localFileName.FileExists() && // Does the user-specific configuration file exist?
!localFileName.DirExists()) // If not, does the directory where it would have
// been not exist either?
{
// Create that directory.
bool success = wxFileName::Mkdir(localFileName.GetPath(), wxS_DIR_DEFAULT,
wxPATH_MKDIR_FULL);
if (!success) { // Assert success in creating it; otherwise terminate.
::wxLogFatalError("Failed to create local configuration directory: "
"%s\n\nTerminating.", localFileName.GetPath());
}
}
wxConfigBase::Set(new wxFileConfig{u8"TrackHack", wxEmptyString, u8"track_hack.ini",
u8"track_hack.ini", wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE |
wxCONFIG_USE_SUBDIR});
// No wxInitAllImageHandlers() as for now, only the BMP/DIB file format is supported.
mainFrame = new MainFrame(wxDefaultPosition, wxSize(640, 720));
mainFrame->Show(true);
SetTopWindow(mainFrame);
return true;
}
示例5: srand
/** OnInit
*
* Initializes the program
*/
bool BBBApp::OnInit()
{
srand(time(NULL));
logger.reset(new LoggerWx());
if (!wxApp::OnInit())
return false;
#ifndef __WIN32
wxHandleFatalExceptions();
#endif
wxInitAllImageHandlers();
SetVendorName("Bottomless Block Builder");
SetAppName("Bottomless Block Builder");
wxBitmap bitmap(panels_gfx_xpm);
panelImages.push_back(bitmap.GetSubBitmap(wxRect(112, 16, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(0, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(16, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(32, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(48, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(64, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(80, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(96, 0, 16, 16)));
panelImages.push_back(bitmap.GetSubBitmap(wxRect(112, 0, 16, 16)));
BBBFrame* frame = new BBBFrame();
frame->Show();
return true;
}
示例6: implementation
/*------------------------------------------------------
FLEXplorer implementation (The Application class)
--------------------------------------------------------*/
bool FLEXplorer::OnInit()
{
wxLocale::AddCatalogLookupPathPrefix(".");
wxLocale::AddCatalogLookupPathPrefix("./locale");
m_locale.Init();
m_locale.AddCatalog("flexemu");
ReadDefaultOptions();
SetAppName(_("FLEXplorer"));
#ifdef wxUSE_DRAG_AND_DROP
wxTheClipboard->UsePrimarySelection();
#endif
int width = 820;
// Create the main frame window
FlexParentFrame *frame =
new FlexParentFrame((wxFrame *)nullptr, -1, GetAppName(),
wxPoint(-1, -1), wxSize(width, 700),
wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
frame->Show(true);
SetTopWindow(frame);
for (int i = 1; i < argc; ++i)
{
if (!frame->OpenContainer(argv[i].ToUTF8()))
{
break;
}
}
return true;
}
示例7: SetVendorName
bool App::OnInit()
{
bool ok = wxApp::OnInit();
if (ok)
{
wxLocaleHelper::Init(&m_locale, STE_APPNAME, m_cmdLine.m_lang);
::wxInitAllImageHandlers();
// Fill in the application information fields before creating wxConfig.
SetVendorName(wxT("wxWidgets"));
SetAppName(APP_NAME_SHORT);
#if (wxVERSION_NUMBER >= 2900)
SetAppDisplayName(APP_NAME_DISPLAY);
#endif
// Create a document manager
wxDocManager* docManager = CreateDocManager();
// create the main frame window
MainFrame* frame = new MainFrame();
ok = frame->Create(docManager, GetAppDisplayName());
if (ok)
{
frame->Show();
OpenDocuments(docManager);
}
else
{
delete frame;
}
}
return ok;
}
示例8: SetAppName
bool retcon::OnInit() {
raii_set rs;
//wxApp::OnInit(); //don't call this, it just calls the default command line processor
SetAppName(appname);
InitWxLogger();
rs.add([&]() { DeInitWxLogger(); });
::wxInitAllImageHandlers();
srand((unsigned int) time(nullptr));
datadir = stdstrwx(wxStandardPaths::Get().GetUserDataDir());
cmdlineproc(argv, argc);
if(terms_requested) return false;
if(!globallogwindow) new log_window(nullptr, LOGT::GROUP_LOGWINDEF, false);
if(!datadir.empty() && datadir.back() == '/') datadir.pop_back();
wxString wxdatadir = wxstrstd(datadir);
if(!::wxDirExists(wxdatadir)) {
::wxMkdir(wxdatadir, 0700);
}
InitCFGDefaults();
SetTermSigHandler();
sm.InitMultiIOHandler();
rs.add([&]() { sm.DeInitMultiIOHandler(); });
bool res = DBC_Init(datadir + "/retcondb.sqlite3");
if(!res) return false;
rs.add([&]() { DBC_DeInit(); });
if(terms_requested) return false;
pool.reset(new ThreadPool::Pool(gc.threadpoollimit));
InitGlobalFilters();
RestoreWindowLayout();
if(mainframelist.empty()) {
mainframe *mf = new mainframe( appversionname, wxPoint(50, 50), wxSize(450, 340));
if(alist.empty() && ad.tpanels.empty()) {
//everything is empty, maybe new user
//make 3 basic auto tpanels to make things more obvious
auto flags = TPF::AUTO_ALLACCS | TPF::DELETEONWINCLOSE;
auto tpt = tpanel::MkTPanel("", "", flags | TPF::AUTO_TW, 0);
tpt->MkTPanelWin(mf, true);
auto tpm = tpanel::MkTPanel("", "", flags | TPF::AUTO_MN, 0);
tpm->MkTPanelWin(mf, false);
auto tpd = tpanel::MkTPanel("", "", flags | TPF::AUTO_DM, 0);
tpd->MkTPanelWin(mf, false);
}
}
if(terms_requested) return false;
mainframelist[0]->Show(true);
for(auto it=alist.begin(); it!=alist.end(); ++it) {
(*it)->Setup();
(*it)->CalcEnabled();
(*it)->Exec();
}
if(terms_requested) return false;
rs.cancel();
return true;
}
示例9: COCA_DEBUG_INFO
bool EditorApplication::OnInit()
{
COCA_DEBUG_INFO( "EditorApplication::OnInit" );
SetAppName( "coca editor" );
// coca resource manager
_resourceManager.createThread();
// frame
EditorFrame* frame = new EditorFrame( 0, E_ID_EDITOR_FRAME, "coca editor",
wxDefaultPosition, wxSize( 800, 600 ) );
SetTopWindow( frame );
readConfig();
loadPlugins();
createDocumentTemplates();
_documentManager.SetMaxDocsOpen( 1 );
frame->Show();
COCA_DEBUG_INFO( "EditorApplication::OnInit finished" );
return true;
}
示例10: SetAppName
bool wxExTestApp::OnInit()
{
SetAppName("wxex-test-gui-report");
if (!wxExApp::OnInit())
{
return false;
}
wxExFrameWithHistory *frame = new
wxExFrameWithHistory(NULL, wxID_ANY, wxTheApp->GetAppDisplayName());
frame->Show(true);
wxLog::SetActiveTarget(new wxLogStderr());
CppUnit::TextUi::TestRunner runner;
wxExTestSuite* suite = new wxExTestSuite;
runner.addTest(suite);
runner.run();
// Return false, so test ends here.
return false;
}
示例11: wxApp
LauncherApp::LauncherApp()
: wxApp()
{
completed = false;
SetAppName(_("IzPack launcher"));
loadParams();
}
示例12: SetAppName
// 'Main program' equivalent: the program execution _T("starts") here
bool ASSDrawApp::OnInit()
{
SetAppName(TITLE);
// create the main application window
ASSDrawFrame * assdrawframe = new ASSDrawFrame( this, TITLE, wxDefaultPosition, wxSize(640, 480) );
SetTopWindow(assdrawframe);
return TRUE;
}
示例13: SLM_ASSERT
bool App::OnInit()
{
::fwWX::LoggerInitializer::initialize();
m_profile = ::fwRuntime::profile::getCurrentProfile();
SLM_ASSERT("Profile is not initialized", m_profile);
#ifndef TDVPM_COMPLIANT
m_locale = new wxLocale();
::boost::filesystem::path pathLauncher;
pathLauncher = ::boost::filesystem::current_path() / "share" / "launcher_0-1" / "locale" ;
wxLocale::AddCatalogLookupPathPrefix( ::fwWX::std2wx( pathLauncher.string() ));
m_locale->Init(GetUILanguage());
m_locale->AddCatalog(_T("launcher"));
m_locale->AddCatalog(_T("runtime"));
// Set the locale to C for all number of all application
setlocale(LC_NUMERIC,"C");
#else
setlocale(LC_ALL,"C");
#endif
wxApp::OnInit();
std::string appName = m_profile->getName();
#ifndef TDVPM_COMPLIANT
m_locale->AddCatalog(::fwWX::std2wx(appName), wxLANGUAGE_FRENCH, _T("utf-8"));
#endif
SetAppName( ::fwWX::std2wx(appName) );
std::string checkerPath = ::fwTools::os::getUserDataDir("IRCAD", appName, true);
if (checkerPath.empty())
{
checkerPath = ::fwTools::os::getUserDataDir("IRCAD", "", true);
}
if (checkerPath.empty())
{
checkerPath = ::fwTools::os::getUserDataDir("", "", true);
}
SLM_ASSERT("Unable to find user's data dir.", !checkerPath.empty());
m_checker = new wxSingleInstanceChecker();
if (m_profile->getCheckSingleInstance())
{
m_checker->Create( ::fwWX::std2wx(appName) + _(".pid"), ::fwWX::std2wx(checkerPath));
if ( m_checker->IsAnotherRunning() )
{
wxLogError(_("Another " + ::fwWX::std2wx(appName) + _(" instance is already running, aborting.")));
return false;
}
}
// Initialize root object : root object, views, ...
//::fwServices::RootManager::initializeRootObject();
return TRUE;
}
示例14: SetAppName
App::App()
{
SetAppName( _("launcher") );
#ifdef __MACOSX__
ProcessSerialNumber PSN;
GetCurrentProcess(&PSN);
TransformProcessType(&PSN,kProcessTransformToForegroundApplication);
#endif
}
示例15: SetVendorName
bool MyApp::OnInit()
{
SetVendorName(_T("Free world"));
SetAppName(_T("wxEdit"));
MyFrame *frame = new MyFrame( NULL, wxID_ANY, _T("wxEdit"), wxPoint(20,20), wxSize(500,340) );
frame->Show( true );
return true;
}