本文整理汇总了C++中GetTranslation函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTranslation函数的具体用法?C++ GetTranslation怎么用?C++ GetTranslation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTranslation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
std::string CFileDialog::AskPassword(LIBSU::CLibSU &suhandler)
{
std::string ret;
while (true)
{
ret = InputBox(GetTranslation("Your account doesn't have permissions to "
"create the directory.\nTo create it with the root "
"(administrator) account, please enter it's password below."), "", 0, '*');
if (ret.empty())
break;
if (!suhandler.TestSU(ret.c_str()))
{
if (suhandler.GetError() == LIBSU::CLibSU::SU_ERROR_INCORRECTPASS)
WarningBox(GetTranslation("Incorrect password given for root user\nPlease retype"));
else
{
WarningBox(GetTranslation("Could not use su to gain root access.\n"
"Make sure you can use su (adding the current user to the wheel group may help)."));
break;
}
}
else
break;
}
return ret;
}
示例2: gtk_hbox_new
void CInstaller::InitButtonSection(GtkWidget *parentbox)
{
GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
GtkWidget *buttonbox = gtk_hbutton_box_new();
m_pCancelLabel = gtk_label_new(GetTranslation("Cancel"));
m_pCancelButton = CreateButton(m_pCancelLabel, GTK_STOCK_CANCEL);
g_signal_connect(G_OBJECT(m_pCancelButton), "clicked", G_CALLBACK(CancelCB), this);
gtk_box_pack_start(GTK_BOX(buttonbox), m_pCancelButton, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(hbox), buttonbox, FALSE, FALSE, 5);
buttonbox = gtk_hbutton_box_new();
gtk_box_set_spacing(GTK_BOX(buttonbox), 15);
m_pBackLabel = gtk_label_new(GetTranslation("Back"));
m_pBackButton = CreateButton(m_pBackLabel, GTK_STOCK_GO_BACK);
g_signal_connect(G_OBJECT(m_pBackButton), "clicked", G_CALLBACK(BackCB), this);
gtk_box_pack_end(GTK_BOX(buttonbox), m_pBackButton, FALSE, FALSE, 5);
m_pNextLabel = gtk_label_new(GetTranslation("Next"));
m_pNextButton = CreateButton(m_pNextLabel, GTK_STOCK_GO_FORWARD);
g_signal_connect(G_OBJECT(m_pNextButton), "clicked", G_CALLBACK(NextCB), this);
gtk_box_pack_end(GTK_BOX(buttonbox), m_pNextButton, FALSE, FALSE, 5);
gtk_box_pack_end(GTK_BOX(hbox), buttonbox, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(parentbox), hbox, FALSE, FALSE, GetMainSpacing());
}
示例3: GetCurEntry
void CLuaCFGMenu::ShowChoiceMenu()
{
SEntry *entry = GetCurEntry();
std::string item = m_pMenu->Value();
NNCurses::TColorPair fc(COLOR_GREEN, COLOR_BLUE), dfc(COLOR_WHITE, COLOR_BLUE);
const char *msg = CreateText(GetTranslation("Please choose a new value for %s"), GetTranslation(item.c_str()));
NNCurses::CDialog *dialog = NNCurses::CreateBaseDialog(fc, dfc, 20, 0, msg);
NNCurses::CMenu *menu = new NNCurses::CMenu(15, 8);
for (TOptionsType::const_iterator it=entry->options.begin(); it!=entry->options.end(); it++)
menu->AddEntry(*it, GetTranslation(*it));
if (!entry->val.empty())
menu->Select(entry->val);
dialog->AddWidget(menu);
dialog->AddButton(new NNCurses::CButton(GetTranslation("OK")), true, false);
NNCurses::CButton *cancelbutton = new NNCurses::CButton(GetTranslation("Cancel"));
dialog->AddButton(cancelbutton, true, false);
NNCurses::TUI.AddGroup(dialog, true);
while (dialog->Run())
;
if (dialog->ActivatedWidget() != cancelbutton)
entry->val = menu->Value();
delete dialog;
}
示例4: switch
void CParasite::Retreat(CStateManager& mgr, EStateMsg msg, float) {
switch (msg) {
case EStateMsg::Activate: {
zeus::CVector3f dir = mgr.GetPlayer().GetTranslation() - GetTranslation();
dir.z() = 0.f;
if (dir.canBeNormalized())
dir.normalize();
else
dir = mgr.GetPlayer().GetTransform().basis[1];
x5f8_targetPos = GetTranslation() - dir * 3.f;
FaceTarget(x5f8_targetPos);
x5e8_stateProgress = 0;
x742_27_landed = false;
x742_28_onGround = false;
x742_25_jumpVelDirty = true;
x450_bodyController->GetCommandMgr().DeliverCmd(CBCJumpCmd(x5f8_targetPos, pas::EJumpType::One));
break;
}
case EStateMsg::Update:
x3b4_speed = 1.f;
break;
case EStateMsg::Deactivate:
x742_28_onGround = true;
break;
}
}
示例5: CoreUpdateLanguage
void CInstaller::CoreUpdateLanguage()
{
CBaseInstall::CoreUpdateLanguage();
m_pCancelButton->SetText(GetTranslation("Cancel"));
m_pPrevButton->SetText(GetTranslation("Back"));
UpdateButtons();
}
示例6: while
const char *CFLTKDirDialog::AskPassword(CSuTerm *suterm)
{
const char *ret = NULL;
while (true)
{
ret = fl_password(GetTranslation("Your account doesn't have permissions to "
"create the directory.\nTo create it with the root "
"(administrator) account, please enter the administrative password below."));
if (!ret || !ret[0])
break;
try
{
if (!suterm->TestPassword(ret))
fl_alert(GetTranslation("Incorrect password given, please retype."));
else
break;
}
catch (Exceptions::CExIO &e)
{
fl_alert(e.what());
break;
}
}
return ret;
}
示例7: while
const char *CFLTKDirDialog::AskPassword(LIBSU::CLibSU &suhandler)
{
const char *ret = NULL;
while (true)
{
ret = fl_password(GetTranslation("Your account doesn't have permissions to "
"create the directory.\nTo create it with the root "
"(administrator) account, please enter it's password below."));
if (!ret || !ret[0])
break;
if (!suhandler.TestSU(ret))
{
if (suhandler.GetError() == LIBSU::CLibSU::SU_ERROR_INCORRECTPASS)
fl_alert(GetTranslation("Incorrect password given for root user\nPlease retype"));
else
{
fl_alert(GetTranslation("Could not use su to gain root access.\n"
"Make sure you can use su (adding the current user to the wheel group may help)."));
break;
}
}
else
break;
}
return ret;
}
示例8: main
int main(int argc, char *argv[])
{
if (!MainInit(argc, argv))
{
printf("Error: %s\n", GetTranslation("Init failed, aborting"));
return 1;
}
// Init
if (!(MainWin = initscr())) throwerror(false, "Could not init ncurses");
if (!(CDKScreen = initCDKScreen(MainWin))) throwerror(false, "Could not init CDK");
initCDKColor();
if ((InstallInfo.dest_dir_type == DEST_DEFAULT) && !ReadAccess(InstallInfo.dest_dir))
throwerror(true, CreateText("This installer will install files to the following directory:\n%s\n"
"However you don't have read permissions to this directory\n"
"Please restart the installer as a user who does or as the root user",
InstallInfo.dest_dir.c_str()));
int i=0;
while(Functions[i])
{
if (Functions[i]()) i++;
else
{
if (YesNoBox(GetTranslation("This will abort the installation\nAre you sure?")))
break;
}
}
EndProg();
return 0;
}
示例9: ShowWelcome
bool ShowWelcome()
{
char *title = CreateText("<C></B/29>%s<!29!B>", GetTranslation("Welcome"));
char filename[] = "config/welcome";
char *buttons[2] = { GetTranslation("OK"), GetTranslation("Cancel") };
int ret = ViewFile(filename, buttons, 2, title);
return (ret==NO_FILE || ret==0);
}
示例10: ShowLicense
bool ShowLicense()
{
char *title = CreateText("<C></B/29>%s<!29!B>", GetTranslation("License agreement"));
char filename[] = "config/license";
char *buttons[2] = { GetTranslation("Agree"), GetTranslation("Decline") };
int ret = ViewFile(filename, buttons, 2, title);
return (ret==NO_FILE || ret==0);
}
示例11: UpdateDesc
bool CLuaCFGMenu::CoreHandleEvent(NNCurses::CWidget *emitter, int event)
{
if (CLuaWidget::CoreHandleEvent(emitter, event))
return true;
if (m_pMenu->Empty())
return false;
if (emitter == m_pMenu)
{
if (event == EVENT_DATACHANGED)
{
UpdateDesc();
return true;
}
else if (event == EVENT_CALLBACK)
{
SEntry *entry = GetCurEntry();
std::string item = m_pMenu->Value();
if (entry)
{
switch (entry->type)
{
case TYPE_STRING:
{
std::string ret = NNCurses::InputBox(CreateText(GetTranslation("Please enter a new value for %s"),
GetTranslation(item.c_str())), entry->val);
if (!ret.empty())
entry->val = ret;
break;
}
case TYPE_DIR:
{
std::string ret = NNCurses::DirectoryBox(CreateText(GetTranslation("Please choose a new value for %s"),
GetTranslation(item.c_str())), entry->val);
if (!ret.empty())
entry->val = ret;
break;
}
case TYPE_LIST:
case TYPE_BOOL:
ShowChoiceMenu();
break;
}
LuaDataChanged();
return true;
}
}
}
return false;
}
示例12: GetTranslation
tvector3 CGizmoTransformMove::RayTrace(tvector3& rayOrigin, tvector3& rayDir, tvector3& norm)
{
tvector3 df,inters;
m_plan=vector4(GetTranslation(), norm);
m_plan.RayInter(inters,rayOrigin,rayDir);
ptd = inters;
df = inters - GetTranslation();
df /=GetScreenFactor();
m_LockVertex = inters;
return df;
}
示例13: GetOptions
void CLuaRadioButton::AddButton(const std::string &label, TSTLVecSize n)
{
const TSTLVecSize size = GetOptions().size();
if (n >= size)
m_pRadioButton->AddChoice(GetTranslation(label));
else
m_pRadioButton->InsertChoice(GetTranslation(label), n);
if (size == 1)
m_pRadioButton->Select(0);
}
示例14: GetTranslation
bool CInstaller::AskQuit()
{
const char *msg;
if (Installing())
msg = GetTranslation("Install commands are still running\n"
"If you abort now this may lead to a broken installation\n"
"Are you sure?");
else
msg = GetTranslation("This will abort the installation\nAre you sure?");
return YesNoBox(msg);
}
示例15: m_bCancelled
CFileDialog::CFileDialog(const std::string &msg, const std::string &start) : m_bCancelled(true)
{
m_Directory = (start.empty()) ? "/" : GetFirstValidDir(start);
StartPack((m_pLabel = new CLabel(msg)), true, true, 1, 1);
StartPack(m_pFileMenu = new CMenu(25, 8), true, true, 0, 0);
StartPack((m_pInputField = new CInputField(m_Directory, CInputField::STRING, 1024)), false, false, 1, 0);
AddButton(m_pOKButton = new CButton(GetTranslation("Open directory")), true, false);
AddButton(m_pCancelButton = new CButton(GetTranslation("Cancel")), true, false);
OpenDir(m_Directory);
}