colorway.icn: Procedures to manipulate color ways

link colorway
August 3, 2000; Ralph E. Griswold
Requires: Version 9 graphics, UNIX for "pick feature"
See also: cw.icn
This file is in the public domain.

Note:  This file contains procedures that can be linked by programs
to add a visual interface, including programs that have one of their
own.

These procedures support the interactive creation and modification of
color ways.  ("Color way" is a the term used in the fashion industry for
a list of colors used in coordination for fabric design or other
decorative purposes.  Think color scheme if you like.)
____________________________________________________________

A color way is represented by a list of color specifications.  A
color specification consists of a name and an associated color.
Color ways are presented in alphabetical order of their color names,
with the name at the left and a swatch for the corresponding color
at the right of the name.

The "edit" button is used to switch between two modes:  control and
edit.

In the control mode, the interface menus and the "edit" button
are available. The "File" menu provides for creating a new color
way, loading an existing color way from a file, and saving the
current color way.  (Only one color way can be manipulated at a time.)
A new color way starts empty.  There also is an item to pick a colorway
file (which must have suffix "cw").

The "Ways" menu allows adding and deleting color specifications from
the current color way.  When adding, a name dialog is presented first,
followed by a color dialog.  Color specifications are added until
the user cancels one of the dialogs.  When deleting, all of the
current color specifications are listed by name, and more than one
can be selected for deletion.

In the edit mode, changes can be made to the current color way.  This is
done in the window displaying the current color way.   Clicking on a name
in the color way window produces a dialog to change that name.  (The new
name cannot be one already in use in the color way.)  Clicking on a
color swatch to the right of a name beings up a color dialog for selecting
a new color for that name.  (The same color can appear in more than one
color specification.)

In the editing mode, pressing the meta key while clicking on a
line of the color way causes the color to be deleted.

The editing mode is exited by typing a "q" in the color way display
window.

Shortcuts exist for all interface features.   @E is a shortcut for
entering the edit mode.

Note:  The current mode is shown by the "edit" button, which is high-
lighted when in the edit mode.  There nonetheless can be confusion about
the current mode.

Unimplemented feature:  Prompting user to save color way that has been
modified since last save.

Source code | Program Library Page | Icon Home Page