| Navigation: Templates > Guide to all Templates > Control Templates >====== RTFToolBar Control Template ====== |   |
| |
This control template requires the population of the RTFTextControl Control Template.
The RTFToolBar Control Template populates a group of support controls to use with the RTFTextControl control template.
There are no template prompts for this control. You can disable or hide controls that you do not want to provide to the user. You can also modify the icons and text used on each support control.
Each control is described as follows:
New | Clears the contents of the RTF Control. |
Open | Prompts you to load an external RTF file's contents into the RTF control |
Save | Allows you to save the existing RTF control's contents to an external file. |
Print | Prints the RTF control contents. |
Find | Opens the Find dialog window, allowing you to search for text in the RTF control. |
Find and Replace | Opens the Find and Replace dialog window, allowing you to search and replace target text in the RTF control. |
Cut, Copy and Paste | Performs the standard Windows cut, copy and paste actions for selected text in the RTF control. |
Undo and Redo | Allows you to undo the sequence of actions performed on an RTF control, and to redo those actions if needed. |
Tab Stops | Press this button to access the Tabs dialog. Set your tab stops in millimeters, inches, or twips. The hotkey to move to the next tab stop is CTRL+TAB |
Paragraph Indents | Press this button to access the Paragraph Indents dialog. Set the First line, Left side and Right side of the paragraph in millimeters, inches, or twips. |
Alignment Controls | These buttons provide the standard alignment features (left, right, center, and full justification) for the selected text. |
Full justification is currently only supported in Rich Edit versions greater than 3.0. The presence of RichEdxx.DLL is required in the Windows System directory.
| Bullets and Numbering/Bullet Styles | Add bullets or numbers and set the style with these buttons. Bullets and numbering can only be applied at the start of a paragraph. |
Font and Colors | These controls set all aspects of the active font and color to use in the RTF control. |
Hiding or Removing Controls
If there are controls that you do not need in your application (Example: Save or Print), you can simply delete them. When you are prompted with “Do you want to delete this control template?” Press No, and only the individual control will be removed.
To conditionally hide controls at runtime, you can use the following embedded source in the Window Manager's Init Method (just after the first RTFControl Initialization embed point):
IF NeedToHideSave !locally defined flag
HIDE(?RTFToolSave) !hide Save button
RTFControl19.AddItem(RTFToolbar:CtlButtonSave,0)
!the AddItem method disables Save button logic
END
Use this technique for any button that you need to conditionally display.