slider.gadget Reference

Comprehensive function reference for slider.gadget, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/slider).

This page documents 2 functions of slider.gadget. Each function entry follows the canonical autodoc format. struct Name, union Name, enum Name are clickable links to the type definition in the types reference.

Function index


slider.gadget()

**slider.gadget -- Create slider BOOPSI objects

SUPERCLASS
gadgetclass

REQUIRES
bevel.image

DESCRIPTION
Slider gadgets are used to control an amount, a level or an intensity
such as volume or color.

Note that the IntuiMessage.Code field will contain the SLIDER_Level
attribute cast to a WORD.

METHODS
OM_NEW -- Create the slider gadget. Passed to superclass.

OM_SET -- Set object attributes. Passed to superclass first.

OM_DISPOSE -- Disposes object and then passed to superclass.

OM_UPDATE -- Update object attributes and pass to superclass.

OM_NOTIFY -- Notifies of attribute changes and pass to superclass.

OM_GET -- Obtain the value of an attribute.

GM_RENDER -- Overrides superclass, renders the gadget imagery.

GM_GOACTIVE -- Handles activation. Overrides the superclass.

GM_HANDLEINPUT -- All input is processed. Overrides the superclass.

GM_GOINACTIVE -- Deactivates input. Overrides the superclass.

GM_DOMAIN -- Returns GDOMAIN_MINIMUM, GDOMAIN_NOMINAL and
             GDOMAIN_MAXIMUM dimensions.

GM_CLIPRECT -- Installs ClipRect for virtual group support.

GM_LAYOUT -- Calculate relative gadget coordinates.

GM_HITTEST -- Determines if gadget was hit.

All other methods are passed to the superclass.

ATTRIBUTES
GA_Disabled (BOOL)
    Determines whether the slider is disabled or not.
    Changing disable state will invoke OM_NOTIFY.

    Defaults to FALSE.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_NOTIFY)

GA_TextAttr (struct TextAttr *)
    The font that will be used for the level display.

    Defaults to NULL (RastPort default font).

    Applicability is (OM_NEW)

GA_BackFill (struct Hook *)
    A layer backfill hook to provide a more complex background
    pattern. See InstallLayerHook() for more details about the
    backfill hook.

    Defaults to NULL.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_Level (WORD)
    The current level of a slider. When the level is at its
    minimum, the knob will be all the way to the left for a
    horizontal slider or all the way at the top for a
    vertical one. Conversely, the maximum level corresponds to
    the knob being to the extreme right or bottom. You can swap
    the minimum and maximum positions by using the SLIDER_Invert
    tag.

    Defaults to 0.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)

SLIDER_Min (WORD)
    The minimum slider level. Values smaller than -32768 are
    not supported.

    Defaults to 0.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)

SLIDER_Max (WORD)
    The maximum slider level. A level beyond 65535 is not
    supported.

    Defaults to 0.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)

SLIDER_Orientation (UWORD)
    Define orientation of the slider.

    Accepted values as defined in <gadgets/slider.h> are:
      SORIENT_HORIZ
      SORIENT_VERT

    Defaults to SORIENT_VERT.

    Applicability is (OM_NEW)

SLIDER_DispHook (struct Hook *)
    Hook which is invoked whenever the slider's level changes.

    Your hook function will be called as follows:

    void Func(struct Hook *hook, APTR slider, struct TagItem *tags);
              A0                 A2           A1

    Object is the slider gadget. The message is a tag list
    with GA_ID, SLIDER_Level, SLIDER_Min, SLIDER_Max, GA_UserInput
    and (optionally) GA_Disabled.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_Ticks (WORD)
    Number of ticks to be displayed along the slider body. For
    small ranges (depending on the gadget size) you'd set this
    to SLIDER_Max + 1.

    Defaults to 0 (no ticks).

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_ShortTicks (BOOL)
    Alternate long and short ticks.

    Defaults to FALSE.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_TickSize (LONG)
    Size of slider ticks.

    Defaults to 5.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_KnobImage (struct Image *)
    Image for slider knob. Must be a BOOPSI object.

    Applicability is (OM_NEW)

SLIDER_BodyImage (struct Image *)
    Image for slider body. Must be a BOOPSI object.

    Applicability is (OM_NEW)

SLIDER_Gradient (BOOL)
SLIDER_PenArray (UWORD *)
    OBSOLETE DON'T USE! Please use gradientslider.gadget.

SLIDER_Invert (BOOL)
    Flip Min/Max positions.

    Defaults to FALSE.

    Applicability is (OM_NEW)

SLIDER_KnobDelta (WORD)
    Level step when clicking in the container.

    Defaults to 1.

    Applicability is (OM_NEW)

SLIDER_LevelFormat (CONST_STRPTR) (V47)
    Format string for slider level display. May contain up to
    one format specifier for RawDoFmt(), e.g. "%lu" or "%s", then
    the SLIDER_LevelHook hook function will be called to query
    the argument.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_LevelPlace (ULONG) (V47)
    Where to display the slider level. Use the PLACETEXT_#?
    defines from <libraries/gadtools.h>.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_LevelJustify (ULONG) (V47)
    Justification of slider level display.
    Either SLJ_LEFT, SLJ_CENTER or SLJ_RIGHT.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_LevelDomain (CONST_STRPTR) (V47)
    Domain string to determine maximum level extent.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_LevelSpace (UWORD) (V47)
    Explicit specification of level display extent.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_LevelHook (struct Hook *) (V47)
    Hook which is invoked to pre-process the level value before
    it goes through the format string.

    Your hook function will be called as follows:

    APTR Func(struct Hook *hook, APTR slider, struct TagItem *tags);
              A0                 A2           A1

    The object is the slider gadget. The message is a tag list
    with GA_ID, SLIDER_Level, SLIDER_Min and SLIDER_Max. The
    hook should return a type which matches the format specifier.
    For example, a LONG when SLIDER_LevelFormat contains "%ld"
    or a CONST_STRPTR when SLIDER_LevelFormat contains "%s".

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_LevelMaxLen (UWORD) (V47)
    Maximum possible length (in characters) of level.

    Defaults to 3.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_NotifyDisable (BOOL) (V47)
    Notify GA_Disabled attribute changes to target.

    Defaults to TRUE.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)

SLIDER_InitDispHook (BOOL) (V47)
    Invoke SLIDER_DispHook immediately whenever a new hook function
    is passed to the gadget. Defaults to FALSE.

    Applicability is (OM_NEW, OM_SET, OM_UPDATE)**

SLIDER_GetClass()

SLIDER_GetClass -- Gets the pointer to the slider class.

Synopsis

slider_class = SLIDER_GetClass();
D0

Class * SLIDER_GetClass(VOID);

Function

Obtains the pointer to the slider gadget class for use with NewObject(). This function always returns a valid pointer so you do not need to check it. The reason is that if the library opens fine, then the pointer returned is already setup. (Of course this implies that if opening the library fails, you shouldn't be calling this.)

Inputs

Nothing.

RESULT

slider_class - Pointer to the slider gadget class.