if (selected == "true")
fselected = true;
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(label.c_str());
if (m_use_gettext)
- wlabel = wgettext(label.c_str());
- else
- wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
+ wlabel = wstrgettext(label);
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
- narrow_to_wide(""),
+ L"",
wlabel,
258+m_fields.size()
);
spec.ftype = f_CheckBox;
-
+ spec.flabel = wlabel; //Needed for displaying text on MSVC
gui::IGUICheckBox* e = Environment->addCheckBox(fselected, rect, this,
- spec.fid, wlabel);
-
+ spec.fid, spec.flabel.c_str());
m_checkboxes.push_back(std::pair<FieldSpec,gui::IGUICheckBox*>(spec,e));
m_fields.push_back(spec);
- if (m_use_gettext)
- delete[] wlabel;
return;
}
errorstream<< "Invalid checkbox element(" << parts.size() << "): '" << element << "'" << std::endl;
label = unescape_string(label);
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(label.c_str());
if (m_use_gettext)
- wlabel = wgettext(label.c_str());
- else
- wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
+ wlabel = wstrgettext(label);
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
wlabel,
- narrow_to_wide(""),
+ L"",
258+m_fields.size()
);
spec.ftype = f_Button;
Environment->addButton(rect, this, spec.fid, spec.flabel.c_str());
m_fields.push_back(spec);
- if (m_use_gettext)
- delete[] wlabel;
return;
}
errorstream<< "Invalid button element(" << parts.size() << "): '" << element << "'" << std::endl;
FieldSpec spec = FieldSpec(
fname_w,
- narrow_to_wide(""),
- narrow_to_wide(""),
+ L"",
+ L"",
258+m_fields.size()
);
FieldSpec spec = FieldSpec(
fname_w,
- narrow_to_wide(""),
- narrow_to_wide(""),
+ L"",
+ L"",
258+m_fields.size()
);
label = unescape_string(label);
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(label.c_str());
if (m_use_gettext) {
if (label.length() > 1)
- wlabel = wgettext(label.c_str());
+ wlabel = wstrgettext(label);
else
- wlabel = (wchar_t*) narrow_to_wide("").c_str();
+ wlabel = L"";
}
- else
- wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
wlabel,
- narrow_to_wide(""),
+ L"",
258+m_fields.size()
);
evt.KeyInput.PressedDown = true;
e->OnEvent(evt);
m_fields.push_back(spec);
- if ((m_use_gettext) && (label.length() >1))
- delete[] wlabel;
return;
}
errorstream<< "Invalid pwdfield element(" << parts.size() << "): '" << element << "'" << std::endl;
default_val = unescape_string(default_val);
label = unescape_string(label);
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(label.c_str());
if (m_use_gettext) {
if (label.length() > 1)
- wlabel = wgettext(label.c_str());
+ wlabel = wstrgettext(label);
else
- wlabel = (wchar_t*) narrow_to_wide("").c_str();
+ wlabel = L"";
}
- else
- wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
Environment->addStaticText(spec.flabel.c_str(), rect, false, true, this, 0);
}
}
- if (m_use_gettext && (label.length() > 1))
- delete[] wlabel;
m_fields.push_back(spec);
}
default_val = unescape_string(default_val);
label = unescape_string(label);
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(label.c_str());
if (m_use_gettext) {
if (label.length() > 1)
- wlabel = wgettext(label.c_str());
+ wlabel = wstrgettext(label);
else
- wlabel = (wchar_t*) narrow_to_wide("").c_str();
+ wlabel = L"";
}
- else
- wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
Environment->addStaticText(spec.flabel.c_str(), rect, false, true, this, 0);
}
}
- if (m_use_gettext && (label.length() > 1))
- delete[] wlabel;
m_fields.push_back(spec);
}
text = unescape_string(text);
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(text.c_str());
if (m_use_gettext)
- wlabel = wgettext(text.c_str());
- else
- wlabel = (wchar_t*) narrow_to_wide(text.c_str()).c_str();
+ wlabel = wstrgettext(text);
FieldSpec spec = FieldSpec(
- narrow_to_wide(""),
+ L"",
wlabel,
- narrow_to_wide(""),
+ L"",
258+m_fields.size()
);
Environment->addStaticText(spec.flabel.c_str(), rect, false, true, this, spec.fid);
m_fields.push_back(spec);
- if (m_use_gettext)
- delete[] wlabel;
return;
}
errorstream<< "Invalid label element(" << parts.size() << "): '" << element << "'" << std::endl;
}
FieldSpec spec = FieldSpec(
- narrow_to_wide(""),
+ L"",
narrow_to_wide(label.c_str()),
- narrow_to_wide(""),
+ L"",
258+m_fields.size()
);
gui::IGUIStaticText *t =
label = unescape_string(label);
- wchar_t* wlabel = 0;
+ std::wstring wlabel = narrow_to_wide(label.c_str());
if (m_use_gettext)
- wlabel = wgettext(label.c_str());
- else
- wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
+ wlabel = wstrgettext(label);
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
e->setDrawBorder(drawborder);
m_fields.push_back(spec);
- if (m_use_gettext)
- delete[] wlabel;
return;
}
FieldSpec spec = FieldSpec(
narrow_to_wide(name.c_str()),
- narrow_to_wide(""),
- narrow_to_wide(""),
+ L"",
+ L"",
258+m_fields.size()
);