// aplComboBox.cpp : implementation file
//

#include "stdafx.h"
#include "apl_gui.h"

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

/////////////////////////////////////////////////////////////////////////////
// CaplComboBox

CaplComboBox::CaplComboBox()
{
}


BEGIN_MESSAGE_MAP(CaplComboBox, CComboBox)
	//{{AFX_MSG_MAP(CaplComboBox)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CaplComboBox message handlers

BOOL CaplComboBox::SetReadOnly( BOOL bReadOnly)
{
	CEdit* pEdit = (CEdit*)GetWindow(GW_CHILD);
	if(pEdit==0)
	{
		if(bReadOnly) EnableWindow(FALSE);
		else EnableWindow(TRUE);
		return FALSE;
	}
	pEdit->EnableWindow(TRUE);
	pEdit->SetReadOnly(bReadOnly);
	return TRUE;
}

void CaplComboBox::DeleteAllItems()
{
	while (GetCount() > 0)
		DeleteString(0);
}