Several changes have been made for MDI client and child windows:
In FOX 1.0, the FXMDIClient class was derived from FXScrollArea. As a consequence, it always contained two "hidden" child widgets (the horizontal and vertical scrollbars) in addition to any MDI child windows. This was the reason for the FXMDIClient member functions getMDIChildFirst() and getMDIChildLast(), as well as the FXMDIChild member functions getMDINext() and getMDIPrev().
In order to simplify this, FXMDIClient is now derived directly from FXComposite, which means that its only child widgets are the FXMDIChild windows themselves. Because of this change, you can now use the more general "window navigation" APIs (i.e. getFirst(), getLast(), getNext(), and getPrev()) when you need to iterate over the FXMDIChild windows in an FXMDIClient window.
Another change for FXMDIClient is the addition of the cascade(), horizontal() and vertical() member functions. These are the functions that are called when an FXMDIClient is sent the ID_MDI_CASCADE, ID_MDI_TILEHORIZONTAL or ID_MDI_TILEVERTICAL message, respectively.
In FOX 1.0, an application could send to an FXMDIClient window a SEL_COMMAND message with the identifier ID_CLOSE_DOCUMENT and in response, the FXMDIClient window would send a SEL_CLOSEALL message to the active FXMDIChild window, inquiring whether it was OK to close all of the FXMDIChild windows associated with that child window's "document" (i.e. its message target). By default, this message was forwarded directly to the document object, giving it either a chance to save the application data before agreeing to the SEL_CLOSEALL request, or to reject the request outright. (A similar approach was used by the FXMDIClient to handle the ID_CLOSE_ALL_DOCUMENTS command message).
The new approach for closing all of the FXMDIChild windows associated with a particular document (i.e. all of those MDI child windows whose message target is a particular object) is to simply call the forallDocWindows() member function for the FXMDIClient class, e.g.
mdiClient->forallDocWindows(documentObj, sender, FXSEL(SEL_CLOSE, 0), NULL); |
Similarly, if you want to close all of the FXMDIChild windows for an FXMDIClient, use the new forallDocuments() member function:
mdiClient->forallDocuments(sender, FXSEL(SEL_CLOSE, 0), NULL); |
FXMDIChild has a new close() member function that is called to close an MDI child window. This is the function that gets called when an MDI child receives a SEL_CLOSE message, and it's subject to the same rules as for closing top-level windows.
The minimize(), maximize(), and restore() member functions for FXMDIChild now have a FXbool return type to indicate whether the requested size change was successful. By default, each of these returns TRUE.
The new MDI_TRACKING construct-time option for FXMDIChild windows enables opaque dragging and resizing of those windows. You can also query and set the state of this option using the new getTracking() and setTracking() member functions.
Previously, an FXMDIChild window would forward any unhandled messages to its content window only. Now, the content window still gets the first crack at unhandled messages, but if it also fails to handle a message, the message is forwarded to the MDI child's message target.
Thanks to a patch submitted by Thomas Friedrichsmeier, the animation used for minimizing, maximizing and restoring FXMDIChild windows is now much smoother.
The FXMDIWindowButton constructor now expects a pointer to an FXPopup window as its second argument. For most cases, this should just be a pointer to your application's FXMDIMenu window. Previously, each FXMDIChild window forced its own window menu to the FXMDIWindowButton in the menubar; this was an unnecessary complication as we can simply share the window menu between all FXMDIWindowButton instances. Note that since the FXMDIMenu object is a shared resource, the application is responsible for properly disposing of it when the application is destroyed.
Improved the drawing for FXMDIChild by adding an interior sunken border.
Renamed the FXMDIChild member functions getWindowIcon(), setWindowIcon(), getWindowMenu() and setWindowMenu() to getIcon(), setIcon(), getMenu() and setMenu(), respectively.