You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
971 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include "StdAfx.h"
#include "FontBarcode.h"
CFontBarcode::CFontBarcode(void)
{
}
CFontBarcode::~CFontBarcode(void)
{
}
//初始化需要的条码类型m_BarcodeTypeVec 保存条码名字和CTbarcode51 控件对应枚举的映射
void CFontBarcode::IniBarcodeTypeVec()
{
m_BarcodeTypeVec.push_back(make_pair("DataMatrix",71));
m_BarcodeTypeVec.push_back(make_pair("QRCode",58));
m_BarcodeTypeVec.push_back(make_pair("MAXICODE",57));
}
void CFontBarcode::Initialize()
{
IniBarcodeTypeVec();
vector<BarcodeType>::iterator iter = m_BarcodeTypeVec.begin();
vector<BarcodeType>::iterator iter_end = m_BarcodeTypeVec.end();
for(;iter!=iter_end;iter++)
{
AddTypeName((*iter).first);
}
}
//转换为CTbarcode51 对应的索引值
int CFontBarcode::GetCurFontNameIdx()
{
int size = m_BarcodeTypeVec.size();
if(m_CurFontNameIdx>=0 && m_CurFontNameIdx<size)
{
return m_BarcodeTypeVec[m_CurFontNameIdx].second;
}
return 0;
}