//
//  textview.h - text view header file
//
//  $Id: textview.h 50 2014-02-07 02:18:02Z brian $ 
//
//  Copyright (c) 1999-2014 by Precision Micro Control Corp. All rights reserved.
//
#ifndef TEXT_VIEW_H
#define TEXT_VIEW_H

#define MAX_LINES			32		// Maximum number of lines that will be displayed (+1)
#define DEFAULT_CHAR_HEIGHT 20		// In case GetTextMetrics() fails

/// <summary>
/// Text view class
/// </summary>
class CTextView : public CView
{
	DECLARE_DYNCREATE(CTextView)

protected:
	/// <summary>Constructor (used by dynamic creation).</summary>
	CTextView();
	/// <summary>Destructor.</summary>
	virtual ~CTextView() {}

	/// <summary>OnDraw message handler.</summary>
	/// <param name="pDC">Device context.</param>
	virtual	void				OnDraw(CDC* pDC);
	/// <summary>Hide text.</summary>
	void						Blank();

public:
	/// <summary>Add text to display.</summary>
	/// <param name="text">Text.</param>
	void						OutputText(LPCSTR text);
	/// <summary>Clear text.</summary>
	void						Erase();

public:
	CString						m_blank_text;					///< text blanking string
	int							m_char_height;					///< character height
	CString						m_disp_string[MAX_LINES];		///< display string
	int							m_first_string;					///< first string index

protected:
	DECLARE_MESSAGE_MAP()
};

#endif			// TEXT_VIEW_H
