static-text

Class

Package: common-graphics

Class

The class of a static-text control.

Control

An instance of the :static-text class. This control is displayed as a block of text that cannot be edited.

The text to be displayed should be stored as a simple string in the value field of the dialog item. See the description of the wrapping property for information on what happens when the text is longer than the control is wide.

Adding a static-text control to your form

Click the static-text tool on the Component toolbar. Move the mouse cursor to the part of the form where you want to place the control, and click again. The control will appear with colored resizing handles.

Resizing and moving the control

Controls can only be resized and moved on forms during the design stage; the size and location of everything is fixed on a running form.

Resize the control by clicking the mouse cursor and dragging one of the handles to the new size-point. Release the mouse key when you are satisfied with the new size. Note: resizing the static-text control changes the size of the bounding-box, but not the size of the actual text inside. Change the font property if you want to change the size of the actual characters displayed.

Move the control by clicking anywhere on it except a resizing handle and dragging it to a new location on the form. Release the mouse key when you are ready to place the control.

Using a Static-Text as a Keyboard Shortcut to Jump to a Control

A static-text control can provide a keyboard shortcut for moving the keyboard focus to the control that immediately follows the static-text in the tab order of the parent window. To effect this, place a tilde character (~) in the control's label just before the character that is to serve as a shortcut. (The label is the string in the value property of the static-text.) The tilde will not appear in the label, and the following character will be underlined to indicate the shortcut. Then whenever the end user holds down the ALT key and presses the shortcut character, the keyboard focus will move to the control after the static-text in the tab order, assuming that no other control on the same parent window uses the same shortcut character.

Note that this works only when the parent window is an instance of the dialog-mixin class (or some subclass of it). This behavior, along with the ability to move the keyboard focus from one control to another by pressing the tab key (or shift-tab for the reverse direction) is what distinguishes dialog-mixin instances from other windows.

The tab order is the order of the controls in the dialog-items property of a window, and is always the same as the occlusion order (that is, which controls are in front of which when they overlap). This order may be specified programmatically by the order of the list of controls passed as the :widgets initarg to make-window (or passed to update-dialog). Interactively, the tab order of controls on a form may be edited with the Form | Set Tab Order menu command or with the tab-position property on the individual controls.

See About how to get sample code for creating controls in cgide.htm, which explains how to use the IDE to create such code.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.