
#pragma once
#if !defined(AFX_CONSOLEBOX_H__3D22F593_4E2E_49EC_8C5E_53257F0F5874__INCLUDED_)
#define AFX_CONSOLEBOX_H__3D22F593_4E2E_49EC_8C5E_53257F0F5874__INCLUDED_

// ConsoleBox.h
//

/////////////////////////////////////////////////////////////////////////////
// CConsoleBox
#define CRLF _T("\r\n")
class CConsoleBox : public CEdit
{
		DECLARE_DYNAMIC(CConsoleBox)

	public:
		CConsoleBox();
		virtual ~CConsoleBox() override;

	public:
		void    CarryReturn(bool bLineFeed = TRUE);
		int     PrintF(LPCTSTR fmt, ...);
		void    PutChar(TCHAR ch);
		void    AppendText(LPCTSTR lpszText = nullptr);

		// {{AFX_VIRTUAL(CConsoleBox)
	protected:
		virtual BOOL PreCreateWindow(CREATESTRUCT &cs) override;
		virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
		// }}AFX_VIRTUAL

	protected:
		void    SetCaretPos(int pos = -1);
		void    GetCaretPos(int &nLine, int &nPos) const;

		bool    IsEditingLine();
		void    DoPaste();

		afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
		afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);

		DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
// {{AFX_INSERT_LOCATION}}

#endif // !defined(AFX_CONSOLEBOX_H__3D22F593_4E2E_49EC_8C5E_53257F0F5874__INCLUDED_)
