Changeset View
Changeset View
Standalone View
Standalone View
source/gui/COList.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | void COList::DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor) | ||||
if (scrollbar) | if (scrollbar) | ||||
IGUIScrollBarOwner::Draw(); | IGUIScrollBarOwner::Draw(); | ||||
if (!GetGUI()) | if (!GetGUI()) | ||||
return; | return; | ||||
CRect rect = GetListRect(); | CRect rect = GetListRect(); | ||||
CGUISpriteInstance* sprite = NULL; | CGUISpriteInstance* sprite = nullptr; | ||||
CGUISpriteInstance* sprite_selectarea = NULL; | CGUISpriteInstance* sprite_selectarea = nullptr; | ||||
int cell_id; | int cell_id; | ||||
GUI<CGUISpriteInstance>::GetSettingPointer(this, _sprite, sprite); | GUI<CGUISpriteInstance>::GetSettingPointer(this, _sprite, sprite); | ||||
GUI<CGUISpriteInstance>::GetSettingPointer(this, _sprite_selected, sprite_selectarea); | GUI<CGUISpriteInstance>::GetSettingPointer(this, _sprite_selected, sprite_selectarea); | ||||
GUI<int>::GetSetting(this, "cell_id", cell_id); | GUI<int>::GetSetting(this, "cell_id", cell_id); | ||||
CGUIList* pList; | CGUIList* pList; | ||||
GUI<CGUIList>::GetSettingPointer(this, "list", pList); | GUI<CGUIList>::GetSettingPointer(this, "list", pList); | ||||
Show All 36 Lines | if (rect_sel.top <= rect.bottom && | ||||
GetGUI()->DrawSprite(*sprite_selectarea, cell_id, bz+0.05f, rect_sel); | GetGUI()->DrawSprite(*sprite_selectarea, cell_id, bz+0.05f, rect_sel); | ||||
} | } | ||||
} | } | ||||
float headingHeight; | float headingHeight; | ||||
GUI<float>::GetSetting(this, "heading_height", headingHeight); | GUI<float>::GetSetting(this, "heading_height", headingHeight); | ||||
// Draw line above column header | // Draw line above column header | ||||
CGUISpriteInstance* sprite_heading = NULL; | CGUISpriteInstance* sprite_heading = nullptr; | ||||
GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite_heading", sprite_heading); | GUI<CGUISpriteInstance>::GetSettingPointer(this, "sprite_heading", sprite_heading); | ||||
CRect rect_head(m_CachedActualSize.left, m_CachedActualSize.top, m_CachedActualSize.right, | CRect rect_head(m_CachedActualSize.left, m_CachedActualSize.top, m_CachedActualSize.right, | ||||
m_CachedActualSize.top + headingHeight); | m_CachedActualSize.top + headingHeight); | ||||
GetGUI()->DrawSprite(*sprite_heading, cell_id, bz, rect_head); | GetGUI()->DrawSprite(*sprite_heading, cell_id, bz, rect_head); | ||||
// Draw column headers | // Draw column headers | ||||
bool sortable; | bool sortable; | ||||
GUI<bool>::GetSetting(this, "sortable", sortable); | GUI<bool>::GetSetting(this, "sortable", sortable); | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator