?? play.cpp
字號(hào):
// Play.cpp : implementation file
//
#include "stdafx.h"
#include "MyFight.h"
#include "Play.h"
#include "MyFightDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Play dialog
Play::Play(CWnd* pParent /*=NULL*/)
: CDialog(Play::IDD, pParent)
{
//{{AFX_DATA_INIT(Play)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_nItem=0;
}
void Play::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Play)
DDX_Control(pDX, IDC_LIST1, m_ListBox);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Play, CDialog)
//{{AFX_MSG_MAP(Play)
ON_BN_CLICKED(IDC_FIGHT, OnFight)
ON_BN_CLICKED(IDC_START, OnStart)
ON_BN_CLICKED(IDC_STOP, OnStop)
ON_BN_CLICKED(IDC_CANCEL, OnCancel)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Play message handlers
void Play::OnFight()
{
// TODO: Add your control notification handler code here
}
void Play::OnStart()
{
// TODO: Add your control notification handler code here
m_idTime=SetTimer(1,2000,0);
}
void Play::OnStop()
{
// TODO: Add your control notification handler code here
KillTimer(m_idTime);
}
void Play::OnCancel()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel();
}
BOOL Play::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CMyFightDlg dlg;
CString str;
str=dlg.m_csCurrentPath;
str+="\\";
str+="play.csv";
CStdioFile file;
file.Open(str,CFile::modeRead );
CString csOutput;
int i=1;
m_ListBox.AddString("");
while(file.ReadString(csOutput))
{
if(i==1)
{}
else
{
while(!csOutput.IsEmpty())
{
int n=csOutput.Find((char)44);
if(n==-1) break;
m_ListBox.AddString(csOutput.Left(n));
csOutput=csOutput.Right(csOutput.GetLength()-n-1);
}
m_ListBox.AddString(" ");
}
i++;
}
file.Close();
m_idTime=SetTimer(1,2000,0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void Play::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if(m_nItem>=m_ListBox.GetCount())
m_nItem=0;
m_ListBox.SetCurSel(m_nItem);
m_nItem+=15;
CDialog::OnTimer(nIDEvent);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -