// ListBoxEx.cpp : implementation file
//

#include "stdafx.h"
#include "Megatron.h"
#include "ListBoxEx.h"

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

/////////////////////////////////////////////////////////////////////////////
// CListBoxEx

CListBoxEx::CListBoxEx()
{
}

CListBoxEx::~CListBoxEx()
{
}


BEGIN_MESSAGE_MAP(CListBoxEx, CListBox)
	//{{AFX_MSG_MAP(CListBoxEx)
	ON_WM_LBUTTONDOWN()
	ON_WM_RBUTTONDOWN()
	ON_WM_RBUTTONUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CListBoxEx message handlers

BOOL CListBoxEx::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	return CListBox::OnCommand(wParam, lParam);
}

void CListBoxEx::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CListBox::OnLButtonDown(nFlags, point);
}

void CListBoxEx::OnRButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default

	CListBox::OnRButtonDown(nFlags, point);
}

void CListBoxEx::OnRButtonUp(UINT nFlags, CPoint point) 
{
	GetParent()->SendMessage(WM_RBUTTONUP,(WPARAM)nFlags,MAKELPARAM(point.x,point.y));
	CListBox::OnRButtonUp(nFlags, point);
}

BOOL CListBoxEx::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
{
	switch (nCode)
	{
	case WM_RBUTTONUP:
		{
			int x=1;
		}
	}
	return CListBox::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
