-
Notifications
You must be signed in to change notification settings - Fork 0
/
TEXT.H
190 lines (155 loc) · 4.63 KB
/
TEXT.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// text.h: include file for text editor classes
#ifndef __TEXT_H__
#define __TEXT_H__
/////////////////////////////////////////////////////////////////////////////
class CTextDoc : public CDocument
{
friend class CTextView;
protected: // create from serialization only
CTextDoc();
DECLARE_DYNCREATE(CTextDoc)
// Attributes
public:
CString m_strDocTitle;
CInternetNavApp* m_pApp;
// Operations
public:
// Implementation
public:
virtual ~CTextDoc();
virtual void Serialize(CArchive& ar); // overridden for document i/o
virtual void DeleteContents();
virtual BOOL SaveModified();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
virtual BOOL OnNewDocument();
// Generated message map functions
protected:
//{{AFX_MSG(CTextDoc)
afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// CTextView view -- for viewing text files
class CTextView : public CEditView
{
friend class CTextWnd;
protected: // create from serialization only
CTextView();
BOOL PreCreateWindow(CREATESTRUCT& cs);
DECLARE_DYNCREATE(CTextView)
// Attributes
public:
// static init/term...
static void Initialize();
static void Terminate();
CTextDoc* GetDocument();
CInternetNavApp* m_pApp;
// Operations
public:
// Word wrap...
BOOL IsWordWrap() const;
BOOL SetWordWrap(BOOL bWordWrap);
// Buffer access...
LPCSTR LockBuffer() const
{ return CEditView::LockBuffer(); }
void UnlockBuffer() const
{ CEditView::UnlockBuffer(); }
// Implementation
public:
BOOL IsUpdatePending() {return (m_uTimerID != NULL);}
protected:
virtual ~CTextView();
virtual void OnDraw(CDC* pDC); // overridden to draw this view
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
UINT m_uTimerID; // ==0 when no outstanding
static LOGFONT NEAR m_lfDefFont;
static LOGFONT NEAR m_lfDefFontOld;
CFont m_font;
static LOGFONT NEAR m_lfDefPrintFont;
static LOGFONT NEAR m_lfDefPrintFontOld;
CFont m_fontPrint;
static UINT m_nDefTabStops;
static UINT m_nDefTabStopsOld;
static BOOL m_bDefWordWrap;
static BOOL m_bDefWordWrapOld;
int m_nHeaderTime;
int m_nFooterTime;
UINT m_nPreviewPage;
CTime m_timeHeader;
CTime m_timeFooter;
BOOL m_bUndo; // undo/redo flag
// Printing support
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnScrollTo(CDC* pDC, CPrintInfo* pInfo, POINT point);
// Generated message map functions
protected:
//{{AFX_MSG(CTextView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMirrorDisplayFont();
afx_msg void OnWordWrap();
afx_msg void OnUpdateWordWrap(CCmdUI* pCmdUI);
afx_msg void OnChoosePrintFont();
afx_msg void OnUpdateChoosePrintFont(CCmdUI* pCmdUI);
afx_msg void OnChooseFont();
afx_msg void OnPageSetup();
afx_msg void OnUpdateMirrorDisplayFont(CCmdUI* pCmdUI);
afx_msg void OnWindowRemember();
afx_msg void OnEditUndo();
afx_msg void OnEditRedo();
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in textview.cpp
inline CTextDoc* CTextView::GetDocument()
{ return (CTextDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
// CTextWnd MDI child frame
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class CTextWnd : public CMDIChildWnd
{
DECLARE_DYNCREATE(CTextWnd)
protected:
CTextWnd(); // protected constructor used by dynamic creation
// Attributes
public:
protected: // control bar embedded members
CDialogBar m_wndRulerBar; // for a ruler along the top edge of the window
CBitmapButton m_btnRuler;
// Operations
public:
virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle,
CWnd* pParentWnd, CCreateContext* pContext = NULL);
// 'pParentWnd' parameter is required for MDI Child
// Implementation
public:
virtual ~CTextWnd();
protected:
// Generated message map functions
//{{AFX_MSG(CTextWnd)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnViewRuler();
afx_msg void OnUpdateViewRuler(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif // __TEXT_H__