?? ddxfolder.h
字號:
/*
Module : DDXFOLDER.CPP
Purpose: Defines the interface to a for a MFC DDX_ routine to get a directory/folder
Using the file open/save as common dialogs
Created: PJN / 26-03-1997
History: None
Copyright (c) 1997 - 1998 by PJ Naughter.
All rights reserved.
*/
////////////////////////////////// Macros ///////////////////////////
#ifndef __DDXFOLDER_H__
#define __DDXFOLDER_H__
#include "BtnST.h"
////////////////////////////////// Consts /////////////////////////////////////
//flags used to control how the DDX_FolderControl routine works
const DWORD GFLDR_OLD_STYLE_DIALOG = 0x0001; //Use the old style file open dialog instead of the
//style as used in Windows Explorer
//Flags used to control how the DDV_FolderControl routine works
const DWORD GFLDR_FOLDER_MUST_EXIST = 0x0001; //Fail validation if the folder does not exist.
////////////////////// foward declaration ///////////////////////////
class CGetFolderControl;
/////////////////////////// Classes /////////////////////////////////
class CModifyButton : public CButton
{
public:
CModifyButton();
void SetBuddy(CGetFolderControl* pBuddy);
protected:
//{{AFX_VIRTUAL(CModifyButton)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL
//{{AFX_MSG(CModifyButton)
afx_msg void OnClicked();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
CGetFolderControl* m_pBuddy;
BOOL m_bFirstCall;
CToolTipCtrl m_ToolTip;
};
class CGetFolderControl : public CEdit
{
public:
//Constructors / Destructors
CGetFolderControl();
//Methods
BOOL SubclassEdit(HWND hEdit);
//Accessors/Mutators
//Set/Get the flags
void SetFlags(DWORD dwFlags) { m_dwFlags = dwFlags; };
DWORD GetFlags() const { return m_dwFlags; };
//Set/Get the dialog title
void SetDialogTitle(const CString& sDialogTitle) { m_sDialogTitle = sDialogTitle; };
CString GetDialogTitle() const { return m_sDialogTitle; };
//Set/Get the actual value
CString GetFolder() const;
void SetFolder(const CString& sFolder);
//Bring up the directory picker dialog
void Edit();
protected:
//{{AFX_VIRTUAL(CGetFolderControl)
//}}AFX_VIRTUAL
//{{AFX_MSG(CGetFolderControl)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
BOOL AddEditButton();
CModifyButton m_Edit;
DWORD m_dwFlags;
CString m_sDialogTitle;
CString m_sPath;
};
/////////////// MFC Data exchange routines //////////////////////////
void DDX_FolderControl(CDataExchange* pDX, int nIDC, CGetFolderControl& rCGetFolderControl, DWORD dwFlags, const CString& sDialogTitle);
void DDX_FolderValue(CDataExchange* pDX, CGetFolderControl& rCGetFolderControl, CString& sFolder);
void DDV_FolderControl(CDataExchange* pDX, CGetFolderControl& rCGetFolderControl, DWORD dwFlags);
#endif //_DDXFOLDER_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -