Материал из Module developer
// The function for removing subdevices
IR.AddListener (IR.EVENT_LIST_ITEM_CHANGE, listDevice, function (Item, Subitem, TypeEvent, object) {
// If pressed, then
if (TypeEvent == 12) {
// If clicked on the remove button, then
if (object.Name == 'button close 1') {
// Removing the wiget
var removeWidget = md[Item].subDevice.removeWidget(md[Item].type + md[Item].index+ moduleID);
// Removing the subdevice
removeSub = module.removeSubDevice(md[Item].subDevice);
// Returning the free channel
m.push (md[Item].W.toString());
// Removing the subdevice from the array of subdevices
md.splice(Item,1);
// Saving in the cache
cache[0] = md;
cache[1] = m;
settingPopup.setData(cache); // Sending the changed cache to the subdevice
fillListFreeChannel(); // Call the function for filling in the list of free channels
fillListSubDevice(); // Call the function for filling in subdevices
};
};
});
// Creating dimming on the background for popups
messageError.GetState(0).FillColor = 0x00000066;
addDimmer.GetState(0).FillColor = 0x00000066;
listFreeChannel.GetState(0).FillColor = 0x00000066;
addDevice.GetState(0).FillColor = 0x00000066;
// Changing item sizes of popups via the code
addDevice.GetItem("listAddDevice").Height = 650;
listFreeChannel.GetItem("listAddchannel").Height = 550;
addDimmer.GetItem("Channelnumber").Width = 200;
