From: boca4711 <boc...@us...> - 2005-10-16 12:08:38
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19258 Added Files: FilePropertyDlg.cpp FilePropertyDlg.h Log Message: Dialog to show file properties. --- NEW FILE: FilePropertyDlg.cpp --- // FilePropertyDlg.cpp: Implementierungsdatei // #include "stdafx.h" #include "anyedit.h" #include "FilePropertyDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropertyDlg CFilePropertyDlg::CFilePropertyDlg(LPCTSTR pszCaption) : CPropertySheet(pszCaption) { //{{AFX_DATA_INIT(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Elementinitialisierung ein //}}AFX_DATA_INIT m_psh.dwFlags |= PSH_NOAPPLYNOW; } void CFilePropertyDlg::DoDataExchange(CDataExchange* pDX) { CPropertySheet::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier DDX- und DDV-Aufrufe ein //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CFilePropertyDlg, CPropertySheet) //{{AFX_MSG_MAP(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Zuordnungsmakros für Nachrichten ein //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CFilePropertyDlg int CFilePropertyDlg::DoModal() { AddPage(&m_pageGeneral); AddPage(&m_pageWordCount); // AddPage(&m_pageEncoding); AddPage(&m_pageTouch); return CPropertySheet::DoModal(); } void CFilePropertyDlg::SetFileInfo(CFileProperty *pFileInfo) { m_pageGeneral.SetFileInfo(pFileInfo); m_pageWordCount.SetFileInfo(pFileInfo); m_pageTouch.SetFileInfo(pFileInfo); } --- NEW FILE: FilePropertyDlg.h --- #if !defined(AFX_FILEPROPERTYDLG_H__312151EF_7C19_4C8A_85F7_22BE19606E6C__INCLUDED_) #define AFX_FILEPROPERTYDLG_H__312151EF_7C19_4C8A_85F7_22BE19606E6C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // FilePropertyDlg.h : Header-Datei // #include "FilePropGeneral.h" #include "FilePropWordCount.h" #include "FilePropTouch.h" #include "Shlwapi.h" class CFileProperty { public: CString m_strFilePath; CString m_strTempFilePath; CString m_strSelFilePath; int m_nTabSize; int m_nIndentSize; int m_nCRLF; HWND m_hwndEditor; bool m_bIsSelection; int m_nCodePage; int m_nSimpleEncoding; bool m_bSimpleEncoding; UINT m_nLanguage; /** * @brief Brief Description * * Detailed description * * @param * * @return * * @note * * @sa * */ CFileProperty() { m_strFilePath = _T(""); m_strTempFilePath = _T(""); m_strSelFilePath = _T(""); m_nTabSize = 4; m_nIndentSize = 4; m_nCRLF = 0; m_hwndEditor = NULL; m_bIsSelection = false; m_nCodePage = 0xFFFF; m_nSimpleEncoding = 0; m_bSimpleEncoding = true; m_nLanguage = NULL; } /** * @brief Brief Description * * Detailed description * * @param * * @return * * @note * * @sa * */ virtual ~CFileProperty() { if (!m_strTempFilePath.IsEmpty() && ::PathFileExists(m_strTempFilePath)) { ::DeleteFile(m_strTempFilePath); } if (!m_strSelFilePath.IsEmpty() && ::PathFileExists(m_strSelFilePath)) { ::DeleteFile(m_strSelFilePath); } } /** * @brief Brief Description * * Detailed description * * @param * * @return * * @note * * @sa * */ CFileProperty& operator=(const CFileProperty& opt) { m_strFilePath = opt.m_strFilePath; m_strTempFilePath = opt.m_strTempFilePath; m_strSelFilePath = opt.m_strSelFilePath; m_nTabSize = opt.m_nTabSize; m_nIndentSize = opt.m_nIndentSize; m_nCRLF = opt.m_nCRLF; m_hwndEditor = opt.m_hwndEditor; m_bIsSelection = opt.m_bIsSelection; m_nCodePage = opt.m_nCodePage; m_nSimpleEncoding = opt.m_nSimpleEncoding; m_bSimpleEncoding = opt.m_bSimpleEncoding; m_nLanguage = opt.m_nLanguage; return *this; } }; class CFileProperty; ///////////////////////////////////////////////////////////////////////////// // Dialogfeld CFilePropertyDlg class CFilePropertyDlg : public CPropertySheet { // Konstruktion public: void SetFileInfo(CFileProperty* pFileInfo); CScintillaEx* GetScintillaControl(void); CFilePropertyDlg(LPCTSTR pszCaption); // Standardkonstruktor // Dialogfelddaten //{{AFX_DATA(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Datenelemente ein //}}AFX_DATA // Überschreibungen // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CFilePropertyDlg) public: virtual int DoModal(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: CFilePropGeneral m_pageGeneral; CFilePropWordCount m_pageWordCount; CFilePropTouch m_pageTouch; // Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CFilePropertyDlg) // HINWEIS: Der Klassen-Assistent fügt hier Member-Funktionen ein //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein. #endif // AFX_FILEPROPERTYDLG_H__312151EF_7C19_4C8A_85F7_22BE19606E6C__INCLUDED_ |