That would be great.
Below are the changes I propose for the Introjucer. For testing, I created a component in the Introjucer that contains all the sub components and properties for that I made the changes (see the attachments). It works fine and also compiles without warnings in VS2012.
[attachment=1]TestGuiComponent.h[/attachment][attachment=0]TestGuiComponent.cpp[/attachment]
Tooltips (except for HyperLink Buttons)
Source/ComponentEditor/components/jucer_ComponentTypeHandler.cpp
[list]
[]inserted “translate(String(” and “))” around the quotedS ttc->getTooltip() if this is not a hyperlink button[/][/list]
In [color=#008000]void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)[/color]:
// […]
if (SettableTooltipClient* ttc = dynamic_cast <SettableTooltipClient*> (component))
{
if (ttc->getTooltip().isNotEmpty())
{
s << memberVariableName << "->setTooltip ("
<< ((dynamic_cast<HyperlinkButton*>(component)) ? String::empty : "translate(String(")
<< quotedString (ttc->getTooltip())
<< ((dynamic_cast<HyperlinkButton*>(component)) ? String::empty : "))")
<< ");\n";
}
}
// […]
Labels
Source/ComponentEditor/components/jucer_LabelHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted l->getText()[/][/list]
In [color=#008000]String getCreationParameters (Component* component)[/color]:
Label* const l = dynamic_cast <Label*> (component);
return quotedString (component->getName())
+ ",\n"
+ "translate(String("
+ quotedString (l->getText())
+ "))";
Group Components
Source/ComponentEditor/components/jucer_GroupComponentHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted g->getText()[/][/list]
In [color=#008000]String getCreationParameters (Component* component)[/color]:
GroupComponent* g = dynamic_cast <GroupComponent*> (component);
return quotedString (component->getName())
+ ",\n"
+ "translate(String("
+ quotedString (g->getText())
+ "))";
Hyperlink Buttons
Source/ComponentEditor/components/jucer_HyperlinkButtonHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted hb->getButtonText()[/][/list]
In [color=#008000]String getCreationParameters (Component* comp)[/color]:
HyperlinkButton* const hb = dynamic_cast <HyperlinkButton*> (comp);
return "translate(String("
+ quotedString (hb->getButtonText())
+ "))"
+ ",\nURL ("
+ quotedString (hb->getURL().toString (false))
+ ")";
Buttons
Source/ComponentEditor/components/jucer_ButtonHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted b->getButtonText()[/][/list]
In [color=#008000]void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)[/color]:
// […]
if (b->getButtonText() != b->getName())
{
code.constructorCode
<< memberVariableName << "->setButtonText ("
<< "translate(String("
<< quotedString (b->getButtonText())
<< "))"
<< ");\n";
}
// […]
Text Editors
Source/ComponentEditor/components/jucer_TextEditorHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted te->getProperties() [“initialText”].toString()[/][/list]
In [color=#008000]void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)[/color]:
// […]
s << memberVariableName << "->setMultiLine (" << CodeHelpers::boolLiteral (te->isMultiLine()) << ");\n"
<< memberVariableName << "->setReturnKeyStartsNewLine (" << CodeHelpers::boolLiteral (te->getReturnKeyStartsNewLine()) << ");\n"
<< memberVariableName << "->setReadOnly (" << CodeHelpers::boolLiteral (te->isReadOnly()) << ");\n"
<< memberVariableName << "->setScrollbarsShown (" << CodeHelpers::boolLiteral (te->areScrollbarsShown()) << ");\n"
<< memberVariableName << "->setCaretVisible (" << CodeHelpers::boolLiteral (te->isCaretVisible()) << ");\n"
<< memberVariableName << "->setPopupMenuEnabled (" << CodeHelpers::boolLiteral (te->isPopupMenuEnabled()) << ");\n"
<< getColourIntialisationCode (component, memberVariableName)
<< memberVariableName << "->setText (translate(String(" << quotedString (te->getProperties() ["initialText"].toString()) << ")));\n\n";
// […]
Combo Boxes
Source/ComponentEditor/components/jucer_ComboBoxHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted c->getTextWhenNothingSelected()[/]
[]inserted “translate(String(” and “))” around the quoted c->getTextWhenNoChoicesAvailable()[/]
[]inserted “translate(String(” and “))” around the quoted lines[/][/list]
In [color=#008000]void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)[/color]:
// […]
s << memberVariableName << "->setEditableText (" << CodeHelpers::boolLiteral (c->isTextEditable()) << ");\n"
<< memberVariableName << "->setJustificationType (" << CodeHelpers::justificationToCode (c->getJustificationType()) << ");\n"
<< memberVariableName << "->setTextWhenNothingSelected (translate(String(" << quotedString (c->getTextWhenNothingSelected()) << ")));\n"
<< memberVariableName << "->setTextWhenNoChoicesAvailable (translate(String(" << quotedString (c->getTextWhenNoChoicesAvailable()) << ")));\n";
// […]
else
s << memberVariableName << "->addItem ("
<< "translate(String(" << quotedString (lines[i]) << ")), " << itemId++ << ");\n";
// […]
Tabbed Components
Source/ComponentEditor/components/jucer_TabbedComponentHandler.h
[list]
[]inserted “translate(String(” and “))” around the quoted t->getTabNames()[/][/list]
In [color=#008000]void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName)[/color]:
// […]
code.constructorCode
<< memberVariableName
<< "->addTab ("
<< "translate(String("
<< quotedString (t->getTabNames() [i])
<< "))"
<< ", "
<< CodeHelpers::colourToCode (t->getTabBackgroundColour (i));
// […]