Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CText.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
} | } | ||||
void CText::SetupText() | void CText::SetupText() | ||||
{ | { | ||||
if (m_GeneratedTexts.empty()) | if (m_GeneratedTexts.empty()) | ||||
return; | return; | ||||
CStrW font; | |||||
if (GUI<CStrW>::GetSetting(this, "font", font) != PSRETURN_OK || font.empty()) | |||||
// Use the default if none is specified | |||||
// TODO Gee: (2004-08-14) Don't define standard like this. Do it with the default style. | |||||
font = L"default"; | |||||
bool scrollbar; | bool scrollbar; | ||||
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; | ||||
const CGUIString& caption = GUI<CGUIString>::GetSetting(this, "caption"); | const CGUIString& caption = GUI<CGUIString>::GetSetting(this, "caption"); | ||||
const CStrW& font = GUI<CStrW>::GetSetting(this, "font"); | |||||
const float buffer_zone = GUI<float>::GetSetting(this, "buffer_zone"); | const float buffer_zone = GUI<float>::GetSetting(this, "buffer_zone"); | ||||
m_GeneratedTexts[0] = CGUIText(m_pGUI, caption, font, width, buffer_zone, this); | m_GeneratedTexts[0] = CGUIText(m_pGUI, 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 | ||||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator