SRadioBox2.cpp 897 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "stdafx.h"
  2. #include "SRadioBox2.h"
  3. namespace SOUI
  4. {
  5. SRadioBox2::SRadioBox2(void):m_pIcon(NULL),m_nTextOffset(0)
  6. {
  7. }
  8. SRadioBox2::~SRadioBox2(void)
  9. {
  10. }
  11. void SRadioBox2::OnPaint(IRenderTarget *pRT)
  12. {
  13. if(m_pSkin)
  14. {
  15. CRect rc;
  16. GetClientRect(&rc);
  17. int nState = 0;
  18. if(GetState() & WndState_Check) nState = 2;
  19. else if(GetState() & WndState_PushDown) nState = 2;
  20. else if(GetState() & WndState_Hover) nState = 1;
  21. m_pSkin->Draw(pRT,rc,nState);
  22. }
  23. if(m_pIcon)
  24. {
  25. CRect rcIcon=GetClientRect();
  26. rcIcon.OffsetRect(m_ptIcon);
  27. rcIcon=CRect(rcIcon.TopLeft(),m_pIcon->GetSkinSize());
  28. m_pIcon->Draw(pRT,rcIcon,IIF_STATE3(GetState(),0,1,2));
  29. }
  30. SWindow::OnPaint(pRT);
  31. }
  32. }