public void cleanup() { GuiStackControl classList = findObjectByInternalName("classList", true); if (classList.isObject()) { classList.clear(); } // Initialize the filter list. GuiStackControl filterList = findObjectByInternalName("filterList", true); if (filterList.isObject()) { filterList.clear(); } GuiPopUpMenuCtrl groupList = findObjectByInternalName("groupList", true); if (groupList.isObject()) { groupList.clear(); } if (this["classArray"].isObject()) { this["classArray"].delete(); } }
public void updateOptions() { GuiStackControl theVisOptionsList = this.findObjectByInternalName("theVisOptionsList", true); theVisOptionsList.clear(); // Go through all the // parameters in our array and // create a check box for each. for (int i = 0; i < array.count(); i++) { string text = " " + array.getValue(i); string val = array.getKey(i); string var = Util.getWord(val, 0); string toggleFunction = Util.getWord(val, 1); int textLength = text.Length; string cmd = ""; if (toggleFunction != "") { cmd = toggleFunction + "( $thisControl.getValue() );"; } ObjectCreator oc = new ObjectCreator("GuiCheckBoxCtrl"); oc["canSaveDynamicFields"] = "0"; oc["isContainer"] = "0"; oc["Profile"] = "ToolsGuiCheckBoxListProfile"; oc["HorizSizing"] = "right"; oc["VertSizing"] = "bottom"; oc["Position"] = "0 0"; oc["Extent"] = (textLength * 4) + " 18"; oc["MinExtent"] = "8 2"; oc["canSave"] = "1"; oc["Visible"] = "1"; oc["Variable"] = var; oc["tooltipprofile"] = "ToolsGuiToolTipProfile"; oc["hovertime"] = "1000"; oc["text"] = text; oc["groupNum"] = "-1"; oc["buttonType"] = "ToggleButton"; oc["useMouseEvents"] = "0"; oc["useInactiveState"] = "0"; oc["Command"] = cmd; GuiCheckBoxCtrl ctrl = oc.Create(); theVisOptionsList.addGuiControl(ctrl); } }
public void initList(string filter) { GuiStackControl SFXParametersStack = this.FOT("SFXParametersStack"); SimSet SFXParameterGroup = "SFXParameterGroup"; // Clear the current lists. SFXParametersStack.clear(); // Add each SFXParameter in SFXParameterGroup. for (uint i = 0; i < SFXParameterGroup.getCount(); i++) { SimObject obj = SFXParameterGroup.getObject(i); if (!Util.isMemberOfClass(obj.getClassName(), "SFXParameter")) { continue; } // If we have a filter, search for it in the parameter's // categories. bool matchesFilter = true; if (filter != "") { matchesFilter = false; for (int idx = 0; obj["categories[" + idx + "]"] != ""; idx++) { if (obj["categories[" + idx + "]"] == filter) { matchesFilter = true; break; } } } if (matchesFilter) { this.addParameter((SFXParameter)obj); } } // Init the filters. this.initFilterList(filter); }
public void addClassOptions() { GuiStackControl visList = this.findObjectByInternalName("theClassVisList", true); GuiStackControl selList = this.findObjectByInternalName("theClassSelList", true); // First clear the stack control. visList.clear(); selList.clear(); string classList = Util._call("enumerateConsoleClasses", "SceneObject"); int classCount = Util.getFieldCount(classList); for (int i = 0; i < classCount; i++) { string className = Util.getField(classList, i); classArray.push_back(className, ""); } // Remove duplicates and sort by key. this.classArray.uniqueKey(); this.classArray.sortkd(); // Go through all the // parameters in our array and // create a check box for each. for (int i = 0; i < classArray.count(); i++) { string Class = classArray.getKey(i); string visVar = "$" + Class + "::isRenderable"; string selVar = "$" + Class + "::isSelectable"; int textLength = Class.Length; string text = " " + Class; // Add visibility toggle. ObjectCreator oc = new ObjectCreator("GuiCheckBoxCtrl"); oc["canSaveDynamicFields"] = "0"; oc["isContainer"] = "0"; oc["Profile"] = "ToolsGuiCheckBoxListFlipedProfile"; oc["HorizSizing"] = "right"; oc["VertSizing"] = "bottom"; oc["Position"] = "0 0"; oc["Extent"] = (textLength * 4) + " 18"; oc["MinExtent"] = "8 2"; oc["canSave"] = "1"; oc["Visible"] = "1"; oc["Variable"] = visVar; oc["tooltipprofile"] = "ToolsGuiToolTipProfile"; oc["hovertime"] = "1000"; oc["tooltip"] = "Show/hide all " + Class + " objects."; oc["text"] = text; oc["groupNum"] = "-1"; oc["buttonType"] = "ToggleButton"; oc["useMouseEvents"] = "0"; oc["useInactiveState"] = "0"; GuiCheckBoxCtrl ctrl = oc.Create(); visList.addGuiControl(ctrl); // Add selectability toggle. oc = new ObjectCreator("GuiCheckBoxCtrl"); oc["canSaveDynamicFields"] = "0"; oc["isContainer"] = "0"; oc["Profile"] = "ToolsGuiCheckBoxListFlipedProfile"; oc["HorizSizing"] = "right"; oc["VertSizing"] = "bottom"; oc["Position"] = "0 0"; oc["Extent"] = (textLength * 4) + " 18"; oc["MinExtent"] = "8 2"; oc["canSave"] = "1"; oc["Visible"] = "1"; oc["Variable"] = selVar; oc["tooltipprofile"] = "ToolsGuiToolTipProfile"; oc["hovertime"] = "1000"; oc["tooltip"] = "Enable/disable selection of all " + Class + " objects."; oc["text"] = text; oc["groupNum"] = "-1"; oc["buttonType"] = "ToggleButton"; oc["useMouseEvents"] = "0"; oc["useInactiveState"] = "0"; ctrl = oc.Create(); selList.addGuiControl(ctrl); } }