?? dialogtemplateupdate.cpp
字號:
// DialogTemplateUpdate.cpp : implementation file
//
#include "stdafx.h"
#include "圖像特征跟蹤系統.h"
#include "DialogTemplateUpdate.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogTemplateUpdate property page
IMPLEMENT_DYNCREATE(CDialogTemplateUpdate, CPropertyPage)
CDialogTemplateUpdate::CDialogTemplateUpdate() : CPropertyPage(CDialogTemplateUpdate::IDD)
{
//{{AFX_DATA_INIT(CDialogTemplateUpdate)
m_nTemplateUpdateType = 0;
//}}AFX_DATA_INIT
m_conTemplateUpdateType = TTUT_PWOER;
m_nPowerResult = 0;
CheckButtonID = new UINT[4];
CheckButtonID[0] = IDC_RADIO_POWER;
CheckButtonID[1] = IDC_RADIO_MOVING_TARGET_SEGMENT;
CheckButtonID[2] = IDC_RADIO_EIGENSPACE_TRAINOFFLIEN;
CheckButtonID[3] = IDC_RADIO_EIGENSPACE_TRAINONLINE;
}
CDialogTemplateUpdate::~CDialogTemplateUpdate()
{
delete CheckButtonID;
}
void CDialogTemplateUpdate::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogTemplateUpdate)
DDX_Control(pDX, IDC_COMBO_UPDATE_POWER, m_conUpdatePower);
DDX_Radio(pDX, IDC_RADIO_POWER, m_nTemplateUpdateType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogTemplateUpdate, CPropertyPage)
//{{AFX_MSG_MAP(CDialogTemplateUpdate)
ON_BN_CLICKED(IDC_RADIO_POWER, OnRadioPower)
ON_BN_CLICKED(IDC_RADIO_MOVING_TARGET_SEGMENT, OnRadioMovingTargetSegment)
ON_BN_CLICKED(IDC_RADIO_EIGENSPACE_TRAINOFFLIEN, OnRadioEigenspaceTrainofflien)
ON_BN_CLICKED(IDC_RADIO_EIGENSPACE_TRAINONLINE, OnRadioEigenspaceTrainonline)
ON_CBN_SELENDOK(IDC_COMBO_UPDATE_POWER, OnSelendokComboUpdatePower)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogTemplateUpdate message handlers
void CDialogTemplateUpdate::SetCheckButton(int id)
{
CButton* pButton=NULL;
for(int i=0;i<4;i++)
{
pButton = (CButton*) this->GetDlgItem(CheckButtonID[i]);
if(i!=id)
pButton->SetCheck(false);
else
pButton->SetCheck(true);
}
CWnd* pWnd = this->GetDlgItem(IDC_COMBO_UPDATE_POWER);
if(pWnd)
{
if(id>=2)
pWnd->EnableWindow(false);
else
pWnd->EnableWindow(true);
}
UpdateWindow();
}
void CDialogTemplateUpdate::OnRadioPower()
{
m_nTemplateUpdateType=0;
m_conTemplateUpdateType = TTUT_PWOER;
SetCheckButton(m_nTemplateUpdateType);
}
void CDialogTemplateUpdate::OnRadioMovingTargetSegment()
{
m_nTemplateUpdateType=1;
m_conTemplateUpdateType = TTUT_MOVING_TARGET_SEGMENT;
SetCheckButton(m_nTemplateUpdateType);
}
void CDialogTemplateUpdate::OnRadioEigenspaceTrainofflien()
{
m_nTemplateUpdateType=2;
m_conTemplateUpdateType = TTUT_EIGENSPACE_TRAINNING_OFFLINE;
SetCheckButton(m_nTemplateUpdateType);
}
void CDialogTemplateUpdate::OnRadioEigenspaceTrainonline()
{
m_nTemplateUpdateType=3;
m_conTemplateUpdateType = TTUT_EIGENSPACE_TRAINNING_ONLINE;
SetCheckButton(m_nTemplateUpdateType);
}
BOOL CDialogTemplateUpdate::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_conUpdatePower.AddString("1:0");
m_conUpdatePower.AddString("1:2");
m_conUpdatePower.AddString("1:4");
m_conUpdatePower.AddString("1:8");
m_conUpdatePower.AddString("0:1");
m_conUpdatePower.SetCurSel(0);
m_conUpdatePower.UpdateWindow();
m_nTemplateUpdateType = 0;
m_conTemplateUpdateType = TTUT_PWOER;
SetCheckButton(m_nTemplateUpdateType);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDialogTemplateUpdate::OnSelendokComboUpdatePower()
{
int i = m_conUpdatePower.GetCurSel();
switch (i)
{
case 0: m_nPowerResult = 0; break;
case 1: m_nPowerResult = 1; break;
case 2: m_nPowerResult = 0.5; break;
case 3: m_nPowerResult = 0.25; break;
case 4: m_nPowerResult = 0.125; break;
default:
AfxMessageBox("Wrong selection!");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -