// TextBoxConsole.h

#pragma once
#include <stdlib.h>
#include <string.h>
#include <vcclr.h>

namespace TextConsole {
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Windows::Forms;

	public ref class TextBoxConsole: public System::Windows::Forms::TextBox
	{
		// TODO: Add your methods for this class here.
	private:
		bool bInputMode; // true - если пограмма ожидает ввода пользователя.
		System::String^ strEnteredValue; // Буфер для хранения введённых данных
	public:
		void Write(const char *s);
		void NewLine();
		char* Input(char* Buf, size_t nBufLen);
	protected:
		char* ConvertStringToCharBuffer(System::String^ strVal, char* Buf, size_t nBufLen);
		virtual void OnKeyPress(System::Windows::Forms::KeyPressEventArgs^ e) override;
	};
}
