public virtual void scanGroup(SimGroup group, GuiPopUpMenuCtrl list, int indentLevel) { // Create a display name for the group. string text = group.getName(); if (text == "") { text = group.getClassName(); } string internalName = group.getInternalName(); if (internalName != "") { text = text + "[" + internalName + "]"; } // Indent the name according to the depth in the hierarchy. if (indentLevel > 0) { text = Util.strrepeat(" ", indentLevel, "") + text; } // Add it to the list. list.add(text, group.getId()); // Recurse into SimSets with at least one child. for (uint i = 0; i < group.getCount(); i++) { SimObject obj = group.getObject(i); if (!obj.isMemberOfClass("SimSet") || obj.call("getCount").AsInt() == 0) { continue; } scanGroup(obj.GetID(), list, indentLevel + 1); } }