Example #1
0
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;
}
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;
}
Example #3
0
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;
}
Example #4
0
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;
}
Example #5
0
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)
          )
    );
}
Example #6
0
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));
}
Example #7
0
//~~ 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);
Example #8
0
//~~ 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;
}
Example #9
0
//~~ 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
{