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


C++ wxString::GetData方法代码示例

本文整理汇总了C++中wxString::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::GetData方法的具体用法?C++ wxString::GetData怎么用?C++ wxString::GetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxString的用法示例。


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

示例1: wxrubyAssert

NORETURN(void wxrubyAssert(const wxString& file,
                                  int line,
                                  const wxString& func,
                                  const wxString& cond,
                                  const wxString& msg)
{
	rb_fatal("(%s) in %s \n %s",
		cond.GetData().AsChar(),
		func.GetData().AsChar(),
		msg.GetData().AsChar()
		);
})
开发者ID:Hanmac,项目名称:rwx,代码行数:12,代码来源:wxError.cpp

示例2: init

void PARSE_ERROR::init( const char* aThrowersFile, const char* aThrowersLoc,
           const wxString& aMsg, const wxString& aSource,
           const char* aInputLine,
           int aLineNumber, int aByteIndex )
{
    // save inpuLine, lineNumber, and offset for UI (.e.g. Sweet text editor)
    inputLine  = aInputLine;
    lineNumber = aLineNumber;
    byteIndex  = aByteIndex;

    errorText.Printf( PARSE_FORMAT, aMsg.GetData(), aSource.GetData(),
        aLineNumber, aByteIndex,
        wxString::FromUTF8( aThrowersFile ).GetData(),
        wxString::FromUTF8( aThrowersLoc ).GetData() );
}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:15,代码来源:richio.cpp

示例3: GetFileName

// ----------------------------------------------------------------------------
void SettingsDlg::GetFileName(wxString& newFileName)
// ----------------------------------------------------------------------------
{
    newFileName = wxEmptyString;

    // Ask user for filename
    wxFileDialog dlg(this,                      //parent  window
                 _T("Select file "),             //message
                 wxEmptyString,                 //default directory
                 wxEmptyString,                 //default file
                 wxT("*.*"),                    //wildcards
                 wxFD_OPEN | wxFD_FILE_MUST_EXIST );  //style

   // move dialog into the parents frame space
    wxPoint mousePosn = ::wxGetMousePosition();
    (&dlg)->Move(mousePosn.x, mousePosn.y);

    if (dlg.ShowModal() != wxID_OK) return;
    newFileName = dlg.GetPath();

    #ifdef LOGGING
     LOGIT( _T("New filename[%s]"), newFileName.GetData() );
    #endif //LOGGING;

}
开发者ID:stahta01,项目名称:codeAdapt_IDE,代码行数:26,代码来源:settingsdlg.cpp

示例4: OnInit

bool WinEDA_App::OnInit(void)
{
wxString msg;
wxString currCWD = wxGetCwd();

	EDA_Appl = this;
	InitEDA_Appl( wxT("cvpcb") );

    if ( m_Checker && m_Checker->IsAnotherRunning() ) 
    { 
        if ( ! IsOK(NULL, _("Cvpcb is already running, Continue?") ) )
			return false; 
    }
	
	GetSettings();					// read current setup

	wxSetWorkingDirectory(currCWD); // mofifie par GetSetting
	SetRealLibraryPath( wxT("modules") );

	if(argc > 1 )
		{
		NetInNameBuffer = argv[1];
		NetNameBuffer = argv[1];
		}

	if ( ! NetInNameBuffer.IsEmpty() )
		wxSetWorkingDirectory( wxPathOnly(NetInNameBuffer) );
	g_DrawBgColor = BLACK;

	Read_Config(NetInNameBuffer);

	m_CvpcbFrame = new WinEDA_CvpcbFrame(this, Main_Title);

	msg.Printf( wxT("Modules: %d"), nblib);
	m_CvpcbFrame->SetStatusText(msg,2);

	// Show the frame
	SetTopWindow(m_CvpcbFrame);

	m_CvpcbFrame->Show(TRUE);

	listlib();
	m_CvpcbFrame->BuildModListBox();

	if( ! NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
		{
		FFileName = MakeFileName(NetDirBuffer,
							NetInNameBuffer, NetInExtBuffer);

		m_CvpcbFrame->ReadNetListe();
		}
	else		/* Mise a jour du titre de la fenetre principale */
		{
 		msg.Printf( wxT("%s {%s%c} [no file]"),
			Main_Title.GetData(), wxGetCwd().GetData(), DIR_SEP);
		m_CvpcbFrame->SetTitle(msg);
		}

  return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:60,代码来源:cvpcb.cpp

示例5: wxFrame

ViewFrame::ViewFrame(const wxString& filepath)
    : wxFrame(NULL, wxID_ANY, filepath, wxDefaultPosition, wxSize(250, 150))
{
    frozen = false;

    wxMenuBar* menubar = new wxMenuBar();
    wxMenu* filemenu = new wxMenu();

    filemenu->Append(wxID_OPEN, "Open\tCtrl-O");
    filemenu->Append(wxID_CLOSE, "Close Window\tCtrl-W");
    filemenu->Append(wxID_EXIT, "Quit\tCtrl-Q");
    menubar->Append(filemenu, "File");

    SetMenuBar(menubar);

    MarkdownRenderer renderer;

    viewer = wxWebView::New(this, wxID_ANY);
    if(!renderer.render(filepath.GetData())) {
        std::cerr << renderer.getErrMsg() << std::endl;
        return;
    }
    viewer->SetPage(renderer.getData(), filepath);
    frozen = true;

    Centre();

    Show(true);
}
开发者ID:kimhyunkang,项目名称:markview,代码行数:29,代码来源:viewframe.cpp

示例6: sprintPinNetName

void NETLIST_EXPORTER::sprintPinNetName( wxString& aResult,
                                    const wxString& aNetNameFormat, NETLIST_OBJECT* aPin,
                                    bool aUseNetcodeAsNetName )
{
    int netcode = aPin->GetNet();

    // Not wxString::Clear(), which would free memory.  We want the worst
    // case wxString memory to grow to avoid reallocation from within the
    // caller's loop.
    aResult.Empty();

    if( netcode != 0 && aPin->GetConnectionType() == PAD_CONNECT )
    {
        if( aUseNetcodeAsNetName )
        {
            aResult.Printf( wxT("%d"), netcode );
        }
        else
        {
        aResult = aPin->GetNetName();

        if( aResult.IsEmpty() )     // No net name: give a name from net code
            aResult.Printf( aNetNameFormat.GetData(), netcode );
        }
    }
}
开发者ID:morio,项目名称:kicad-source-mirror,代码行数:26,代码来源:netlist_exporter.cpp

示例7: GetActualContextForMacro

bool Tokenizer::GetActualContextForMacro(Token* tk, wxString& actualContext)
{
    // e.g. "#define AAA AAA" and usage "AAA(x)"
    if (!tk || tk->m_Name == tk->m_Type)
        return false;

    // 1. break the args into substring with ","
    wxArrayString formalArgs;
    if (ReplaceBufferForReparse(tk->m_Args, false))
        SpliteArguments(formalArgs);

    // 2. splite the actual macro arguments
    wxArrayString actualArgs;
    if (!formalArgs.IsEmpty()) // e.g. #define AAA(x) x \n #define BBB AAA \n BBB(int) variable;
        SpliteArguments(actualArgs);

    // 3. get actual context
    actualContext = tk->m_Type;
    const size_t totalCount = std::min(formalArgs.GetCount(), actualArgs.GetCount());
    for (size_t i = 0; i < totalCount; ++i)
    {
        TRACE(_T("GetActualContextForMacro(): The formal args are '%s' and the actual args are '%s'."),
              formalArgs[i].wx_str(), actualArgs[i].wx_str());

        wxChar* data = const_cast<wxChar*>((const wxChar*)actualContext.GetData());
        const wxChar* dataEnd = data + actualContext.Len();
        const wxChar* target = formalArgs[i].GetData();
        const int targetLen = formalArgs[i].Len();

        wxString alreadyReplaced;
        alreadyReplaced.Alloc(actualContext.Len() * 2);

        while (true)
        {
            const int pos = GetFirstTokenPosition(data, dataEnd - data, target, targetLen);
            if (pos != -1)
            {
                alreadyReplaced << wxString(data, pos) << actualArgs[i];
                data += pos + targetLen;
                if (data == dataEnd)
                    break;
            }
            else
            {
                alreadyReplaced << data;
                break;
            }
        }

        actualContext = alreadyReplaced;
    }

    // 4. erease string "##"
    actualContext.Replace(_T("##"), wxEmptyString);

    TRACE(_T("The replaced actual context are '%s'."), actualContext.wx_str());
    return true;
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:58,代码来源:tokenizer.cpp

示例8: init

void IO_ERROR::init( const char* aThrowersFile, const char* aThrowersLoc, const wxString& aMsg )
{
    // The throwers filename is a full filename, depending on Kicad source location.
    // a short filename will be printed (it is better for user, the full filename has no meaning).
    wxString srcname = wxString::FromUTF8( aThrowersFile );

    errorText.Printf( IO_FORMAT, aMsg.GetData(),
        srcname.AfterLast( '/' ).GetData(),
        wxString::FromUTF8( aThrowersLoc ).GetData() );
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:10,代码来源:richio.cpp

示例9: SelectTagsByFile

wxSQLite3ResultSet TagsDatabase::SelectTagsByFile(const wxString& file, const wxFileName& path)
{
	// Incase empty file path is provided, use the current file name
	wxFileName databaseFileName(path);
	path.IsOk() == false ? databaseFileName = m_fileName : databaseFileName = path;
	OpenDatabase(databaseFileName);

	wxString query;
	query = wxString::Format(_T("select * from tags where file='%s';"), file.GetData());
	return m_db->ExecuteQuery(query.GetData());
}
开发者ID:BackupTheBerlios,项目名称:codelite-svn,代码行数:11,代码来源:tags_database.cpp

示例10: OnDropText

// ----------------------------------------------------------------------------
bool SnippetDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data)
// ----------------------------------------------------------------------------
{
    // Put dragged text into SnippetTextCtrl
    #ifdef LOGGING
     LOGIT( _T("Dragged Data[%s]"), data.GetData() );
    #endif //LOGGING
    //m_Window->m_SnippetEditCtrl->WriteText(data);
    m_Window->m_SnippetEditCtrl->AddText(data);
    return true;

} // end of OnDropText
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:13,代码来源:snippetproperty.cpp

示例11: MakeCommandLine

wxString NETLIST_EXPORTER::MakeCommandLine( const wxString& aFormatString,
            const wxString& aTempfile, const wxString& aFinalFile, const wxString& aProjectPath )
{
    wxString    ret  = aFormatString;
    wxFileName  in   = aTempfile;
    wxFileName  out  = aFinalFile;

    ret.Replace( wxT( "%P" ), aProjectPath.GetData(), true );
    ret.Replace( wxT( "%B" ), out.GetName().GetData(), true );
    ret.Replace( wxT( "%I" ), in.GetFullPath().GetData(), true );
    ret.Replace( wxT( "%O" ), out.GetFullPath().GetData(), true );

    return ret;
}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:14,代码来源:netlist_exporter.cpp

示例12: StringToColor

//-----------------------------------------------------------------------------
wxColor Property::StringToColor (wxString strColor)
{
	std::string stdStrColor(strColor.GetData());
	std::string::size_type posK0 = stdStrColor.find_first_of("(");
	std::string::size_type posD0 = stdStrColor.find_first_of(",");
	std::string strRed = stdStrColor.substr(posK0+1, posD0-posK0-1);
	std::string::size_type posD1 = stdStrColor.find_last_of(",");
	std::string::size_type posK1 = stdStrColor.find_first_of(")");
	std::string strGreen = stdStrColor.substr(posD0+1, posD1-posD0-1);
	std::string strBlue = stdStrColor.substr(posD1+1, posK1-posD1);
	int red = atoi(strRed.c_str());
	int green = atoi(strGreen.c_str());
	int blue = atoi(strBlue.c_str());

	return wxColor((unsigned char)red, (unsigned char)green,
		(unsigned char)blue);
}
开发者ID:ascetic85,项目名称:Phoenix3d,代码行数:18,代码来源:PX2Property.cpp

示例13: throw

FILE_LINE_READER::FILE_LINE_READER( const wxString& aFileName,
            unsigned aStartingLineNumber,
            unsigned aMaxLineLength ) throw( IO_ERROR ) :
    LINE_READER( aMaxLineLength ),
    iOwn( true )
{
    fp = wxFopen( aFileName, wxT( "rt" ) );
    if( !fp )
    {
        wxString msg = wxString::Format(
            _( "Unable to open filename '%s' for reading" ), aFileName.GetData() );
        THROW_IO_ERROR( msg );
    }

    source  = aFileName;
    lineNum = aStartingLineNumber;
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:17,代码来源:richio.cpp

示例14: if

static inline long parseInt( const wxString& aValue, double aScalar )
{
    double value = LONG_MAX;

    /*
     * In 2011 gEDA/pcb introduced values with units, like "10mm" or "200mil".
     * Unit-less values are still centimils (100000 units per inch), like with
     * the previous format.
     *
     * Distinction between the even older format (mils, 1000 units per inch)
     * and the pre-2011 format is done in ::parseMODULE already; the
     * distinction is by wether an object definition opens with '(' or '['.
     * All values with explicite unit open with a '[' so there's no need to
     * consider this distinction when parsing them.
     *
     * The solution here is to watch for a unit and, if present, convert the
     * value to centimils. All unit-less values are read unaltered. This way
     * the code below can contine to consider all read values to be in mils or
     * centimils. It also matches the strategy gEDA/pcb uses for backwards
     * compatibility with its own layouts.
     *
     * Fortunately gEDA/pcb allows only units 'mil' and 'mm' in files, see
     * definition of ALLOW_READABLE in gEDA/pcb's pcb_printf.h. So we don't
     * have to test for all 11 units gEDA/pcb allows in user dialogs.
     */
    if( aValue.EndsWith( wxT( "mm" ) ) )
    {
        aScalar *= 100000.0 / 25.4;
    }
    else if( aValue.EndsWith( wxT( "mil" ) ) )
    {
        aScalar *= 100.;
    }

    // This conversion reports failure on strings as simple as "1000", still
    // it returns the right result in &value. Thus, ignore the return value.
    aValue.ToCDouble(&value);
    if( value == LONG_MAX ) // conversion really failed
    {
        THROW_IO_ERROR( wxString::Format( _( "Cannot convert \"%s\" to an integer" ),
                                          aValue.GetData() ) );
        return 0;
    }

    return KiROUND( value * aScalar );
}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:46,代码来源:gpcb_plugin.cpp

示例15: FootprintDelete

void GPCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
                                   const PROPERTIES* aProperties )
{
    LOCALE_IO   toggle;     // toggles on, then off, the C locale.

    init( aProperties );

    cacheLib( aLibraryPath );

    if( !m_cache->IsWritable() )
    {
        THROW_IO_ERROR( wxString::Format( _( "Library '%s' is read only" ),
                                          aLibraryPath.GetData() ) );
    }

    m_cache->Remove( aFootprintName );
}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:17,代码来源:gpcb_plugin.cpp


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