本文整理汇总了C++中wxFileConfig类的典型用法代码示例。如果您正苦于以下问题:C++ wxFileConfig类的具体用法?C++ wxFileConfig怎么用?C++ wxFileConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxFileConfig类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: actSave
void ActLearn::actSave(wxFileConfig & fileConfig)const
{
fileConfig.Write("listName", _listName);
fileConfig.Write("nbText", (double)_nbText);
}
开发者ID:antoine163,项目名称:Talv,代码行数:5,代码来源:actLearn.cpp
示例17: theConfig
//~~ int GetIconIndex() [AstadeRelation] ~~
wxArrayString names;
wxFileConfig theConfig(wxEmptyString, wxEmptyString, wxEmptyString, myModelElement->GetFileName().GetFullPath());
wxString RelationType = theConfig.Read(wxS("Astade/RelationType"));
if (RelationType == wxS("ImplementationDependency"))
{
names.Add(wxS("relation"));
names.Add(CODE_CPlusPlus);
}
else if (RelationType == wxS("SpecificationDependency"))
{
names.Add(wxS("relation"));
names.Add(wxS("h"));
}
else if (RelationType == wxS("Friend"))
names.Add(wxS("relation"));
else if (RelationType == wxS("Association"))
names.Add(wxS("association"));
else if (RelationType == wxS("Aggregation"))
names.Add(wxS("aggregation"));
else if (RelationType == wxS("Composition"))
names.Add(wxS("composition"));
else if (RelationType == wxS("Generalization"))
names.Add(wxS("generalisation"));
else
assert(false);
开发者ID:andib78,项目名称:Astade,代码行数:30,代码来源:code.cpp
示例18: aFile
//~~ void Load(const wxString fileName) [glFrame] ~~
if (!fileName.empty())
{
currentFile = fileName;
wxFileName aFile(currentFile);
wxFileConfig aConfig(wxEmptyString, wxEmptyString, aFile.GetFullPath(), wxEmptyString, wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
int saveVersion = 1;
bool read = aConfig.Read(wxS("SaveFileVersion"), &saveVersion);
if (read && (saveVersion < 2))
{
wxMessageBox(wxS("This file has an older graphic format. If you overwrite it with this newer program, the program which has generated this file will not be able to read it any more!"), wxS("Notice!"), wxOK | wxICON_INFORMATION, this);
}
int w = 600;
aConfig.Read(wxS("Window/XSize"), &w);
int h = 400;
aConfig.Read(wxS("Window/YSize"), &h);
xPixelSlider->SetValue(w);
yPixelSlider->SetValue(h);
wxScrollEvent dummy;
OnSliderMove(dummy);
graphicPanel->Load(aConfig);
SetTitle(currentFile);
isChanged = false;
}
开发者ID:Astade,项目名称:Astade,代码行数:31,代码来源:code.cpp
注:本文中的wxFileConfig类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论