Exemplo n.º 1
0
/*
** Read the options specified in the ini file.
**
*/
void CMeterImage::ReadOptions(CConfigParser& parser, const WCHAR* section)
{
	CMeter::ReadOptions(parser, section);

	m_Path = parser.ReadString(section, L"Path", L"");
	if (!m_Path.empty())
	{
		if (!CSystem::IsPathSeparator(m_Path[m_Path.length() - 1]))
		{
			m_Path += L'\\';
		}
	}

	m_ImageName = parser.ReadString(section, L"ImageName", L"");

	m_PreserveAspectRatio = 0!=parser.ReadInt(section, L"PreserveAspectRatio", 0);
	m_Tile = 0!=parser.ReadInt(section, L"Tile", 0);

	static const RECT defMargins = {0};
	m_ScaleMargins = parser.ReadRECT(section, L"ScaleMargins", defMargins);

	// Read tinting options
	m_Image.ReadOptions(parser, section);

	if (m_Initialized && m_Measures.empty() && !m_DynamicVariables)
	{
		Initialize();
		m_NeedsRedraw = true;
	}
}
Exemplo n.º 2
0
/*
** Read the options specified in the ini file.
**
*/
void CMeterImage::ReadOptions(CConfigParser& parser, const WCHAR* section)
{
	CMeter::ReadOptions(parser, section);

	m_Path = parser.ReadString(section, L"Path", L"");
	if (!m_Path.empty())
	{
		if (!CSystem::IsPathSeparator(m_Path[m_Path.length() - 1]))
		{
			m_Path += L'\\';
		}
	}

	m_ImageName = parser.ReadString(section, L"ImageName", L"");

	int mode = parser.ReadInt(section, L"Tile", 0);
	if (mode != 0)
	{
		m_DrawMode = DRAWMODE_TILE;
	}
	else
	{
		mode = parser.ReadInt(section, L"PreserveAspectRatio", 0);
		switch (mode)
		{
		case 0:
			m_DrawMode = DRAWMODE_NONE;
			break;
		case 1:
		default:
			m_DrawMode = DRAWMODE_KEEPRATIO;
			break;
		case 2:
			m_DrawMode = DRAWMODE_KEEPRATIOANDCROP;
			break;
		}
	}

	static const RECT defMargins = {0};
	m_ScaleMargins = parser.ReadRECT(section, L"ScaleMargins", defMargins);

	// Read tinting options
	m_Image.ReadOptions(parser, section);

	if (m_Initialized && m_Measures.empty() && !m_DynamicVariables)
	{
		Initialize();
		m_NeedsRedraw = true;
	}
}