?? dlgcodegif.cpp
字號:
// DlgCodeGIF.cpp : implementation file
//
#include "stdafx.h"
#include "ch1_1.h"
#include "DlgCodeGIF.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgCodeGIF dialog
CDlgCodeGIF::CDlgCodeGIF(CWnd* pParent /*=NULL*/)
: CDialog(CDlgCodeGIF::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCodeGIF)
m_strFilePath = _T("");
m_bInterlace = FALSE;
//}}AFX_DATA_INIT
}
void CDlgCodeGIF::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCodeGIF)
DDX_Text(pDX, IDC_EDIT_FileName, m_strFilePath);
DDX_Radio(pDX, IDC_RADIO1, m_bInterlace);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCodeGIF, CDialog)
//{{AFX_MSG_MAP(CDlgCodeGIF)
ON_BN_CLICKED(IDC_btnSaveAs, OnbtnSaveAs)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgCodeGIF message handlers
void CDlgCodeGIF::OnbtnSaveAs()
{
// 提示選擇保存文件路徑
CFileDialog dlg(FALSE, "GIF", m_strFilePath, OFN_HIDEREADONLY,
"GIF圖像文件 (*.GIF) | *.GIF|所有文件 (*.*) | *.*||", NULL);
// 提示用戶選擇保存的路徑
if (dlg.DoModal() != IDOK)
{
// 返回
return;
}
// 獲取用戶指定的文件路徑
m_strFilePath = dlg.GetPathName();
// 更新
UpdateData(FALSE);
}
void CDlgCodeGIF::OnOK()
{
// 更新
UpdateData(TRUE);
// 判斷用戶指定的文件是否存在
if (fFind.FindFile(m_strFilePath, 0) != 0)
{
// 詢問用戶是否覆蓋
if (MessageBox("指定的文件已經存在,是否覆蓋?", "系統提示",
MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES)
{
// 退出
return;
}
}
// 調用默認的OnOK事件
CDialog::OnOK();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -