GME  13
ArrowButton.cpp
Go to the documentation of this file.
00001 // ArrowButton.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "objectinspector.h"
00006 #include "ArrowButton.h"
00007 
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013 
00015 // CArrowButton
00016 
00017 CArrowButton::CArrowButton()
00018 {
00019 }
00020 
00021 CArrowButton::~CArrowButton()
00022 {
00023 }
00024 
00025 
00026 BEGIN_MESSAGE_MAP(CArrowButton, CButton)
00027         //{{AFX_MSG_MAP(CArrowButton)
00028                 // NOTE - the ClassWizard will add and remove mapping macros here.
00029         //}}AFX_MSG_MAP
00030 END_MESSAGE_MAP()
00031 
00033 // CArrowButton message handlers
00034 
00035 void CArrowButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
00036 {
00037             
00038     CDC*    pDC     = CDC::FromHandle(lpDrawItemStruct->hDC);
00039     CRect   rect    = lpDrawItemStruct->rcItem;
00040     UINT    state   = lpDrawItemStruct->itemState;
00041 
00042 
00043     // Draw arrow
00044     pDC->DrawFrameControl(&rect, DFC_SCROLL, DFCS_SCROLLDOWN  | 
00045                           ((state & ODS_SELECTED) ? DFCS_PUSHED : 0) |
00046                           ((state & ODS_DISABLED) ? DFCS_INACTIVE : 0));
00047   
00048 }
00049 
00050 void CArrowButton::PreSubclassWindow() 
00051 {
00052         ModifyStyle(0, BS_OWNERDRAW);        // Make it owner drawn
00053         
00054         CButton::PreSubclassWindow();
00055 }