2015-04-02 22:27:58 +08:00
|
|
|
#pragma once
|
2016-01-05 23:01:17 +08:00
|
|
|
|
2015-04-02 22:27:58 +08:00
|
|
|
#include "ITH.h"
|
|
|
|
#include "utility.h" // UniqueHandle, CriticalSection
|
|
|
|
|
|
|
|
class TextBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextBuffer(HWND edit);
|
|
|
|
~TextBuffer();
|
|
|
|
void Flush();
|
2018-07-19 04:18:43 +08:00
|
|
|
void AddText(std::wstring text, bool line);
|
2015-04-02 22:27:58 +08:00
|
|
|
void ClearBuffer();
|
|
|
|
bool Running() { return running; }
|
|
|
|
private:
|
|
|
|
CriticalSection cs;
|
|
|
|
bool line_break, running;
|
|
|
|
UniqueHandle hThread;
|
|
|
|
HWND hEdit;
|
|
|
|
std::wstring str;
|
|
|
|
};
|