예제 #1
0
ConsoleTitle::ConsoleTitle(const wchar_t *title)
{
	CriticalSectionLock Lock(TitleCS);
	Console.GetTitle(strOldTitle);

	if (title)
		SetFarTitle(title, true);
}
예제 #2
0
파일: constitle.cpp 프로젝트: elfmz/far2l
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);
}
예제 #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);
}
예제 #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);
}
예제 #5
0
BaseFormat& ConsoleTitle::Flush()
{
	SetFarTitle(*this);
	Clear();
	return *this;
}
예제 #6
0
ConsoleTitle::ConsoleTitle(const string& title)
{
	SCOPED_ACTION(CriticalSectionLock)(TitleCS);
	Global->Console->GetTitle(strOldTitle);
	SetFarTitle(title);
}