ColorCtrl.cpp
Upload User: popouu88
Upload Date: 2013-02-11
Package Size: 2894k
Code Size: 1k
Category:

VOIP program

Development Platform:

Visual C++

  1. // ColorCtrl.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ColorCtrl.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CColorCtrl
  12. CColorCtrl::CColorCtrl()
  13. {
  14. this->color = RGB( 0 , 0 , 0 );
  15. }
  16. CColorCtrl::~CColorCtrl()
  17. {
  18. }
  19. BEGIN_MESSAGE_MAP(CColorCtrl, CStatic)
  20. //{{AFX_MSG_MAP(CColorCtrl)
  21. ON_WM_PAINT()
  22. //}}AFX_MSG_MAP
  23. END_MESSAGE_MAP()
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CColorCtrl message handlers
  26. void CColorCtrl::SetColor( COLORREF color )
  27. {
  28. this->color = color;
  29. this->Invalidate( );
  30. }
  31. void CColorCtrl::OnPaint() 
  32. {
  33. CPaintDC dc( this );
  34. CRect rc;
  35. this->GetClientRect( &rc );
  36. dc.FillSolidRect( &rc , this->color );
  37. }