<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Preparing to Migrate the User Interface</h1>
[ <ahref="motif-walkthrough-3.html">Next: Using TQt Standard Dialogs</a> ]
<p> 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.
<p> 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 <ahref="motif-extension.html#Motif">Motif</a><tt>XmMainWindow</tt> widgets, these should be
viewed as two separate entities: the <em>Main Window</em> widget with the
popup-menu hierarchy and the <em>View</em> widget contained in the <em>Main Window</em> widget. The <em>View</em> widget depends on the <em>Main Window</em>
widget.
<p> We begin migrating the pieces that have no dependencies, and work our
way up the dependency tree until all the pieces have been migrated.
<p> The hierarchy for this project looks something like this:
<p><center><imgsrc="motif-todo.png"alt="Motif Todo Hierarchy"></center>
<p> We will begin by migrating and replacing all of the dialogs, then the
<em>Main Window</em> widget with popup-menu hierarchy, and finally the <em>View</em> widget.
<p> However, we are not ready to begin just yet. The migration process can
be long, but it does not have to be difficult. The <em>Open</em>, <em>Save As</em>, <em>Page Delete</em> and <em>IO Error</em> dialogs use Motif <tt>XmFileSelectionBox</tt> and <tt>XmMessageBox</tt> dialogs. TQt provides similar
until we replace the <em>Main Window</em> and <em>View</em> widgets.
<p> The help text included with the original project is very small and
only contains information about the <tt>XmNoteBook</tt> widget. The use of
tooltips and whats-this text will suffice for this example. If your
migration project has a large online <ahref="helpsystem.html#help-system">help system</a>, we recommend looking
at the <ahref="helpviewer-example.html">Simple HTML Help Browser</a>
example for information on how to build an rich text help system with
hypertext navigation and full printing capabilities, or using <ahref="assistant.html">TQt Assistant</a>.
<p> Removing the existing <em>Help</em> dialog is relatively simple. We remove
the <tt>Xmd/Help.h</tt>, <tt>Xmd/HelpP.h</tt> and <tt>Xmd/Help.c</tt> files from our
project file and regenerate our <tt>Makefile</tt>.
<p> The code to create the <em>Help</em> menu and <em>Help</em> dialog is in <tt>todo.cpp</tt>. We remove the <tt>Xmd/Help.h</tt> include, the <tt>*help_manager</tt>
resource string, the <tt>help_cb()</tt> function forward declaration and the
<tt>help_widget</tt> global variable. We also need to remove the code that
creates the <em>Help</em> dialog. We will also remove the code to create
the <em>Help</em> menu, since this menu is now empty. Finally, we remove
the <tt>help_cb()</tt> function implementation.
<p> The <em>Help</em> dialog is now removed from our project. We cannot add