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


C++ wxConfigBase::Read方法代码示例

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


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

示例1: installPluginsList

/* Read the initialized plugins in config and fill the list
 * of names
 */
void DIALOG_BOM::installPluginsList()
{
    wxString list, active_plugin_name;
    m_config->Read( BOM_PLUGINS_KEY, &list );
    m_config->Read( BOM_PLUGIN_SELECTED_KEY, &active_plugin_name );

    if( !list.IsEmpty() )
    {
        BOM_CFG_READER_PARSER cfg_parser( &m_plugins, TO_UTF8( list ),
                                          wxT( "plugins" ) );
        try
        {
            cfg_parser.Parse();
        }
        catch( const IO_ERROR& ioe )
        {
//            wxLogMessage( ioe.errorText );
        }
    }

    // Populate list box
    for( unsigned ii = 0; ii < m_plugins.GetCount(); ii+=2 )
    {
        m_lbPlugins->Append( m_plugins[ii] );

        if( active_plugin_name == m_plugins[ii] )
            m_lbPlugins->SetSelection( ii/2 );
    }

    pluginInit();
}
开发者ID:Elphel,项目名称:kicad-source-mirror,代码行数:34,代码来源:dialog_bom.cpp

示例2: initDialog

void DIALOG_GEN_MODULE_POSITION::initDialog()
{
    m_config = Kiface().KifaceSettings();
    m_config->Read( PLACEFILE_UNITS_KEY, &m_unitsOpt, 1 );
    m_config->Read( PLACEFILE_OPT_KEY, &m_fileOpt, 0 );

    // Output directory
    m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() );
    m_radioBoxUnits->SetSelection( m_unitsOpt );
    m_radioBoxFilesCount->SetSelection( m_fileOpt );

    m_sdbSizerButtonsOK->SetDefault();
}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:13,代码来源:gen_modules_placefile.cpp

示例3: Load

void wxFileHistoryBase::Load(const wxConfigBase& config)
{
    RemoveExistingHistory();

    m_fileHistory.Clear();

    wxString buf;
    buf.Printf(wxT("file%d"), 1);

    wxString historyFile;
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    while ((m_fileHistory.GetCount() < m_fileMaxFiles) &&
           config.Read(buf, &historyFile) && !historyFile.empty())
    {
        m_fileHistory.Add(historyFile);

        buf.Printf(wxT("file%d"), (int)m_fileHistory.GetCount()+1);
        historyFile = wxEmptyString;
    }

    AddFilesToMenu();
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:30,代码来源:filehistorycmn.cpp

示例4: InitValues

void DIALOG_PRINT_FOR_MODEDIT::InitValues( )
{
    // Read the scale adjust option
    int scale_Select = 3; // default selected scale = ScaleList[3] = 1

    if( m_config )
    {
        m_config->Read( OPTKEY_PRINT_MODULE_SCALE, &scale_Select );
        m_config->Read( OPTKEY_PRINT_MONOCHROME_MODE, &s_Parameters.m_Print_Black_and_White, 1);
    }

    s_Parameters.m_PenDefaultSize = g_DrawDefaultLineThickness;
    m_ScaleOption->SetSelection( scale_Select );

    if( s_Parameters.m_Print_Black_and_White )
        m_ModeColorOption->SetSelection( 1 );
}
开发者ID:RyuKojiro,项目名称:kicad-source-mirror,代码行数:17,代码来源:dialog_print_for_modedit.cpp

示例5: Load

void ButcherOptions::Load(wxConfigBase &config)
{
    long rlong;

    config.SetPath(wxT("/options"));
    config.Read(wxT("editmode"), &rlong, EM_ADVANCED);
    editmode_=static_cast<editmode_t>(rlong);
}
开发者ID:RangelReale,项目名称:htmlbutcher,代码行数:8,代码来源:BUtil.cpp

示例6: Kiface

    DIALOG_EXPORT_3DFILE( PCB_EDIT_FRAME* parent ) :
        DIALOG_EXPORT_3DFILE_BASE( parent )
    {
        m_parent = parent;
        m_config = Kiface().KifaceSettings();
        m_filePicker->SetFocus();
        m_config->Read( OPTKEY_OUTPUT_UNIT, &m_unitsOpt, 1 );
        m_config->Read( OPTKEY_3DFILES_OPT, &m_copy3DFilesOpt, false );
        m_config->Read( OPTKEY_USE_RELATIVE_PATHS, &m_useRelativePathsOpt, false );
        m_config->Read( OPTKEY_USE_PLAIN_PCB, &m_usePlainPCBOpt, false );
        m_config->Read( OPTKEY_VRML_REF_UNITS, &m_RefUnits, 0 );
        m_config->Read( OPTKEY_VRML_REF_X, &m_XRef, 0.0 );
        m_config->Read( OPTKEY_VRML_REF_Y, &m_YRef, 0.0 );
        m_rbSelectUnits->SetSelection( m_unitsOpt );
        m_cbCopyFiles->SetValue( m_copy3DFilesOpt );
        m_cbUseRelativePaths->SetValue( m_useRelativePathsOpt );
        m_cbPlainPCB->SetValue( m_usePlainPCBOpt );
        m_VRML_RefUnitChoice->SetSelection( m_RefUnits );
        wxString tmpStr;
        tmpStr << m_XRef;
        m_VRML_Xref->SetValue( tmpStr );
        tmpStr = wxT( "" );
        tmpStr << m_YRef;
        m_VRML_Yref->SetValue( tmpStr );
        m_sdbSizer1OK->SetDefault();

        // Now all widgets have the size fixed, call FinishDialogSettings
        FinishDialogSettings();

        Connect( ID_USE_ABS_PATH, wxEVT_UPDATE_UI,
                 wxUpdateUIEventHandler( DIALOG_EXPORT_3DFILE::OnUpdateUseRelativePath ) );
    }
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:32,代码来源:dialog_export_vrml.cpp

示例7: LoadFont

// Load and save font descriptions
bool wxWindowSettings::LoadFont(wxConfigBase& config, const wxString& windowName, wxFont& font)
{
    wxString pathBase(wxT("/Fonts/"));
    pathBase += windowName;
    pathBase += wxT("/");

    int pointSize, family, style, weight;
    bool underlined = FALSE;
    wxString faceName;

    if (!config.Read(pathBase + wxT("PointSize"), & pointSize))
        return FALSE;

    if (!config.Read(pathBase + wxT("Family"), & family))
        return FALSE;

    if (!config.Read(pathBase + wxT("Style"), & style))
        return FALSE;

    if (!config.Read(pathBase + wxT("Weight"), & weight))
        return FALSE;

    config.Read(pathBase + wxT("Underlined"), (bool*) & underlined);
    config.Read(pathBase + wxT("FaceName"), & faceName);

    wxFont font1(pointSize, family, style, weight, underlined, faceName);
    font = font1;

    return TRUE;    
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:31,代码来源:ecutils.cpp

示例8: Kiface

    DIALOG_EXPORT_IDF3( PCB_EDIT_FRAME* parent ) :
            DIALOG_EXPORT_IDF3_BASE( parent )
    {
        m_parent = parent;
        m_config = Kiface().KifaceSettings();
        SetFocus();
        m_idfThouOpt = false;
        m_config->Read( OPTKEY_IDF_THOU, &m_idfThouOpt );
        m_rbUnitSelection->SetSelection( m_idfThouOpt ? 1 : 0 );

        GetSizer()->SetSizeHints( this );
        Centre();
    }
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:13,代码来源:dialog_export_idf.cpp

示例9: LoadFileConfig

void wxSTEditorOptions::LoadFileConfig( wxConfigBase &config)
{
    wxFileHistory *fileHistory = GetFileHistory();
    if (!fileHistory)
        return;

    wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false);
    wxString value, key = configPath+wxT("/LastDir");
    if (config.Read(key, &value) && wxDirExists(value))
        SetDefaultFilePath(value);

    int n = 1;
    key = configPath + wxString::Format(wxT("/file%d"), n);
    while ((int(n-1) < fileHistory->GetMaxFiles()) && config.Read(key, &value) && (!value.IsEmpty()))
    {
        //value.Trim(false).Trim(true);
        if (!value.IsEmpty() && wxFileExists(value))
            fileHistory->AddFileToHistory(value);

        key = configPath + wxString::Format(wxT("/file%d"), ++n);
        value.Clear();
    }
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:23,代码来源:steopts.cpp

示例10: LoadConfig

bool wxSTEditorFindReplaceData::LoadConfig(wxConfigBase &config,
                                           const wxString &configPath)
{
    m_loaded_config = true; // maybe it failed, but we tried at least once

    wxString key = wxSTEditorOptions::FixConfigPath(configPath, false);
    long val;
    if (config.Read(key + wxT("/FindFlags"), &val))
    {
        SetFlags(int(val));
        return true;
    }
    return false;
}
开发者ID:Slulego,项目名称:GD,代码行数:14,代码来源:stefindr.cpp

示例11: LoadConfig

void wxSTEditorFrame::LoadConfig(wxConfigBase &config, const wxString &configPath_)
{
    wxString configPath = wxSTEditorOptions::FixConfigPath(configPath_, false);

    if (GetMenuBar() && GetMenuBar()->FindItem(ID_STF_SHOW_SIDEBAR))
    {
        long val = 0;
        if (config.Read(configPath + "/ShowSidebar", &val))
        {
            wxSTEditorMenuManager::DoCheckItem(NULL, GetMenuBar(), NULL,
                                               ID_STF_SHOW_SIDEBAR, val != 0);
            // send fake event to HandleEvent
            wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, ID_STF_SHOW_SIDEBAR);
            evt.SetInt(int(val));
            HandleMenuEvent(evt);
        }
    }

    wxString str;
    if (config.Read(configPath + "/FrameSize", &str))
    {
        wxRect rect = GetRect();
        long lrect[4] = { rect.x, rect.y, rect.width, rect.height };
        wxArrayString arrStr = wxStringTokenize(str, ",");
        if (arrStr.GetCount() == 4u)
        {
            for (size_t n = 0; n < 4; n++)
                arrStr[n].ToLong(&lrect[n]);

            wxRect cfgRect((int)lrect[0], (int)lrect[1], (int)lrect[2], (int)lrect[3]);
            cfgRect = cfgRect.Intersect(wxGetClientDisplayRect());

            if ((cfgRect != rect) && (cfgRect.width>=100) && (cfgRect.height>=100))
                SetSize(cfgRect);
        }
    }
}
开发者ID:burzumishi,项目名称:caprice32wx,代码行数:37,代码来源:steframe.cpp

示例12: LoadFileConfig

void wxSTEditorOptions::LoadFileConfig( wxConfigBase &config)
{
    const wxString oldpath = config.GetPath();
    wxFileHistory *fileHistory = GetFileHistory();
    if (!fileHistory)
        return;

    wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false);
    wxString value, key = configPath+wxT("/LastDir");
    if (config.Read(key, &value) && wxDirExists(value))
        SetDefaultFilePath(value);

    config.SetPath(configPath);
    fileHistory->Load(config);
    config.SetPath(oldpath);
}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:16,代码来源:steopts.cpp

示例13: Load

void FileHistory::Load(wxConfigBase & config, const wxString & group)
{
   mHistory.Clear();

   config.SetPath(group);

   wxString file;
   long ndx;
   bool got = config.GetFirstEntry(file, ndx);
   while (got) {
      AddFileToHistory(config.Read(file), false);
      got = config.GetNextEntry(file, ndx);
   }

   config.SetPath(wxT(".."));

   AddFilesToMenu();
}
开发者ID:LBoggino,项目名称:audacity,代码行数:18,代码来源:FileHistory.cpp

示例14: Load

void wxFileHistoryBase::Load(const wxConfigBase& config)
{
    m_fileHistory.Clear();

    wxString buf;
    buf.Printf(wxT("file%d"), 1);

    wxString historyFile;
    while ((m_fileHistory.GetCount() < m_fileMaxFiles) &&
           config.Read(buf, &historyFile) && !historyFile.empty())
    {
        m_fileHistory.Add(historyFile);

        buf.Printf(wxT("file%d"), (int)m_fileHistory.GetCount()+1);
        historyFile = wxEmptyString;
    }

    AddFilesToMenu();
}
开发者ID:Anonymous2,项目名称:project64,代码行数:19,代码来源:filehistorycmn.cpp

示例15: Kiface

    DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* parent ) :
            DIALOG_EXPORT_STEP_BASE( parent )
    {
        m_parent = parent;
        m_config = Kiface().KifaceSettings();
        SetFocus();
        m_useDrillOrg = false;
        m_config->Read( OPTKEY_STEP_USE_DRILL_ORG, &m_useDrillOrg );
        m_cbDrillOrigin->SetValue( m_useDrillOrg );
        m_useAuxOrg = false;
        m_config->Read( OPTKEY_STEP_USE_AUX_ORG, &m_useAuxOrg );
        m_cbAuxOrigin->SetValue( m_useAuxOrg );
        m_useUserOrg = false;
        m_config->Read( OPTKEY_STEP_USE_USER_ORG, &m_useUserOrg );
        m_cbUserOrigin->SetValue( m_useUserOrg );
        m_cbUserOrigin->Bind( wxEVT_CHECKBOX, &DIALOG_EXPORT_STEP::OnUserOriginSelect, this );
        m_config->Read( OPTKEY_STEP_UORG_UNITS, &m_OrgUnits, 0 );
        m_config->Read( OPTKEY_STEP_UORG_X, &m_XOrg, 0.0 );
        m_config->Read( OPTKEY_STEP_UORG_Y, &m_YOrg, 0.0 );
        m_config->Read( OPTKEY_STEP_NOVIRT, &m_noVirtual );
        m_cbRemoveVirtual->SetValue( m_noVirtual );

        m_STEP_OrgUnitChoice->SetSelection( m_OrgUnits );
        wxString tmpStr;
        tmpStr << m_XOrg;
        m_STEP_Xorg->SetValue( tmpStr );
        tmpStr = "";
        tmpStr << m_YOrg;
        m_STEP_Yorg->SetValue( tmpStr );

        if( m_useUserOrg )
        {
            m_STEP_OrgUnitChoice->Enable( true );
            m_STEP_Xorg->Enable( true );
            m_STEP_Yorg->Enable( true );
        }
        else
        {
            m_STEP_OrgUnitChoice->Enable( false );
            m_STEP_Xorg->Enable( false );
            m_STEP_Yorg->Enable( false );
        }

        m_sdbSizerOK->SetDefault();

        FixOSXCancelButtonIssue();

        // Now all widgets have the size fixed, call FinishDialogSettings
        FinishDialogSettings();
    }
开发者ID:reportingsjr,项目名称:kicad-source-mirror,代码行数:50,代码来源:dialog_export_step.cpp


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