📄 dispimginfo.cpp
字号:
// DispImgInfo.cpp : implementation file
//
#include "stdafx.h"
#include "bxt.h"
#include "DispImgInfo.h"
#include "bxtDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DispImgInfo dialog
DispImgInfo::DispImgInfo(CWnd* pParent /*=NULL*/)
: CDialog(DispImgInfo::IDD, pParent)
{
//{{AFX_DATA_INIT(DispImgInfo)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bHaveAvi = FALSE;
}
void DispImgInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DispImgInfo)
DDX_Control(pDX, IDC_SLIDER1, m_Delay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DispImgInfo, CDialog)
//{{AFX_MSG_MAP(DispImgInfo)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
ON_BN_CLICKED(IDC_BUTTON7, OnButton7)
ON_BN_CLICKED(IDC_BUTTON15, OnButton15)
ON_WM_HSCROLL()
ON_WM_SHOWWINDOW()
ON_WM_KILLFOCUS()
//}}AFX_MSG_MAP
ON_MESSAGE(WX_SETSEQ, SetSeqEnable)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DispImgInfo message handlers
void
DispImgInfo::SetSeqEnable(WPARAM wParm, LPARAM lParm)
{
m_bHaveAvi = (FALSE == (BOOL)(wParm)) ? (FALSE) : (TRUE);
GetDlgItem(IDC_BUTTON7)->EnableWindow(m_bHaveAvi);
if (m_bPlayBacking) OnButton15();
m_bPlayBacking = FALSE;
GetDlgItem(IDC_BUTTON15)->EnableWindow(FALSE);
}
BOOL DispImgInfo::OnInitDialog()
{
CDialog::OnInitDialog();
p1.SubclassDlgItem(IDC_BUTTON1,this);
p1.SetIcon(IDI_P1);
p1.SetWindowText("每屏一幅");
p2.SubclassDlgItem(IDC_BUTTON2,this);
p2.SetIcon(IDI_PH2);
p2.SetWindowText("左右两幅");
p3.SubclassDlgItem(IDC_BUTTON3,this);
p3.SetIcon(IDI_PV2);
p3.SetWindowText("上下两幅");
p4.SubclassDlgItem(IDC_BUTTON4,this);
p4.SetIcon(IDI_P4);
p4.SetWindowText("每屏四幅");
p5.SubclassDlgItem(IDC_BUTTON5,this);
p5.SetIcon(IDI_P6);
p5.SetWindowText("每屏六幅");
p6.SubclassDlgItem(IDC_BUTTON6,this);
p6.SetIcon(IDI_P9);
p6.SetWindowText("每屏九幅");
//if( ((CBxtDlg*)AfxGetMainWnd())->imgpcs->SeqPath.GetLength() < 1 ) GetDlgItem(IDC_BUTTON7)->EnableWindow(false);
((CButton*)(GetDlgItem(IDC_CHECK1)))->SetCheck(0);
m_Delay.SetRange(50, 1000);
m_Delay.SetPos(100);
m_Delay.SetTicFreq(100);
m_bPlayBacking = FALSE;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DispImgInfo::OnButton1()
{
if (m_bPlayBacking) OnButton15();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_DSPIMG, 1, 0);//one pic
}
void DispImgInfo::OnButton4()
{
if (m_bPlayBacking) OnButton15();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_DSPIMG,4,0);//four pic
}
void DispImgInfo::OnButton5()
{
if (m_bPlayBacking) OnButton15();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_DSPIMG,6,0);//six pic
}
void DispImgInfo::OnButton6()
{
if (m_bPlayBacking) OnButton15();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_DSPIMG, 9, 0);//nine pic
}
void DispImgInfo::OnButton2()
{
if (m_bPlayBacking) OnButton15();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_DSPIMG,2,0);// p|p two pic
}
void DispImgInfo::OnButton3()
{
if (m_bPlayBacking) OnButton15();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_DSPIMG,3,0);// p/p tow pic
}
/*
[选择/取消选择] 拉伸
*/
void DispImgInfo::OnCheck1()
{
if (m_bPlayBacking) OnButton15();
int iStretchChecked = ((CButton*)(GetDlgItem(IDC_CHECK1)))->GetCheck();
((CBxtDlg*)AfxGetMainWnd())->imgpcs->
SendMessage(WX_DSPSTRETCH, iStretchChecked, 0);
}
void DispImgInfo::OnButton7()
{
if (FALSE == m_bPlayBacking)
{
((CButton*)(GetDlgItem(IDC_BUTTON15)))->EnableWindow(TRUE);
((CButton*)(GetDlgItem(IDC_BUTTON7)))->SetWindowText("暂停动态图像");
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_PLAYBACK, 0, 0);
m_bPlayBacking = TRUE;
}
else
{
CString sCaption;
((CButton*)(GetDlgItem(IDC_BUTTON7)))->GetWindowText(sCaption);
if ("暂停动态图像" == sCaption)
((CButton*)(GetDlgItem(IDC_BUTTON7)))->SetWindowText("显示动态图像");
else
((CButton*)(GetDlgItem(IDC_BUTTON7)))->SetWindowText("暂停动态图像");
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_PLAYBACK, -3, 0);
}
}
void DispImgInfo::OnButton15()
{
((CButton*)(GetDlgItem(IDC_BUTTON15)))->EnableWindow(FALSE);
((CButton*)(GetDlgItem(IDC_BUTTON7)))->SetWindowText("显示动态图像");
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_PLAYBACK, -1, 0);
m_bPlayBacking = FALSE;
}
void DispImgInfo::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if (m_bPlayBacking)
{
if (NULL != ((CBxtDlg*)AfxGetMainWnd())->imgpcs)
((CBxtDlg*)AfxGetMainWnd())->imgpcs->SendMessage(WX_PLAYBACK, -2, m_Delay.GetPos());
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
void DispImgInfo::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
if(!bShow && m_bPlayBacking) OnButton15();
}
void DispImgInfo::OnKillFocus(CWnd* pNewWnd)
{
CDialog::OnKillFocus(pNewWnd);
if(m_bPlayBacking) OnButton15();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -