| 10 | typedef CWinTraits<WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL, WS_EX_CLIENTEDGE> CPlainTextViewWinTraits; |
| 11 | |
| 12 | class CPlainTextView: |
| 13 | public CWindowImpl<CPlainTextView, CEdit, CPlainTextViewWinTraits>, |
| 14 | public CEditCommands<CPlainTextView> |
| 15 | { |
| 16 | protected: |
| 17 | typedef CPlainTextView thisClass; |
| 18 | typedef CWindowImpl<CPlainTextView, CEdit, CPlainTextViewWinTraits> baseClass; |
| 19 | |
| 20 | protected: |
| 21 | HACCEL m_hAccel; |
| 22 | WTL::CFont m_font; |
| 23 | |
| 24 | public: |
| 25 | CPlainTextView() : |
| 26 | m_hAccel(NULL) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | public: |
| 31 | DECLARE_WND_SUPERCLASS(NULL, CEdit::GetWndClassName()) |
| 32 | |
| 33 | BOOL PreTranslateMessage(MSG* pMsg) |
| 34 | { |
| 35 | if(pMsg) |
| 36 | { |
| 37 | if((pMsg->hwnd == m_hWnd) || ::IsChild(m_hWnd, pMsg->hwnd)) |
| 38 | { |
| 39 | // We'll have the Accelerator send the WM_COMMAND to our view |
| 40 | if(m_hAccel != NULL && ::TranslateAccelerator(m_hWnd, m_hAccel, pMsg)) |
| 41 | { |
| 42 | return TRUE; |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | return FALSE; |
| 47 | } |
| 48 | |
| 49 | BEGIN_MSG_MAP(thisClass) |
| 50 | MESSAGE_HANDLER(WM_CREATE, OnCreate) |
| 51 | MESSAGE_HANDLER(WM_DESTROY, OnDestroy) |
| 52 | if(uMsg == WM_FORWARDMSG) |
| 53 | if(PreTranslateMessage((LPMSG)lParam)) return TRUE; |
| 54 | CHAIN_MSG_MAP_ALT(CEditCommands<CPlainTextView>, 1) |
| 55 | |
| 56 | DEFAULT_REFLECTION_HANDLER() |
| 57 | END_MSG_MAP() |
| 58 | |
| 59 | LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) |
| 60 | { |
| 61 | // "base::OnCreate()" |
| 62 | LRESULT lRet = DefWindowProc(uMsg, wParam, lParam); |
| 63 | bHandled = TRUE; |
| 64 | |
| 65 | // "OnInitialUpdate" |
| 66 | this->InitializeFont(); |
| 67 | this->CreateAccelerators(); |
| 68 | |
| 69 | return lRet; |
nothing calls this directly
no outgoing calls
no test coverage detected