There is a few things I wanted to bring to light, from this and the sample code...
For the windows you have this style...
Style = _
%WS_CHILD | _
%WS_DLGFRAME | _
%WS_CAPTION | _
%WS_SYSMENU | _
%WS_OVERLAPPEDWINDOW | _
%WS_CLIPCHILDREN | _
%WS_CLIPSIBLINGS
DLGFRAME ' -- (Creates a window that has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.)
But you also have...
CAPTION (Title-bar)
SYSMENU
OVERLAPPEDWINDOW (Creates an overlapped window with the %WS_OVERLAPPED, %WS_CAPTION, %WS_SYSMENU, %WS_THICKFRAME, %WS_MINIMIZEBOX, and %WS_MAXIMIZEBOX styles. Same as the %WS_TILEDWINDOW style.)
Could be simplified to just this...
Style = _
%WS_CHILD | _
%WS_OVERLAPPEDWINDOW | _
%WS_CLIPCHILDREN | _
%WS_CLIPSIBLINGS
That solves the "Sometimes it does not draw the graph" issue... (Well, for me it did.)
But that is related to the BLOCKING of other MDI child windows, from the code...
"if iswindow(hMDIChild) = %FALSE then"
Plus, with MDI not actually controlling the forms, the repaint is not in sync with the active window.
However, that does not solve the issue with only having one form at a time. (You block "Multiple Documents"... in the MultipleDocumentInterface procedure?)
You should be able to create thousands of "Those" forms... You are still trying to create separate code for each "Window", but you only need code for each-TYPE of window. (If the windows are the same, only one code area controls all 1000 of them.)
If you have an...
Image-Form
Sound-Form
Login-Form
Chat-Form
Those should have separate code, but...
They all use the same code when you create...
Chat-form#1 (Joe)
Chat-form#2 (Andy)
Chat-form#3 (Sam)
Chat-form#4 (Omar)
Chat-form#5 (Nick)
You are thinking linear, not procedural. Windows manages all the controls and windows for you. You only have to provide the code which reacts to the CBHNDL which is ACTIVE. (The Active MDI.) Which should be in the MENU, as a LIST of all children in the window, so you don't have to rifle through thousands of hidden windows, or minimize them all where you can't read the title-bars.
Until that MDI-function is complete... We are not getting the function of an MDI, other than the container window. (The function of the MDI is the control of each child by ID, and of the MENU inheritance from the children, to the parent. Being an MDI-Container is only a function of the form/window.)
If you remove %WS_CLIPSIBLINGS from the main window... (Container)... and remove the "if iswindow(hMDIChild) = %FALSE then" which only allows one child to be created... It works as an MDI... Except for the menu-inheritance issue, and the issue related to an inability to create an MDI control inside a normal form. (This setup demands that the whole form becomes the container. So there is no way to have an actual program/window/form... that has a container as it would have a TAB, or BUTTON, or LIST.)
I can sooo see that being used as a FORM-EDITOR for ThinAIR in the future...
Bookmarks