Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/COList.cpp
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | case GUIM_MOUSE_PRESS_LEFT: | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
default: | default: | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
bool COList::HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile) | bool COList::HandleAdditionalChildren(const XMBFile& file, const XMBElement& child) | ||||
{ | { | ||||
#define ELMT(x) int elmt_##x = pFile->GetElementID(#x) | #define ELMT(x) int elmt_##x = file.GetElementID(#x) | ||||
#define ATTR(x) int attr_##x = pFile->GetAttributeID(#x) | #define ATTR(x) int attr_##x = file.GetAttributeID(#x) | ||||
ELMT(item); | ELMT(item); | ||||
ELMT(column); | ELMT(column); | ||||
ELMT(translatableAttribute); | ELMT(translatableAttribute); | ||||
ATTR(id); | ATTR(id); | ||||
ATTR(context); | ATTR(context); | ||||
if (child.GetNodeName() == elmt_item) | if (child.GetNodeName() == elmt_item) | ||||
{ | { | ||||
CGUIString vlist; | CGUIString vlist; | ||||
vlist.SetValue(child.GetText().FromUTF8()); | vlist.SetValue(child.GetText().FromUTF8()); | ||||
AddItem(vlist, vlist); | AddItem(vlist, vlist); | ||||
return true; | return true; | ||||
} | } | ||||
else if (child.GetNodeName() == elmt_column) | else if (child.GetNodeName() == elmt_column) | ||||
{ | { | ||||
COListColumn column; | COListColumn column; | ||||
for (XMBAttribute attr : child.GetAttributes()) | for (XMBAttribute attr : child.GetAttributes()) | ||||
{ | { | ||||
CStr attr_name(pFile->GetAttributeString(attr.Name)); | CStr attr_name(file.GetAttributeString(attr.Name)); | ||||
CStr attr_value(attr.Value); | CStr attr_value(attr.Value); | ||||
if (attr_name == "color") | if (attr_name == "color") | ||||
{ | { | ||||
if (!CGUI::ParseString<CGUIColor>(&m_pGUI, attr_value.FromUTF8(), column.m_TextColor)) | if (!CGUI::ParseString<CGUIColor>(&m_pGUI, attr_value.FromUTF8(), column.m_TextColor)) | ||||
LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str()); | ||||
} | } | ||||
else if (attr_name == "id") | else if (attr_name == "id") | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator