|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "DlgMarkPar.h"
|
|
|
|
|
#include "afxdialogex.h"
|
|
|
|
|
#include "MarkParMgr.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
#include "MsgBox.h"
|
|
|
|
|
#include "AuthorityMgr.h"
|
|
|
|
|
#include "MarkCtrl.h"
|
|
|
|
|
#include "LaipuVbDllMgr.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgMarkPar, CDialogEx)
|
|
|
|
|
|
|
|
|
|
CDlgMarkPar::CDlgMarkPar(CWnd* pParent /*=NULL*/)
|
|
|
|
|
{
|
|
|
|
|
m_CurPen = 0;//<2F><>ǰ<EFBFBD>ʺ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CDlgMarkPar::~CDlgMarkPar()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CDlgMarkPar::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
{
|
|
|
|
|
CDialogEx::DoDataExchange(pDX);
|
|
|
|
|
DDX_Control(pDX, IDC_PAR_LIST, m_PenList);
|
|
|
|
|
DDX_Text(pDX, IDC_CUR_PEN, m_CurPen);
|
|
|
|
|
DDX_Text(pDX, IDC_MS, m_CurPar.ms);
|
|
|
|
|
DDX_Text(pDX, IDC_MMS, m_CurPar.mms);
|
|
|
|
|
DDX_Text(pDX, IDC_TOF, m_CurPar.tof);
|
|
|
|
|
DDX_Text(pDX, IDC_TOH, m_CurPar.toh);
|
|
|
|
|
DDX_Text(pDX, IDC_TCF, m_CurPar.tcf);
|
|
|
|
|
DDX_Text(pDX, IDC_TCH, m_CurPar.tch);
|
|
|
|
|
DDX_Text(pDX, IDC_DR, m_CurPar.dr_time);
|
|
|
|
|
DDX_Text(pDX, IDC_LASER_FRE, m_CurPar.laserfre);
|
|
|
|
|
DDX_Text(pDX, IDC_LASER_POWER, m_CurPar.laserpower);
|
|
|
|
|
}
|
|
|
|
|
BEGIN_MESSAGE_MAP(CDlgMarkPar, CDialogEx)
|
|
|
|
|
ON_NOTIFY(NM_CLICK, IDC_PAR_LIST, &CDlgMarkPar::OnNMClickParList)
|
|
|
|
|
ON_NOTIFY(NM_CUSTOMDRAW, IDC_PAR_LIST, OnCustomdrawMyList)
|
|
|
|
|
ON_BN_CLICKED(IDC_COMMIT, &CDlgMarkPar::OnBnClickedCommit)
|
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
|
// CDlgStdMarkCtr <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
BOOL CDlgMarkPar::OnInitDialog()
|
|
|
|
|
{
|
|
|
|
|
CDialogEx::OnInitDialog();
|
|
|
|
|
|
|
|
|
|
IniPenList();
|
|
|
|
|
UpdatePenList();
|
|
|
|
|
|
|
|
|
|
gMarkParMgr->SaveOrLoad(false);//<2F><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
gMarkParMgr->SetCurPenNum(m_CurPen);
|
|
|
|
|
|
|
|
|
|
UpdatePar();
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
#if 1
|
|
|
|
|
void CDlgMarkPar::IniPenList()
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>
|
|
|
|
|
m_PenList.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int idx = 0;
|
|
|
|
|
m_PenList.InsertColumn(idx,"<EFBFBD>ʺ<EFBFBD>",LVCFMT_CENTER,50,-1);
|
|
|
|
|
idx++;
|
|
|
|
|
m_PenList.InsertColumn(idx,"<EFBFBD><EFBFBD>ɫ",LVCFMT_CENTER,90,-1);
|
|
|
|
|
}
|
|
|
|
|
void CDlgMarkPar::UpdatePenList()
|
|
|
|
|
{
|
|
|
|
|
m_PenList.DeleteAllItems();
|
|
|
|
|
gMarkParMgr->InsertToList(m_PenList);
|
|
|
|
|
}
|
|
|
|
|
void CDlgMarkPar::UpdatePar()
|
|
|
|
|
{
|
|
|
|
|
m_CurPar = gMarkParMgr->GetPen(m_CurPen);
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
}
|
|
|
|
|
void CDlgMarkPar::OnNMClickParList(NMHDR *pNMHDR, LRESULT *pResult)
|
|
|
|
|
{
|
|
|
|
|
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
|
|
|
|
|
*pResult = 0;
|
|
|
|
|
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
|
{
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
m_CurPen=GetCurListIdx(m_PenList);
|
|
|
|
|
gMarkParMgr->SetCurPenNum(m_CurPen);
|
|
|
|
|
m_CurPar = gMarkParMgr->GetPen(m_CurPen);
|
|
|
|
|
UpdateData(FALSE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ȡlist <20><>ǰѡ<C7B0><D1A1><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
|
|
|
|
|
int CDlgMarkPar::GetCurListIdx(CListCtrl &list)
|
|
|
|
|
{
|
|
|
|
|
POSITION pos = list.GetFirstSelectedItemPosition();
|
|
|
|
|
if (pos == NULL)
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
while (pos)
|
|
|
|
|
{
|
|
|
|
|
int nItem = list.GetNextSelectedItem(pos);
|
|
|
|
|
return nItem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>ñʺŶ<CABA>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
void CDlgMarkPar::OnCustomdrawMyList ( NMHDR* pNMHDR, LRESULT* pResult )
|
|
|
|
|
{
|
|
|
|
|
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
|
|
|
|
|
*pResult = CDRF_DODEFAULT;
|
|
|
|
|
if( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
|
|
|
|
|
{
|
|
|
|
|
*pResult = CDRF_NOTIFYITEMDRAW;
|
|
|
|
|
}
|
|
|
|
|
else if( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
|
|
|
|
|
{
|
|
|
|
|
*pResult = CDRF_NOTIFYSUBITEMDRAW;
|
|
|
|
|
}
|
|
|
|
|
else if((CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage )
|
|
|
|
|
{
|
|
|
|
|
COLORREF crText, crBkgnd;
|
|
|
|
|
if(1 == pLVCD->iSubItem)
|
|
|
|
|
{
|
|
|
|
|
crText = RGB_BLACK;
|
|
|
|
|
crBkgnd = gMarkParMgr->GetPenColor(pLVCD->nmcd.dwItemSpec);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
crText = RGB_BLACK;
|
|
|
|
|
crBkgnd = RGB_WHITE;
|
|
|
|
|
}
|
|
|
|
|
pLVCD->clrText = crText;
|
|
|
|
|
pLVCD->clrTextBk = crBkgnd;
|
|
|
|
|
|
|
|
|
|
*pResult = CDRF_DODEFAULT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
//<2F><><EFBFBD>浱ǰ<E6B5B1>ʵIJ<CAB5><C4B2><EFBFBD>
|
|
|
|
|
void CDlgMarkPar::OnBnClickedCommit()
|
|
|
|
|
{
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY,true)==false)
|
|
|
|
|
return;
|
|
|
|
|
UpdateData(TRUE);
|
|
|
|
|
gMarkParMgr->SaveCurPen(m_CurPen,m_CurPar);
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
MsgBox.Show("<EFBFBD>ѱ<EFBFBD><EFBFBD><EFBFBD>",false);
|
|
|
|
|
}
|