#include <windows.h>
#include "cmemory.h"

#ifndef __OUTPUTWINDOWCLASS
#define __OUTPUTWINDOWCLASS


class COutputWindow
{
	private:
		WNDPROC oldWindowProc;
		HWND hwnd;
		CMemory *buffer;

		void wmLBUTTONDBLCLK();
		void StopBuffering();
	public:
		COutputWindow(HWND parent);
		~COutputWindow();
		void DoResize();

		void AddLine(char* string);//prida riadok do vystupu
		void StartBuffering(DWORD numOfLines);
		void AddNumberedLineToBuffer(char* string, int line);//zapamata si novy riadok spolu s cislom riadku (nezobrazi)
		void AddNumberedLine(char *string, int line);
		void WriteBuffer();//zobrazi zapisane riadky s cislom a skonci buffrovanie

		void Clear();
		void ShowWindow(bool show);
		HWND GetHandle();

		LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp);
		static LRESULT CALLBACK StaticWindowProc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp);
};

#endif __OUTPUTWINDOWCLASS