|
|
|
@ -275,7 +275,7 @@ namespace NLGUI
|
|
|
|
|
if (stricmp((char*)cur->name, "action") == 0)
|
|
|
|
|
{
|
|
|
|
|
string strId, strAh, strParams, strCond, strTexture;
|
|
|
|
|
ucstring ucstrName;
|
|
|
|
|
string ucstrName;
|
|
|
|
|
|
|
|
|
|
if (id) strId = (const char*)id;
|
|
|
|
|
CXMLAutoPtr name((const char*) xmlGetProp (cur, (xmlChar*)"name"));
|
|
|
|
@ -286,7 +286,7 @@ namespace NLGUI
|
|
|
|
|
if (NLMISC::startsWith(ptrName, "ui"))
|
|
|
|
|
ucstrName = CI18N::get(ptrName);
|
|
|
|
|
else
|
|
|
|
|
ucstrName.fromUtf8(ptrName);
|
|
|
|
|
ucstrName = ptrName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CXMLAutoPtr ah((const char*) xmlGetProp (cur, (xmlChar*)"handler"));
|
|
|
|
@ -1215,7 +1215,7 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
CViewTextMenu* CGroupSubMenu::addLine (const ucstring &name, const std::string &ah,
|
|
|
|
|
CViewTextMenu* CGroupSubMenu::addLine (const std::string &name, const std::string &ah,
|
|
|
|
|
const std::string ¶ms, const std::string &id,
|
|
|
|
|
const std::string &cond, const std::string &texture,
|
|
|
|
|
bool checkable /*= false*/, bool checked /*= false*/, bool formatted /*= false */
|
|
|
|
@ -1231,11 +1231,11 @@ namespace NLGUI
|
|
|
|
|
{
|
|
|
|
|
pV->setMultiLine (true);
|
|
|
|
|
pV->setMultiLineMaxWOnly (true);
|
|
|
|
|
pV->setTextFormatTaged (name.toUtf8());
|
|
|
|
|
pV->setTextFormatTaged (name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pV->setText (name.toUtf8());
|
|
|
|
|
pV->setText (name);
|
|
|
|
|
}
|
|
|
|
|
pV->setColor (_GroupMenu->_Color);
|
|
|
|
|
pV->setFontSize (_GroupMenu->_FontSize, _GroupMenu->_FontSizeCoef);
|
|
|
|
@ -1296,7 +1296,7 @@ namespace NLGUI
|
|
|
|
|
return pV;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CViewTextMenu* CGroupSubMenu::addLineAtIndex(uint index, const ucstring &name, const std::string &ah,
|
|
|
|
|
CViewTextMenu* CGroupSubMenu::addLineAtIndex(uint index, const std::string &name, const std::string &ah,
|
|
|
|
|
const std::string ¶ms, const std::string &id /*=""*/,
|
|
|
|
|
const std::string &cond /*=std::string()*/, const std::string &texture,
|
|
|
|
|
bool checkable /*= false*/, bool checked /*= false*/, bool formatted /*= false */
|
|
|
|
@ -1319,11 +1319,11 @@ namespace NLGUI
|
|
|
|
|
{
|
|
|
|
|
pV->setMultiLine (true);
|
|
|
|
|
pV->setMultiLineMaxWOnly (true);
|
|
|
|
|
pV->setTextFormatTaged (name.toUtf8());
|
|
|
|
|
pV->setTextFormatTaged (name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pV->setText (name.toUtf8());
|
|
|
|
|
pV->setText (name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pV->setColor (_GroupMenu->_Color);
|
|
|
|
@ -1602,7 +1602,7 @@ namespace NLGUI
|
|
|
|
|
texture = _Lines[k].ViewText->getCheckBox()->getTexture();
|
|
|
|
|
}
|
|
|
|
|
CViewTextMenu *pV = NULL;
|
|
|
|
|
pV = copyMenu->addLine (CUtfStringView(_Lines[k].ViewText->getText()).toUtf16(), _Lines[k].AHName, _Lines[k].AHParams, _Lines[k].Id, _Lines[k].Cond,
|
|
|
|
|
pV = copyMenu->addLine (_Lines[k].ViewText->getText(), _Lines[k].AHName, _Lines[k].AHParams, _Lines[k].Id, _Lines[k].Cond,
|
|
|
|
|
texture, _Lines[k].ViewText->getCheckable(), _Lines[k].ViewText->getChecked(), _Lines[k].ViewText->getFormatted ());
|
|
|
|
|
copyMenu->_Lines[k].Selectable = _Lines[k].Selectable;
|
|
|
|
|
pV->setGrayed(_Lines[k].ViewText->getGrayed());
|
|
|
|
@ -1858,8 +1858,8 @@ namespace NLGUI
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING);
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING);
|
|
|
|
|
ucstring arg1;
|
|
|
|
|
nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1));
|
|
|
|
|
addLine(arg1, ls.toString(2), ls.toString(3), ls.toString(4));
|
|
|
|
|
nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1)); // FIXME: Lua UTF-8
|
|
|
|
|
addLine(arg1.toUtf8(), ls.toString(2), ls.toString(3), ls.toString(4));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1874,8 +1874,8 @@ namespace NLGUI
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING);
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING);
|
|
|
|
|
ucstring arg1;
|
|
|
|
|
nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1));
|
|
|
|
|
addLine(arg1, ls.toString(2), ls.toString(3), ls.toString(4), string(), ls.toString(5));
|
|
|
|
|
nlverify(CLuaIHM::getUCStringOnStack(ls, 1, arg1)); // FIXME: Lua UTF-8
|
|
|
|
|
addLine(arg1.toUtf8(), ls.toString(2), ls.toString(3), ls.toString(4), string(), ls.toString(5));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1890,8 +1890,8 @@ namespace NLGUI
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 4, LUA_TSTRING);
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 5, LUA_TSTRING);
|
|
|
|
|
ucstring arg2;
|
|
|
|
|
nlverify(CLuaIHM::getUCStringOnStack(ls, 2, arg2));
|
|
|
|
|
addLineAtIndex((uint) ls.toInteger(1), arg2, ls.toString(3), ls.toString(4), ls.toString(5));
|
|
|
|
|
nlverify(CLuaIHM::getUCStringOnStack(ls, 2, arg2)); // FIXME: Lua UTF-8
|
|
|
|
|
addLineAtIndex((uint) ls.toInteger(1), arg2.toUtf8(), ls.toString(3), ls.toString(4), ls.toString(5));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2532,25 +2532,7 @@ namespace NLGUI
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
void CGroupMenu::addLine (const string &name, const string &ah, const string ¶ms,
|
|
|
|
|
const std::string &id/*=std::string()*/,
|
|
|
|
|
const std::string &cond /*= std::string()*/, const std::string &texture,
|
|
|
|
|
bool checkable /*= false*/, bool checked /*= false*/
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
if (_RootMenu == NULL)
|
|
|
|
|
{
|
|
|
|
|
_RootMenu = new CGroupSubMenu(CViewText::TCtorParam());
|
|
|
|
|
_RootMenu->_GroupMenu = this;
|
|
|
|
|
_RootMenu->setSerializable( false );
|
|
|
|
|
addGroup (_RootMenu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_RootMenu->addLine (name, ah, params, id, cond, texture, checkable, checked, _Formatted);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
void CGroupMenu::addLine(const ucstring &name, const std::string &ah, const std::string ¶ms,
|
|
|
|
|
void CGroupMenu::addLine(const std::string &name, const std::string &ah, const std::string ¶ms,
|
|
|
|
|
const std::string &id /* = std::string()*/,
|
|
|
|
|
const std::string &cond /*= std::string()*/, const std::string &texture,
|
|
|
|
|
bool checkable /*= false*/, bool checked /*= false*/
|
|
|
|
@ -2566,7 +2548,7 @@ namespace NLGUI
|
|
|
|
|
_RootMenu->addLine (name, ah, params, id, cond, texture, checkable, checked, _Formatted);
|
|
|
|
|
}
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
void CGroupMenu::addLineAtIndex(uint index, const ucstring &name, const std::string &ah,
|
|
|
|
|
void CGroupMenu::addLineAtIndex(uint index, const std::string &name, const std::string &ah,
|
|
|
|
|
const std::string ¶ms, const std::string &id /*=std::string()*/,
|
|
|
|
|
const std::string &cond /*=std::string()*/, const std::string &texture,
|
|
|
|
|
bool checkable /*=false*/, bool checked /*=false*/)
|
|
|
|
|