--- /dev/null
+// ColorButton.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "merge.h"
+#include "ColorButton.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CColorButton
+
+CColorButton::CColorButton( COLORREF clrFill ) : m_clrFill(clrFill)
+{
+}
+
+CColorButton::~CColorButton()
+{
+}
+
+
+BEGIN_MESSAGE_MAP(CColorButton, CButton)
+ //{{AFX_MSG_MAP(CColorButton)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CColorButton message handlers
+
+void CColorButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
+{
+ CBrush brush;
+
+ brush.CreateSolidBrush( m_clrFill );
+
+ ::FillRect( lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem, brush );
+
+#if 0
+ ::FrameRect( lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem,
+ (HBRUSH)GetStockObject(BLACK_BRUSH) );
+#endif
+}
+
+
+void CColorButton::SetColor( COLORREF clrFill )
+{
+ m_clrFill = clrFill;
+ Invalidate();
+}
+
+
--- /dev/null
+#if !defined(AFX_COLORBUTTON_H__75623C05_2D2D_4FBE_B819_661F49DEAE94__INCLUDED_)
+#define AFX_COLORBUTTON_H__75623C05_2D2D_4FBE_B819_661F49DEAE94__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// ColorButton.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CColorButton window
+
+class CColorButton : public CButton
+{
+ COLORREF m_clrFill;
+
+// Construction
+public:
+ CColorButton( COLORREF clrFill );
+
+// Attributes
+public:
+
+// Operations
+public:
+
+ void SetColor( COLORREF clrFill );
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CColorButton)
+ public:
+ virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CColorButton();
+
+ // Generated message map functions
+protected:
+ //{{AFX_MSG(CColorButton)
+ //}}AFX_MSG
+
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_COLORBUTTON_H__75623C05_2D2D_4FBE_B819_661F49DEAE94__INCLUDED_)