Formatted Text Views

A Formatted Text File (FTF) is a file whose template should include definitions for section limits and other syntax-dependent definitions. Examples of FTF are C/C++ files (section+syntax information) or man output pages (section only) information.

For non-source code files, the main difference with a Standard Text View is the section information. For source code files, however, and along with the options for a Standard Text View, Scriptum includes several facilities to handle software projects, like SCCS/RCS compatibility, Definition Browsing facility, and Syntax decorations among others.

In this chapter we will review the features available for FTFs.

Most of the features available for FTFs are grouped under the standard Tools menu.

Common Features (Text only+Source Code)

The Pattern Browser

The pattern browser is invoked (in the standard configuration) with ``Alt+.'' (i.e., press the ``Alt'' key and hold it while you press ``.'') or with the Pattern Browser option of the Edit menu. This command will present a dialog box with a list of all the ocurrences of the pattern the cursor is under for he current view. If the cursor is on a blank space the expression browser will ask for a pattern (that can be a regular expression) to browse.

When the window is active, the user can edit the expression that is being browsed and click Apply, to search for it. When one expression is selected, the user can either single-click on it and then click Ok, or double click on it. Either action will move the cursor position to the selected ocurrence of the expression.

A tipical pattern browser dialog box could be as follows:

The Pattern Browser dialog box

The Section Browser

The Section Browser depends on the proper definition of what a Section is for the current file type (for more information on sections, see ``Configuring Scriptum'' on page 35).That definition appears in the template features configuration file or in the configuration file itself. The section definition is composed of three regular expressions. For an explanation on how to define section information for a template, see ``Case Study: the C++ Source view'' on page 49.

Source Code Only Options

Definition Browser

The definition browser uses a database defined and maintained for each selected directory structure. These database contains references to C/C++ functions, class types, typedefs and macro definitions only. The release version of Scriptum will include a generic, easily extendable Definition Database generator along with a more powerful browser.

Version Management

Scriptum supports four common version management commands: Check in, Check Out, Version Log and Open last version. Each command calls a shell script that will end up calling the actual version management tool (RCS or SCCS). Information on the version management system installation requirements can be found on the Manual Addenda in the Scriptum CD.

Literate programming

Scriptum lets you take advantage what is known as literate programming.

Literate programming is supported in Scriptum through various features: Styles, Section Management, Regions, Syntax Decorations and Symbol replacement.

Styles

With Styles, Scriptum will understand a subset of the HTML (HyperText Markup Language) standard, including links and text highlightings such as boldface. It is important to note that this capability is not built-in Scriptum, but obtained through proper configuration, i.e., Scriptum is configured to understand a subset of HTML inside these special comments. In the same way, it could be considered to understand other markings, such as LaTeX's.

Section Management

An important feature for literate programming is Section Management. Whenever a document has defined sections, a section handler appears at the left side of the section header. This section handler, through mouse bindings defined in the appropiate configuration file, can collapse and expand sections or filter an entire section through a Scriptum command or an OS command, among other things.

Also, Scriptum includes a Section Separator, a visual cue that allows for a quick visual identification of the different sections inside the view.

Regions

A Region is a set of lines that can be grouped logically by their function. For example, a region could be the block of an if statement, or a piece of Documentation.

Scriptum defines three types of Regions: the Section Region, defined between the beginning of a section and its ending, The Main Section region, defined between the section header and the section ending, and Inner Regions, which are special regions defined to increase the readability of the code. The section region and the main region use the Section definition; the Inner Regions are defined using CollapseString (for more information on these configuration Options, see ``Case Study: the C++ Source view'' on page 49.

Section Bars and Collapse handlers in a C++ view

Syntax decoration

Sets on/off the syntax decoration. Syntax decorations are defined in configuration files, along with the syntax definitions.

Reveal Codes

Shows special characters for the normal ASCII non-printable characters.

4


Last Modified: 01:15am , January 20, 1996