SUIVoteStar::SUIVoteStar(LPCTSTR szStarBmpYellow,LPCTSTR szStarBmpNull,LPCTSTR szStarBmpRed, int iStars , int defaultRate) { m_iStars = iStars; m_Rating = defaultRate; m_StarBmpYellow.Attach(CSUIButton::SUILoadImage(szStarBmpYellow)); CSUIButton::PreMultiplyBitmap(m_StarBmpYellow,m_StarBmpYellowSize , true); m_StarBmpNull.Attach(CSUIButton::SUILoadImage(szStarBmpNull)); CSUIButton::PreMultiplyBitmap(m_StarBmpNull,m_StarBmpNullSize , true); m_StarBmpRed.Attach(CSUIButton::SUILoadImage(szStarBmpRed)); CSUIButton::PreMultiplyBitmap(m_StarBmpRed,m_StarBmpRedSize , true); CountDPI(); }
CSUIButton::CSUIButton(UINT Imgid, int iAlign, CRect marginTownd , BOOL bNotButton, UINT htMsgID, BOOL bHide ,UINT alignToButton , CSUIButton * relativeToButton , CRect marginToBtn) : m_stat(0) { m_NotButton = bNotButton; m_marginTownd = marginTownd; m_iAlign = iAlign; m_htMsgID = htMsgID; if( m_png.LoadFromResource( Imgid ) ){ if(m_png.IsDIBSection()){ this->Attach((HBITMAP)m_png); } } CountDPI(); //m_szBmpName = MAKEINTRESOURCE(Imgid); m_hide = bHide; addAlignRelButton(alignToButton, relativeToButton , marginToBtn); }
CSUIButton::CSUIButton(LPCTSTR szBmpName, int iAlign, CRect marginTownd , BOOL bNotButton, UINT htMsgID, BOOL bHide ,UINT alignToButton , CSUIButton * relativeToButton , CRect marginToBtn ) : m_stat(0) , m_lastBtnDownStat(0) { m_NotButton = bNotButton; m_marginTownd = marginTownd; m_iAlign = iAlign; m_htMsgID = htMsgID; CString szBmpPath(szBmpName); szBmpPath = CString(_T("skins\\")) + szBmpPath.Left(szBmpPath.GetLength()-4) + _T(".png"); CSVPToolBox svpToolBox; szBmpPath = svpToolBox.GetPlayerPath(szBmpPath); BOOL bExtLoaded = false; //SVP_LogMsg(szBmpPath); if(svpToolBox.ifFileExist( szBmpPath)){ m_png.Load( szBmpPath ); if(m_png.IsDIBSection()){ this->Attach((HBITMAP)m_png); bExtLoaded = true; } } if(!bExtLoaded) this->LoadImage(szBmpName); m_szBmpName = szBmpName; m_hide = bHide; CountDPI(); addAlignRelButton(alignToButton, relativeToButton , marginToBtn); }