15. More
about windows...
15.1 The
"Scrap" window
Typing
cmd-o in the "Scrap" window
allows loading text files of any type. This window provides work space to edit
grammars and data. For instance, another grammar may be loaded to the "Scrap"
window and parts of it copied to the current grammar.
The
"Trace" window
may equally be used for storing text. However, it is also used by BP2 for
displaying error messages, and sometimes BP2 needs to clear it (with the user's
permission).
Clicking
the go-away box of the "Trace" window erases its content after prompting the
user to save changes.
15.2 Adjusting
window sizes and locations
Window
sizes and locations are saved with the current settings. If the name of the
settings file appears on top of the grammar or data, each time the grammar or
data is loaded the same window environment is reset.
If
the project was created on a larger monitor, BP2 checks the dimensions of the
current screen and avoids dragging or resizing windows beyond screen boundaries.
Users
of large monitors may want to change default positions and sizes taking full
advantage of their large screen. Start BP2 (with no project), drag and resize
windows, then save settings as a start-up file.
15.3 BP2
editor
BP2
is basically a word processor (enhanced as
bol
processor, where 'bol' stands for a musical-speech symbol) using the WASTE text
engine designed by Marco Piovanelli. Unlike BP2 versions before 7.5.2, window
contents are not limited to 32,000 characters.
Basic
operations: copy, cut, paste, find/replace are implemented in the usual manner.
Undo (cmd-z) works more or less as expected in word processors.
Moving
the text cursor is accomplished by clicking the mouse or hitting the four
direction keys.
If
the
option
key
is down, left/right arrows move by one
word
while up/down arrows move by one
paragraph.
In word processing, a paragraph is a sequence of characters between two
carriage returns; it is displayed on several lines if it is larger that the
window width. These movements with the option key down are much more practical
than the usual scrolling.
If
both the
option
and the
shift
key
are down, moving by one word or one paragraph extends the current selection
accordingly.
The
command
key
(cmd) may be used for jumping to the beginning or the end of a line (left and
right arrows), and to the beginning or the end of a text window (up and down
arrows).
These
commands using arrows in combination with option, shift or command keys are
identical to the ones in well-known editors like Alpha or Symantec® C++.
Any
musical item, grammar rule or script instruction in BP2 must be written as one
single paragraph. This is a problem when text warping provokes undesirable
lay-outs (depending on the window width). Because of this, a
special
line break
character is supplied: '¬'. To use the special line break, type 'return'
with the 'option' key down. (The same symbol and keyboard sequence are used by
HyperTalk and AppleScript.) When interpreting the input, BP2 pastes together
lines separated with '¬'.
Tabulations
in BP2 documents are displayed as ordinary spaces. Nevertheless, typing tabs
instead of spaces may be useful for formatting the text in a word processor.
BP2
has another useful feature borrowed from Symantec: typing cmd-b allows you to
check the "balance" of brackets () and {}. You may try it with polymetric
expressions
contained in the last subgrammar of "-gr.Mozart".
Each stroke selects a higher bracket level. After several strokes you get a
beep (if brackets are not balanced) or the entire window is selected, meaning
that all expressions are balanced. Note however that a correct grammar (e.g.
"-gr.koto3")
may contain rules with unbalanced brackets.
In
addition, BP2 allows users to 'type' notes from a MIDI keyboard (using cmd-j,
see §1.4) or map the keyboard to predefined tokens (see §10.4).
15.4 Remarks
about remarks
BP2
supports four styles of remarks:
- AppleScript®
or HyperTalk® style (
in
scripts only
):
inserting "--" forces the compiler to ignore the next characters till the end
of the current line. Example:
Activate
window Scrap -- this is an AppleScript style remark
- BP1
style: the remark is between square brackets. Example:
S
--> do4 re4 [This a BP1 style remark]
- old
C style: the remark starts with "/*" and ends with "*/". It may contain
several lines. Example:
/*
This an old C style remark */
- new
C style: any line starting with "//" is ignored. Example:
//
This is a new C style remark