本文整理汇总了C++中CGUIString::GetOriginalString方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIString::GetOriginalString方法的具体用法?C++ CGUIString::GetOriginalString怎么用?C++ CGUIString::GetOriginalString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIString
的用法示例。
在下文中一共展示了CGUIString::GetOriginalString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getProperty
//.........这里部分代码省略.........
}
catch (PSERROR_Scripting_ConversionFailed)
{
debug_warn(L"Error creating size object!");
break;
}
break;
}
case GUIST_CGUIString:
{
CGUIString value;
GUI<CGUIString>::GetSetting(e, propName, value);
*vp = ScriptInterface::ToJSVal(cx, value.GetOriginalString());
break;
}
case GUIST_CStr:
{
CStr value;
GUI<CStr>::GetSetting(e, propName, value);
*vp = ScriptInterface::ToJSVal(cx, value);
break;
}
case GUIST_CStrW:
{
CStrW value;
GUI<CStrW>::GetSetting(e, propName, value);
*vp = ScriptInterface::ToJSVal(cx, value);
break;
}
case GUIST_CGUISpriteInstance:
{
CGUISpriteInstance *value;
GUI<CGUISpriteInstance>::GetSettingPointer(e, propName, value);
*vp = ScriptInterface::ToJSVal(cx, value->GetName());
break;
}
case GUIST_EAlign:
{
EAlign value;
GUI<EAlign>::GetSetting(e, propName, value);
CStr word;
switch (value)
{
case EAlign_Left: word = "left"; break;
case EAlign_Right: word = "right"; break;
case EAlign_Center: word = "center"; break;
default: debug_warn(L"Invalid EAlign!"); word = "error"; break;
}
*vp = ScriptInterface::ToJSVal(cx, word);
break;
}
case GUIST_EVAlign:
{
EVAlign value;
GUI<EVAlign>::GetSetting(e, propName, value);
CStr word;
switch (value)
{
case EVAlign_Top: word = "top"; break;
case EVAlign_Bottom: word = "bottom"; break;
case EVAlign_Center: word = "center"; break;
default: debug_warn(L"Invalid EVAlign!"); word = "error"; break;
}
*vp = ScriptInterface::ToJSVal(cx, word);
break;
}
case GUIST_CGUIList:
{
CGUIList value;
GUI<CGUIList>::GetSetting(e, propName, value);
JSObject *obj = JS_NewArrayObject(cx, 0, NULL);
*vp = OBJECT_TO_JSVAL(obj); // root it
for (size_t i = 0; i < value.m_Items.size(); ++i)
{
jsval val = ScriptInterface::ToJSVal(cx, value.m_Items[i].GetOriginalString());
JS_SetElement(cx, obj, (jsint)i, &val);
}
break;
}
default:
JS_ReportError(cx, "Setting '%s' uses an unimplemented type", propName.c_str());
DEBUG_WARN_ERR(ERR::LOGIC);
return JS_FALSE;
}
return JS_TRUE;
}
}