AFC

JNotepad INI File Layout

JNotepad is a highly customizable program; it was designed for expandability in mind. The core of its customization is the JNOTEPAD.INI file. This allows you to set colors and settings for the application.

JNotepad tries to read the JNOTEPAD.INI file upon startup. If it does not exist, an internal set of settings is used instead. The JNOTEPAD.INI file is written when the program exits. This allows you to obtain a clean default JNOTEPAD.INI simply by erasing the current JNOTEPAD.INI and running JNotepad.

JNOTEPAD.INI has a format very similar to Windows INI files. There are several section names, enclosed in brackets, containing key-value pairs. All values are case sensative. A sample section may look like:

[Colors] Bright Green=0 255 0 Yellow=255 255 0 Bright Red=255 0 0 Red=128 0 0 Each line contains a key associated with a value. For example, Yellow is associated with the string "255 255 0". All keys and values are strings.

JNotepad contains several sections:

[Colors]

Defines colors for the JNotepad system. Each key in this section is the name of a color, and each value is the RGB definition for it. Each field in the RGB definition is separated by a space.
Example: Blue=0 0 128 Blue is associated with the RGB value 0 0 128 (0 red, 0 green 128 blue).
Color names are used in other sections of the INI file.

[Accelerators]

Defines accelerator keys. These keys are shortcut keys for menu and toolbar commands in JNotepad. Each key is the name of the accelerator key and the menu command it will perform. Example: ctrl-s=Save Ctrl-S is the shortcut key, and it runs the command Save. The section key must start with ctrl and be followed by the key to act as the accelerator. The command to run must be identical to the name of the menu item which runs it.

Control keys must be a single character. The only exception is the TAB key, which must be spelled out:

ctrl-tab=Next Window Control-shift key combinations are also supported using the ctrlshift keyword: ctrlshift-tab=Previous Window

[Toolbar]

The toolbar section allows you to customize the toolbar. All keys in this section start with a number, which corresponds to the position of the button in the toolbar. 0 is the leftmost button. Each key has a value which identifies what command is executed when that button is pressed. This string identifies a separate section in the INI file which describes the command. A sample [Toolbar] entry looks like this:
[Toolbar] 0=CMD_New 1=CMD_Cut This key identifies the leftmost toolbar button, button 0, as having the command described by the section [CMD_New], and a button in position 1 which has the command CMD_Cut.

The sections that describe commands look similar to:

[CMD_New] Image=Images\new.gif CMD=4021 Tip=101 The Image key identifies the relative path of the GIF used on the toolbar button. The CMD key specifies the menu ID of the command which the toolbar button will activate. The Tip key contains the string ID number of the text on the tooltip. The menu ID and string ID numbers refer to values found in the jnotepad.res resource file's Menu section and String table section, respectively.

File Format Sections

JNotepad allows customization by file type. This is done by including a section in the INF containing the extension of the file type. This section name must be in all uppercase. Example:
[JAVA] corresponds to .java files.
[TXT] corresponds to .txt files. A special section named [DEFAULT] stores settings for files that are created in JNotepad.

These sections can have one of two keys:

Foreground
Specifies the foreground color. This is the name of a color from the [Colors] section.
Background
Specifies the background color. This is the name of a color from the [Colors] section.

For example:

[JAVA] Foreground=White Background=Blue sets the foreground color of .java files to White and the background color to Blue. These colors must have been defined in a [Colors] section.


Top © 1996 Microsoft Corporation. All rights reserved.