您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxSetEnv函数代码示例

51自学网 2021-06-03 10:11:50
  C++
这篇教程C++ wxSetEnv函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxSetEnv函数的典型用法代码示例。如果您正苦于以下问题:C++ wxSetEnv函数的具体用法?C++ wxSetEnv怎么用?C++ wxSetEnv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxSetEnv函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: running

bool CppCheck::AppExecute(const wxString& app, const wxString& CommandLine, wxArrayString& Output, wxArrayString& Errors){    wxWindowDisabler disableAll;    wxBusyInfo running(_("Running ") + app + _T("... please wait (this may take several minutes)..."),                       Manager::Get()->GetAppWindow());    AppendToLog(CommandLine);    if ( -1 == wxExecute(CommandLine, Output, Errors, wxEXEC_SYNC) )    {        wxString msg = _("Failed to launch ") + app + _T("./n"                         "Please setup the ") + app + _T(" executable accordingly in the settings/n"                        "and make sure its also in the path so ") + app + _T(" resources are found.");        AppendToLog(msg);        cbMessageBox(msg, _("Error"), wxICON_ERROR | wxOK, Manager::Get()->GetAppWindow());        if (!m_PATH.IsEmpty()) wxSetEnv(wxT("PATH"), m_PATH); // Restore        return false;    }    int Count = Output.GetCount();    for (int idxCount = 0; idxCount < Count; ++idxCount)        AppendToLog(Output[idxCount]);    Count = Errors.GetCount();    for (int idxCount = 0; idxCount < Count; ++idxCount)        AppendToLog(Errors[idxCount]);    if (!m_PATH.IsEmpty()) wxSetEnv(wxT("PATH"), m_PATH); // Restore    return true;}
开发者ID:wiesyk,项目名称:wiesyk,代码行数:29,


示例2: Destroy

//---------------------------------------------------------bool CSG_Module_Library::Create(const CSG_String &File_Name){	Destroy();	TSG_PFNC_MLB_Initialize		MLB_Initialize;	TSG_PFNC_MLB_Get_Interface	MLB_Get_Interface;	wxString	sPath;	wxFileName	fName(File_Name.c_str());	fName.MakeAbsolute();	m_File_Name		= fName.GetFullPath();	//-----------------------------------------------------	if( wxGetEnv(ENV_LIB_PATH, &sPath) && sPath.Length() > 0 )	{		wxSetEnv(ENV_LIB_PATH, CSG_String::Format(SG_T("%s%c%s"), sPath.c_str(), ENV_LIB_SEPA, SG_File_Get_Path(m_File_Name).c_str()));	}	else	{		wxSetEnv(ENV_LIB_PATH, SG_File_Get_Path(m_File_Name).c_str());	}	//-----------------------------------------------------	if(	m_pLibrary->Load(m_File_Name.c_str())	&&	(MLB_Get_Interface	= (TSG_PFNC_MLB_Get_Interface)	m_pLibrary->GetSymbol(SYMBOL_MLB_Get_Interface)) != NULL	&&	(MLB_Initialize		= (TSG_PFNC_MLB_Initialize)		m_pLibrary->GetSymbol(SYMBOL_MLB_Initialize)   ) != NULL	&&	 MLB_Initialize(m_File_Name) )	{		m_pInterface	= MLB_Get_Interface();	}	//-----------------------------------------------------	if( sPath.Length() > 0 )	{		wxSetEnv(ENV_LIB_PATH, sPath);	}	else	{		wxUnsetEnv(ENV_LIB_PATH);	}	//-----------------------------------------------------	if( Get_Count() > 0 )	{		for(int i=0; i<Get_Count(); i++)			Get_Module(i)->Set_Managed(false);		return( true );	}	Destroy();	return( false );}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:56,


示例3: wxSetEnv

void CrtTestCase::SetGetEnv(){    wxString val;    wxSetEnv(_T("TESTVAR"), _T("value"));    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) == true );    CPPUNIT_ASSERT( val == _T("value") );    wxSetEnv(_T("TESTVAR"), _T("something else"));    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) );    CPPUNIT_ASSERT( val == _T("something else") );    CPPUNIT_ASSERT( wxUnsetEnv(_T("TESTVAR")) );    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), NULL) == false );}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:12,


示例4: f

bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxString & path){   // Since we now have builtin VST support, ignore the VST bridge as it   // causes duplicate menu entries to appear.   wxFileName f(path);   if (f.GetName().CmpNoCase(wxT("vst-bridge")) == 0) {      return false;   }   // As a courtesy to some plug-ins that might be bridges to   // open other plug-ins, we set the current working   // directory to be the plug-in's directory.   wxString envpath;   bool hadpath = wxGetEnv(wxT("PATH"), &envpath);   wxSetEnv(wxT("PATH"), f.GetPath() + wxFILE_SEP_PATH + envpath);   wxString saveOldCWD = f.GetCwd();   f.SetCwd();      int index = 0;   LADSPA_Descriptor_Function mainFn = NULL;   wxDynamicLibrary lib;   if (lib.Load(path, wxDL_NOW)) {      wxLogNull logNo;      mainFn = (LADSPA_Descriptor_Function) lib.GetSymbol(wxT("ladspa_descriptor"));      if (mainFn) {         const LADSPA_Descriptor *data;         for (data = mainFn(index); data; data = mainFn(++index)) {            LadspaEffect effect(path, index);            if (effect.SetHost(NULL)) {               pm.RegisterPlugin(this, &effect);            }         }      }   }   if (lib.IsLoaded()) {      // PRL:  I suspect Bug1257 -- Crash when enabling Amplio2 -- is the fault of a timing-      // dependent multi-threading bug in the Amplio2 library itself, in case the unload of the .dll      // comes too soon after the load.  I saw the bug in Release builds but not Debug.      // A sleep of even 1 ms was enough to fix the problem for me, but let's be even more generous.      ::wxMilliSleep(10);      lib.Unload();   }   wxSetWorkingDirectory(saveOldCWD);   hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));   return index > 0;}
开发者ID:forssil,项目名称:thirdpartysource,代码行数:51,


示例5: kisysmod

bool EDA_APP::SetFootprintLibTablePath(){    wxString    path;    wxString    kisysmod( wxT( KISYSMOD ) );    // Set the KISYSMOD environment variable for the current process if it is not already    // defined in the user's environment.  This is required to expand the global footprint    // library table paths.    if( wxGetEnv( kisysmod, &path ) && wxFileName::DirExists( path ) )        return true;    // Set the KISYSMOD environment variable to the path defined in the user's configuration    // if it is defined and the path exists.    if( m_commonSettings->Read( kicadFpLibPath, &path ) && wxFileName::DirExists( path ) )    {        wxSetEnv( kisysmod, path );        return true;    }    // Attempt to determine where the footprint libraries were installed using the legacy    // library search paths.    if( !GetLibraryPathList().IsEmpty() )    {        unsigned      modFileCount = 0;        wxString      bestPath;        wxArrayString tmp;        for( unsigned i = 0;  i < GetLibraryPathList().GetCount();  i++ )        {            unsigned cnt = wxDir::GetAllFiles( GetLibraryPathList()[i], &tmp, wxT( "*.mod" ),                                               wxDIR_FILES );            if( cnt > modFileCount )            {                modFileCount = cnt;                bestPath = GetLibraryPathList()[i];            }        }        if( modFileCount != 0 )        {            wxSetEnv( kisysmod, bestPath );            return true;        }    }    return false;}
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:48,


示例6: wxT

AutoDetectResult CompilerOW::AutoDetectInstallationDir(){    /* Following code is Not necessary as OpenWatcom does not write to       Registry anymore */    /*wxRegKey key; // defaults to HKCR    key.SetName(wxT("HKEY_LOCAL_MACHINE//Software//Open Watcom//c_1.0"));    if (key.Open())        // found; read it        key.QueryValue(wxT("Install Location"), m_MasterPath);*/    if (m_MasterPath.IsEmpty())        // just a guess; the default installation dir        m_MasterPath = wxT("C://watcom");    if (!m_MasterPath.IsEmpty())    {        AddIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("h"));        AddIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("h") + wxFILE_SEP_PATH + wxT("nt"));        AddLibDir(m_MasterPath + wxFILE_SEP_PATH + wxT("lib386"));        AddLibDir(m_MasterPath + wxFILE_SEP_PATH + wxT("lib386") + wxFILE_SEP_PATH + wxT("nt"));        AddResourceIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("h"));        AddResourceIncludeDir(m_MasterPath + wxFILE_SEP_PATH + wxT("h") + wxFILE_SEP_PATH + wxT("nt"));        m_ExtraPaths.Add(m_MasterPath + wxFILE_SEP_PATH + wxT("binnt"));        m_ExtraPaths.Add(m_MasterPath + wxFILE_SEP_PATH + wxT("binw"));    }    wxSetEnv(wxT("WATCOM"), m_MasterPath);    return wxFileExists(m_MasterPath + wxFILE_SEP_PATH + wxT("binnt") + wxFILE_SEP_PATH + m_Programs.C) ? adrDetected : adrGuessed;}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:29,


示例7: 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;}
开发者ID:renemilk,项目名称:springlobby,代码行数:60,


示例8: set_lib_env_var

/// Extend LIB_ENV_VAR list with the directory from which I came, prepending it.static void set_lib_env_var( const wxString& aAbsoluteArgv0 ){    // POLICY CHOICE 2: Keep same path, so that installer MAY put the    // "subsidiary DSOs" in the same directory as the kiway top process modules.    // A subsidiary shared library is one that is not a top level DSO, but rather    // some shared library that a top level DSO needs to even be loaded.  It is    // a static link to a shared object from a top level DSO.    // This directory POLICY CHOICE 2 is not the only dir in play, since LIB_ENV_VAR    // has numerous path options in it, as does DSO searching on linux, windows, and OSX.    // See "man ldconfig" on linux. What's being done here is for quick installs    // into a non-standard place, and especially for Windows users who may not    // know what the PATH environment variable is or how to set it.    wxFileName  fn( aAbsoluteArgv0 );    wxString    ld_path( LIB_ENV_VAR );    wxString    my_path   = fn.GetPath();    wxString    new_paths = PrePendPath( ld_path, my_path );    wxSetEnv( ld_path, new_paths );#if defined(DEBUG)    {        wxString    test;        wxGetEnv( ld_path, &test );        printf( "LIB_ENV_VAR:'%s'/n", TO_UTF8( test ) );    }#endif}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:31,


示例9: candidate_path

void PROJECT::SetProjectFullName( const wxString& aFullPathAndName ){    // Compare paths, rather than inodes, to be less surprising to the user.    // Create a temporary wxFileName to normalize the path    wxFileName candidate_path( aFullPathAndName );    // Edge transitions only.  This is what clears the project    // data using the Clear() function.    if( m_project_name.GetFullPath() != candidate_path.GetFullPath() )    {        Clear();            // clear the data when the project changes.        wxLogTrace( tracePathsAndFiles, "%s: old:'%s' new:'%s'", __func__,                    TO_UTF8( GetProjectFullName() ), TO_UTF8( aFullPathAndName ) );        m_project_name = aFullPathAndName;        wxASSERT( m_project_name.IsAbsolute() );        wxASSERT( m_project_name.GetExt() == ProjectFileExtension );        // until multiple projects are in play, set an environment variable for the        // the project pointer.        {            wxString path = m_project_name.GetPath();            wxSetEnv( PROJECT_VAR_NAME, path );        }    }}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:30,


示例10: f

bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxString & path){   // Since we now have builtin VST support, ignore the VST bridge as it   // causes duplicate menu entries to appear.   wxFileName f(path);   if (f.GetName().CmpNoCase(wxT("vst-bridge")) == 0) {      return false;   }   // As a courtesy to some plug-ins that might be bridges to   // open other plug-ins, we set the current working   // directory to be the plug-in's directory.   wxString envpath;   bool hadpath = wxGetEnv(wxT("PATH"), &envpath);   wxSetEnv(wxT("PATH"), f.GetPath() + wxFILE_SEP_PATH + envpath);   wxString saveOldCWD = f.GetCwd();   f.SetCwd();      int index = 0;   LADSPA_Descriptor_Function mainFn = NULL;   wxDynamicLibrary lib;   if (lib.Load(path, wxDL_NOW)) {      wxLogNull logNo;      mainFn = (LADSPA_Descriptor_Function) lib.GetSymbol(wxT("ladspa_descriptor"));      if (mainFn) {         const LADSPA_Descriptor *data;         for (data = mainFn(index); data; data = mainFn(++index)) {            LadspaEffect effect(path, index);            if (effect.SetHost(NULL)) {               pm.RegisterPlugin(this, &effect);            }         }      }   }   if (lib.IsLoaded()) {      lib.Unload();   }   wxSetWorkingDirectory(saveOldCWD);   hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));   return index > 0;}
开发者ID:QuincyPYoung,项目名称:audacity,代码行数:46,


示例11: AppendToLog

wxString CppCheck::GetAppExecutable(const wxString& app, const wxString& app_cfg){    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("cppcheck"));    wxString Executable = ConfigPanel::GetDefaultCppCheckExecutableName();    if (cfg)        Executable = cfg->Read(app_cfg, Executable);    Manager::Get()->GetMacrosManager()->ReplaceMacros(Executable);    AppendToLog(wxString::Format(_("Executable ") + app + _T(": '%s'."),                                 Executable.wx_str()));    // Make sure file is accessible, otherwise add path to cppcheck to PATH envvar    wxFileName fn(Executable);    if (fn.IsOk() && fn.FileExists())    {        wxString AppPath = fn.GetPath();        AppendToLog(wxString::Format(_("Path to ") + app + _T(": '%s'."),                                     AppPath.wx_str()));        if ( AppPath.Trim().IsEmpty() )            return Executable; // Nothing to do, lets hope it works and cppcheck is in the PATH        bool PrependPath = true;        wxString NewPathEnvVar = wxEmptyString;        wxPathList PathList;        PathList.AddEnvList(wxT("PATH"));        for (size_t i=0; i<PathList.GetCount(); ++i)        {            wxString PathItem = PathList.Item(i);            if ( PathItem.IsSameAs(AppPath, (platform::windows ? false : true)) )            {                AppendToLog(_("Executable of cppcheck is in the path."));                PrependPath = false;                break; // Exit for-loop            }            if ( !NewPathEnvVar.IsEmpty() )                NewPathEnvVar << wxPATH_SEP;            NewPathEnvVar << PathItem;        }        if (m_PATH.IsEmpty())            m_PATH = NewPathEnvVar;        if (PrependPath)        {            NewPathEnvVar = NewPathEnvVar.Prepend(wxPATH_SEP);            NewPathEnvVar = NewPathEnvVar.Prepend(AppPath);            wxSetEnv(wxT("PATH"), NewPathEnvVar); // Don't care about return value            AppendToLog(wxString::Format(_("Updated PATH environment to include path to ") + app + _T(": '%s' ('%s')."),                                         AppPath.wx_str(), NewPathEnvVar.wx_str()));        }    }    return Executable;}
开发者ID:wiesyk,项目名称:wiesyk,代码行数:58,


示例12: wxSetEnv

void sysProcess::SetEnvironment(const wxArrayString &environment){	size_t i;	for (i = 0 ; i < environment.GetCount() ; i++)	{		wxString str = environment.Item(i);		wxSetEnv(str.BeforeFirst('='), str.AfterFirst('='));	}}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:9,


示例13: wxSetEnv

void CrtTestCase::SetGetEnv(){    wxString val;    wxSetEnv(_T("TESTVAR"), _T("value"));    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) == true );    CPPUNIT_ASSERT( val == _T("value") );    wxSetEnv(_T("TESTVAR"), _T("something else"));    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), &val) );    CPPUNIT_ASSERT( val == _T("something else") );    // this test doesn't work under Unix systems without setenv(): putenv() can    // only be used to add or modify environment variables but not to unset    // them#if !defined(__UNIX__) || defined(HAVE_SETENV)    CPPUNIT_ASSERT( wxUnsetEnv(_T("TESTVAR")) );    CPPUNIT_ASSERT( wxGetEnv(_T("TESTVAR"), NULL) == false );#endif}
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:18,


示例14: wxIcon

void MainFrame::SetSystemTrayIcon(const wxString& icon, const wxString& tooltip){    if(CheckOption(wxT("UD_MINIMIZE_TO_SYSTEM_TRAY"))){        wxIcon i = wxIcon(icon,wxBITMAP_TYPE_ICO_RESOURCE,g_iconSize,g_iconSize);        if(!m_systemTrayIcon->SetIcon(i,tooltip)){            etrace("system tray icon setup failed");            wxSetEnv(wxT("UD_MINIMIZE_TO_SYSTEM_TRAY"),wxT("0"));        }    }}
开发者ID:andyvand,项目名称:UltraDefrag,代码行数:10,


示例15: wxT

void EnvTestCase::GetSet(){    const wxChar *var = wxT("wxTestVar");    wxString contents;    CPPUNIT_ASSERT(!wxGetEnv(var, &contents));    CPPUNIT_ASSERT(contents.empty());    wxSetEnv(var, wxT("value for wxTestVar"));    CPPUNIT_ASSERT(wxGetEnv(var, &contents));    CPPUNIT_ASSERT(contents == wxT("value for wxTestVar"));    wxSetEnv(var, wxT("another value"));    CPPUNIT_ASSERT(wxGetEnv(var, &contents));    CPPUNIT_ASSERT(contents == wxT("another value"));    wxUnsetEnv(var);    CPPUNIT_ASSERT(!wxGetEnv(var, &contents));}
开发者ID:euler0,项目名称:Helium,代码行数:19,


示例16: defined

bool nsEnvVars::EnvvarApply(const wxString& key, const wxString& value){#if defined(TRACE_ENVVARS)  Manager::Get()->GetLogManager()->DebugLog(F(_T("EnvvarApply")));#endif  // Replace all macros the user might have setup for the key  wxString the_key = key;  Manager::Get()->GetMacrosManager()->ReplaceMacros(the_key);  if (the_key.Trim().IsEmpty()) return false;  // Value: First, expand stuff like:  //        set PATH=%PATH%;C:/NewPath OR export PATH=$PATH:/new_path  //        After, replace all macros the user might have used in addition  wxString value_set;  bool     is_set    = wxGetEnv(the_key, &value_set);  wxString the_value = value;  if (is_set)  {    std::map<wxString,wxString>::iterator it = nsEnvVars::EnvVarsStack.find(the_key);    if (it==nsEnvVars::EnvVarsStack.end()) // envvar not already on the stack      nsEnvVars::EnvVarsStack[the_key] = value_set; // remember the old value    // Avoid endless recursion if the value set contains e.g. $PATH, too    if (nsEnvVars::EnvvarIsRecursive(the_key,the_value))    {      if (nsEnvVars::EnvvarIsRecursive(the_key,value_set))      {        EV_DBGLOG(_T("EnvVars: Setting environment variable '%s' failed "                     "due to unresolvable recursion."), the_key.wx_str());        return false;      }      // Restore original value in case of recursion before      if (it!=nsEnvVars::EnvVarsStack.end())        value_set = nsEnvVars::EnvVarsStack[the_key];      // Resolve recursion now (if any)      wxString recursion;      if (platform::windows) recursion = _T("%")+the_key+_("%");      else                   recursion = _T("$")+the_key;      the_value.Replace(recursion.wx_str(), value_set.wx_str());    }  }  // Replace all macros the user might have setup for the value  Manager::Get()->GetMacrosManager()->ReplaceMacros(the_value);  EV_DBGLOG(_T("EnvVars: Trying to set environment variable '%s' to value '%s'..."), the_key.wx_str(), the_value.wx_str());  if (!wxSetEnv(the_key, the_value)) // set the envvar as computed  {    EV_DBGLOG(_T("EnvVars: Setting environment variable '%s' failed."), the_key.wx_str());    return false;  }  return true;}// EnvvarApply
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:54,


示例17: APP_KICAD

    APP_KICAD(): wxApp()    {        // Disable proxy menu in Unity window manager. Only usual menubar works with wxWidgets (at least <= 3.1)        // When the proxy menu menubar is enable, some important things for us do not work: menuitems UI events and shortcuts.        wxString wm;        if( wxGetEnv( wxT( "XDG_CURRENT_DESKTOP" ), &wm ) && wm.CmpNoCase( wxT( "Unity" ) ) == 0 )        {            wxSetEnv ( wxT("UBUNTU_MENUPROXY" ), wxT( "0" ) );        }    }
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:11,


示例18: udefrag_query_parameters

//right now this is equivalent to Job.cpp @ void MainFrame::OnStartJob(wxCommandEvent& event)void MainFrame::QueryClusters(wxCommandEvent& event){    wxString filtertext,itemtext;        int id = event.GetId();    m_queryThread->m_qp = new udefrag_query_parameters();    WxTextCtrl1->Clear();    //Launched from Menu:    if (id == ID_QueryClusters){        itemtext = m_filesList->GetListItem().GetText();        WxFilePickerCtrl1->SetPath(itemtext);                ProcessCommandEvent(ID_SelectProperDrive);        long i = m_filesList->GetFirstSelected();        while(i != -1){            wxString selitem = m_filesList->GetItemText(i);            Utils::extendfiltertext(selitem,&filtertext);            i = m_filesList->GetNextSelected(i);        }    }//Launched from Tab    else if (id == ID_PERFORMQUERY){        itemtext = WxFilePickerCtrl1->GetPath();        Utils::extendfiltertext(itemtext,&filtertext);    }       //set the Analysis Mode to SINGLE file mode.    // This probably can't work for all queries, but is fast.    wxSetEnv(L"UD_CUT_FILTER",filtertext);    m_queryThread->singlefile = TRUE;    m_queryThread->m_flags |= UD_JOB_CONTEXT_MENU_HANDLER;    m_queryThread->m_querypath = (wchar_t *)itemtext.fn_str();    m_queryThread->m_qp->path = m_queryThread->m_querypath;    m_queryThread->m_letter = (char)(itemtext[0]); //find the drive-letter of the fragmented files tab.            m_queryThread->m_mapSize = getmapsize();        switch(id){    case ID_QueryClusters:    case ID_PERFORMQUERY:        m_queryThread->m_qType = QUERY_GET_VCNLIST;        break;    case ID_QueryClusters+1:        m_queryThread->m_qType = QUERY_GET_FREE_REGIONS;        break;        default:        break;    }    m_busy = true; m_paused = false; m_stopped = false;    m_queryThread->m_startquery = true; //BEGIN LAUNCH.    }
开发者ID:genbtc,项目名称:UltraDefrag,代码行数:54,


示例19: wxT

void CrtTestCase::SetGetEnv(){#define TESTVAR_NAME wxT("WXTESTVAR")    wxString val;    wxSetEnv(TESTVAR_NAME, wxT("value"));    CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) );    CPPUNIT_ASSERT_EQUAL( "value", val );    CPPUNIT_ASSERT_EQUAL( "value", wxString(wxGetenv(TESTVAR_NAME)) );    wxSetEnv(TESTVAR_NAME, wxT("something else"));    CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) );    CPPUNIT_ASSERT_EQUAL( "something else", val );    CPPUNIT_ASSERT_EQUAL( "something else", wxString(wxGetenv(TESTVAR_NAME)) );    CPPUNIT_ASSERT( wxUnsetEnv(TESTVAR_NAME) );    CPPUNIT_ASSERT( !wxGetEnv(TESTVAR_NAME, NULL) );    CPPUNIT_ASSERT( !wxGetenv(TESTVAR_NAME) );#undef TESTVAR_NAME}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:21,


示例20: generator

void QMakePlugin::OnBuildStarting(clBuildEvent& event){    // call Skip() to allow the standard compilation to take place    event.Skip();    QmakePluginData::BuildConfPluginData bcpd;    wxString  project = event.GetProjectName();    wxString  config  = event.GetConfigurationName();    if ( !DoGetData(project, config, bcpd) ) {        return;    }    if ( !bcpd.m_enabled ) {        return;    }    wxString errMsg;    ProjectPtr p = m_mgr->GetWorkspace()->FindProjectByName(project, errMsg);    if ( !p ) {        return;    }    QMakeProFileGenerator generator(m_mgr, project, config);    // regenrate the .pro file    bool needRegeneration = generator.Generate();    wxString qmake_exe = m_conf->Read(wxString::Format(wxT("%s/qmake"),     bcpd.m_qmakeConfig.c_str()));    wxString qmakespec = m_conf->Read(wxString::Format(wxT("%s/qmakespec"), bcpd.m_qmakeConfig.c_str()));    wxString qtdir     = m_conf->Read(wxString::Format(wxT("%s/qtdir"),     bcpd.m_qmakeConfig.c_str()));    // Create qmake comand    wxString qmake_exe_line;    qmake_exe.Trim().Trim(false);    qmakespec.Trim().Trim(false);    // Set QTDIR    DirSaver ds;    {        wxSetWorkingDirectory ( p->GetFileName().GetPath(wxPATH_GET_SEPARATOR|wxPATH_GET_VOLUME) );        wxSetEnv(wxT("QTDIR"), qtdir);        qmake_exe_line << wxT("/"") << qmake_exe << wxT("/" -spec ") << qmakespec << wxT(" ") << generator.GetProFileName();        if ( needRegeneration ) {            wxArrayString output;            ProcUtils::SafeExecuteCommand(qmake_exe_line, output);        }    }}
开发者ID:AndrianDTR,项目名称:codelite,代码行数:51,


示例21: InitEDA_Appl

bool EDA_APP::OnInit(){    wxFileName      fn;    PCB_EDIT_FRAME* frame = NULL;    wxString        msg;    InitEDA_Appl( wxT( "Pcbnew" ), APP_PCBNEW_T );#ifdef KICAD_SCRIPTING    msg.Empty();#ifdef __WINDOWS__    // force python environment under Windows:    const wxString python_us("python27_us");    // Build our python path inside kicad    wxString kipython = m_BinDir + python_us;    // If our python install is existing inside kicad, use it    if( wxDirExists( kipython ) )    {        wxString ppath;        if( !wxGetEnv( wxT( "PYTHONPATH" ), &ppath ) || !ppath.Contains( python_us ) )        {            ppath << kipython << wxT("/pylib;");            ppath << kipython << wxT("/lib;");            ppath << kipython << wxT("/dll");            wxSetEnv( wxT( "PYTHONPATH" ), ppath );            DBG( std::cout << "set PYTHONPATH to "  << TO_UTF8(ppath) << "/n"; )            // Add python executable path:            wxGetEnv( wxT( "PATH" ), &ppath );            if( !ppath.Contains( python_us ) )            {                kipython << wxT(";") << ppath;                wxSetEnv( wxT( "PATH" ), kipython );                DBG( std::cout << "set PATH to " << TO_UTF8(kipython) << "/n"; )            }
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:37,


示例22: wxLogTrace

bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValue ){    wxString env;    // Check to see if the environment variable is already set.    if( wxGetEnv( aName, &env ) )    {        wxLogTrace( traceEnvVars, wxT( "Environment variable %s already set to %s." ),                    GetChars( aName ), GetChars( env ) );        return env == aValue;    }    wxLogTrace( traceEnvVars, wxT( "Setting local environment variable %s to %s." ),                GetChars( aName ), GetChars( aValue ) );    return wxSetEnv( aName, aValue );}
开发者ID:chgans,项目名称:kicad,代码行数:17,


示例23: saveCommonSettings

void PGM_BASE::SetLocalEnvVariables( const ENV_VAR_MAP& aEnvVarMap ){    m_local_env_vars.clear();    m_local_env_vars = aEnvVarMap;    if( m_common_settings )        m_common_settings->DeleteGroup( pathEnvVariables );    saveCommonSettings();    // Overwrites externally defined environment variable until the next time the application    // is run.    for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )    {        wxLogTrace( traceEnvVars, wxT( "Setting local environment variable %s to %s." ),                    GetChars( it->first ), GetChars( it->second.GetValue() ) );        wxSetEnv( it->first, it->second.GetValue() );    }}
开发者ID:chgans,项目名称:kicad,代码行数:19,


示例24: wxASSERT

void PROJECT::SetProjectFullName( const wxString& aFullPathAndName ){    m_project_name = aFullPathAndName;    wxASSERT(  m_project_name.GetName() == NAMELESS_PROJECT || m_project_name.IsAbsolute() );#if 0    wxASSERT( m_project_name.GetExt() == ProjectFileExtension )#else    m_project_name.SetExt( ProjectFileExtension );#endif    // until multiple projects are in play, set an environment variable for the    // the project pointer.    {        wxString path = m_project_name.GetPath();        // wxLogDebug( wxT( "Setting env %s to '%s'." ),  PROJECT_VAR_NAME, GetChars( path ) );        wxSetEnv( PROJECT_VAR_NAME, path );    }}
开发者ID:manasdas17,项目名称:kicad-source-mirror,代码行数:21,


示例25: return

bool ecUtils::AddToPath(const ecFileName & strFolder, bool bAtFront){    wxString strPath,strOldPath;        if (wxGetEnv(wxT("PATH"), & strOldPath))    {        // Place the user tools folders at the head or tail of the new path        if(bAtFront)        {            strPath.Printf(wxT("%s;%s"), (const wxChar*) strFolder.ShortName(), (const wxChar*) strOldPath);        } else        {            strPath.Printf(wxT("%s;%s"), (const wxChar*) strOldPath, (const wxChar*) strFolder.ShortName());        }    } else    {        // unlikely, but ...        strPath = strFolder;    }    return (TRUE == wxSetEnv(wxT("PATH"),strPath));}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:21,



注:本文中的wxSetEnv函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wxSetWorkingDirectory函数代码示例
C++ wxS函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。