📄 recordsetdlg.cpp
字号:
// RecordSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "phonerec.h"
#include "RecordSetDlg.h"
#include "PhoneRecView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
enum ELineRecCol
{
recLineIDtemp,
recLineID,
recChannelType,
recPhoneNum,
recRecordEnable,
recRecordMode,
recMax
};
static char g_szaLineListTitle[recMax][16] =
{
" ",
"线路ID",
"类型",
"电话号码",
"录音功能",
"录音方式"
};
static int g_izLineListWidth[recMax] = { 0,52,45,66,64,64 };
extern CPhoneRecView* g_pMgr;
/////////////////////////////////////////////////////////////////////////////
// CRecordSetDlg dialog
CRecordSetDlg::CRecordSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRecordSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRecordSetDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CRecordSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRecordSetDlg)
DDX_Control(pDX, IDC_LIST_LINE, m_listLine);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRecordSetDlg, CDialog)
//{{AFX_MSG_MAP(CRecordSetDlg)
ON_NOTIFY(NM_DBLCLK, IDC_LIST_LINE, OnDblclkListLine)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRecordSetDlg message handlers
BOOL CRecordSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
for( int i=0; i<recMax; i++ )
{
m_listLine.InsertColumn(i, g_szaLineListTitle[i],
(i==0)?LVCFMT_LEFT:LVCFMT_CENTER,g_izLineListWidth[i] );
}
m_listLine.SetExtendedStyle( LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT );
CChannel * pChannel=NULL;
int iLineID = 0;
char buffer[16];
do
{
pChannel = g_pMgr->GetChannelObject( iLineID );
if( !pChannel )
break;
sprintf( buffer, "%d", iLineID );
m_listLine.InsertItem( iLineID, buffer );
CString strLineID;
strLineID.Format( "%d", iLineID );
m_listLine.SetItemText( iLineID, recLineID, strLineID );
m_listLine.SetItemText( iLineID, recChannelType, GetChannelTypeText( pChannel->GetChannelType() ) );
CString strPhone;
CString strReEab;
CString strReMode;
if( pChannel->GetChannelType() != CH_USER )
{
m_setTable.GetChannelInfoByLineID( strPhone, strReEab,strReMode, iLineID);
m_listLine.SetItemText( iLineID, recPhoneNum, strPhone );
m_listLine.SetItemText( iLineID, recRecordEnable, strReEab );
m_listLine.SetItemText( iLineID, recRecordMode, strReMode );
}
iLineID++;
}while(pChannel);
return TRUE;
}
void CRecordSetDlg::OnDblclkListLine(NMHDR* pNMHDR, LRESULT* pResult)
{
int iLineIDIndex = m_listLine.GetNextItem( -1, LVNI_SELECTED );
if ( 0 <= iLineIDIndex )
{
CChannel * pChannel=NULL;
pChannel = g_pMgr->GetChannelObject( iLineIDIndex );
if( pChannel )
{
if( pChannel->GetChannelType() != CH_USER )
{
CLineRecSet LineRecSet( iLineIDIndex, m_listLine.GetItemText( iLineIDIndex, 3 ),
m_listLine.GetItemText( iLineIDIndex, 4), m_listLine.GetItemText(iLineIDIndex,5) );
if( LineRecSet.DoModal() == IDOK )
{
CString strReEab;
CString strReMode;
strReEab = LineRecSet.m_iReEable == 0 ? "启动" : "关闭";
strReMode= LineRecSet.m_iReMode == 0 ? "压控" : "声控";
m_listLine.SetItemText(iLineIDIndex, 3, LineRecSet.m_strPhone );
m_listLine.SetItemText(iLineIDIndex, 4 ,strReEab );
m_listLine.SetItemText(iLineIDIndex, 5 ,strReMode );
//修改数据库
m_setTable.UpdateLineSet( iLineIDIndex, LineRecSet.m_strPhone, LineRecSet.m_iReEable, LineRecSet.m_iReMode );
//改变图标显示号码
g_pMgr->m_pButtonArray[ iLineIDIndex ]->SetWindowText( LineRecSet.m_strPhone );
pChannel->m_bRecordEnable = LineRecSet.m_iReEable;
pChannel->m_bRecordMode = LineRecSet.m_iReMode;
}
}
}
}
*pResult = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -