Thanks for clearing up some things. I understand where you're going, but that's exactly what I'm trying to prevent. The multidimensional array you name it, is an object in my code. It won't take more memmory, it's even more compact than writing out each seperate window.
If you take a close look at my code, you'll notive my constructor takes the argument of windows and elements, combined with a function to execute:
code:
new cWindow(
{'__OS_wndCalender':
{'__OS_btnStatusSave' : function()
{
MsgPlus.DisplayToast('Made IT!');
}
}
}
);
Here you have the structure of all elements (defined just one here, but could be a lot more) inside of all windows, which are filled with the function to execute. It could also include a reference to execute another part of the script, which makes the code flexible.
Another advantage of this object-collection is that I could easily make a function to manage the elements and windows. I have the openWindow function, which will make every new window available to this control. Thereby I could add a function to each window like 'addElementControl', which'll give me the feature to dynamically add (handling of) control-elements.
In the code you're showing as an alternative, there's no such possibility. I'll have to hardcore every change and every action in seperate functies. I think it's LESS readable and workable instead of a nice collection, but that's indeed just a personal opinion.
I'll keep thinking about the handling. I've been trying to dynamically create the functions to handle the windows and reference them to the global one, but i don't think that'll be a nice workaround....