I have an MDI application that can have many child windows, although each
"document" does not nececarily just have one window. There are a few issues
that I have.
I want multi-threading abilities. Controls have to be created and run by the
main thread.
I have other threads running that need to be able to create "documents" that
may have multiple windows.
To do this i have a "singleton" window manager class that, after being
launched and initiated by the main form, records the opeining of documents
and the visibility of windows, and can be accessed from any thread and will
invoke window creation on the main thread.
Problems :
Window manager class -
Owns the parent form and can cause it to open new forms.
Is this the best way to deal with window creation via multiple threads (e.g.
a TCP/IP connection requesting window opening) ?
Window closure -
I want to be able to "hide" windows in the MDI area when they are asked to
close, and not dispose() them. These need to be able to be reopened. The way
i have implemented this is to override the onclose() method and call hide()
if a global static bool "appIsClosing" is not set to true.
The problem is that the framework seems to call the onclosing method of the
MDI children before the parent, so i effectively have to tell the app to
close twice for this to work, once to set the bool to true, and then again
to perform the close(). How do i make children hide() and not
close()/dispose() if the main app isnt exiting ?
Layout -
what is the best way of ordering created windows in a user friendly way ?
Manybe dependent of windows already created.
Many thanks for anyones comments
Jon Rea
Student