Make generic dialog popup reentrant
To allow persistent dialogs to be implemented through the generic popup,
it must be possible to have several dialogs open at the same time, and
thus make sure the popdowns under the cacel or close-window button know
which one to pop down. To this end an array shells[] is created that
takes over the function of settingsShell, and GenericPopUp gets an extra
parameter telling it which element to use for storing the dialog shell.
This number is then also passed to the callbacks that trigger popdown.
This was a bit nasty for the CatchDeleteWindow stuff, which passes user
data to the callback as text strings.
Keep a separate up/down indicator, so that shell widgets can be kept
for persistent dialogs. Also keep a currentOption per dialog type.
The coordinates and size of the window is read out and stored in a
WindowPlacement structure, (if one is specified for that dialog), when
the dialog is popped down. When initialized the structure is also used
to set the window parameters when the dialog is created. (The idea being
that the structure was saved in the settings file.)
The routine MarkMenu checkmarks a given menu item, and logs it for the
given dialog type, so that a later popdown automatically unchecks is.