[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

Like mutually exclusive gadgets, cycle gadgets (CYCLE_KIND) allow the user
to choose exactly one option from among several.

The cycle gadget appears as a raised rectangular button with a vertical
divider near the left side.  A circular arrow glyph appears to the left of
the divider, while the current choice appears to the right.  Clicking on
the cycle gadget advances to the next choice, while shift-clicking on it
changes it to the previous choice.

Cycle gadgets are more compact than mutually exclusive gadgets, since only
the current choice is displayed.  They are preferable to mutually
exclusive gadgets when a window needs to have several such gadgets as in
the PrinterGfx Preferences editor, or when there is a medium number of
choices.  If the number of choices is much more than about a dozen, it may
become too frustrating and inefficient for the user to find the desired
choice.  In that case, use a listview (scrolling list) instead.

The tags recognized by cycle gadgets are:

GTCY_Labels (STRPTR *)
    Like gtmx_labels, this tag is associated with a
    NULL-pointer-terminated array of strings which are the choices that
    this gadget allows.  This array must be supplied to creategadget(),
    and can only be changed starting in V37.  The strings themselves must
    remain valid for the lifetime of the gadget.  (Create only (V36),
    Create and set (V37).)

GTCY_Active (UWORD)
    The ordinal number, counting from zero, of the active choice of the
    cycle gadget.  The default is zero.  (Create and set.)

GA_Disabled (BOOL)
    (New for V37, ignored by V36.)  Set this attribute to TRUE to disable
    the cycle gadget, to FALSE otherwise.  The default is FALSE.  (Create
    and set.)

When the user clicks or shift-clicks on a cycle gadget, the program will
receive an idcmp_gadgetup intuimessage.  look in the code field of the
intuimessage for the ordinal number of the new active selection.