Example #1
0
bool cScrollBar::CreateScrollBar(int ID, int x, int y, int width, int height, int visibleitems)
{
	// see if static class-wide default images are loaded; if not, do so
	if (!m_ImgNotches)
		LoadInitial();

	SetPosition(x, y, width, height);
	m_SectionHeight = height - m_ImgButtonDownOff->h - m_ImgButtonDownOff->h;
	m_BarHeight = m_SectionHeight;
	m_ItemsVisible = visibleitems;
	m_PageAmount = visibleitems - 1;

	// set up SDL_Rects indicating top and bottom halves of displayed background from source background images
	m_RectBGTop->x = m_RectBGTop->y = m_RectBGBottom->x = 0;
	m_RectBGTop->w = m_RectBGBottom->w = m_ImgBarBG->w;
	m_RectBGTop->h = (m_SectionHeight / 2);
	m_RectBGBottom->h = m_SectionHeight - m_RectBGTop->h;
	m_RectBGBottom->y = m_ImgBarBG->h - m_RectBGBottom->h;

	// set up initial base data for SDL_Rects indicating top and bottom halves of displayed bar from source bar images
	m_RectTop->x = m_RectTop->y = m_RectBottom->x = 0;
	m_RectTop->w = m_RectBottom->w = m_ImgBarBG->w;

	// go ahead and prepare initial "disabled" state
	UpdateScrollBar();

	m_ID = ID;

	return true;
}
bool ConfigMgr::Reload(std::string& error)
{
    return LoadInitial(_filename, std::move(_args), error);
}
Example #3
0
bool ConfigMgr::Reload()
{
    return LoadInitial(_filename.c_str());
}