当前位置: 首页>>代码示例>>C++>>正文


C++ wxGetCwd函数代码示例

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


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

示例1: IsSameAs

/** Returns true if the two paths are equal. */
bool IsSameAs(const wxString& a, const wxString& b)
{
	// Cache the current directory
	const wxString cwd = wxGetCwd();

	// We normalize everything, except env. variables, which
	// can cause problems when the string is not encodable
	// using wxConvLibc which wxWidgets uses for the purpose.
	const int flags = (wxPATH_NORM_ALL | wxPATH_NORM_CASE) & ~wxPATH_NORM_ENV_VARS;

	// Let wxFileName handle the tricky stuff involved in actually
	// comparing two paths ... Currently, a path ending with a path-
	// seperator will be unequal to the same path without a path-
	// seperator, which is probably for the best, but can could
	// lead to some unexpected behavior.
	wxFileName fn1(a);
	wxFileName fn2(b);
	
	fn1.Normalize(flags, cwd);
	fn2.Normalize(flags, cwd);

	return (fn1.GetFullPath() == fn2.GetFullPath());
}
开发者ID:dreamerc,项目名称:amule,代码行数:24,代码来源:Path.cpp

示例2: fopen

void WinEDA_MainFrame::Load_Prj_Config(void)
/*******************************************/
{
FILE * in_file;

	in_file = fopen(m_PrjFileName, "rt");
	if ( in_file == 0 )
		{
		wxString msg = _("Project File <") + m_PrjFileName + _("> not found");
		DisplayError(this, msg);
		return;
		}
	fclose(in_file);

	wxSetWorkingDirectory(wxPathOnly(m_PrjFileName) );
	SetTitle(Main_Title + " " + m_PrjFileName);
	ReCreateMenuBar();
	m_LeftWin->ReCreateTreePrj();

	wxString msg = _("\nWorking dir: ") + wxGetCwd();
	msg << _("\nProject: ") << m_PrjFileName << "\n";
	PrintMsg(msg);
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:23,代码来源:prjconfig.cpp

示例3: wxExOpenFiles

void wxExOpenFiles(
    wxExFrame* frame,
    const wxArrayString& files,
    long file_flags,
    int dir_flags)
{
    // std::vector gives compile error.
    for (
#ifdef wxExUSE_CPP0X
        auto it = files.begin();
#else
        wxArrayString::const_iterator it = files.begin();
#endif
        it != files.end();
        it++)
    {
        wxString file = *it; // cannot be const because of file = later on

        if (file.Contains("*") || file.Contains("?"))
        {
            wxExDirOpenFile dir(frame, wxGetCwd(), file, file_flags, dir_flags);
            dir.FindFiles();
        }
        else
        {
            int line = 0;

            if (!wxFileName(file).FileExists() && file.Contains(":"))
            {
                line = atoi(file.AfterFirst(':').c_str());
                file = file.BeforeFirst(':');
            }

            frame->OpenFile(file, line, wxEmptyString, file_flags);
        }
    }
}
开发者ID:hugofvw,项目名称:wxExtension,代码行数:37,代码来源:util.cpp

示例4: Unpack

int Unpack(wxFile& pkg_f, std::string src, std::string dst)
{
	PKGHeader* m_header = (PKGHeader*) malloc (sizeof(PKGHeader));

	wxFile dec_pkg_f;
	std::string decryptedFile = wxGetCwd() + "/dev_hdd1/" + src + ".dec";

	dec_pkg_f.Create(decryptedFile, true);
	
	if (Decrypt(pkg_f, dec_pkg_f, m_header) < 0)
		return -1;
	
	dec_pkg_f.Close();

	wxFile n_dec_pkg_f(decryptedFile, wxFile::read);

	std::vector<PKGEntry> m_entries;
	m_entries.resize(m_header->file_count);

	PKGEntry *m_entries_ptr = &m_entries[0];
	if (!LoadEntries(n_dec_pkg_f, m_header, m_entries_ptr))
		return -1;

	wxProgressDialog pdlg("PKG Decrypter / Installer", "Please wait, unpacking...", m_entries.size(), 0, wxPD_AUTO_HIDE | wxPD_APP_MODAL);

	for (const PKGEntry& entry : m_entries)
	{
		UnpackEntry(n_dec_pkg_f, entry, dst + src + "/");
		pdlg.Update(pdlg.GetValue() + 1);
	}
	pdlg.Update(m_entries.size());

	n_dec_pkg_f.Close();
	wxRemoveFile(decryptedFile);

	return 0;
}
开发者ID:MissValeska,项目名称:rpcs3,代码行数:37,代码来源:unpkg.cpp

示例5: S

void CShowDescriptionListDlg::SaveAs()
{
    int            err, i;
    CBaseObject  * pObj;
    CStr           S(128);

    wxString CurrentDir = wxGetCwd();
    wxFileDialog dialog(GetParent(),
                        wxT("Save current text"),
                        wxT(""),
                        wxT(""),
                        wxT(SZ_ALL_FILES),
                        wxFD_SAVE |  wxFD_OVERWRITE_PROMPT );
    err = dialog.ShowModal();
    wxSetWorkingDirectory(CurrentDir);

    if (wxID_OK == err)
    {
        CFileWriter F;
        if (F.Open(dialog.GetPath().mb_str()))
        {
            for (i=0; i<m_pItems->Count(); i++)
            {
                pObj = (CBaseObject*)m_pItems->At(i);
                S    = pObj->Description;
                S.TrimRight(TRIM_ALL);
                S << EOL_FILE;
                F.WriteBuf(S.GetData(), S.GetLength());
            }
            F.Close();
        }
        else
            wxMessageBox(wxT("Can not open file"));

    }

}
开发者ID:erwin47,项目名称:alh,代码行数:37,代码来源:utildlgs.cpp

示例6: wxGetCwd

void PGM_BASE::saveCommonSettings()
{
    // m_common_settings is not initialized until fairly late in the
    // process startup: initPgm(), so test before using:
    if( m_common_settings )
    {
        wxString cur_dir = wxGetCwd();

        m_common_settings->Write( workingDirKey, cur_dir );
        m_common_settings->Write( showEnvVarWarningDialog, m_show_env_var_dialog );

        // Save the local environment variables.
        m_common_settings->SetPath( pathEnvVariables );

        for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )
        {
            wxLogTrace( traceEnvVars, wxT( "Saving environment varaiable config entry %s as %s" ),
                        GetChars( it->first ),  GetChars( it->second.GetValue() ) );
            m_common_settings->Write( it->first, it->second.GetValue() );
        }

        m_common_settings->SetPath( wxT( ".." ) );
    }
}
开发者ID:chgans,项目名称:kicad,代码行数:24,代码来源:pgm_base.cpp

示例7: ClearOutputWindow

void CscopePlugin::DoCscopeCommand(const wxString &cmd, const wxString &endMsg)
{
    ClearOutputWindow();
	MakeOutputPaneVisible();
	m_CscouptOutput.clear();

    cbProject * prj = Manager::Get()->GetProjectManager()->GetActiveProject();
    wxString path;
    if ( prj )
        path = prj->GetBasePath();

    Manager::Get()->GetLogManager()->Log(cmd);
    m_EndMsg = endMsg;

    if ( m_pProcess ) return;


    wxString curDir = wxGetCwd();
	wxSetWorkingDirectory(path);
    //set environment variables for cscope
	wxSetEnv(_T("TMPDIR"), _T("."));

    m_view->GetWindow()->SetMessage(_T("Executing cscope..."), 10);

	m_pProcess = new CscopeProcess(this);
    if ( !wxExecute(cmd, wxEXEC_ASYNC|wxEXEC_MAKE_GROUP_LEADER, m_pProcess) )
    {
        delete m_pProcess;
        m_pProcess = NULL;
        m_view->GetWindow()->SetMessage(_T("Error while calling cscope occurred!"), 0);
    }

    //set environment variables back
    Manager::Get()->GetLogManager()->Log(_T("cscope process started"));
    wxSetWorkingDirectory(curDir);
}
开发者ID:jenslody,项目名称:codeblocks,代码行数:36,代码来源:CscopePlugin.cpp

示例8: WXUNUSED

void MyFrame::OnPDF(wxCommandEvent& WXUNUSED(event))
{
  wxFileName fileName;
  fileName.SetPath(wxGetCwd());
  fileName.SetFullName(wxT("default.pdf"));
  wxPrintData printData;
  printData.SetOrientation(wxPORTRAIT);
  printData.SetPaperId(wxPAPER_A4);
  printData.SetFilename(fileName.GetFullPath());
  {
    wxPdfDC dc(printData);
    bool ok = dc.StartDoc(_("Printing ..."));
    if (ok)
    {
      dc.StartPage();
      Draw(dc);
      dc.EndPage();
      dc.EndDoc();
    }
  }
#if defined(__WXMSW__)
  ShellExecute(NULL, _T("open"), fileName.GetFullPath(), _T(""), _T(""), 0);
#endif
}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:24,代码来源:printing.cpp

示例9: SaveAbstractLayer

//Helper
bool SaveAbstractLayer(vtAbstractLayer *alay, bool bAskFilename)
{
	vtFeatureSet *fset = alay->GetFeatureSet();
	vtString fname = fset->GetFilename();

	if (bAskFilename)
	{
		// save current directory
		wxString path = wxGetCwd();

		wxString default_file(StartOfFilename(fname), wxConvUTF8);
		wxString default_dir(ExtractPath(fname, false), wxConvUTF8);

		EnableContinuousRendering(false);
		wxFileDialog saveFile(NULL, _("Save Abstract Data"), default_dir,
			default_file, FSTRING_SHP, wxFD_SAVE);
		bool bResult = (saveFile.ShowModal() == wxID_OK);
		EnableContinuousRendering(true);
		if (!bResult)
		{
			wxSetWorkingDirectory(path);	// restore
			return false;
		}
		wxString str = saveFile.GetPath();
		fname = str.mb_str(wxConvUTF8);
		fset->SetFilename(fname);
	}
	bool success = fset->SaveToSHP(fname);

	if (success)
		alay->SetModified(false);
	else
		wxMessageBox(_("Couldn't save layer."));

	return success;
}
开发者ID:kamalsirsa,项目名称:vtp,代码行数:37,代码来源:LayerDlg.cpp

示例10: WXUNUSED

    void MainFrame::loadPopulation(wxCommandEvent& WXUNUSED(event))
    {
        if (experimentRun.isStarted())
            {}
        else
        {
            wxFileDialog loadParametersDialog(
                this,
                _T("Choose a Population File"),
                wxGetCwd(),
                _T(""),
                _T("*.xml;*.gz"),
                wxOPEN|wxFILE_MUST_EXIST
            );

            int retVal = loadParametersDialog.ShowModal();

            if (retVal==wxID_OK)
            {
                cout_ << "Loading population file: " << WXSTRING_TO_STRING(loadParametersDialog.GetPath()) << endl;

                populationFileName = WXSTRING_TO_STRING(loadParametersDialog.GetFilename());

                experimentRun.setupExperimentInProgress(
                    WXSTRING_TO_STRING(loadParametersDialog.GetPath()),
                    WXSTRING_TO_STRING(loadParametersDialog.GetPath())+string(".new")
                );

                fileMenu->FindItem(wxID_RUNEXPERIMENT_MENUITEM)->Enable(true);
                int genCount = experimentRun.getPopulation()->getGenerationCount();
                updateNumGenerations(genCount);
                setPopulationSize(int(NEAT::Globals::getSingleton()->getParameterValue("PopulationSize")));
                return;
            }
        }
    }
开发者ID:GiorgosMethe,项目名称:Soft-Robots-Novelty-Search,代码行数:36,代码来源:HCUBE_MainFrame.cpp

示例11: MyDirGuard

 MyDirGuard() : _d( wxGetCwd() ) {}
开发者ID:Bloodknight,项目名称:codelite,代码行数:1,代码来源:winprocess_impl.cpp

示例12: wxASSERT_MSG

bool wxGenericFileCtrl::Create( wxWindow *parent,
                                wxWindowID id,
                                const wxString& defaultDirectory,
                                const wxString& defaultFileName,
                                const wxString& wildCard,
                                long style,
                                const wxPoint& pos,
                                const wxSize& size,
                                const wxString& name )
{
    this->m_style = style;
    m_inSelected = false;
    m_noSelChgEvent = false;
    m_check = NULL;

    // check that the styles are not contradictory
    wxASSERT_MSG( !( ( m_style & wxFC_SAVE ) && ( m_style & wxFC_OPEN ) ),
                  wxT( "can't specify both wxFC_SAVE and wxFC_OPEN at once" ) );

    wxASSERT_MSG( !( ( m_style & wxFC_SAVE ) && ( m_style & wxFC_MULTIPLE ) ),
                  wxT( "wxFC_MULTIPLE can't be used with wxFC_SAVE" ) );

    wxNavigationEnabled<wxControl>::Create( parent, id,
                                            pos, size,
                                            wxTAB_TRAVERSAL,
                                            wxDefaultValidator,
                                            name );

    m_dir = defaultDirectory;

    m_ignoreChanges = true;

    if ( ( m_dir.empty() ) || ( m_dir == wxT( "." ) ) )
    {
        m_dir = wxGetCwd();
        if ( m_dir.empty() )
            m_dir = wxFILE_SEP_PATH;
    }

    const size_t len = m_dir.length();
    if ( ( len > 1 ) && ( wxEndsWithPathSeparator( m_dir ) ) )
        m_dir.Remove( len - 1, 1 );

    m_filterExtension = wxEmptyString;

    // layout

    const bool is_pda = ( wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA );

    wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );

    wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL );
    if ( is_pda )
        staticsizer->Add( new wxStaticText( this, wxID_ANY, _( "Current directory:" ) ),
                          wxSizerFlags().DoubleBorder(wxRIGHT) );
    m_static = new wxStaticText( this, wxID_ANY, m_dir );
    staticsizer->Add( m_static, 1 );
    mainsizer->Add( staticsizer, wxSizerFlags().Expand().Border());

    long style2 = wxLC_LIST;
    if ( !( m_style & wxFC_MULTIPLE ) )
        style2 |= wxLC_SINGLE_SEL;

#ifdef __WXWINCE__
    style2 |= wxSIMPLE_BORDER;
#else
    style2 |= wxSUNKEN_BORDER;
#endif

    m_list = new wxFileListCtrl( this, ID_FILELIST_CTRL,
                                 wxEmptyString, false,
                                 wxDefaultPosition, wxSize( 400, 140 ),
                                 style2 );

    m_text = new wxTextCtrl( this, ID_TEXT, wxEmptyString,
                             wxDefaultPosition, wxDefaultSize,
                             wxTE_PROCESS_ENTER );
    m_choice = new wxChoice( this, ID_CHOICE );

    if ( is_pda )
    {
        // PDAs have a different screen layout
        mainsizer->Add( m_list, wxSizerFlags( 1 ).Expand().HorzBorder() );

        wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
        textsizer->Add( m_text, wxSizerFlags( 1 ).Centre().Border() );
        textsizer->Add( m_choice, wxSizerFlags( 1 ).Centre().Border() );
        mainsizer->Add( textsizer, wxSizerFlags().Expand() );

    }
    else // !is_pda
    {
        mainsizer->Add( m_list, wxSizerFlags( 1 ).Expand().Border() );
        mainsizer->Add( m_text, wxSizerFlags().Expand().Border() );

        wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL );
        choicesizer->Add( m_choice, wxSizerFlags( 1 ).Centre() );

        if ( !( m_style & wxFC_NOSHOWHIDDEN ) )
        {
//.........这里部分代码省略.........
开发者ID:chromylei,项目名称:third_party,代码行数:101,代码来源:filectrlg.cpp

示例13: wxStringTokenize

void EnvVarsTableDlg::OnExport(wxCommandEvent& event)
{
    int selection = m_notebook1->GetSelection();
    if(selection == wxNOT_FOUND)
        return;

#ifdef __WXMSW__
    bool isWindows = true;
#else
    bool isWindows = false;
#endif

    wxString text;
    if(selection == 0) {
        text = m_textCtrlDefault->GetText();
    } else {
        EnvVarSetPage* page = dynamic_cast<EnvVarSetPage*>(m_notebook1->GetPage((size_t)selection));
        if(page) {
            text = page->m_textCtrl->GetText();
        }
    }

    if(text.IsEmpty())
        return;

    wxArrayString lines = wxStringTokenize(text, wxT("\r\n"), wxTOKEN_STRTOK);
    wxString envfile;
    if(isWindows) {
        envfile << wxT("environment.bat");
    } else {
        envfile << wxT("environment");
    }

    wxFileName fn(wxGetCwd(), envfile);
    wxFFile fp(fn.GetFullPath(), wxT("w+b"));
    if(fp.IsOpened() == false) {
        wxMessageBox(wxString::Format(_("Failed to open file: '%s' for write"), fn.GetFullPath().c_str()),
                     wxT("CodeLite"),
                     wxOK | wxCENTER | wxICON_WARNING);
        return;
    }

    for(size_t i = 0; i < lines.GetCount(); i++) {

        wxString sLine = lines.Item(i).Trim().Trim(false);
        if(sLine.IsEmpty())
            continue;

        static wxRegEx reVarPattern(wxT("\\$\\(( *)([a-zA-Z0-9_]+)( *)\\)"));
        if(isWindows) {
            while(reVarPattern.Matches(sLine)) {
                wxString varName = reVarPattern.GetMatch(sLine, 2);
                wxString text = reVarPattern.GetMatch(sLine);
                sLine.Replace(text, wxString::Format(wxT("%%%s%%"), varName.c_str()));
            }
            sLine.Prepend(wxT("set "));
            sLine.Append(wxT("\r\n"));

        } else {
            while(reVarPattern.Matches(sLine)) {
                wxString varName = reVarPattern.GetMatch(sLine, 2);
                wxString text = reVarPattern.GetMatch(sLine);
                sLine.Replace(text, wxString::Format(wxT("$%s"), varName.c_str()));
            }
            sLine.Prepend(wxT("export "));
            sLine.Append(wxT("\n"));
        }
        fp.Write(sLine);
    }

    wxMessageBox(wxString::Format(_("Environment exported to: '%s' successfully"), fn.GetFullPath().c_str()),
                 wxT("CodeLite"));
}
开发者ID:chhlatnash,项目名称:codelite,代码行数:73,代码来源:envvar_table.cpp

示例14: wxGetCwd

// Loads bitmaps
bool wxEmulatorInfo::Load(const wxString& appDir)
{
    // Try to find absolute path
    wxString absoluteConfigPath = m_emulatorFilename;
    if ( !::wxIsAbsolutePath(absoluteConfigPath) )
    {
        wxString currDir = wxGetCwd();
        absoluteConfigPath = currDir + wxString(wxFILE_SEP_PATH) + m_emulatorFilename;
        if ( !wxFile::Exists(absoluteConfigPath) )
        {
            absoluteConfigPath = appDir + wxString(wxFILE_SEP_PATH)
                + m_emulatorFilename;
        }
    }

    if ( !wxFile::Exists(absoluteConfigPath) )
    {
        wxString str;
        str.Printf( wxT("Could not find config file %s"),
            absoluteConfigPath.c_str() );

        wxMessageBox(str);
        return false;
    }

    wxString rootPath = wxPathOnly(absoluteConfigPath);

    {
        wxFileConfig config(wxT("wxEmulator"), wxT("wxWidgets"),
            absoluteConfigPath, wxEmptyString, wxCONFIG_USE_LOCAL_FILE);

        config.Read(wxT("/General/title"), & m_emulatorTitle);
        config.Read(wxT("/General/description"), & m_emulatorDescription);
        config.Read(wxT("/General/backgroundBitmap"), & m_emulatorBackgroundBitmapName);

        wxString colString;
        if (config.Read(wxT("/General/backgroundColour"), & colString) ||
            config.Read(wxT("/General/backgroundColor"), & colString)
           )
        {
            m_emulatorBackgroundColour = wxHexStringToColour(colString);
        }

        int x = 0, y = 0, w = 0, h = 0, dw = 0, dh = 0;
        config.Read(wxT("/General/screenX"), & x);
        config.Read(wxT("/General/screenY"), & y);
        config.Read(wxT("/General/screenWidth"), & w);
        config.Read(wxT("/General/screenHeight"), & h);
        if (config.Read(wxT("/General/deviceWidth"), & dw) && config.Read(wxT("/General/deviceHeight"), & dh))
        {
            m_emulatorDeviceSize = wxSize(dw, dh);
        }

        m_emulatorScreenPosition = wxPoint(x, y);
        m_emulatorScreenSize = wxSize(w, h);
    }

    if (!m_emulatorBackgroundBitmapName.empty())
    {
        wxString absoluteBackgroundBitmapName = rootPath + wxString(wxFILE_SEP_PATH) + m_emulatorBackgroundBitmapName;
        if ( !wxFile::Exists(absoluteBackgroundBitmapName) )
        {
            wxString str;
            str.Printf( wxT("Could not find bitmap %s"),
                absoluteBackgroundBitmapName.c_str() );
            wxMessageBox(str);
            return false;
        }

        wxBitmapType type = wxDetermineImageType(m_emulatorBackgroundBitmapName);
        if (type == wxBITMAP_TYPE_INVALID)
            return false;

        if (!m_emulatorBackgroundBitmap.LoadFile(m_emulatorBackgroundBitmapName, type))
        {
            wxString str;
            str.Printf( wxT("Could not load bitmap file %s"),
                m_emulatorBackgroundBitmapName.c_str() );
            wxMessageBox(str);
            return false;
        }

        m_emulatorDeviceSize = wxSize(m_emulatorBackgroundBitmap.GetWidth(),
            m_emulatorBackgroundBitmap.GetHeight());
    }
    return true;
}
开发者ID:mark711,项目名称:Cafu,代码行数:88,代码来源:emulator.cpp

示例15: wxInitAllImageHandlers

// 'Main program' equivalent: the program execution "starts" here
bool wxEmulatorApp::OnInit()
{
#if wxUSE_LOG
    wxLog::DisableTimestamp();
#endif // wxUSE_LOG
    wxInitAllImageHandlers();

    wxString currentDir = wxGetCwd();

    // Use argv to get current app directory
    m_appDir = wxFindAppPath(argv[0], currentDir, wxT("WXEMUDIR"));

    // If the development version, go up a directory.
#ifdef __WXMSW__
    if ((m_appDir.Right(5).CmpNoCase(wxT("DEBUG")) == 0) ||
        (m_appDir.Right(11).CmpNoCase(wxT("DEBUGSTABLE")) == 0) ||
        (m_appDir.Right(7).CmpNoCase(wxT("RELEASE")) == 0) ||
        (m_appDir.Right(13).CmpNoCase(wxT("RELEASESTABLE")) == 0)
        )
        m_appDir = wxPathOnly(m_appDir);
#endif

    // Parse the command-line parameters and options
    wxCmdLineParser parser(sg_cmdLineDesc, argc, argv);
    int res;
    {
        wxLogNull log;
        res = parser.Parse();
    }
    if (res == -1 || res > 0 || parser.Found(wxT("h")))
    {
#ifdef __X__
        wxLog::SetActiveTarget(new wxLogStderr);
#endif
        parser.Usage();
        return false;
    }
    if (parser.Found(wxT("v")))
    {
#ifdef __X__
        wxLog::SetActiveTarget(new wxLogStderr);
#endif
        wxString msg;
        msg.Printf(wxT("wxWidgets PDA Emulator (c) Julian Smart, 2002 Version %.2f, %s"), wxEMULATOR_VERSION, __DATE__);
        wxLogMessage(msg);
        return false;
    }
    if (parser.Found(wxT("u"), & m_displayNumber))
    {
        // Should only be number, so strip out anything before
        // and including a : character
        if (m_displayNumber.Find(wxT(':')) != -1)
        {
            m_displayNumber = m_displayNumber.AfterFirst(wxT(':'));
        }
    }
    if (parser.GetParamCount() == 0)
    {
        m_emulatorInfo.m_emulatorFilename = wxT("default.wxe");
    }
    else if (parser.GetParamCount() > 0)
    {
        m_emulatorInfo.m_emulatorFilename = parser.GetParam(0);
    }

    // Load the emulation info
    if (!LoadEmulator(m_appDir))
    {
        //wxMessageBox(wxT("Sorry, could not load this emulator. Please check bitmaps are valid."));
        return false;
    }

    // create the main application window
    wxEmulatorFrame *frame = new wxEmulatorFrame(wxT("wxEmulator"),
                                 wxPoint(50, 50), wxSize(450, 340));

#if wxUSE_STATUSBAR
    frame->SetStatusText(m_emulatorInfo.m_emulatorTitle, 0);

    wxString sizeStr;
    sizeStr.Printf(wxT("Screen: %dx%d"), (int) m_emulatorInfo.m_emulatorScreenSize.x,
            (int) m_emulatorInfo.m_emulatorScreenSize.y);
    frame->SetStatusText(sizeStr, 1);
#endif // wxUSE_STATUSBAR

    m_containerWindow = new wxEmulatorContainer(frame, wxID_ANY);

    frame->SetClientSize(m_emulatorInfo.m_emulatorDeviceSize.x,
                         m_emulatorInfo.m_emulatorDeviceSize.y);

    // and show it (the frames, unlike simple controls, are not shown when
    // created initially)
    frame->Show(true);

#ifdef __WXX11__
    m_xnestWindow = new wxAdoptedWindow;

    wxString cmd;
    cmd.Printf(wxT("Xnest :%s -geometry %dx%d"),
//.........这里部分代码省略.........
开发者ID:mark711,项目名称:Cafu,代码行数:101,代码来源:emulator.cpp


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