| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665 |
- // RealEventDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "IDE.h"
- #include "RealEventDlg.h"
- #include <mmsystem.h>
- #include "shlwapi.h"
- #include "mainfrm.h"
- #include ".\realeventdlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern BOOL g_bRun;
- extern BOOL g_bEventAlarm;
- extern CString g_strYkWave;
- extern CString g_strLoginWave;
- extern CString g_strReguWave;
- extern CString g_strSetWave;
- extern CString g_strYcWave;
- extern CString g_strYxChangeWave;
- /////////////////////////////////////////////////////////////////////////////
- // CRealEventDlg dialog
- #define NOTICE_DELAY 30 //通知延时
- CRealEventDlg::CRealEventDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CRealEventDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CRealEventDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- m_bStopSound = false;
- m_bExitThread = false;
- m_hPlaysound = NULL;
- }
- CRealEventDlg::~CRealEventDlg()
- {
- if( m_hPlaysound != NULL )
- {
- //MTVERIFY( WaitForSingleObject( m_hPlaysound, INFINITE ) != WAIT_FAILED );
- MTVERIFY( CloseHandle( m_hPlaysound ) );
- m_hPlaysound = NULL;
- }
- CDialog::~CDialog();
- }
- void CRealEventDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CRealEventDlg)
- DDX_Control(pDX, IDC_LIST_GRID, m_ctrlGrid);
- DDX_Control(pDX, IDC_CONFIRM, m_Btn_Config);
- DDX_Control(pDX, IDC_HIDE, m_Btn_ConfigAll);
- DDX_Control(pDX, IDC_DELETEALL, m_BtnDel);
- DDX_Control(pDX, IDC_BTN_EXIT, m_BtnExit);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CRealEventDlg, CDialog)
- //{{AFX_MSG_MAP(CRealEventDlg)
- ON_WM_PAINT()
- ON_WM_CREATE()
- ON_WM_TIMER()
- ON_BN_CLICKED(IDC_CONFIRM, OnConfirm)
- ON_BN_CLICKED(IDC_DELETEALL, OnDeleteall)
- ON_WM_CLOSE()
- ON_BN_CLICKED(IDC_HIDE, OnHide)
- ON_BN_CLICKED(IDC_BTN_EXIT, OnBtnEixt)
- ON_WM_SHOWWINDOW()
- //}}AFX_MSG_MAP
- ON_WM_CTLCOLOR()
- ON_WM_ERASEBKGND()
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CRealEventDlg message handlers
- BOOL CRealEventDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- //m_ctrlGrid.InsertColumn( 0, g_strHappentTime1 );
- //m_ctrlGrid.SetColumnWidth( 0, 135 );
- //m_ctrlGrid.InsertColumn( 1, g_strEventType );
- //m_ctrlGrid.SetColumnWidth( 1, 60);
- //m_ctrlGrid.InsertColumn( 2, g_strNormalData );
- //m_ctrlGrid.SetColumnWidth( 2, 110);
- //m_ctrlGrid.InsertColumn( 3, g_strAlarmData );
- //m_ctrlGrid.SetColumnWidth( 3, 60);
- //m_ctrlGrid.InsertColumn( 4, g_strEventInfo );
- //m_ctrlGrid.SetColumnWidth( 4, 470);
- //m_ctrlGrid.InsertColumn( 5, g_strDealStatus );
- //m_ctrlGrid.SetColumnWidth( 5, 100);
- //m_ctrlGrid.SetExtendedStyle(m_ctrlGrid.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
- m_ctrlGrid.SetHeaderBKColor(213,222,242,8); //设置头部背景色
- ////m_List_Rule.SetFontHW(15,0); //设置字体高度,和宽度,0表示缺省宽度
- //m_List_Rule.SetColTextColor(2,RGB(255,255,100)); //设置列文本颜色
- //m_List_Rule.SetItemTextColor(3,1,RGB(255,0,0)); //设置单元格字体颜色
- m_ctrlGrid.InsertColumn(0,g_strHappentTime1,LVCFMT_LEFT,145);
- m_ctrlGrid.InsertColumn(1,g_strEventType,LVCFMT_CENTER,70);
- m_ctrlGrid.InsertColumn(2,g_strNormalData,LVCFMT_CENTER,110);
- m_ctrlGrid.InsertColumn(3,g_strAlarmData,LVCFMT_CENTER,70);
- m_ctrlGrid.InsertColumn(4,g_strEventInfo,LVCFMT_LEFT,480);
- m_ctrlGrid.InsertColumn(5,g_strDealStatus,LVCFMT_LEFT,100);
- m_ctrlGrid.SetExtendedStyle(m_ctrlGrid.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
- m_ctrlGrid.SetBkColor( RGB( 204,232,207 ) );
- //SetWindowLong(m_ctrlList.m_hWnd ,GWL_EXSTYLE,WS_EX_CLIENTEDGE);
- //m_ctrlList.SetExtendedStyle(LVS_EX_GRIDLINES); //设置扩展风格为网格
- //::SendMessage(m_ctrlList.m_hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
- m_ctrlGrid.SetRowHeigt( 20 );
- CString sIDE;
- sIDE.Format( "%s",g_strDirectory );
- int nEnd = 0;
- for (int i = sIDE.GetLength()-1; i >= 0; i--)
- {
- if (sIDE[i] == '\\')
- {
- nEnd = i;
- break;
- }
- }
- m_sIoServerPath = sIDE.Left( nEnd ) + "\\new_server";
- if( g_nAlarmModeIsSound != 0 )
- {
- m_hPlaysound = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ThreadPlaySound,this,0,NULL);
- if (m_hPlaysound == NULL)
- {
-
- }
- }
- SetTimer( 2,1000,NULL );//更改等待状态和时间
- SetTimer( 3,300,NULL );//设置颜色
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CRealEventDlg::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
-
- // TODO: Add your message handler code here
-
- // Do not call CDialog::OnPaint() for painting messages
- }
- int CRealEventDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- AfxEnableControlContainer();
- if (CDialog::OnCreate(lpCreateStruct) == -1)
- return -1;
- SetTimer(1, 400, NULL);
- return 0;
- }
-
- void CRealEventDlg::OnTimer(UINT nIDEvent)
- {
- // 如果不报警,直接返回
- if ( !g_bRun ) return;
-
- if( nIDEvent==1 )
- {
- // 取新事件,加入列表
- CAlarmEvent* pEvent = pEventServer->GetNewEvent();
- if ( pEvent != NULL )
- {
- if( strcmp(pEvent->strContent,"") == 0 )
- {
- pEvent->nGet = 1;
- return;
- }
- //自动跳到报警画面
- if( g_nAlarmToPic && pEvent->strContent.Find(pVariantsManager->m_strReturnNormal) == -1 )
- {
- CMainFrame* pFrame = (CMainFrame*)AfxGetApp()->GetMainWnd();
- CString sVarName = pVariantsManager->GetVarNameByID( pEvent->nVarID );
- pFrame->SendMessage( WM_MY_NEW_ALERT,(WPARAM)sVarName.GetBuffer(sVarName.GetLength()),0 );
- sVarName.ReleaseBuffer();
- }
- m_bComfig = true;
- AddEventInfoToList(pEvent);
- //LOG4C((LOG_NOTICE, "AddEventInfoToList %s",pEvent->strContent));
- if ( !IsWindowVisible() && g_bRun)
- {
- ShowWindow(SW_SHOW);
- }
- }
- }
- if( nIDEvent==2 )
- {
- int nSize = m_ctrlGrid.GetItemCount();
- if( nSize>0 )
- {
- int nSec=0;
- CString sDeal,sTemp1;
- for( int i=0;i<nSize;i++ )
- {
- sDeal = m_ctrlGrid.GetItemText( i,5 );
- sDeal = sDeal.TrimLeft();
- if( -1 != sDeal.Find( "等待确认" ) )
- {
- sTemp1 = sDeal.Mid( 9,sDeal.GetLength()-8-4 );
- nSec = atoi( sTemp1 )-1;
- if( nSec>=0 )
- {
- sDeal.Format( " %s(%d秒)",sDeal.Left(8),nSec );
- m_ctrlGrid.SetItemText( i,5,sDeal );
- }
- else
- {
- sDeal.Format( " %s","等待过时" );
- m_ctrlGrid.SetItemText( i,5,sDeal );
- }
- }
- }
- }
- }
- if( nIDEvent==3 && g_nAlarmModeIsSound != 0 )
- {
- int nSize = m_ctrlGrid.GetItemCount();
- if( nSize>0 )
- {
- int nSec=0;
- CString sDeal,sTemp1;
- for( int i=0;i<nSize;i++ )
- {
- sDeal = m_ctrlGrid.GetItemText( i,5 );
- sDeal = sDeal.TrimLeft();
- //if( -1 != sDeal.Find( "等待确认" ) )
- {
- CString strUid;
- int nVarID=0,nStatus=0,nAlarmIndex=0,nIsSound=0,nColor=0;
- pEventServer->GetOneEventInfo( i,strUid,nVarID,nStatus,nAlarmIndex,nIsSound,nColor );
- if( nIsSound==0 && nColor!=1 )
- {
- pEventServer->SetOneEventInfo( i,0,1 );
- m_ctrlGrid.SetItemColor( 5,i,RGB(255,0,0) );
- m_ctrlGrid.Invalidate();
- break;
- }
- else if( nIsSound==0 )
- {
- break;
- }
- else if( nIsSound==1 && nColor!=2 )
- {
- pEventServer->SetOneEventInfo( i,1,2 );
- m_ctrlGrid.SetItemColor( 5,i,RGB(204,232,207) );
- m_ctrlGrid.Invalidate();
- }
- }
- }
- }
- }
- CDialog::OnTimer(nIDEvent);
- }
- void CRealEventDlg::PlaySoundTims( CString sWavPath,int iTimes )
- {
- MSG message;
- BOOL bRet = false;
- int nTimes = 0;
- while( !m_bStopSound )
- {
- bRet = sndPlaySound( sWavPath,SND_FILENAME|SND_ASYNC|SND_NOSTOP );
- Sleep( 100 );
- if( bRet )
- {
- nTimes++;
- if( nTimes>=iTimes )
- {
- break;
- }
- }
- if(::PeekMessage (&message,NULL,0,0,PM_REMOVE))
- { //响应其他事件 如Exit按钮操作
- ::TranslateMessage (&message);
- ::DispatchMessage (&message);
- }
- }
- }
- void CRealEventDlg::OnClose()
- {
- // m_bComfig = false;
- // m_ctrlGrid.DeleteAllItems();
- // // 将所有未确定事件确定;
- // while( m_pCurEvent != NULL )
- // {
- // CAnalog *pAnalog = pVariantsManager->FindAnalog( m_pCurEvent->nVarID );
- // pAnalog->bConfirm = true;
- // m_pCurEvent->nConfirm = m_pCurEvent->nConfirm==0?1:3;
- // m_pCurEvent = pEventServer->GetUnconfirmEvent();
- // }
- //
- //#if 1
- // sndPlaySound( NULL, SND_ASYNC );
- // sndPlaySound(NULL,NULL); //停止
- //#endif
- // ShowWindow(SW_HIDE);
- }
- CString CRealEventDlg::GetWeekStr( int iDayofWeek )
- {
- CString sRet;
- switch( iDayofWeek )
- {
- case 0: sRet = "日"; break;
- case 1: sRet = "一"; break;
- case 2: sRet = "二"; break;
- case 3: sRet = "三"; break;
- case 4: sRet = "四"; break;
- case 5: sRet = "五"; break;
- case 6: sRet = "六"; break;
- }
- return sRet;
- }
- void CRealEventDlg::AddEventInfoToList(CAlarmEvent *event)
- {
- CString sTime,sEventTye,sNormalData,sCurrentData,sContent,sDealStatus;
- sTime.Format(g_strTime, event->time.wYear,event->time.wMonth,event->time.wDay,event->time.wHour, event->time.wMinute, event->time.wSecond,GetWeekStr( event->time.wDayOfWeek ) );
- sEventTye = event->nStatus==0 ? "报警" : "恢复正常";
- if( event->nUpperLimit>0 || event->nLowerLimit>0 || event->nUpperLimit>event->nLowerLimit )
- {
- sNormalData.Format( "X>=%d && X<=%d",event->nLowerLimit,event->nUpperLimit );//sNormalData.Format( "%d<= X <=%d",event->nLowerLimit,event->nUpperLimit );
- sCurrentData.Format( "%0.1f",event->dbParaValue );
- }
- else
- {
- sNormalData.Format( "X = %d",event->nNormalState );
- sCurrentData.Format( "%d",event->nAlarmState );
- }
- sDealStatus.Format( " 等待确认(%d秒)",NOTICE_DELAY );
- int nInsertIndex = m_ctrlGrid.GetItemCount();
- m_ctrlGrid.InsertItem(nInsertIndex, sTime);
- m_ctrlGrid.SetItemText(nInsertIndex, 1, sEventTye );
- m_ctrlGrid.SetItemText(nInsertIndex, 2, sNormalData);
- m_ctrlGrid.SetItemText(nInsertIndex, 3, sCurrentData);
- m_ctrlGrid.SetItemText(nInsertIndex, 4, " "+event->strContent);
- m_ctrlGrid.SetItemText(nInsertIndex, 5, sDealStatus );
- m_ctrlGrid.EnsureVisible(nInsertIndex, FALSE);
- }
- CString CRealEventDlg::GetAlarmFile(int type)
- {
- #if 0
- switch (type)
- {
- case YC_LOWALARM:
- case YC_UPALARM:
- case YC_BACK:
- return g_strYcWave;
- case LOGIN:
- case LOGOUT:
- return g_strLoginWave;
- case YK:
- return g_strYkWave;
- case YX_CHANGE:
- return g_strYxChangeWave;
- case SET:
- return g_strSetWave;
- }
- #endif
- return "";
- }
- DWORD WINAPI CRealEventDlg::ThreadPlaySound( CRealEventDlg *pDlg )
- {
- do
- {
- int nSize = pDlg->m_ctrlGrid.GetItemCount();
- if( nSize > 0 )
- {
- int nSec=0;
- CString sDeal,sContent;
- for( int i=0;i<nSize;i++ )
- {
- sContent = pDlg->m_ctrlGrid.GetItemText( i,4 );
- sDeal = pDlg->m_ctrlGrid.GetItemText( i,5 );
- sDeal = sDeal.TrimLeft();
- if( -1 != sDeal.Find( "等待确认" ) )
- {
- CString strUid;
- int nVarID=0,nStatus=0,nAlarmIndex=0,nIsSound=0,nColor=0;
- pEventServer->GetOneEventInfo( i,strUid,nVarID,nStatus,nAlarmIndex,nIsSound,nColor );
- if( nIsSound==0 )
- {
- CString strFileName;
-
- if( g_nAlarmModeIsSound==1 )
- {
- strFileName.Format("%s\\wav\\temp_%s_%d_%d_IDE.wav", g_strDirectory, strUid, nVarID,nAlarmIndex );
- pStoneUDLLTxtToWav( (char *)(LPCTSTR)sContent, (char *)(LPCTSTR)strFileName,g_nTTSType,-5,300 );
- UINT uFlag = SND_ASYNC|SND_LOOP|SND_NODEFAULT;
- pDlg->m_bStopSound = false;
- pDlg->PlaySoundTims( strFileName,g_nAlarmModeSoundPlayNum );
-
- pEventServer->SetOneEventInfo( i,1,1 );
- if( PathFileExists(strFileName) )
- DeleteFile( strFileName );
- }
- else if( g_nAlarmModeIsSound==2 )
- {
- strFileName.Format("%s\\wav\\temp_%s_%d_%d_IDE.wav", pDlg->m_sIoServerPath, strUid, nVarID,nAlarmIndex );
- UINT uFlag = SND_ASYNC|SND_LOOP|SND_NODEFAULT;
- pDlg->m_bStopSound = false;
- pDlg->PlaySoundTims( strFileName,g_nAlarmModeSoundPlayNum );
-
- pEventServer->SetOneEventInfo( i,1,1 );
- }
- }
- }
- }
- }
- }while( WaitForSingleObject( g_hRunObject, 125L ) == WAIT_TIMEOUT );
- return 0;
- }
- HBRUSH CRealEventDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
- // TODO: 在此更改 DC 的任何属性
- // TODO: 如果默认的不是所需画笔,则返回另一个画笔
- return hbr;
- }
- BOOL CRealEventDlg::OnEraseBkgnd(CDC* pDC)
- {
- CBrush br1;
- CRect rect;
- GetWindowRect(&rect);
- ScreenToClient(&rect);
- br1.CreateSolidBrush(RGB(230, 241, 249));
- pDC->FillRect(rect,&br1);
- DeleteObject( br1 );
-
- return TRUE;
- //return CDialog::OnEraseBkgnd(pDC);
- }
- //确认全部
- void CRealEventDlg::OnHide()
- {
- int nSize = m_ctrlGrid.GetItemCount();
- if( nSize==0 )
- return;
- if( MessageBox( "确定要确认全部事件(在等待确认状态的事件才能确认 )?", g_strTip, MB_YESNO|MB_ICONINFORMATION)!=IDYES )
- return;
- int nSec=0;
- CString sDeal,sTemp1;
- for( int i=0;i<nSize;i++ )
- {
- sDeal = m_ctrlGrid.GetItemText( i,5 );
- sDeal = sDeal.TrimLeft();
- if( -1 != sDeal.Find( "等待确认" ) )
- {
- CString strUid;
- int nVarID=0,nStatus=0,nAlarmIndex=0,nIsSound=0,nColor=0;
- pEventServer->GetOneEventInfo( i,strUid,nVarID,nStatus,nAlarmIndex,nIsSound,nColor );
- pEventServer->SetOneEventInfo( i,1,1 );
- m_bStopSound = true;
- sndPlaySound( NULL, SND_ASYNC );
- sndPlaySound( NULL,NULL );
- Sleep( 100 );
- pDevicesManager->ConfigAlarm( strUid,nVarID,nStatus,nAlarmIndex );
- m_ctrlGrid.SetItemText( i,5," 已经确认" );
- }
- }
- }
- //确认所选
- void CRealEventDlg::OnConfirm()
- {
- int iListCount = m_ctrlGrid.GetItemCount();
- POSITION pos = m_ctrlGrid.GetFirstSelectedItemPosition();
- int nListSel = m_ctrlGrid.GetNextSelectedItem(pos);
- if(nListSel>=iListCount || nListSel==-1)
- {
- return;
- }
- if( MessageBox( "确定要确认所选择的事件(等待确认状态的事件才能确认 )?", g_strTip, MB_YESNO|MB_ICONINFORMATION)!=IDYES )
- return;
- pos = m_ctrlGrid.GetFirstSelectedItemPosition();
- if(NULL == pos)
- {
- }
- else
- {
- CString sDeal,sTemp1;
- while(pos)
- {
- int nItem = m_ctrlGrid.GetNextSelectedItem(pos);
- sDeal = m_ctrlGrid.GetItemText( nItem,5 );
- if( -1 != sDeal.Find( "等待确认" ) )
- {
- CString strUid;
- int nVarID=0,nStatus=0,nAlarmIndex=0,nIsSound=0,nColor=0;
- pEventServer->GetOneEventInfo( nItem,strUid,nVarID,nStatus,nAlarmIndex,nIsSound,nColor );
- pEventServer->SetOneEventInfo( nItem,1,1 );
- m_bStopSound = true;
- sndPlaySound( NULL, SND_ASYNC );
- sndPlaySound( NULL,NULL );
- Sleep( 100 );
- pDevicesManager->ConfigAlarm( strUid,nVarID,nStatus,nAlarmIndex );
- m_ctrlGrid.SetItemText( nItem,5," 已经确认" );
- }
- }
- }
- }
- //删除所选
- void CRealEventDlg::OnDeleteall()
- {
- int iListCount = m_ctrlGrid.GetItemCount();
- POSITION pos = m_ctrlGrid.GetFirstSelectedItemPosition();
- int nListSel = m_ctrlGrid.GetNextSelectedItem(pos);
- if(nListSel>=iListCount || nListSel==-1)
- {
- return;
- }
- if( MessageBox( "确定要删除所选择的事件(等待确认状态的事件不能删除 )?", g_strTip, MB_YESNO|MB_ICONINFORMATION)!=IDYES )
- return;
- pos = m_ctrlGrid.GetFirstSelectedItemPosition();
- if(NULL == pos)
- {
- }
- else
- {
- CString sDeal,sTemp1;
- while(pos)
- {
- int nItem = m_ctrlGrid.GetNextSelectedItem(pos);
- sDeal = m_ctrlGrid.GetItemText( nItem,5 );
- if( -1 == sDeal.Find( "等待确认" ) )
- {
- pEventServer->DeleteOneEvent( nItem );
- m_ctrlGrid.DeleteItem( nItem );
-
- pos = m_ctrlGrid.GetFirstSelectedItemPosition();
- }
- }
- }
- int a=0;
- }
- //关闭对话框
- void CRealEventDlg::OnBtnEixt()
- {
- bool bCanExit=true;
- int nSize = m_ctrlGrid.GetItemCount();
- if( nSize>0 )
- {
- int nSec=0;
- CString sDeal,sTemp1;
- for( int i=0;i<nSize;i++ )
- {
- sDeal = m_ctrlGrid.GetItemText( i,5 );
- sDeal = sDeal.TrimLeft();
- if( -1 != sDeal.Find( "等待确认" ) )
- {
- bCanExit = false;
- break;
- }
- }
- }
- if( bCanExit )
- {
- if( nSize>0 )
- {
- for( int i=nSize-1;i>=0;i-- )
- {
- pEventServer->DeleteOneEvent( i );
- m_ctrlGrid.DeleteItem( i );
- }
- }
- OnOK();
- }
- else
- MessageBox( "还有等待确认状态的事件尚未处理,不能关闭对话框", g_strTip, MB_ICONINFORMATION);
- }
- BOOL CRealEventDlg::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: 在此添加专用代码和/或调用基类
- if( pMsg->message == WM_KEYDOWN )
- {
- if(pMsg->wParam==VK_RETURN||pMsg->wParam==VK_ESCAPE)
- {
- return TRUE;
- }
- }
- return CDialog::PreTranslateMessage(pMsg);
- }
|