There are only two things left to be done in this chapter: add glyphs to the most often used actions and then add these actions to the toolbar.
First, add a TImageList component to the Designer Surface, rename it Normal, and then add glyphs for the New, Open, Save, Undo, Cut, Copy, Paste, Delete, and Find actions (see Figure 16-17). After you add these images to the TImageList component, assign the TImageList component to the TActionList, TToolbar, and TMainMenu components and then open the Action List editor and assign the glyphs to the appropriate actions.
Figure 16-17: The images used in the text editor
When you're done assigning glyphs to the actions, select the toolbar and right-click it to display the toolbar's context menu. The context menu offers you the New Button option to create a new toolbar button and the New Separator option to create a separator item that enables you to visually group buttons. All that you have to do now is add several buttons to the toolbar and assign an action to the Action property of each button.
If you want, you can also modify the following two properties to make the toolbar more attractive:
Set the AutoSize property to True to remove the empty space on the toolbar.
Set the ShowCaptions property to True to display button captions (if you do this, you'll have to remove the ampersand characters and dots from the button captions).
Also, you can improve the look of the disabled toolbar buttons by adding another TImageList component to the Designer Surface to hold disabled glyphs. Here's what you have to do to add disabled glyphs to the toolbar:
Add another TImageList component to the Designer Surface.
Rename it Disabled.
Add disabled glyphs to the image list (the disabled glyphs in the GlyFX folder end with _d).
Make sure that the index of each disabled glyph matches the index of the normal glyph in the Normal image list (see Figure 16-18).
Figure 16-18: Normal and disabled image lists
Assign the disabled image list to the toolbar's DisabledImages property.
After you've added the disabled glyphs to the toolbar, you're done. The text editor is completely finished. You can see the final product in Figure 16-19.
Figure 16-19: The best text editor in the galaxy