www.pudn.com > GroupCombo_demo.zip > DynamicCombo.cpp


// DynamicCombo.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "GroupComboDlg.h" 
#include "DynamicCombo.h" 
#include "ComboGroup.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CDynamicCombo 
 
CDynamicCombo::CDynamicCombo() 
{ 
    pNext = NULL; 
    currentIndex = 0; 
    currentString = ""; 
    boxNum = 0; 
    GroupOwner = NULL; 
} 
 
CDynamicCombo::~CDynamicCombo() 
{ 
} 
 
 
BEGIN_MESSAGE_MAP(CDynamicCombo, CComboBox) 
	//{{AFX_MSG_MAP(CDynamicCombo) 
	ON_CONTROL_REFLECT(CBN_SELCHANGE, OnSelchange) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CDynamicCombo message handlers 
 
void CDynamicCombo::OnSelchange()  
{ 
    GroupOwner->SelChanged(this);    
} 
 
void CDynamicCombo::InitializeDynamicCombo(int index, int boxNumber, CString *str) 
{ 
    SetCurSel(index); 
    currentIndex = index; 
    currentString = *str; 
    boxNum = boxNumber; 
}