ok, Heres the full XMLFile.js
its not complete, but im just trying to get it to display the contents when loadFiles(PlusWnd) is called
js code:
var pitems;
var pword;
var nitems;
var nword;
var mitems;
var mword;
function showConfig(PlusWnd)
{
WndOptions = MsgPlus.CreateWnd("dialogMain.xml", "options");
loadItems(PlusWnd);
}
function loadItems(PlusWnd)
{
var filename = (MsgPlus.ScriptFilesPath + '\\processes2.txt')
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.OpenTextFile(filename);
while (!f.AtEndOfStream)
{
var readFileLine = f.ReadLine();
var PIDv = ReadIni(ConfigFile, 'Processes', readFileLine, 0)
var MSNn = ReadIni(ConfigFile, 'Names', PIDv, 0)
PlusWnd.LstBox_AddItem('ProcessLBox', readFileLine, pitems + 1);
PlusWnd.LstBox_AddItem('FileNameLBox', PIDv, nitems + 1);
PlusWnd.LstBox_AddItem('MSNNameLBox', MSNn, mitems + 1);
}
f.Close();
}
function newProcess(PlusWnd)
{
pitems = PlusWnd.LstBox_GetCount("ProcessLBox");
pword = PlusWnd.GetControlText('Processes');
nitems = PlusWnd.LstBox_GetCount("FileNameLBox");
nword = PlusWnd.GetControlText('FileNames');
mitems = PlusWnd.LstBox_GetCount("MSNNameLBox");
mword = PlusWnd.GetControlText('MSNDispNames');
PlusWnd.LstBox_AddItem('ProcessLBox', pword, pitems + 1);
PlusWnd.LstBox_AddItem('FileNameLBox', nword, nitems + 1);
PlusWnd.LstBox_AddItem('MSNNameLBox', mword, mitems + 1);
}
function OnoptionsEvent_CtrlClicked(PlusWnd, ControlId) {
if (ControlId == "BtnLoad") {
loadItems(PlusWnd);
}
if (ControlId == "BtnSave") {
}
if (ControlId == "BtnAdd") {
newProcess(PlusWnd);
}
if (ControlId == "BtnClose") {
PlusWnd.Close(1)
}
}
FIXED, i wasnt detecting PlusWnd.LstBox_ as it was loading at the same time as building XML, having it on individual load button works