コード例 #1
0
StatsHeroesList::StatsHeroesList(const Point & pt, KingdomHeroes & heroes) : Interface::ListBox<HEROESPTR>(pt)
{
    const Sprite & back = AGG::GetICN(ICN::OVERVIEW, 13);

    SetTopLeft(pt);
    SetScrollSplitter(AGG::GetICN(ICN::SCROLL, 4),
                        Rect(pt.x + 630, pt.y + 18, back.w(), back.h()));
    SetScrollButtonUp(ICN::SCROLL, 0, 1,
                        Point(pt.x + 626, pt.y));
    SetScrollButtonDn(ICN::SCROLL, 2, 3,
                        Point(pt.x + 626, pt.y + 20 + back.h()));
    SetAreaMaxItems(4);
    SetAreaItems(Rect(pt.x + 30, pt.y + 17, 594, 344));
    SetListContent(heroes);
}
コード例 #2
0
	void ClearScreen() const
	{
		CONSOLE_SCREEN_BUFFER_INFO csbi;

		if (!::GetConsoleScreenBufferInfo(output_handle_, &csbi))
			ThrowSystemError("Call to ::GetConsoleScreenBufferInfo() failed");

		DWORD dwConSize = static_cast<DWORD>(csbi.dwSize.X * csbi.dwSize.Y);
		DWORD cCharsWritten;
		COORD top_left;

		top_left.X = 0;
		top_left.Y = 0;

		if (!::FillConsoleOutputCharacter(output_handle_, (TCHAR) ' ',
			dwConSize, top_left, &cCharsWritten))
			ThrowSystemError("Call to ::FillConsoleOutputCharacter() failed");

		SetTopLeft();
	}
コード例 #3
0
StatsCastlesList::StatsCastlesList(const Point & pt, KingdomCastles & castles) : Interface::ListBox<CstlRow>(pt)
{
    const Sprite & back = AGG::GetICN(ICN::OVERVIEW, 13);

    SetTopLeft(pt);
    SetScrollSplitter(AGG::GetICN(ICN::SCROLL, 4),
                        Rect(pt.x + 629, pt.y + 18, back.w(), back.h()));
    SetScrollButtonUp(ICN::SCROLL, 0, 1,
                        Point(pt.x + 626, pt.y));
    SetScrollButtonDn(ICN::SCROLL, 2, 3,
                        Point(pt.x + 626, pt.y + 20 + back.h()));
    SetAreaMaxItems(4);
    SetAreaItems(Rect(pt.x + 30, pt.y + 17, 594, 344));

    content.resize(castles.size());

    for(KingdomCastles::iterator
	it = castles.begin(); it != castles.end(); ++it)
	content[std::distance(castles.begin(), it)].Init(*it);

    SetListContent(content);
}