Almost every programmer tries to create a Notepad replacement at one time or another. With everything that is available in Delphi, building a great text editor is a pretty painless experience.
Figure 16-1: The text editor that we're going to create in this chapter
The first thing that we have to do is build the basic user interface of the application. To do that, drop TMainMenu, TMemo, TStatusBar (Win32 category), and TToolbar components on the Designer Surface.
After you have added the components to the Designer Surface, select the TMainMenu component and create the File, Edit, and Format menu groups (see Figure 16-2). Don't create any menu items; we're going to use actions to implement menu commands instead.
Figure 16-2: Main menu groups
Now select the TMemo component and do the following:
Rename it Editor.
Set the Align property to alClient to have the component fill the entire client area of the form.
Delete the Memo1 text from the Lines property.
Set the ScrollBars property to ssVertical to display the vertical scroll bar to enable the user to easily view long text files.
If you've done everything right, your Designer Surface should like the one in Figure 16-3.
Figure 16-3: The basic user interface