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


C++ PART_LIB::GetFullFileName方法代码示例

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


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

示例1: DisplayLibInfos

void LIB_EDIT_FRAME::DisplayLibInfos()
{
    PART_LIB* lib = GetCurLib();
    wxString title = wxString::Format( L"Part Library Editor \u2014 %s%s",
            lib ? lib->GetFullFileName() : _( "no library selected" ),
            lib && lib->IsReadOnly() ? _( " [Read Only] ") : wxString( wxEmptyString ) );

    SetTitle( title );
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:9,代码来源:libedit.cpp

示例2: DisplayLibInfos

void LIB_VIEW_FRAME::DisplayLibInfos()
{
    PART_LIBS*  libs = Prj().SchLibs();

    if( libs )
    {
        PART_LIB* lib = libs->FindLibrary( m_libraryName );

        wxString title = wxString::Format( "Library Browser \u2014 %s",
            lib ? lib->GetFullFileName() : "no library selected" );
        SetTitle( title );
    }
}
开发者ID:imr,项目名称:kicad-source-mirror,代码行数:13,代码来源:viewlibs.cpp

示例3: makeLibraries

XNODE* NETLIST_EXPORTER_GENERIC::makeLibraries()
{
    XNODE*  xlibs = node( wxT( "libraries" ) );     // auto_ptr

    for( std::set<void*>::iterator it = m_Libraries.begin(); it!=m_Libraries.end();  ++it )
    {
        PART_LIB*    lib = (PART_LIB*) *it;
        XNODE*      xlibrary;

        xlibs->AddChild( xlibrary = node( wxT( "library" ) ) );
        xlibrary->AddAttribute( wxT( "logical" ), lib->GetLogicalName() );
        xlibrary->AddChild( node( wxT( "uri" ),  lib->GetFullFileName() ) );

        // @todo: add more fun stuff here
    }

    return xlibs;
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:18,代码来源:netlist_exporter_generic.cpp

示例4: SaveActiveLibrary

bool LIB_EDIT_FRAME::SaveActiveLibrary( bool newFile )
{
    wxFileName fn;
    wxString   msg;

    m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );

    PART_LIB* lib = GetCurLib();

    // Just in case the library hasn't been cached yet.
    lib->GetCount();

    if( !lib )
    {
        DisplayError( this, _( "No library specified." ) );
        return false;
    }

    wxString oldFileName = lib->GetFullFileName();

    if( GetScreen()->IsModify() )
    {
        if( IsOK( this, _( "Include last component changes?" ) ) )
        {
            lib->EnableBuffering();

            try
            {
                SaveOnePart( lib, false );
            }
            catch( ... )
            {
                lib->EnableBuffering( false );
                msg.Printf( _( "Unexpected error occured saving part to '%s' symbol library." ),
                            lib->GetName() );
                DisplayError( this, msg );
                return false;
            }

            lib->EnableBuffering( false );
        }
    }

    if( newFile )
    {
        PROJECT&        prj = Prj();
        SEARCH_STACK*   search = prj.SchSearchS();

        // Get a new name for the library
        wxString default_path = prj.GetRString( PROJECT::SCH_LIB_PATH );

        if( !default_path )
            default_path = search->LastVisitedPath();

        wxFileDialog dlg( this, _( "Part Library Name:" ), default_path,
                          wxEmptyString, SchematicLibraryFileWildcard,
                          wxFD_SAVE | wxFD_OVERWRITE_PROMPT );

        if( dlg.ShowModal() == wxID_CANCEL )
            return false;

        fn = dlg.GetPath();

        // The GTK file chooser doesn't return the file extension added to
        // file name so add it here.
        if( fn.GetExt().IsEmpty() )
            fn.SetExt( SchematicLibraryFileExtension );

        prj.SetRString( PROJECT::SCH_LIB_PATH, fn.GetPath() );
    }
    else
    {
        fn = wxFileName( lib->GetFullFileName() );

        msg.Printf( _( "Modify library file '%s' ?" ), GetChars( fn.GetFullPath() ) );

        if( !IsOK( this, msg ) )
            return false;
    }

    // Verify the user has write privileges before attempting to save the library file.
    if( !IsWritable( fn ) )
        return false;

    ClearMsgPanel();

    wxFileName libFileName = fn;
    wxFileName backupFileName = fn;

    // Rename the old .lib file to .bak.
    if( libFileName.FileExists() )
    {
        backupFileName.SetExt( "bak" );

        if( backupFileName.FileExists() )
            wxRemoveFile( backupFileName.GetFullPath() );

        if( !wxRenameFile( libFileName.GetFullPath(), backupFileName.GetFullPath() ) )
        {
            libFileName.MakeAbsolute();
//.........这里部分代码省略.........
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:101,代码来源:libedit.cpp


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