⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ddxfolder.h

📁 视频芯片管理系统
💻 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 + -