📄 dlggamefilelist.cpp
字号:
// DlgGameFileList.cpp : 实现文件
//
#include "stdafx.h"
#include "DartScore.h"
#include "DlgGameFileList.h"
// CDlgGameFileList 对话框
IMPLEMENT_DYNAMIC(CDlgGameFileList, CDialogWM)
CDlgGameFileList::CDlgGameFileList(CWnd* pParent /*=NULL*/)
: CDialogWM(CDlgGameFileList::IDD, IDR_MENU_OKCANCEL, pParent)
{
}
CDlgGameFileList::~CDlgGameFileList()
{
}
void CDlgGameFileList::DoDataExchange(CDataExchange* pDX)
{
CDialogWM::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CDlgGameFileList, CDialogWM)
ON_LBN_SETFOCUS(IDC_LIST1, &CDlgGameFileList::OnLbnSetfocusList1)
END_MESSAGE_MAP()
// CDlgGameFileList 消息处理程序
void CDlgGameFileList::OnInit(void)
{
CListBox *pListBox = (CListBox*)GetDlgItem(IDC_LIST1);
ASSERT ( pListBox );
CString csFindFile;
csFindFile.Format ( _T("%s*.gam"), g_CurDir );
CHwDir dir ( csFindFile, TRUE, TRUE );
for ( int i=0; dir.m_pStrAryResFile && i < dir.m_pStrAryResFile->GetSize(); i++ )
{
CString csPathFileName = dir.m_pStrAryResFile->GetAt ( i );
TCHAR szOnlyFileName[MAX_PATH] = {0};
PartFileAndPathByFullPath ( csPathFileName, szOnlyFileName, sizeof(szOnlyFileName) );
pListBox->AddString ( szOnlyFileName );
}
OnLbnSetfocusList1 ();
CDialogWM::OnInit ();
}
void CDlgGameFileList::OnLbnSetfocusList1()
{
CListBox *pListBox = (CListBox*)GetDlgItem(IDC_LIST1);
ASSERT ( pListBox );
if ( pListBox->GetCurSel () < 0 && pListBox->GetCount () > 0 )
{
pListBox->SetCurSel ( 0 );
}
}
void CDlgGameFileList::OnOK(void)
{
CListBox *pListBox = (CListBox*)GetDlgItem(IDC_LIST1);
ASSERT ( pListBox );
int nCurSel = pListBox->GetCurSel ();
if ( nCurSel >= 0 )
{
pListBox->GetText ( nCurSel, m_csFileName );
}
CDialogWM::OnOK ();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -