Tivoli Service Desk 6.0 Developer's Toolkit Interface Designer Guide

Chapter 5: Building Additional Features

Back to Table of Contents


Introduction

Overview

Adding enhancements, such as menus, toolbars, patterns, and online help can make your application more useful. You must first set menu and toolbar styles before you can add these enhancements. Then, rename the menu and toolbar with the same name as the form and they will automatically "attach" to the form.

Pattern Components

What are patterns?

Patterns are templates for text boxes and are used to provide visual cues to users regarding the format of typed information. Patterns are specified as part of the control description in a resource file.

Pattern types

There are six possible pattern types:

Entry and display masks

Every pattern consists of an entry and display mask. Entry masks consist of blank and non-blank characters and do not appear to users, but restrict what can be typed. For example, you may want to restrict users to only typing numbers in a social security field, and only alphabetic characters for a name field. Both display masks are defined using character flags.

Entry masks are visual cues to users for what should be typed in a text box, though a user could enter anything. For example, an entry mask for a social security number looks like this:

nnn-nn-nnn

and an entry mask for a phone number looks like this:

nnn-nnn-nnnn

Unlike display masks, entry masks appear to users.

Character flags

Entry masks are composed of character flags and define what a user can type in a pattern. Character flags can be one of the following:

Valid characters

Character flags can be customized using valid characters. For example, if you create a control where a driver's license number is entered, and the number begins with a capital letter, you could select the numeric character flag and customize it with the "A," valid character. This allows the user to enter the one uppercase alpha letter in the first position, while the rest of the field remains numeric.

The following are valid character types:

Fill flags

Fill flags consist of the following:

Formatting Text Boxes with Patterns

Creating patterns

The predefined patterns in the Interface Designer cover most any type of control you will add to a form. However, use the following procedure if you prefer to create your own patterns.

To create a pattern:

  1. Open the Interface Designer.
  2. Open a resource file that contains a form for which you want to define patterns.
  3. Choose the Patterns tab.
  4. Choose Add.
    Result: The Pattern Artist dialog box appears.
  5. Use the following table to type information as appropriate for your application.

    Field Description
    Pattern ID The name of the new pattern.
    Description The description of the pattern.
    Display Mask The format that controls what the user can enter. For example, if you have a phone number mask with only numeric characters, users would not be able to enter any other type of character but numeric.
    Entry Mask The entry mask appears in the field but has not control over what the user can enter. For example, an entry mask for a phone number might appear as nnn-nnn-nnnn, however this would not stop the user from typing alphabetic characters in the field if the display mask was not configured for numeric only.
    Valid Characters The list of valid characters is shown here.
    Fill Character A character that is inserted in a text box when a control entry is incomplete.
    Test Pattern The test pattern.
    Characters Places a restriction on what type of data users can type in the pattern: AlphabeticNumericAny characters
    Fill Specifies how fill characters can be inserted:
    • Reverse inserts characters from right-to-left.
    • Fill all inserts characters in all non-blank spaces.
  6. Choose Apply or OK.
  7. Associate the pattern with a text box on the form. For more information about specifying patterns with text box control, see "Designing Controls."

Applying patterns to text boxes

You can apply predefined and user-defined patterns to text boxes.

To apply patterns to a text box:

  1. Open the Interface Designer.
  2. Open a resource file that contains at least one form.
  3. Open the form that you want to use.
  4. Double-click the text box to which you want to apply a pattern.
  5. Choose the Text Box tab.
  6. From the Pattern Type list, select the pattern you want to use.
  7. Choose Apply or OK.

Disassociating patterns from text boxes

Patterns can be disassociated from any text box, including those in run time applications. If a pattern is disassociated from a text box, then any character can be typed in the text box.

To disassociate a pattern from a text box:

  1. Open the Interface Designer.
  2. Open a resource file that contains the form.
  3. Open the form that you want to use.
  4. Double-click the control from which you want to disassociate the pattern.
  5. Choose the Text Box tab.
  6. From the Pattern Type list, select None.

Creating Menus

Introduction

Menus are often used in forms to access commands without using a command prompt. This section discusses how to create menus for forms that become windows.

Note: The Interface Designer allows you to build menus with submenus, but you must first set menu and toolbar styles. Then, rename the menu and toolbar with the same name as the form and they will automatically "attach" to the form.

Creating window menus

You can create a menu when you create a new form for a window, or when you work with an existing form. In this instance, instructions are for an existing form.

Note: It is not required to associate menus with forms. If the Menu tab does not appear in the TDT Interface Designer window, select Preferences from the Options menu, then click the Show Menu Page check box and click the OK button to save your changes.

To create a menu:

  1. Open the Interface Designer.
  2. Open a resource file that contains at least one form.
  3. Choose the Menu tab.
  4. Choose Add.
    Result: The Menu Designer dialog box appears.
  5. Click the menu name.
    Result: The name associated with the menu appears in the Menu Name box.
  6. Choose the Menu Name browse button.
  7. Type a unique menu name in the Unique ID dialog box and choose OK.
    Result: The Unique ID dialog box closes and the menu name you entered appears in the Menu Name text box on the Menu Designer dialog box. The menu name is for development purposes only and does not appear to your users.
  8. In the Menu Text box, type the text that you want to appear on the menu.
  9. Under the Style group box, select from the following styles:
  10. Choose Update.
  11. Choose OK.

You can add another menu at the same menu level by clicking Add After.

Adding submenus

Submenus appear under menus. You can create submenus to a menu as well as nest another submenu to a submenu.

To add a submenu:

  1. Open a resource file that contains at least one form.
  2. Choose the Menu tab.
  3. Choose the menu you want to add a submenu to and click Update.
    Result: The Menu Designer dialog box appears.
  4. Click the menu in the menu list to which you want to add a submenu.
  5. Choose Add Under.
    Result: A new sub-menu with the default name NEW_ITEM1 appears under the selected menu.
  6. Click the new submenu name.
    Result: The Menu Name and Menu Text boxes populate with default information.
  7. Specify a unique menu name, menu text, and help (if needed).
  8. Choose Update.
    Result: The default submenu is replaced by the new menu text, as well as the other information you specified.
  9. Choose OK.

You can add a submenu to a submenu by repeating this procedure. To do this, select the submenu instead of a menu before clicking Add Under. (You can add another submenu at the same submenu level by clicking Add After.)

Testing menus

To test a menu:

  1. Select a menu in the tree structure.
  2. Choose Test.
    Result: A pop-up menu appears with the menu structure and text you created.
  3. Click anywhere to close the pop-up menu.
  4. Choose OK.

Deleting menus

To delete a menu:

  1. Click a menu or submenu in the tree structure.
  2. Click Delete.
    Result: If you selected a menu or submenu that is a "parent" to other submenus, a prompt appears that asks you whether to update the modifications to the menu. Otherwise, the selected menu is deleted and removed from the list of menus.
  3. Choose OK.

Creating and Working with Toolbars

Introduction

Toolbars allow programs to behave in a manner that is more "user-friendly" than might be the case otherwise. The buttons on a toolbar act as visual mnemonics; that is, a button represents a menu command that the user does not have to remember. Buttons also makes frequently used commands more accessible.

This section describes how to add a toolbar to a form that becomes a window.

Note: To create a toolbar, select Preferences from the Options menu, then click the Show Toolbar Page check box and click the OK button to save your changes.

Creating Toolbars

A toolbar can be added to a form at any time.

To create a toolbar:

  1. Open the Interface Designer.
  2. Choose the Toolbars tab.
  3. Click Add.
    Result: The Toolbar Properties dialog box appears. A default toolbar name, NEW_TOOLBAR1, appears in the Toolbar Name text box.
    Note: If you selected the Auto Property Sheets form preference, the Toolbar Properties properties sheet appears automatically when you create a new toolbar.
  4. Choose the Toolbar Name browse button.
  5. In the Unique ID dialog box, type a unique name to replace the default toolbar name and choose OK.
    Result: The Unique ID dialog box closes and the toolbar name you typed appears in the Toolbar Name text box in the Toolbar Properties dialog box.

Creating toolbar buttons

To add a toolbar button:

  1. Choose the Toolbars tab.
  2. Click the toolbar to which you want to add a button.
  3. Click Update.
  4. From the Toolbar Properties dialog box, type a string ID in the Item ID text box to represent the button for development purposes.
  5. Click the Icon File browse button.
  6. Select the icon file you want to appear on the button.
  7. To create tooltip text for the button, type text in the Help Text box.
  8. Choose Add.
    Result: The button appears in the list represented by the item ID, icon file, and help text information you typed.
  9. To add additional buttons to the toolbar, repeat steps 5-9 as needed.
  10. If you want the buttons in a different order than that in which you added them, use the Move Up and Move Down buttons to rearrange the order.
    Note: The button at the top of the list appears at the top of the toolbar if the toolbar appears vertically, and the first button on the left side if the toolbar appears horizontally.
  11. Choose Update.
  12. Choose OK.

Creating separators between buttons

Separators enhance the appearance of a toolbar because they allow space between buttons, which makes the toolbar easier to use visually.

To add a separator to a toolbar:

  1. Open a resource file containing the form you want to work with.
  2. Choose the Toolbars tab.
  3. Double-click the toolbar name you want to use.
  4. From the Toolbar Properties dialog box, click the name of the toolbar form you want to use.
  5. Choose Separator.
    Result: The separator appears at the bottom of the list of toolbars.
  6. Choose Move Up or Move Down to move the Separator between the toolbar buttons.
  7. Repeat steps 6-7 to add additional separators.
  8. If you want the buttons in a different order than that in which you added them, use the Move Up and Move Down buttons to rearrange the order.
  9. Choose Update.
  10. Choose OK.

Creating Hypertext Controls

Introduction

Hypertext controls provide online information to end users and can include text, sound, and images. They can also be linked to external programs. Hypertext controls do not replace online help, but are an alternative method of displaying information.

Hypertext controls are visible as long as a form is open. Hypertext controls appear as a multi-line entry box with text. Text can be represented as colored text or as a button.

Types of hypertext buttons

Buttons appear in a different color from regular text at run time. When the button is clicked, the TSD Developer's Toolkit Hypertext Viewer appears containing the linked item.

The following are the types of buttons you can create:

Creating hypertext buttons

Buttons are created using hypertext string tags.

To create a hypertext button:

  1. Open a resource file that contains the form you want to use.
  2. Open the form that you want to use.
  3. From the Control Palette, click the Hypertext button.
  4. On the form, click your mouse pointer where you want the button to appear and drag the mouse pointer until the button outline is the size you want.
    Note: If you selected the Auto Property Sheets form preference, the Control Properties properties sheet appears automatically when you create a new control.
  5. Right-click the hypertext control.
  6. Choose Properties.
  7. Set Base or Help tab properties as needed.
  8. Choose the Hypertext tab.
  9. Select a style to apply to the hypertext button.
  10. Use the following table to type the appropriate hypertext tag in the Starting Text box.
    Note: In each hypertag example, Button Name represents what the user will see.

    Tag Purpose Syntax Style Choices
    Alphabetic button Passes an alphabetic ID to a Developer's Toolkit program [[Button Name|LABEL labeltext]] N/A
    External file Creates a link to an external file [[Button Name|FILE filename ATTRIBUTES]]
    • No Wordwrap means the user must use hard carriage returns to manually wrap text to the next line.
    • No Format causes automatic wordwrap.
    • None has no line formatting.
    External program Creates links to external programs. The program's executable file must have an .exe extension. Arguments you specify are passed as command prompt arguments to the program. [[Button Name|RUN program name ARGUMENTS]] N/A
    Hypertext link Creates a hypertext link to a URL. The link launches the internet browser specified in the WebBrowser environment variable. URL name can be http, ftp, and news. [[text | URL name]] Text appears as a blue block.
    Image Creates an image button [[Button Name|IMAGE filename ATTRIBUTES]]
    • Scroll creates scroll bars on the hypertext window.
    • Clip crops the image to fit the border.
    • Scale causes the image to fit entirely in the hypertext window.
    Jump tag Searches the tag list for a marker that matches the text following the jump. If a match is found, the line containing the marker is positioned at the top of the viewer. Also, the hypertext view processes the EventJump to keep a list of markers used in a file. [[text | Jump marker name]] N/A
    Marker tag Places an invisible marker in the text [[text | Marker marker name]] N/A
    Numeric button Passes a numeric button to an TSD Script program [[Button Name|ID id_number]] where Button Name is the text displayed to the user N/A
    Search string Finds specified text in a hypertext viewer [[Button Name|SEARCH search text]] N/A
    Sound file Creates links to sound files [[Button Name|PLAY filename]] N/A


  11. When you finish setting properties, choose Apply or OK.
    Note: Clicking the link displays the TSD Developer's Toolkit Viewer.

Creating Online Help

Introduction

You can create context-sensitive online help for controls and forms in two ways:

Help files linked to your form must reside in one of the following areas:

Adding online help

To add online help:

  1. Double-click the control or form to display its properties.
  2. Choose the Help tab.
  3. Do one of the following:
  4. Choose Apply or OK.
    Note: You can only use Developer's Toolkit help text tags in your form.

Tivoli Service Desk 6.0 Developer's Toolkit Interface Designer Guide

Back to Table of Contents

Copyright