本文整理汇总了C++中wxFileConfig::SetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ wxFileConfig::SetPath方法的具体用法?C++ wxFileConfig::SetPath怎么用?C++ wxFileConfig::SetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxFileConfig
的用法示例。
在下文中一共展示了wxFileConfig::SetPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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("..");
}
}
示例2: 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("..");
}
示例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);
}
}
示例4: 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));
}
示例5: 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("..");
}
示例6: ChangePath
static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
{
fc.SetPath(path);
return fc.GetPath();
}