|
|
|
@ -114,19 +114,6 @@ namespace NLGUI
|
|
|
|
|
OldShadowColorGrayed.A = OldColorGrayed.A = (uint8)a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
void CViewTextMenu::setActive (bool state)
|
|
|
|
|
{
|
|
|
|
|
if (_ParentMenu)
|
|
|
|
|
_ParentMenu->setActive(state);
|
|
|
|
|
|
|
|
|
|
if (_Active != state)
|
|
|
|
|
{
|
|
|
|
|
_Active = state;
|
|
|
|
|
invalidateCoords();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
|
// CGroupSubMenu
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
@ -303,9 +290,6 @@ namespace NLGUI
|
|
|
|
|
if (cond) strCond = (const char*)cond;
|
|
|
|
|
CXMLAutoPtr params((const char*) xmlGetProp (cur, (xmlChar*)"params"));
|
|
|
|
|
if (params) strParams = (const char*)params;
|
|
|
|
|
CXMLAutoPtr icon((const char*) xmlGetProp (cur, (xmlChar*)"icon"));
|
|
|
|
|
if (icon)
|
|
|
|
|
strTexture = (const char*)icon;
|
|
|
|
|
CXMLAutoPtr strCheckable((const char*) xmlGetProp (cur, (xmlChar*)"checkable"));
|
|
|
|
|
bool bCheckable = false;
|
|
|
|
|
if (strCheckable) bCheckable = convertBool (strCheckable);
|
|
|
|
@ -409,11 +393,11 @@ namespace NLGUI
|
|
|
|
|
pVB->setSerializable( false );
|
|
|
|
|
pVB->setParent (this);
|
|
|
|
|
pVB->setParentPos (parentPos);
|
|
|
|
|
pVB->setParentPosRef (Hotspot_BL);
|
|
|
|
|
pVB->setPosRef (Hotspot_BR);
|
|
|
|
|
pVB->setParentPosRef (Hotspot_ML);
|
|
|
|
|
pVB->setPosRef (Hotspot_MR);
|
|
|
|
|
pVB->setTexture(texture);
|
|
|
|
|
pVB->setModulateGlobalColor(false);
|
|
|
|
|
pVB->setX (MENU_WIDGET_X);
|
|
|
|
|
pVB->setX (-2);
|
|
|
|
|
addView (pVB);
|
|
|
|
|
return pVB;
|
|
|
|
|
}
|
|
|
|
@ -655,14 +639,12 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
// *** Update Text Positions
|
|
|
|
|
// sint32 currX = 0;
|
|
|
|
|
sint32 maxTextW = 0;
|
|
|
|
|
for(k = 0; k < _Lines.size(); ++k)
|
|
|
|
|
{
|
|
|
|
|
if (_Lines[k].ViewText)
|
|
|
|
|
{
|
|
|
|
|
// Setup Y
|
|
|
|
|
_Lines[k].ViewText->setY(_Lines[k].TextDY);
|
|
|
|
|
maxTextW = max(maxTextW, _Lines[k].ViewText->getW());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -676,12 +658,10 @@ namespace NLGUI
|
|
|
|
|
|
|
|
|
|
// *** Setup SubMenus and CheckBoxes Positions
|
|
|
|
|
sint32 maxViewW = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 1; i < _Views.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
CViewBitmap *pVB = dynamic_cast<CViewBitmap *>(_Views[i]);
|
|
|
|
|
if (pVB == NULL) continue;
|
|
|
|
|
|
|
|
|
|
if (pVB->getId() == ID_MENU_SUBMENU)
|
|
|
|
|
{
|
|
|
|
|
// Look for the next line of the menu that contains a sub menu
|
|
|
|
@ -1270,7 +1250,6 @@ namespace NLGUI
|
|
|
|
|
_GroupList->addChild (pV);
|
|
|
|
|
|
|
|
|
|
CViewBitmap *checkBox = NULL;
|
|
|
|
|
CViewBitmap *icon = NULL;
|
|
|
|
|
|
|
|
|
|
if (checkable)
|
|
|
|
|
{
|
|
|
|
@ -1279,6 +1258,15 @@ namespace NLGUI
|
|
|
|
|
pV->setCheckBox(checkBox);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CViewBitmap *icon = NULL;
|
|
|
|
|
if (!texture.empty())
|
|
|
|
|
{
|
|
|
|
|
if (_GroupList->getNumChildren() == 1)
|
|
|
|
|
pV->setX(20);
|
|
|
|
|
icon = createIcon(pV, texture);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tmp.ViewText = pV;
|
|
|
|
|
tmp.Separator = NULL;
|
|
|
|
|
tmp.AHName = ah;
|
|
|
|
@ -1292,39 +1280,12 @@ namespace NLGUI
|
|
|
|
|
tmp.Id = id;
|
|
|
|
|
|
|
|
|
|
pV->setId(_GroupMenu->getId()+":"+tmp.Id);
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
typedef std::pair<std::string, std::string> TTmplParams;
|
|
|
|
|
std::vector<TTmplParams> vparams;
|
|
|
|
|
uint lineIndex = _Lines.size()-1;
|
|
|
|
|
vparams.push_back(TTmplParams("id", toString("icon%d", lineIndex)));
|
|
|
|
|
vparams.push_back(TTmplParams("sizeref", ""));
|
|
|
|
|
vparams.push_back(TTmplParams("icon_texture", texture.c_str()));
|
|
|
|
|
//vparams.push_back(TTmplParams("icon_color", options.ColorNormal.toString()));
|
|
|
|
|
string lineId = toString("%s:icon%d", _GroupMenu->getId().c_str(), lineIndex);
|
|
|
|
|
|
|
|
|
|
CInterfaceGroup *pUGLeft = CWidgetManager::getInstance()->getParser()->createGroupInstance("menu_row_icon", lineId, vparams);
|
|
|
|
|
if (pUGLeft)
|
|
|
|
|
{
|
|
|
|
|
tmp.UserGroupLeft = pUGLeft;
|
|
|
|
|
tmp.UserGroupLeftOwnership = true;
|
|
|
|
|
addGroup(pUGLeft);
|
|
|
|
|
pUGLeft->setParent(this);
|
|
|
|
|
pUGLeft->setParentPos(this);
|
|
|
|
|
pUGLeft->setParentPosRef (Hotspot_BL);
|
|
|
|
|
pUGLeft->setPosRef (Hotspot_BL);
|
|
|
|
|
pUGLeft->setX(LEFT_MENU_WIDGET_X);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_Lines.push_back (tmp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add an empty sub menu by default
|
|
|
|
|
_SubMenus.push_back (NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_GroupMenu->invalidateCoords();
|
|
|
|
|
|
|
|
|
|
return pV;
|
|
|
|
|