DlgMain.cpp
上传用户:gnaf34
上传日期:2022-04-22
资源大小:1657k
文件大小:4k
- /*
- * DlgMain.cxx
- *
- * Implementation file
- *
- * Copyright (c) ITEC-Ohio, 2002.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Open H323 Library available at http://www.openh323.org
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- */
- #include "stdafx.h"
- #include "BeaconClient.h"
- #include "DlgMain.h"
- #include "MyTabCtrl.h"
- #include "BeaconClientDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- CString consoleStr;
- CString ReportStr;
- CString laG,laA,laU,loG,loA,loU,jiG,jiA,jiU;
- /////////////////////////////////////////////////////////////////////////////
- // CDlgMain dialog
- //CString ipglobal = "";
- //extern int FlagEndPoint;
- CDlgMain::CDlgMain(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgMain::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDlgMain)
- //}}AFX_DATA_INIT
-
- }
- void CDlgMain::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDlgMain)
- DDX_Control(pDX, IDC_CONSOLE, m_Console);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDlgMain, CDialog)
- //{{AFX_MSG_MAP(CDlgMain)
- ON_WM_CTLCOLOR()
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgMain message handlers
- //DEL void CDlgMain::OnButtonApply()
- //DEL {
- //DEL // TODO: Add your control notification handler code here
- //DEL /*CWnd* pIP = (CWnd*)GetDlgItem(IDC_IPADDRESS1);
- //DEL pIP->GetWindowText(ipHolder);
- //DEL ipglobal = ipHolder;
- //DEL
- //DEL if (ipglobal == "0.0.0.0"){
- //DEL MessageBox("Please enter a destination IP Address and press apply before placing a call...","H.323 Beacon Client",MB_OK);
- //DEL CIPAddressCtrl *pIPReset = (CIPAddressCtrl *)GetDlgItem(IDC_IPADDRESS1);
- //DEL pIPReset->SetFocus();
- //DEL }
- //DEL else{
- //DEL
- //DEL FlagEndPoint = 1;
- //DEL }*/
- //DEL }
- //DEL void CDlgMain::OnButtonClear()
- //DEL {
- //DEL // TODO: Add your control notification handler code here
- //DEL /*CIPAddressCtrl *pIP = (CIPAddressCtrl *)GetDlgItem(IDC_IPADDRESS1);
- //DEL pIP->ClearAddress();
- //DEL
- //DEL CIPAddressCtrl *pIPGateway = (CIPAddressCtrl *)GetDlgItem(IDC_IPADDRESS2);
- //DEL pIPGateway->ClearAddress();
- //DEL
- //DEL ipglobal = "";*/
- //DEL
- //DEL }
- BOOL CDlgMain::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
-
- //Adding color to the console edit box
- m_blackcolor=RGB(0,0,0); //black
- m_textcolor=RGB(0,255,0);//green
- m_blackbrush.CreateSolidBrush(m_blackcolor);
-
-
- consoleStr+="Waiting to initiate test session...";
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- HBRUSH CDlgMain::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
- {
- HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
-
- // TODO: Change any attributes of the DC here
- if (pWnd->GetDlgCtrlID() == IDC_CONSOLE){
- // Set the text color to green.
- pDC->SetTextColor(m_textcolor);
- // Set the background color to black
- pDC->SetBkColor(m_blackcolor);
- // Return handle to our CBrush object.
- hbr = (HBRUSH)m_blackbrush;
- }
- // TODO: Return a different brush if the default is not desired
- return hbr;
- }
- void CDlgMain::AppendString(CString str)
- {
- if(!consoleStr.IsEmpty())
- consoleStr += "rn";
- consoleStr += str;
- }
- void CDlgMain::OnPaint()
- {
-
- CPaintDC dc(this); // device context for painting
-
- // TODO: Add your message handler code here
- SetDlgItemText(IDC_CONSOLE,consoleStr);
- // Do not call CDialog::OnPaint() for painting messages
- }