Updated gesture floater to use more modern (and actual working) method of adding list elements via xml.
This commit is contained in:
@@ -3224,16 +3224,20 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
|||||||
|
|
||||||
for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
|
for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
|
||||||
{
|
{
|
||||||
if (child->hasName("row"))
|
if (child->hasName("row") || child->hasName("rows"))
|
||||||
{
|
{
|
||||||
LLUUID id;
|
LLUUID id;
|
||||||
child->getAttributeUUID("id", id);
|
|
||||||
|
|
||||||
LLSD row;
|
LLSD row;
|
||||||
|
std::string value;
|
||||||
|
child->getAttributeString("value",value);
|
||||||
|
bool id_found = child->getAttributeUUID("id", id);
|
||||||
|
if(id_found)
|
||||||
row["id"] = id;
|
row["id"] = id;
|
||||||
|
else
|
||||||
|
row["id"] = value;
|
||||||
|
|
||||||
S32 column_idx = 0;
|
S32 column_idx = 0;
|
||||||
|
bool explicit_column = false;
|
||||||
LLXMLNodePtr row_child;
|
LLXMLNodePtr row_child;
|
||||||
for (row_child = child->getFirstChild(); row_child.notNull(); row_child = row_child->getNextSibling())
|
for (row_child = child->getFirstChild(); row_child.notNull(); row_child = row_child->getNextSibling())
|
||||||
{
|
{
|
||||||
@@ -3255,9 +3259,18 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
|||||||
row["columns"][column_idx]["font"] = font;
|
row["columns"][column_idx]["font"] = font;
|
||||||
row["columns"][column_idx]["font-style"] = font_style;
|
row["columns"][column_idx]["font-style"] = font_style;
|
||||||
column_idx++;
|
column_idx++;
|
||||||
|
explicit_column = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(explicit_column)
|
||||||
scroll_list->addElement(row);
|
scroll_list->addElement(row);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LLSD entry_id;
|
||||||
|
if(id_found)
|
||||||
|
entry_id = id;
|
||||||
|
scroll_list->addSimpleElement(value,ADD_BOTTOM,entry_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,10 +51,10 @@
|
|||||||
</text>
|
</text>
|
||||||
<scroll_list bottom_delta="-120" draw_border="true" follows="top|left" height="110"
|
<scroll_list bottom_delta="-120" draw_border="true" follows="top|left" height="110"
|
||||||
left="16" multi_select="false" name="library_list" width="100">
|
left="16" multi_select="false" name="library_list" width="100">
|
||||||
Animation
|
<row name="action_animation" value="Animation"/>
|
||||||
Sound
|
<row name="action_sound" value="Sound"/>
|
||||||
Chat
|
<row name="action_chat" value="Chat"/>
|
||||||
Wait
|
<row name="action_wait" value="Wait"/>
|
||||||
</scroll_list>
|
</scroll_list>
|
||||||
<button bottom_delta="90" follows="top|left" height="20" label="Add >>"
|
<button bottom_delta="90" follows="top|left" height="20" label="Add >>"
|
||||||
left="130" name="add_btn" width="80" />
|
left="130" name="add_btn" width="80" />
|
||||||
|
|||||||
@@ -32,10 +32,10 @@
|
|||||||
Pasos:
|
Pasos:
|
||||||
</text>
|
</text>
|
||||||
<scroll_list name="library_list">
|
<scroll_list name="library_list">
|
||||||
Animación
|
<row name="action_animation" value="Animación"/>
|
||||||
Sonidos
|
<row name="action_sound" value="Sonidos"/>
|
||||||
Chat
|
<row name="action_chat" value="Chat"/>
|
||||||
Esperar
|
<row name="action_wait" value="Esperar"/>
|
||||||
</scroll_list>
|
</scroll_list>
|
||||||
<button label="Añadir >>" name="add_btn"/>
|
<button label="Añadir >>" name="add_btn"/>
|
||||||
<button label="Subir" name="up_btn"/>
|
<button label="Subir" name="up_btn"/>
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
Étapes:
|
Étapes:
|
||||||
</text>
|
</text>
|
||||||
<scroll_list name="library_list">
|
<scroll_list name="library_list">
|
||||||
Animation
|
<row name="action_animation" value="Animation"/>
|
||||||
Son
|
<row name="action_sound" value="Son"/>
|
||||||
Chat
|
<row name="action_chat" value="Chat"/>
|
||||||
Attendre
|
<row name="action_wait" value="Attendre"/>
|
||||||
</scroll_list>
|
</scroll_list>
|
||||||
<button label="Ajouter >>" name="add_btn"/>
|
<button label="Ajouter >>" name="add_btn"/>
|
||||||
<button label="Monter" name="up_btn"/>
|
<button label="Monter" name="up_btn"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user