//--------------------------------------------------------------------- // ParseINI //--------------------------------------------------------------------- BOOL CSkinScrollArea::ParseINI( CSystem_IniFile &iniFile, const CStdString §ionName, const CStdString &entryName, const CSkinElement *parent ) { if( parent ) { m_left = parent->m_left; m_top = parent->m_top; m_right = parent->m_right; m_bottom = parent->m_bottom; } RECT rct = StringToRect( iniFile.GetProfileString( sectionName, entryName + ".ScrollArea.Area", "" ) ); if( rct.left != VALUE_INVALID && rct.top != VALUE_INVALID && rct.right != VALUE_INVALID && rct.bottom != VALUE_INVALID ) { m_left = rct.left; m_top = rct.top; m_right = rct.right; m_bottom = rct.bottom; } m_singleRowHeight = iniFile.GetProfileInt( sectionName, entryName + ".ScrollArea.SingleRow.Height", 0 ); CSkinHighlightBar hb; if( hb.ParseINI( iniFile, sectionName, entryName + ".ScrollArea" ) ) m_highlightBar = new CSkinHighlightBar( hb ); return (m_left != VALUE_INVALID && m_top != VALUE_INVALID && m_right != VALUE_INVALID && m_bottom != VALUE_INVALID ); }
//--------------------------------------------------------------------- // ParseINI //--------------------------------------------------------------------- BOOL CSkinHighlightBar::ParseINI( CSystem_IniFile &iniFile, const CStdString §ionName, const CStdString &parentEntryName, const CStdString &childEntryName ) { CStdString entryName = parentEntryName; if( entryName == "" ) entryName = childEntryName; else entryName += "." + childEntryName; RECT rct = StringToRect( iniFile.GetProfileString( sectionName, entryName + ".Area", "" ) ); if( rct.left != VALUE_INVALID && rct.top != VALUE_INVALID && rct.right != VALUE_INVALID && rct.bottom != VALUE_INVALID ) { m_left = rct.left; m_top = rct.top; m_right = rct.right; m_bottom = rct.bottom; } // Parse the color, allowing either one color for all 4 corners, or individual colors BOOL colorSetup = FALSE; CStdString temp = iniFile.GetProfileString( sectionName, entryName + ".Color", "" ); if( temp != "" ) { m_cornerColors[0] = m_cornerColors[1] = m_cornerColors[2] = m_cornerColors[3] = StringToColor( temp ); colorSetup = TRUE; } else { temp = iniFile.GetProfileString( sectionName, entryName + ".Color.UpperLeft", "" ); if( temp != "" ) colorSetup = TRUE; m_cornerColors[0] = StringToColor( temp ); temp = iniFile.GetProfileString( sectionName, entryName + ".Color.UpperRight", "" ); if( temp != "" ) colorSetup = TRUE; m_cornerColors[1] = StringToColor( temp ); temp = iniFile.GetProfileString( sectionName, entryName + ".Color.LowerRight", "" ); if( temp != "" ) colorSetup = TRUE; m_cornerColors[2] = StringToColor( temp ); temp = iniFile.GetProfileString( sectionName, entryName + ".Color.LowerLeft", "" ); if( temp != "" ) colorSetup = TRUE; m_cornerColors[3] = StringToColor( temp ); } return colorSetup || (m_left != VALUE_INVALID && m_right != VALUE_INVALID && m_top != VALUE_INVALID && m_bottom != VALUE_INVALID ); }