• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ wxConfigBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Save

void FileHistory::Save(wxConfigBase& config)
{
	wxString old = config.GetPath();
	config.SetPath(m_configSubdir);
	wxFileHistory::Save(config);
	config.SetPath(old);
}
开发者ID:Marlinc,项目名称:0ad,代码行数:7,代码来源:FileHistory.cpp


示例2: LoadFromSubDir

void FileHistory::LoadFromSubDir(wxConfigBase& config)
{
	wxString old = config.GetPath();
	config.SetPath(m_configSubdir);
	Load(config);
	config.SetPath(old);
}
开发者ID:Valvador,项目名称:PyroSpaceFork,代码行数:7,代码来源:FileHistory.cpp


示例3: 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


示例4: Save

void FileHistory::Save(wxConfigBase & config, const wxString & group)
{
   config.DeleteGroup(group);
   config.SetPath(group);

   // Stored in reverse order
   int n = mHistory.GetCount() - 1;
   for (size_t i = 1; i <= mHistory.GetCount(); i++) {
      config.Write(wxString::Format(wxT("file%02d"), (int)i), mHistory[n--]);
   }

   config.SetPath(wxT(".."));
}
开发者ID:LBoggino,项目名称:audacity,代码行数:13,代码来源:FileHistory.cpp


示例5: SaveFileConfig

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

    wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false);
    config.Write(configPath+wxT("/LastDir"), GetDefaultFilePath());

    int n, count = fileHistory->GetCount();
    for (n = 0; n < count; n++)
        config.Write(configPath + wxString::Format(wxT("/file%d"), n+1), fileHistory->GetHistoryFile(n));
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:13,代码来源:steopts.cpp


示例6: SaveConfig

void wxSTEditorFrame::SaveConfig(wxConfigBase &config, const wxString &configPath_)
{
    wxString configPath = wxSTEditorOptions::FixConfigPath(configPath_, false);
    if (GetMenuBar() && GetMenuBar()->FindItem(ID_STF_SHOW_SIDEBAR))
    {
        wxString val = GetMenuBar()->IsChecked(ID_STF_SHOW_SIDEBAR) ? "1" : "0";
        config.Write(configPath + "/ShowSidebar", val);
    }

    wxRect rect = GetRect();
    if ((rect.x>=0) && (rect.y>=0) && (rect.width>=100) && (rect.height>=100))
       config.Write(configPath + "/FrameSize", wxString::Format("%d,%d,%d,%d", rect.x, rect.y, rect.width, rect.height));
}
开发者ID:burzumishi,项目名称:caprice32wx,代码行数:13,代码来源:steframe.cpp


示例7: Save

void wxFileHistoryBase::Save(wxConfigBase& config)
{
    size_t i;
    for (i = 0; i < m_fileMaxFiles; i++)
    {
        wxString buf;
        buf.Printf(wxT("file%d"), (int)i+1);
        if (i < m_fileHistory.GetCount())
            config.Write(buf, wxString(m_fileHistory[i]));
        else
            config.Write(buf, wxEmptyString);
    }
}
开发者ID:Anonymous2,项目名称:project64,代码行数:13,代码来源:filehistorycmn.cpp


示例8: SaveFileConfig

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

    wxString configPath = FixConfigPath(GetConfigPath(STE_OPTION_CFGPATH_FILEHISTORY), false);
    config.Write(configPath+wxT("/LastDir"), GetDefaultFilePath());

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


示例9: 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


示例10: 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


示例11: 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


示例12: SaveConfig

void wxSTEditorOptions::SaveConfig(wxConfigBase &config)
{
    if (HasConfigOption(STE_CONFIG_PREFS) && GetEditorPrefs().Ok())
        GetEditorPrefs().SaveConfig(config, GetConfigPath(STE_OPTION_CFGPATH_PREFS));
    if (HasConfigOption(STE_CONFIG_STYLES) && GetEditorStyles().Ok())
        GetEditorStyles().SaveConfig(config, GetConfigPath(STE_OPTION_CFGPATH_STYLES));
    if (HasConfigOption(STE_CONFIG_LANGS) && GetEditorLangs().Ok())
        GetEditorLangs().SaveConfig(config, GetConfigPath(STE_OPTION_CFGPATH_LANGS));

    if (GetEditorPrefs().Ok() || GetEditorStyles().Ok() || GetEditorLangs().Ok())
        config.Flush(true); // what is current only?
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:12,代码来源:steopts.cpp


示例13: 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


示例14: Save

void wxFileHistoryBase::Save(wxConfigBase& config)
{
    size_t i;
#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 */
    for (i = 0; i < m_fileMaxFiles; i++)
    {
        wxString buf;
        buf.Printf(wxT("file%d"), (int)i+1);
        if (i < m_fileHistory.GetCount())
            config.Write(buf, wxString(m_fileHistory[i]));
        else
            config.Write(buf, wxEmptyString);
    }
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:22,代码来源:filehistorycmn.cpp


示例15: 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


示例16: 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


示例17: 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


示例18: 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


示例19: 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


示例20: OnCloseWindow

void DIALOG_PRINT_FOR_MODEDIT::OnCloseWindow( wxCloseEvent& event )
{
    if( m_config )
    {
        m_config->Write( OPTKEY_PRINT_MODULE_SCALE, m_ScaleOption->GetSelection() );
        m_config->Write( OPTKEY_PRINT_MONOCHROME_MODE, s_Parameters.m_Print_Black_and_White );
    }

    EndModal( 0 );
}
开发者ID:RyuKojiro,项目名称:kicad-source-mirror,代码行数:10,代码来源:dialog_print_for_modedit.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxContextMenuEvent类代码示例发布时间:2022-05-31
下一篇:
C++ wxCommandEvent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap