cke: How to define a new class

Nameversiondate
cke0.21 and latersseptember 5, 2006

991 Visitas
last update agoust, 9 2006

Note: In all the settings windows, you can cancel any changes pressing the red cross in the upper-right side of the screen. Changes are effective only after you press the Ok button just over the Cancel. You can access the context sensitive help choosing the help item in the normal Start menu.

Most of the settings described below, can also be applied to any active document, in a per-session way, modifying them in the "Document" tab. They can be useful to experimentate the settings effects before creating the classes.
Choose first the "Classes" tab, and write the name of the desired class in the upper-left edit box and then press the new button.
The settings in the "default" class will be applied to all the unclassified files, and used as default for every new class.
In the upper-right combo choose the filter element. Write the file pattern and press the Add button. You can add as many file patterns as you wish. Normally you will be interested in deleting the "*.*" filter which appears by default (inherited from the default class), otherwise all the settings of this class will be applyed to all the files which don't match any previous class.
Each file pattern can contain the wildcard characters ? and * and character sets definitions such as [a-z] or [a-f0-9., ]. Only the filename of a given file will be matched against the pattern.
If more than one class filter matches a given filename, the first (upper in the combo) class that matches will be applied.
Once you have set the filter, you can proceed with the other settings specific to the class. You can alter the settings for "paragraph", "font", "syntax" and "colors" groups of settings.
In the syntax group, you choose wether you want syntax highlighting for this class, and in the affirmative, you choose, within the *.syntax files present in the installation directory of cke, which one you want to use.
You can create your own syntax file, see the Syntax of syntax files. By default only syntax files for c++, html, c# and TeX are present, you can delete any of them you will not be using in order to economize disk space.
The color settings will only be useful if the syntax highlighting is active for a class, in which case it allows to modify the presented color for a given syntax component.
In order to modify a color, choose it in the leftward listbox, and modify the position of the red/green and blue sliders, to choose thhe color and see the result press the Set Color button.
The "paragraph" settings allows you to modify the way cke handles paragraphs. Here you can change the
tabsize: maximum number of spaces taken by a tab '0x09' character,
the relative indent: paragraph indentation in wordwrap mode, wihch is the number of white space characters shown to the left of the second and following lines of a paragraph.
The indent new paragraphs switch, which instructs the program to keep in new paragraphs the same indentation than the previous paragraph,
and the Wrodwrap switch, which instructs the program wether to wrap long lines in multiple lines, or to show them in a single line adding an horizontal scrollbar to allow navigation.
The font settings shows in the font name combo, the fixed-pitch fonts installed in the PPC (usually the only one will be Courier New but you can add other fonts). The remaining items in this page allos you to modify the way the font is shown, it's type, and it's size in pts.
If you turn on the Alter Font switch you can enter a width percentage (estimative), and the number of pixels you want to reduce the inter-line space. Currently I don't recomend any value greater than 1 since I haven't yet resolved the way to avoid text overlapping.
The Cleartype and Proof switches, are flags that control the rendering of the font, their effect depend in the font choosen.

Once finished press the ok button to apply the changes. The settings are only commited to disk when you exit the program with the Tools->Exit menu command. All the settings are kept in a single file "cke.opt" which is in the installation folder of the program.