SDI and MDI

In many GUI applications, we would arrive at a situation to open more than one document at a time for processing. We would want to design our application to handle this. This can be achieved by either of the two approaches namely, SDI and MDI. A Single Document Interface or SDI application implements this by creating separate windows for each of the documents. This is done by creating a window subclass that handles everything by itself, including loading, saving, and clean-up, and so on. Each of the documents will be a clone of the main window having a separate menu bar, toolbar, and status bar on its own. Each of the main window instances must be able to act independently. However, there are some disadvantages to this approach. This approach would consume a lot of resources and would be very inconvenient to open many windows at a time and keep track of them.

The second approach is to use a Multiple Document Interface or MDI application where the central widget is instantiated with multiple instances. All these widgets will be interrelated within the main window and shares the common menu bar, toolbar, and other components. MDI application will use lesser resources as compared to SDI applications. The MDI applications are provided with an extra menu to manage between windows, as shifting between them is not controlled by the underlying operating system. We will discuss more about SDI and MDI, and its implementation in Chapter 5, Dialogs and Widgets.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.170.63