Exemplo n.º 1
0
ConsoleTitle::ConsoleTitle(const wchar_t *title)
{
	CriticalSectionLock Lock(TitleCS);
	Console.GetTitle(strOldTitle);

	if (title)
		SetFarTitle(title, true);
}
Exemplo n.º 2
0
void ConsoleTitle::Set(const wchar_t *fmt, ...)
{
	CriticalSectionLock Lock(TitleCS);
	wchar_t msg[2048];
	va_list argptr;
	va_start(argptr, fmt);
	vswprintf(msg, ARRAYSIZE(msg)-1, fmt, argptr);
	va_end(argptr);
	SetFarTitle(msg);
}
Exemplo n.º 3
0
ConsoleTitle::~ConsoleTitle()
{
	CriticalSectionLock Lock(TitleCS);
	const string &strTitleAddons = GetFarTitleAddons();
	size_t OldLen = strOldTitle.GetLength();
	size_t AddonsLen = strTitleAddons.GetLength();

	if (AddonsLen <= OldLen)
	{
		if (!StrCmpI(strOldTitle.CPtr()+OldLen-AddonsLen, strTitleAddons))
			strOldTitle.SetLength(OldLen-AddonsLen);
	}

	SetFarTitle(strOldTitle, true);
}
Exemplo n.º 4
0
ConsoleTitle::~ConsoleTitle()
{
	SCOPED_ACTION(CriticalSectionLock)(TitleCS);
	const string &strTitleAddons = GetFarTitleAddons();
	size_t OldLen = strOldTitle.size();
	size_t AddonsLen = strTitleAddons.size();

	if (AddonsLen <= OldLen)
	{
		if (!StrCmpI(strOldTitle.data()+OldLen-AddonsLen, strTitleAddons.data()))
			strOldTitle.resize(OldLen-AddonsLen);
	}

	SetFarTitle(strOldTitle);
}
Exemplo n.º 5
0
BaseFormat& ConsoleTitle::Flush()
{
	SetFarTitle(*this);
	Clear();
	return *this;
}
Exemplo n.º 6
0
ConsoleTitle::ConsoleTitle(const string& title)
{
	SCOPED_ACTION(CriticalSectionLock)(TitleCS);
	Global->Console->GetTitle(strOldTitle);
	SetFarTitle(title);
}