// ComboTreeButton.cpp : implementation file
//

#include "stdafx.h"
#include "AplGuiEx.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// ComboTreeButton

CComboTreeButton::CComboTreeButton()
{
}

CComboTreeButton::~CComboTreeButton()
{
}

BEGIN_MESSAGE_MAP(CComboTreeButton, CButton)
	//{{AFX_MSG_MAP(ComboTreeButton)
	ON_WM_GETDLGCODE()
	ON_WM_MOUSEACTIVATE()
	ON_WM_MOUSEWHEEL()
	ON_WM_MOUSEMOVE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// ComboTreeButton message handlers

int CComboTreeButton::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
	UNREFERENCED_PARAMETER(pDesktopWnd);
	UNREFERENCED_PARAMETER(nHitTest);
	UNREFERENCED_PARAMETER(message);

	return MA_ACTIVATE;
}

void CComboTreeButton::OnMouseMove(UINT nFlags, CPoint point)
{
	UNREFERENCED_PARAMETER(nFlags);
	UNREFERENCED_PARAMETER(point);
}

BOOL CComboTreeButton::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
	UNREFERENCED_PARAMETER(nFlags);
	UNREFERENCED_PARAMETER(zDelta);
	UNREFERENCED_PARAMETER(pt);

	return 0;
}

void CComboTreeButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
	UINT style = DFCS_SCROLLDOWN;
	if (lpDrawItemStruct->itemState & ODS_SELECTED)
	{
		style |= DFCS_PUSHED;
	}
	if (lpDrawItemStruct->itemState & ODS_DISABLED)
	{

		style |= DFCS_INACTIVE;
	}

	DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem, DFC_SCROLL, style);
}


UINT CComboTreeButton::OnGetDlgCode()
{
	UINT result = CButton::OnGetDlgCode();
	result |= DLGC_WANTALLKEYS | DLGC_WANTARROWS | DLGC_WANTCHARS ;
	return result;
}
