Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
We are ready to start migrating the user interface for our project. As mentioned in the introduction, we do this in steps, ensuring that our application is still usable at every step of the migration process.
The user interface can be viewed as a hierarchy; each top-level window and dialog depends upon a parent (which is another top-level window or dialog). When using Motif XmMainWindow widgets, these should be viewed as two separate entities: the Main Window widget with the popup-menu hierarchy and the View widget contained in the Main Window widget. The View widget depends on the Main Window widget.
We begin migrating the pieces that have no dependencies, and work our way up the dependency tree until all the pieces have been migrated.
The hierarchy for this project looks something like this:
We will begin by migrating and replacing all of the dialogs, then the Main Window widget with popup-menu hierarchy, and finally the View widget.
However, we are not ready to begin just yet. The migration process can be long, but it does not have to be difficult. The Open, Save As, Page Delete and IO Error dialogs use Motif XmFileSelectionBox and XmMessageBox dialogs. TQt provides similar functionality with TQFileDialog and TQMessageBox, which we can begin using immediately.
The Print dialog is special, however. The Print dialog cannot be replaced until after we have replaced the View widget. TQt provides a complete printing mechanism with TQPrinter, but we cannot start using it until we have replaced the View widget.
The Help dialog is also special. Instead of replacing the Help dialog with a custom TQDialog, we will use the TQt Help System classes to provide a more advanced online help. However, we cannot start using classes like TQToolTip and TQWhatsThis until we replace the Main Window and View widgets.
The help text included with the original project is very small and only contains information about the XmNoteBook widget. The use of tooltips and whats-this text will suffice for this example. If your migration project has a large online help system, we recommend looking at the Simple HTML Help Browser example for information on how to build an rich text help system with hypertext navigation and full printing capabilities, or using TQt Assistant.
Removing the existing Help dialog is relatively simple. We remove the Xmd/Help.h, Xmd/HelpP.h and Xmd/Help.c files from our project file and regenerate our Makefile.
The code to create the Help menu and Help dialog is in todo.cpp. We remove the Xmd/Help.h include, the *help_manager resource string, the help_cb() function forward declaration and the help_widget global variable. We also need to remove the code that creates the Help dialog. We will also remove the code to create the Help menu, since this menu is now empty. Finally, we remove the help_cb() function implementation.
The Help dialog is now removed from our project. We cannot add TQToolTip and TQWhatsThis help at the moment, since we are still using XmMainWindow for the Main Window widget. Once we have migrated the Main Window and the popup-menu hierarchy, we can begin using TQToolTip and TQWhatsThis for online help.
[ Previous: Getting Started ] [ Home ] [ Next: Using TQt Standard Dialogs ]
Copyright © 2007 Trolltech | Trademarks | TQt 3.3.8
|