Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CText.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | if (m_GeneratedTexts.empty()) | ||||
return; | return; | ||||
CStrW font; | CStrW font; | ||||
if (GUI<CStrW>::GetSetting(this, "font", font) != PSRETURN_OK || font.empty()) | if (GUI<CStrW>::GetSetting(this, "font", font) != PSRETURN_OK || font.empty()) | ||||
// Use the default if none is specified | // Use the default if none is specified | ||||
// TODO Gee: (2004-08-14) Don't define standard like this. Do it with the default style. | // TODO Gee: (2004-08-14) Don't define standard like this. Do it with the default style. | ||||
font = L"default"; | font = L"default"; | ||||
CGUIString caption; | CGUIString* caption = nullptr; | ||||
GUI<CGUIString>::GetSettingPointer(this, "caption", caption); | |||||
bool scrollbar; | bool scrollbar; | ||||
GUI<CGUIString>::GetSetting(this, "caption", caption); | |||||
GUI<bool>::GetSetting(this, "scrollbar", scrollbar); | GUI<bool>::GetSetting(this, "scrollbar", scrollbar); | ||||
float width = m_CachedActualSize.GetWidth(); | float width = m_CachedActualSize.GetWidth(); | ||||
// remove scrollbar if applicable | // remove scrollbar if applicable | ||||
if (scrollbar && GetScrollBar(0).GetStyle()) | if (scrollbar && GetScrollBar(0).GetStyle()) | ||||
width -= GetScrollBar(0).GetStyle()->m_Width; | width -= GetScrollBar(0).GetStyle()->m_Width; | ||||
float buffer_zone = 0.f; | float buffer_zone = 0.f; | ||||
GUI<float>::GetSetting(this, "buffer_zone", buffer_zone); | GUI<float>::GetSetting(this, "buffer_zone", buffer_zone); | ||||
*m_GeneratedTexts[0] = GetGUI()->GenerateText(caption, font, width, buffer_zone, this); | *m_GeneratedTexts[0] = GetGUI()->GenerateText(*caption, font, width, buffer_zone, this); | ||||
if (!scrollbar) | if (!scrollbar) | ||||
CalculateTextPosition(m_CachedActualSize, m_TextPos, *m_GeneratedTexts[0]); | CalculateTextPosition(m_CachedActualSize, m_TextPos, *m_GeneratedTexts[0]); | ||||
// Setup scrollbar | // Setup scrollbar | ||||
if (scrollbar) | if (scrollbar) | ||||
{ | { | ||||
bool scroll_top = false, scroll_bottom = false; | bool scroll_top = false, scroll_bottom = false; | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator