|
|
1.1 root 1: // Microsoft Foundation Classes C++ library.
2: // Copyright (C) 1992 Microsoft Corporation,
3: // All rights reserved.
4:
5: // This source code is only intended as a supplement to the
6: // Microsoft Foundation Classes Reference and Microsoft
7: // QuickHelp documentation provided with the library.
8: // See these sources for detailed information regarding the
9: // Microsoft Foundation Classes product.
10:
11:
12: #ifndef __AFXPEN_H__
13: #define __AFXPEN_H__
14:
15: #ifndef __NTWIN
16:
17: /////////////////////////////////////////////////////////////////////////////
18: // Classes declared in this file
19:
20: //CEdit
21: class CHEdit; // Handwriting Edit control
22: class CBEdit; // Boxed Handwriting Edit control
23:
24: /////////////////////////////////////////////////////////////////////////////
25: // Make sure 'afxwin.h' is included first
26:
27: #ifndef __AFXWIN_H__
28: #include "afxwin.h"
29: #endif
30:
31: #include "penwin.h"
32:
33: /////////////////////////////////////////////////////////////////////////////
34: // CHEdit - Handwriting Edit control
35:
36: class CHEdit : public CEdit
37: {
38: DECLARE_DYNAMIC(CHEdit)
39:
40: // Constructors
41: public:
42: CHEdit();
43: BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
44:
45: // Attributes
46: // inflation between client area and writing window
47: BOOL GetInflate(LPRECTOFS lpRectOfs);
48: BOOL SetInflate(LPRECTOFS lpRectOfs);
49:
50: // Recognition context (lots of options here)
51: BOOL GetRC(LPRC lpRC);
52: BOOL SetRC(LPRC lpRC);
53:
54: // Underline mode (HEdit only)
55: BOOL GetUnderline();
56: BOOL SetUnderline(BOOL bUnderline = TRUE);
57:
58: // Operations
59: HANDLE GetInkHandle();
60: BOOL SetInkMode(HPENDATA hPenDataInitial = NULL); // start inking
61: BOOL StopInkMode(UINT hep);
62:
63: // Implementation
64: protected:
65: virtual WNDPROC* GetSuperWndProcAddr();
66: };
67:
68: /////////////////////////////////////////////////////////////////////////////
69: // CBEdit - Boxed Handwriting Edit control
70:
71: class CBEdit : public CHEdit
72: {
73: DECLARE_DYNAMIC(CBEdit)
74:
75: // Constructors
76: public:
77: CBEdit();
78: BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
79:
80: // Attributes
81: // converting from logical to byte positions
82: DWORD CharOffset(UINT nCharPosition); // logical -> byte
83: DWORD CharPosition(UINT nCharOffset); // byte -> logical
84:
85: // BOXLAYOUT info
86: void GetBoxLayout(LPBOXLAYOUT lpBoxLayout);
87: BOOL SetBoxLayout(LPBOXLAYOUT lpBoxLayout);
88:
89: // Operations
90: void DefaultFont(BOOL bRepaint); // set default font
91:
92: // Implementation
93: private:
94: BOOL GetUnderline(); // disabled in HBEdit
95: BOOL SetUnderline(BOOL bUnderline); // disabled in HBEdit
96: protected:
97: virtual WNDPROC* GetSuperWndProcAddr();
98: };
99:
100: /////////////////////////////////////////////////////////////////////////////
101: // Inlines
102:
103: inline CHEdit::CHEdit()
104: { }
105: inline BOOL CHEdit::GetInflate(LPRECTOFS lpRectOfs)
106: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
107: HE_GETINFLATE, (LPARAM)lpRectOfs); }
108: inline HANDLE CHEdit::GetInkHandle()
109: { return (HANDLE)::SendMessage(m_hWnd, WM_HEDITCTL,
110: HE_GETINKHANDLE, 0); }
111: inline BOOL CHEdit::GetRC(LPRC lpRC)
112: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
113: HE_GETRC, (LPARAM)lpRC); }
114: inline BOOL CHEdit::GetUnderline()
115: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
116: HE_GETUNDERLINE, 0); }
117: inline BOOL CHEdit::SetInflate(LPRECTOFS lpRectOfs)
118: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
119: HE_SETINFLATE, (LPARAM)lpRectOfs); }
120: inline BOOL CHEdit::SetInkMode(HPENDATA hPenDataInitial)
121: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
122: HE_SETINKMODE, MAKELONG(hPenDataInitial, 0)); }
123: inline BOOL CHEdit::SetRC(LPRC lpRC)
124: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
125: HE_SETRC, (LPARAM)lpRC); }
126: inline BOOL CHEdit::SetUnderline(BOOL bUnderline)
127: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
128: HE_SETUNDERLINE, MAKELONG(bUnderline, 0)); }
129: inline BOOL CHEdit::StopInkMode(UINT hep)
130: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
131: HE_STOPINKMODE, MAKELONG(hep, 0)); }
132:
133: inline CBEdit::CBEdit()
134: { }
135: inline DWORD CBEdit::CharOffset(UINT nCharPosition)
136: { return (DWORD)::SendMessage(m_hWnd, WM_HEDITCTL,
137: HE_CHAROFFSET, MAKELONG(nCharPosition, 0)); }
138: inline DWORD CBEdit::CharPosition(UINT nCharOffset)
139: { return (DWORD)::SendMessage(m_hWnd, WM_HEDITCTL,
140: HE_CHARPOSITION, MAKELONG(nCharOffset, 0)); }
141: inline void CBEdit::GetBoxLayout(LPBOXLAYOUT lpBoxLayout)
142: { ::SendMessage(m_hWnd, WM_HEDITCTL,
143: HE_GETBOXLAYOUT, (LPARAM)lpBoxLayout); }
144: inline void CBEdit::DefaultFont(BOOL bRepaint)
145: { ::SendMessage(m_hWnd, WM_HEDITCTL,
146: HE_DEFAULTFONT, MAKELONG(bRepaint, 0)); }
147: inline BOOL CBEdit::SetBoxLayout(LPBOXLAYOUT lpBoxLayout)
148: { return (BOOL)::SendMessage(m_hWnd, WM_HEDITCTL,
149: HE_SETBOXLAYOUT, (LPARAM)lpBoxLayout); }
150:
151: //////////////////////////////////////////////////////////////////////////////
152:
153: #endif //!_NTWIN
154:
155: #endif //__AFXPEN_H__
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.