本文整理汇总了C++中GeneratedCode::shouldUseTransMacro方法的典型用法代码示例。如果您正苦于以下问题:C++ GeneratedCode::shouldUseTransMacro方法的具体用法?C++ GeneratedCode::shouldUseTransMacro怎么用?C++ GeneratedCode::shouldUseTransMacro使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeneratedCode
的用法示例。
在下文中一共展示了GeneratedCode::shouldUseTransMacro方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillInCreationCode
void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)
{
String params (getCreationParameters (code, component));
const String virtualName (component->getProperties() ["virtualName"].toString());
String s;
s << memberVariableName << ".reset (new ";
if (virtualName.isNotEmpty())
s << CodeHelpers::makeValidIdentifier (virtualName, false, false, true);
else
s << getClassName (component);
if (params.isEmpty())
{
s << "());\n";
}
else
{
StringArray lines;
lines.addLines (params);
params = lines.joinIntoString ("\n" + String::repeatedString (" ", s.length() + 2));
s << " (" << params << "));\n";
}
s << "addAndMakeVisible (" << memberVariableName << ".get());\n";
if (SettableTooltipClient* ttc = dynamic_cast<SettableTooltipClient*> (component))
{
if (ttc->getTooltip().isNotEmpty())
{
s << memberVariableName << "->setTooltip ("
<< quotedString (ttc->getTooltip(), code.shouldUseTransMacro())
<< ");\n";
}
}
if (component->getExplicitFocusOrder() > 0)
s << memberVariableName << "->setExplicitFocusOrder ("
<< component->getExplicitFocusOrder()
<< ");\n";
code.constructorCode += s;
}