//{{AFX_MSG_MAP(DApp)
ON_MAND(ID_APP_ABOUT; OnAppAbout)
// NOTE the ClassWizard will add and remove mapping macros here。
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document mands
ON_MAND(ID_FILE_NEW; CWinApp::OnFileNew)
ON_MAND(ID_FILE_OPEN; CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DApp construction
DApp::DApp()
{
// TODO: add construction code here;
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only DApp object
DApp theApp;
/////////////////////////////////////////////////////////////////////////////
…………………………………………………………Page 470……………………………………………………………
// DApp initialization
BOOL DApp::InitInstance()
{
// Step 1: Allocate C++ window object。
DMainFrame * pFrame;
pFrame = new DMainFrame();
// Step 2: Initialize window object。
pFrame…》LoadFrame(IDR_MAINFRAME);
// Make window visible
pFrame…》ShowWindow(m_nCmdShow);
// Assign frame as application"s main window
m_pMainWnd = pFrame;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// Implementation
protected:
…………………………………………………………Page 471……………………………………………………………
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg; CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App mand to run the dialog
void DApp::OnAppAbout()
{
CAboutDlg aboutDlg;
…………………………………………………………Page 472……………………………………………………………
aboutDlg。DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// DApp mands
// mainfrm。h : interface of the DMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#include // Connect to CArray template。
// Structure to track lines in text file。
class STRING
{
public:
LPTSTR pText;
int ccLen;
};
// This declaration uses the CArray template
// to provide a dynamic array of STRING records。
class StringArray : public CArray
{
public:
StringArray() {}
STRING& operator=(STRING & s)
{m_pData…》pText = s。pText;
m_pData…》ccLen = s。ccLen;
return *m_pData;}
};
…………………………………………………………Page 473……………………………………………………………
const int g_nTabCount=25;
const int g_nTabStop=4;
class DMainFrame : public CFrameWnd
{
public:
DMainFrame();
protected: // create from serialization only
DECLARE_DYNCREATE(DMainFrame)
// Attributes
public:
BOOL d_bTabs; // Respect tabs or not。
CFileDialog * d_pOpenFile; // Ptr to OpenFile dialog。
CFontDialog * d_pSetFont; // Ptr to Font Picker dialog。
CFont * d_pFont; // Ptr to CFont object。
COLORREF d_crForeground; // Foreground text color。
COLORREF d_crBackground; // Background text color。
LOGFONT d_lf; // Current logical font。
LPINT d_pnTabs; // Array of tab settings。
LPTSTR d_lpTextBuffer; // Ptr to text buffer。
DWORD d_dwFileLength; // File length。
StringArray d_saTextInfo; // Array of string info。
int d_cLines; // Count of lines in text。
int d_cyLineHeight; // Height of one line of text。
int d_clHeight; // Window height line count。
int d_iTopLine; // Index of top…most line。
int d_cyClient; // Window client area height。
…………………………………………………………Page 474……………………………………………………………
int d_cxLeftMargin; // Margin to left of text。
// Operations
public:
void BuildStringArray();
BOOL CreateNewFont();
void ResetScrollValues();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DMainFrame)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~DMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(DMainFrame)
afx_msg void CmdFileOpen();
afx_msg void CmdFormatFont();
afx_msg void CmdFormatTabs();
afx_msg void UpdFormatTabs(CCmdUI* pCmdUI);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnPaint();
…………………………………………………………Page 475……………………………………………………………
afx_msg void OnSize(UINT nType; int cx; int cy);
afx_msg void OnVScroll(UINT nSBCode; UINT nPos; CScrollBar* pScrollBar);
afx_msg void OnWinIniChange(LPCTSTR lpszSection);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
////////////////////////////////////////////////////
小说推荐
- C语言游戏编程从入门到精通(PDF格式)
- -Page 1-Page 2-Page 3-Page 4-Page 5-Page 6-Page 7-Page 8-Page 9-Page 10-Page 11-Page 12-Page 13-Page 14
- 最新章:第4章
- JMS简明教程(PDF格式)
- -Page 1-JMS1.1规范中文版卫建军2007‐11‐22-Page 2
- 最新章:第28章
- SQL语言艺术(PDF格式)
- -Page 1-SQLSSQQLL语言艺术内容介绍本书分为12章,每一章包含许多原则或准则,并通过举例的方式对原则进行解释说明。这些例子大多来自于实际案例,对九种SQL经典查询场景以及其性能影响讨论,非常便于实践,为你数据库应用维护人员阅读。资深 SQL 专家 Stéphane Faroult倾力打
- 最新章:第27章
- 软件工程实践者的思想(PDF格式)
- -Page 1-大 道 至 简—软件工程实践者的思想周爱民(Aimingoo 著-Page 2-序2004 年 11 月初爱民(Aimingoo)第一次把他的书稿给我,我翻看了一下,第一反应讲的是感想。这不错,在技
- 最新章:第26章
- asp基础实用教程(DOC格式)
- 目 录一、关于ASP二、ASP的新功能三、创建ASP页四、使用脚本语言五、使用变量和常量六、使用集合七、ASP内建对象八、向浏览器发送内容九、包含文件十、访问数据库十一、调试ASP脚本十二、维护ASP应用程序的安全一、关于ASP Active Server Pages(ASP)是服务器端脚本编写环境
- 最新章:第17章
- Linux实用培训教程(PDF)
- -Page 1-rrktqt的个人空间 Linux实用培训教程第一部分 作者:红联Linux实用培训教程第一部分-共三部分解的Linux知识,循序渐进的介绍Linux相关知识,从入门到提高,希望对所有学习Linux的朋友都有帮助 红联Linux论坛是致力于Linux技术讨论的站点,目前网站收录的文章
- 最新章:第42章
- php程序设计简明教程(DOC格式)
- -Page 1-PHP 程序设计简明教程PHP 讲义 第 1 页 共 90 页-Page 2-目录序 4第一章 PHP 简介 6
- 最新章:第31章
- 路由器基本知识及应用实例(DOC格式)
- 第二章 路由器第一节 路由器发展概述自从1984年问世至今,路由器已经走过了近20年的快速技术发展历程。路由器的应用领域不断扩展、从单一的互通网关逐渐扩展到覆盖广域网、城域网乃至用户接入的各个领域。近年来,路由器早已逐渐脱离单纯用于企业网出口和互联的概念,开始成为运营网络和各种专用业务网络的核心设备
- 最新章:第48章
- Java编程思想第4版[中文版](PDF格式)
- -Page 1-Page 2《Thinking In Java》中文版作者:Bruce Eckel主页:http/BruceEckel.编译:Trans Bot主页:http/memberease~transbot致谢-献给那些直到现在仍在孜孜不倦创造下一代计算机语言的人们!指导您利用万维网的语言进
- 最新章:第295章