BroadCastDialog.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:3k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // BroadCastDialog.cpp : implementation file
- //
- #include "stdafx.h"
- #include "conference.h"
- #include "BroadCastDialog.h"
- #include "MainFrame.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern CConferenceApp theApp;
- /////////////////////////////////////////////////////////////////////////////
- // CBroadCastDialog dialog
- CBroadCastDialog::CBroadCastDialog(CFrameWnd * pParent )
- : CDialog(CBroadCastDialog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CBroadCastDialog)
- m_all = FALSE;
- m_clear = FALSE;
- //}}AFX_DATA_INIT
- this->mainFrame = ( CMainFrame * )pParent;
- }
- void CBroadCastDialog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CBroadCastDialog)
- DDX_Control(pDX, IDC_ONLINE_LIST, m_olist);
- DDX_Check(pDX, IDC_ALL_CHECK, m_all);
- DDX_Check(pDX, IDC_CLEAR_CHECK, m_clear);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CBroadCastDialog, CDialog)
- //{{AFX_MSG_MAP(CBroadCastDialog)
- ON_BN_CLICKED(IDC_ALL_CHECK, OnAllCheck)
- ON_BN_CLICKED(IDC_CLEAR_CHECK, OnClearCheck)
- ON_WM_CTLCOLOR()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CBroadCastDialog message handlers
- BOOL CBroadCastDialog::OnInitDialog()
- {
- CDialog::OnInitDialog( );
- this->m_olist.SetExtendedStyle( LVS_EX_FULLROWSELECT );
- CRect rc;
- this->m_olist.GetClientRect( &rc );
- this->m_olist.InsertColumn( 0 , "在先用户信息" , LVCFMT_LEFT , rc.Width( ) );
- int index = 0;
- for( int i = 0; i < this->mainFrame->GetConferenceDialog( ).m_olist.GetItemCount( ); i ++ )
- {
- index = this->m_olist.InsertItem( 0 , this->mainFrame->GetConferenceDialog( ).m_olist.GetItemText( i , 0 ) );
- this->m_olist.SetItemData( index , this->mainFrame->GetConferenceDialog( ).m_olist.GetItemData( i ) );
- }
- return TRUE;
- }
- void CBroadCastDialog::OnAllCheck()
- {
- this->m_all = true;
- this->m_clear = false;
- this->UpdateData( false );
- for( int i = 0; i < this->m_olist.GetItemCount( ); i ++ )
- this->m_olist.SetItemState( i , LVIS_SELECTED , LVIS_SELECTED );
- }
- void CBroadCastDialog::OnClearCheck()
- {
- this->m_all = false;
- this->m_clear = true;
- this->UpdateData( false );
- for( int i = 0; i < this->m_olist.GetItemCount( ); i ++ )
- this->m_olist.SetItemState( i , ~LVIS_SELECTED , LVIS_SELECTED );
- }
- void CBroadCastDialog::OnOK()
- {
- POSITION pos = this->m_olist.GetFirstSelectedItemPosition( );
- int index = 0;
- while( pos )
- {
- index = this->m_olist.GetNextSelectedItem( pos );
- theApp.GetClient( ).SendBroadCastREQ( this->m_olist.GetItemData( index ) );
- }
- CDialog::OnOK();
- }
- HBRUSH CBroadCastDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- static HBRUSH b = ::CreateSolidBrush( RGB( 214 , 239 , 255 ) );
- pDC->SetBkMode( TRANSPARENT );
- return b;
- }