Exemplo n.º 1
0
void SchemeConfigParser::ResetClasses()
{
	for(StylePtrMap::iterator i = m_LoadState.m_Classes.begin(); 
		i != m_LoadState.m_Classes.end();
		++i)
	{
		(*i).second->Reset();
	}

	// Also going to reset the default colours here:
	m_LoadState.m_DefaultColours.Clear();

	// Now re-set the default style:
	StylePtr defcls = GetClass(_T("default"));
	defcls->Combine(NULL, m_LoadState.m_Default);
}
Exemplo n.º 2
0
void SchemeConfigParser::LoadPresets(LPCTSTR path)
{
	// Reset the current settings:
	m_LoadState.m_DefaultColours.Clear();

	for(SchemeDetailsList::iterator i = m_Schemes.begin();
		i != m_Schemes.end();
		++i)
	{
		(*i)->ResetAll();
	}

	for(StylePtrMap::iterator j = m_LoadState.m_Classes.begin();
		j != m_LoadState.m_Classes.end();
		++j)
	{
		(*j).second->Reset();
	}

	// Now load the new...
	UserSettingsParser usp;
	usp.SetPresetLoadMode();
	usp.Parse(path, &m_LoadState);

	StylePtr defcls = GetClass(_T("default"));

	// Minor validation (want our default font to look good):
	if(defcls->CustomStyle != NULL && (defcls->CustomStyle->values & edvFontName))
	{
		if(!validateFont(defcls->CustomStyle->FontName.c_str()))
		{
			defcls->CustomStyle->FontName = _T("");
			defcls->CustomStyle->values ^= edvFontName;
		}
	}

	// Now re-set the default style:
	defcls->Combine(NULL, m_LoadState.m_Default);
}