Changeset View
Changeset View
Standalone View
Standalone View
source/gui/IGUIScrollBarOwner.cpp
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
wraitii: 2018 now | |||||
* 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 All 32 Lines | void IGUIScrollBarOwner::AddScrollBar(IGUIScrollBar* scrollbar) | ||||
scrollbar->SetHostObject(this); | scrollbar->SetHostObject(this); | ||||
scrollbar->SetGUI(GetGUI()); | scrollbar->SetGUI(GetGUI()); | ||||
m_ScrollBars.push_back(scrollbar); | m_ScrollBars.push_back(scrollbar); | ||||
} | } | ||||
const SGUIScrollBarStyle* IGUIScrollBarOwner::GetScrollBarStyle(const CStr& style) const | const SGUIScrollBarStyle* IGUIScrollBarOwner::GetScrollBarStyle(const CStr& style) const | ||||
{ | { | ||||
if (!GetGUI()) | if (!GetGUI()) | ||||
{ | |||||
// TODO Gee: Output in log | |||||
return NULL; | |||||
} | |||||
std::map<CStr, SGUIScrollBarStyle>::const_iterator it = GetGUI()->m_ScrollBarStyles.find(style); | |||||
if (it == GetGUI()->m_ScrollBarStyles.end()) | |||||
{ | |||||
// TODO Gee: Output in log | |||||
return NULL; | return NULL; | ||||
} | |||||
return &it->second; | return GetGUI()->GetScrollBarStyle(style); | ||||
} | } | ||||
void IGUIScrollBarOwner::HandleMessage(SGUIMessage& msg) | void IGUIScrollBarOwner::HandleMessage(SGUIMessage& msg) | ||||
{ | { | ||||
for (IGUIScrollBar* const& sb : m_ScrollBars) | for (IGUIScrollBar* const& sb : m_ScrollBars) | ||||
sb->HandleMessage(msg); | sb->HandleMessage(msg); | ||||
} | } | ||||
Show All 10 Lines |
Wildfire Games · Phabricator
2018 now