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


C++ wxFileConfig类代码示例

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


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

示例1: change

void
FileConfigTestCase::CheckGroupSubgroups(const wxFileConfig& fc,
                                        const wxChar *path,
                                        size_t nGroups,
                                        ...)
{
    wxConfigPathChanger change(&fc, wxString(path) + wxT("/"));

    CPPUNIT_ASSERT( fc.GetNumberOfGroups() == nGroups );

    va_list ap;
    va_start(ap, nGroups);

    long cookie;
    wxString name;
    for ( bool cont = fc.GetFirstGroup(name, cookie);
          cont;
          cont = fc.GetNextGroup(name, cookie), nGroups-- )
    {
        CPPUNIT_ASSERT( name == va_arg(ap, wxChar *) );
    }

    CPPUNIT_ASSERT( nGroups == 0 );

    va_end(ap);
}
开发者ID:beanhome,项目名称:dev,代码行数:26,代码来源:fileconf.cpp

示例2: actLoad

void ActLearn::actLoad(wxFileConfig & fileConfig)
{
	fileConfig.Read("listName", &_listName);
	double tmp;
	
	fileConfig.Read("nbText", &tmp);
	if(tmp == 0)//La valeur minimums de _nbText est 1.
		_nbText = 1;
	else
		_nbText = tmp;
}
开发者ID:antoine163,项目名称:Talv,代码行数:11,代码来源:actLearn.cpp

示例3: copyValuesIntoConfig

void copyValuesIntoConfig(HKEY key, wxFileConfig& config, const wxString& sectionName) {
	config.SetPath(sectionName);

	for (DWORD i = 0; ; ++i) {
		wxString name;
		wxString value;
		if (!enumRegistryValue(key, i, name, value))
		{
			break;
		}
		config.Write(name, value);
	}
}
开发者ID:scp-fs2open,项目名称:wxLauncher,代码行数:13,代码来源:Compatibility.cpp

示例4: actLoad

void ActTranslationToNotification::actLoad(wxFileConfig& fileConfig)
{
	_lgto = ManGeneral::get().getSystemLanguage();                                  
	if(	_lgto == wxLANGUAGE_ENGLISH)
		_lgsrc = wxLANGUAGE_FRENCH;
	else
		_lgsrc = wxLANGUAGE_ENGLISH;	
	
	//On récupère les préférences.
	wxString lg;
	lg = fileConfig.Read("lgsrc", wxLocale::GetLanguageName(_lgsrc));
	_lgsrc = (wxLanguage)wxLocale::FindLanguageInfo(lg)->Language;
	lg = fileConfig.Read("lgto", wxLocale::GetLanguageName(_lgto));
	_lgto = (wxLanguage)wxLocale::FindLanguageInfo(lg)->Language;
}
开发者ID:antoine163,项目名称:Talv,代码行数:15,代码来源:actTranslationToNotification.cpp

示例5: SetDefaultFonts

void wxFontsManager::SetDefaultFonts(wxFileConfig& cfg)
{
    wxString name;

    if ( cfg.Read("Default", &name) )
    {
        m_defaultFacenames[wxFONTFAMILY_DECORATIVE] =
        m_defaultFacenames[wxFONTFAMILY_ROMAN] =
        m_defaultFacenames[wxFONTFAMILY_SCRIPT] =
        m_defaultFacenames[wxFONTFAMILY_SWISS] =
        m_defaultFacenames[wxFONTFAMILY_MODERN] =
        m_defaultFacenames[wxFONTFAMILY_TELETYPE] = name;
    }

    if ( cfg.Read("DefaultDecorative", &name) )
        m_defaultFacenames[wxFONTFAMILY_DECORATIVE] = name;
    if ( cfg.Read("DefaultRoman", &name) )
        m_defaultFacenames[wxFONTFAMILY_ROMAN] = name;
    if ( cfg.Read("DefaultScript", &name) )
        m_defaultFacenames[wxFONTFAMILY_SCRIPT] = name;
    if ( cfg.Read("DefaultSwiss", &name) )
        m_defaultFacenames[wxFONTFAMILY_SWISS] = name;
    if ( cfg.Read("DefaultModern", &name) )
        m_defaultFacenames[wxFONTFAMILY_MODERN] = name;
    if ( cfg.Read("DefaultTeletype", &name) )
        m_defaultFacenames[wxFONTFAMILY_TELETYPE] = name;
}
开发者ID:BauerBox,项目名称:wxWidgets,代码行数:27,代码来源:fontmgr.cpp

示例6: manSave

void ManAction::manSave(wxFileConfig& fileConfig)const
{
	for(auto &it: _shortcutKeysActions)
	{
		//Obtenir la version string du raccourci.
		wxString stringShortcut = ShortcutKey::shortcutKeyToString(it.first);
		//Crée un groupe pour ce raccourci.
		fileConfig.SetPath(stringShortcut+"/");
		
		//Sauvegarde le type de l'action.
		fileConfig.Write("ActTypeName", it.second->getActTypeName());
		//Sauvegarde de l'action.
		it.second->save(fileConfig);
		
		//On positionne le path
		fileConfig.SetPath("..");
	}
}	
开发者ID:antoine163,项目名称:Talv,代码行数:18,代码来源:manAction.cpp

示例7: ReadFilePath

static wxString
ReadFilePath(const wxString& name, const wxString& dir, wxFileConfig& cfg)
{
    wxString p = cfg.Read(name, wxEmptyString);

    if ( p.empty() || wxFileName(p).IsAbsolute() )
        return p;

    return dir + "/" + p;
}
开发者ID:BauerBox,项目名称:wxWidgets,代码行数:10,代码来源:fontmgr.cpp

示例8: manLoad

void ManAction::manLoad(wxFileConfig& fileConfig)
{
	wxString stringShortcut;
	long lIndex;
	
	//Avent de charger quoi que se soi on supprime tout les raccourcis/actions
	removeAll();
	
	//On récupère le premier raccourci.
	if(!fileConfig.GetFirstGroup(stringShortcut, lIndex))
		return;
		
	do
	{	
		//On positionne le path
		fileConfig.SetPath(stringShortcut+"/");
		
		//Récupérer le type de l'action.
		wxString actTypeName;
		fileConfig.Read("ActTypeName", &actTypeName);
		
		//Création d'une action a partir de son nom.
		Action* tmpAct = Action::createAction(actTypeName);
		
		//Si la création de l'action a réussie, alor on l'ajoute.
		if(tmpAct)
		{
			//Chargement des préférences de l'action à partir du fichier de configuration.
			tmpAct->load(fileConfig);
			//Ajout de l'action.
			add(ShortcutKey::stringToShortcutKey(stringShortcut), tmpAct);
		}
		
		//On positionne le path
		fileConfig.SetPath("..");
		
	}//Puis tous les autres
	while(fileConfig.GetNextGroup(stringShortcut, lIndex));
}
开发者ID:antoine163,项目名称:Talv,代码行数:39,代码来源:manAction.cpp

示例9: AddFont

void wxFontsManager::AddFont(const wxString& dir,
                             const wxString& name,
                             wxFileConfig& cfg)
{
    wxLogTrace("font", "adding font '%s'", name.c_str());

    wxConfigPathChanger ch(&cfg, wxString::Format("/%s/", name.c_str()));

    AddBundle
    (
      new wxFontBundle
          (
            name,
            ReadFilePath("Regular", dir, cfg),
            ReadFilePath("Italic", dir, cfg),
            ReadFilePath("Bold", dir, cfg),
            ReadFilePath("BoldItalic", dir, cfg),
            cfg.Read("IsFixed", (long)false)
          )
    );
}
开发者ID:BauerBox,项目名称:wxWidgets,代码行数:21,代码来源:fontmgr.cpp

示例10: Dump

static wxString Dump(wxFileConfig& fc)
{
    wxStringOutputStream sos;
    fc.Save(sos);
    return wxTextFile::Translate(sos.GetString(), wxTextFileType_Unix);
}
开发者ID:beanhome,项目名称:dev,代码行数:6,代码来源:fileconf.cpp

示例11: theConfig

//~~ int GetIconIndex() [AstadeTransition] ~~

wxArrayString names;

wxFileConfig theConfig(wxEmptyString, wxEmptyString, wxEmptyString, myModelElement->GetFileName().GetFullPath());

wxString TransitionType = theConfig.Read(wxS("Astade/TransitionType"));

if (TransitionType == wxS("Self"))
	names.Add(wxS("selftransition"));
else if (TransitionType == wxS("Internal"))
	names.Add(wxS("internaltransition"));
else
	names.Add(wxS("transition"));

if (search->isSet(AdeSearch::SearchIsActive))
{
	switch (myModelElement->Search(*search))
	{
	case AdeSearch::contain:
		names.Add(wxS("hasfound"));
		break;
	case AdeSearch::found:
		names.Add(wxS("found"));
		break;
	default:
		break;
	}
}
else
{
开发者ID:andib78,项目名称:Astade,代码行数:31,代码来源:code.cpp

示例12: ChangePath

    static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
    {
        fc.SetPath(path);

        return fc.GetPath();
    }
开发者ID:beanhome,项目名称:dev,代码行数:6,代码来源:fileconf.cpp

示例13: manLoad

void ManNotification::manLoad(wxFileConfig& fileConfig)
{
	//On détruis les fenêtres de notification au préalable.
	deleteAllFramesNotify();
	
	_useNotification = (UseNotification_e)fileConfig.ReadLong("useNotification", (long)USE_NOTIFICATION_RICH);
	_notificationPosition = (NotificationPosition_e)fileConfig.ReadLong("notificationPosition", (long)NOTIFICATION_POSITION_TOP_RIGHT);
	_nearCursor = fileConfig.ReadBool("nearCursor", true);
	_multipleNotifications = fileConfig.ReadBool("multipleNotifications", true);
	_border = fileConfig.ReadLong("border", (long)SIZE_BORDER);
		
	_colourBackground.SetRGB(fileConfig.ReadLong("colourBackground", (long)0x000000));
	_colourText.SetRGB(fileConfig.ReadLong("colourText", (long)0xd2d2d2));
	
	
	fileConfig.SetPath("workarea/");
	
	//On lie -1 pour les valeur par défaut.
	_workarea = wxDisplay().GetGeometry();
	long readVal = -1;
	
		readVal = fileConfig.ReadLong("x", -1);
		if(readVal != -1)
			_workarea.x = readVal;
			
		readVal = fileConfig.ReadLong("y", -1);
		if(readVal != -1)
			_workarea.y = readVal;
			
			
		readVal = fileConfig.ReadLong("height", -1);
		if(readVal != -1)
			_workarea.height = readVal;
		else
			_workarea.height -= _workarea.y;
			
		readVal = fileConfig.ReadLong("width", -1);
		if(readVal != -1)
			_workarea.width = readVal;
		else
			_workarea.width -= _workarea.x;
	
	fileConfig.SetPath("..");
}
开发者ID:antoine163,项目名称:Talv,代码行数:44,代码来源:manNotification.cpp

示例14: actSave

void ActTranslationToNotification::actSave(wxFileConfig& fileConfig)const
{
	fileConfig.Write("lgsrc", wxLocale::GetLanguageName(_lgsrc));
	fileConfig.Write("lgto", wxLocale::GetLanguageName(_lgto));
}
开发者ID:antoine163,项目名称:Talv,代码行数:5,代码来源:actTranslationToNotification.cpp

示例15: manSave

void ManNotification::manSave(wxFileConfig& fileConfig)const
{	
	fileConfig.Write("useNotification", (long)_useNotification);
	fileConfig.Write("notificationPosition", (long)_notificationPosition);
	fileConfig.Write("nearCursor", _nearCursor);
	fileConfig.Write("multipleNotifications", _multipleNotifications);
	fileConfig.Write("border", (long)_border);
	
	fileConfig.Write("colourBackground", (long)_colourBackground.GetRGB());
	fileConfig.Write("colourText", (long)_colourText.GetRGB());
	
	
	fileConfig.SetPath("workarea/");
	
	//On écrit -1 pour les valeur par défaut.
	wxRect workarea = wxDisplay().GetGeometry();
	
		if(workarea.x == _workarea.x)
			fileConfig.Write("x", (long)-1);
		else
			fileConfig.Write("x", (long)_workarea.x);
		if(workarea.y == _workarea.y)
			fileConfig.Write("y", (long)-1);
		else
			fileConfig.Write("y", (long)_workarea.y);
		if(workarea.height == _workarea.height)	
			fileConfig.Write("height", (long)-1);
		else
			fileConfig.Write("height", (long)_workarea.height);
		if(workarea.width == _workarea.width)	
			fileConfig.Write("width", (long)-1);
		else
			fileConfig.Write("width", (long)_workarea.width);
	
	fileConfig.SetPath("..");
}
开发者ID:antoine163,项目名称:Talv,代码行数:36,代码来源:manNotification.cpp


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