speedbar.gadget Reference

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

This page documents 6 functions of speedbar.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


speedbar_gc()

**speedbar_gc -- create speedbar BOOPSI objects

SUPERCLASS
    gadgetclass

REQUIRES
    bevel.image

DESCRIPTION
    This classes provides a simple way to create and manage
    "Speed Bars", also commonly called Button Bars, Tool Docs, etc.

    A speed bar is a horizontal row or vertical column of button
    gadgets, usually with an image face denoting some program function.
    The speedbar gadget could be placed in the main programs window
    or perhaps its own window to form a floating speedbar/tooldoc.

    An advantages that this class provides:

     > Speedbar button strip created & removed as a single gadget.

     > Help strings for each button can be provided, and displayed
       in a window title bar while a button is depressed.

     > Supports Right Mouse Button abort.

     > Supports window relativity.

     > Custom centered images.

     > Ability to change background color of the speed bar strip
       or use fill hook pattern.

     > Horizontal or Vertical speed bar orientation.

     > Supports hiding and exposing speed buttons in the bar.

     > Supports scrolling additional speed buttons in to view
       via holding down the SHIFT key while clicking and
       dragging the mouse left/right or up/down depending on
       the SPEEDBAR_Orientation setting.

     > Supports OM_NOTIFY and may be attached to either
       button.gadget, scroller.gadget and/or propgclass to scroll
       the speed buttons if more buttons exist that are visible
       within its bounds. However, this as a slight unresolvable bug.

METHODS
    OM_NEW -- Passed to superclass, defaults set, then OM_SET.

    OM_SET -- Passed to superclass, options tags set then rendered.

    OM_GET -- Custom tag returned or passed to superclass.

    OM_UPDATE -- Passed to superclass, options set then rendered.

    OM_NOTIFY -- Passed to superclass, options set then rendered.

    OM_DISPOSE -- Passed to superclass.

    GM_RENDER -- Passed to superclass, then speedbar is rendered.

    GM_HITTEST -- Overrides supperclass, returns GMR_HITTEST.

    GM_GOACTIVE -- Passed to superclass, speedbar activated.

    GM_HANDLEINPUT -- Overrides supperclass, all input processed.

    GM_GOINACTIVE -- Passed to superclass, speedbar deactivated.

    GM_DOMAIN -- Returns GDOMAIN_MINIMUM and GDOMAIN_MAXIMUM dimensions.

ATTRIBUTES
    SPEEDBAR_Buttons (struct List *)
        An Exec list.  Nodes in this list must be allocated with
        AllocSpeedButtonNodeA().

        See the included SpeedBarTest.c example for additional
        information.

        Passing a NULL list will remove all buttons from the speedbar and
        detatch the buttons.  Passing ~0 will detach all buttons but not
        erase the display, useful when working on the list data, or while
        changing button lists.

        Applicability is (OM_NEW,OM_SET,OM_GET)

    SPEEDBAR_Orientation (WORD)
        Define orientation of the speedbar's button strip.

        Accepted values as defined in <gadgets/speedbar.h> are:

           SBORIENT_HORIZ
           SBORIENT_VERT

        Defaults to SBORIENT_HORIZ


        Applicability is (OM_NEW,OM_SET,OM_GET)

    SPEEDBAR_Background (WORD)
        Background colour to appear behind gadget.

        Defaults to 0.

        Applicability is (OM_NEW,OM_SET,OM_GET)

    SPEEDBAR_Window (struct Window *)
        This Window's TitleBar will changed to the selected button's
        help text while the button remains selected.

        Defaults to NULL.

        Applicability is (OM_NEW,OM_SET,OM_GET)

        NOTE: SPEEDBAR_Screen is *NOT* implemented.

    SPEEDBAR_StrumBar (BOOL)
        Enable "strumming" mode, where by you can drag the mouse
        over the button bar to view the help titles and release
        mouse button select the speed button under the mouse.

        Defaults to FALSE.

        Applicability is (OM_NEW,OM_SET)

        NOTE: SPEEDBAR_StrumBar has been disabled to support other
              features available now, and in the future.

    SPEEDBAR_OffButton (SHORT)
        Disconnect a specified button ID from the speedbar display,
        but does not remove or deallocate button from the list.

        Applicability is (OM_SET, OM_UPDATE)

    SPEEDBAR_OnButton (SHORT)
        Reconnect specified button ID to the speedbar.

        Applicability is (OM_SET, OM_UPDATE)

    SPEEDBAR_ScrollLeft (BOOL)
        Scrolls the speedbuttons to the Left or Up depending on
        gadget orientation.

        Applicability is (OM_SET, OM_UPDATE)

    SPEEDBAR_ScrollRight (BOOL)
        Scrolls the speedbuttons to the Right or Down depending on
        gadget orientation.

        Applicability is (OM_SET, OM_UPDATE)

    SPEEDBAR_Top (WORD)
        Set or retrieve the SpeedButton ID of the Top (read First
        Visible) gadget in the button list.

        Applicability is (OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)

    SPEEDBAR_Visible (WORD)
        Retrieve the number of speed buttons visible within
        the gadget's container bounds.

        Applicability is (OM_GET, OM_NOTIFY)

    SPEEDBAR_Total (WORD)
        Retrieve the total number of speed buttons in the button list.
        SPEEDBAR_Total, SPEEDBAR_Visible and SPEEDBAR_Top could be
        mapped to a scroller's matching PGA tags to scroll the button
        list if so desired.

        Applicability is (OM_GET, OM_NOTIFY)

    SPEEDBAR_BevelStyle (WORD)
        Set bevel box style around the speed bar. In some cases
        complex speedbars might be built via a series of speedbars
        in a layout object group and it would be desirable to
        select other bevel styles such as BVS_NONE, which under any
        bevel style preferences in use, it will not render a bevel.

        Defaults to BVS_BUTTON.

        Applicability is (ON_NEW, OM_SET, OM_GET)**

AllocSpeedButtonNodeA()

AllocSpeedButtonNodeA -- Allocate a SpeedBar node.

Synopsis

struct Node * AllocSpeedButtonNode(UWORD, Tag, ...)
node = AllocSpeedButtonNode(number, Tag, ...)
struct Node * AllocSpeedButtonNodeA(UWORD, struct TagItem *)
node = AllocSpeedButtonNodeA(number, taglist)

Function

    Allocates a node that can be added to the Exec linked list of
    labels in the speedbar.  This is the only way to allocate a
    node for this list, you cannot allocate nodes yourself because
    the SpeedBar class uses a private node structure.

Inputs

    number - Places value in node->sbn_Node.ln_Pri, and is the
        numeric ID of the button within the bar. Note the current
        limitation, ln_Pri is a BYTE. This will be addressed, and
        *posibly* made obsolete and overridden by SBNA_ButtonID.

    taglist - Attributes for the node, passed onto
        SetSpeedButtonNodeAttrsA().

RESULT
    node - A node that can be added into the Exec list of labels for
        a SpeedBar gadget.

See also

    FreeSpeedButtonNode(), SetSpeedButtonNodeAttrsA()

FreeSpeedButtonNode()

FreeSpeedButtonNode -- Free a SpeedBar node.

Synopsis

VOID FreeSpeedButtonNode(struct Node *)
FreeSpeedButtonNode(node)

Function

    Frees a SpeedButtonNode allocated with AllocSpeedButtonNodeA().

Inputs

    node - The node to free.

See also

    AllocSpeedButtonNodeA()

GetSpeedButtonNodeAttrsA()

GetSpeedButtonNodeAttrsA -- Get attributes about a SpeedBar node. (V4 0)

Synopsis

VOID GetSpeedButtonNodeAttrs(struct Node *, Tag, ...)
GetSpeedButtonNodeAttrs(node, firsttag, ...)
VOID GetSpeedButtonNodeAttrsA(struct Node *, struct TagItem *)
GetSpeedButtonNodeAttrsA(node, taglist)

Function

    The SpeedBar uses a private node structure and all attributes
    are hidden, and must therefore be accessed with this function.

Inputs

    node - The SpeedBar node to get the information on.
    taglist - A tag list of attributes to get.  ti_Tag is the attribute
        to get and ti_Data is a pointer to a location to copy the result
        to.

See also

    SetSpeedButtonNodeAttrsA()

SetSpeedButtonNodeAttrsA()

SetSpeedButtonNodeAttrsA -- Set attributes of a SpeedBar node.

Synopsis

VOID SetSpeedButtonNodeAttrs(struct Node *, Tag, ...)
SetSpeedButtonNodeAttrs(node, firsttag, ...)
VOID SetSpeedButtonNodeAttrsA(struct Node *, struct TagItem *)
SetSpeedButtonNodeAttrsA(node, taglist)

Function

    Changes attributes for a SpeedBar node.  Since the SpeedBar
    class uses a private node structure, this is the only way to change
    node attributes.

    You may NOT change node attributes when the node is in a list
    attached to a SpeedBar gadget.  You must first detach the list
    with SPEEDBAR_Buttons, ~0 before you can change attributes, and
    then re-attach the list.

TAGS
    SBNA_Left (WORD)
    Left spacing offset of button from left of bar, set automatically.

    SBNA_Top (WORD)
    Top spacing offset of button from top of bar, set automatically.

    SBNA_Width (WORD)
    Width Of Button - these are set automatically.

    SBNA_Height (WORD)
    Height Of Button - these are set automatically.

    SBNA_Image (struct Image *)
    Standard Image or BOOPSI Image to be displayed in this button.

    SBNA_SelImage (struct Image *)
    Standard Image or BOOPSI Image to be displayed in this button
    when selected.

    SBNA_Spacing (WORD)
    Spacing between this button and the last button.

    SBNA_Highlight (WORD)
    Button selecting highlight mode, ant one of the following
    is supported:

            SBH_NONE        - Do not highlight.
            SBH_BACKFILL    - BackFill will FILLPEN
            SBH_RECESS      - Shift image right and down when selected.
            SBH_IMAGE       - Display alternate image (SBNA_SelImage)

    SBNA_Enabled (BOOL)
    Enabled (hidden/shown) state of a speed button.

    SBNA_Help (STRPTR)
    String Pointer to optional help text place in window titlebar
    when this speed button is active/selected. This only works if you
    have provided a valid SPEEDBAR_Window.

    SBNA_UserData (APTR)
    User Data, use as desired.

    SBNA_Disabled (BOOL) (V41)
    Marks this button as disabled, it will render with a ghost pattern
    and will not allow it to be selected.

    SBNA_Toggle (BOOL) (V41)
    Designates the button as a boolean toggle button. Defaults FALSE.

    SBNA_Selected (BOOL) (V41)
    The current selection state of a Toggle/MX button. Defaults FALSE.

    SBNA_MXGroup (BOOL) (V41)
    Set the MXGroup a button belongs in. This setting implies the
    SBNA_Toggle setting as TRUE also. The default is ~0, or not
    in any MXGroup. Note, a single speedbar can contain several
    MX groupings and mixtures of toggles and normal selections!
    Eg. six buttons as two groups of three could be implemented as
    SBNA_MXGroup, 0 for the first three buttons and SBNA_MXGroup, 1
    for the last three buttons.

    GA_GadgetHelpText  (STRPTR) (V47)
    Same as for gadgets. If set on a node this is the text the speedbar
    returns when this node is hit

Inputs

    node - Node whose attributes you are changing.
    taglist - Tag list of attributes to change.

See also

    GetSpeedButtonNodeAttrsA()

SPEEDBAR_GetClass()

SPEEDBAR_GetClass -- Gets the pointer to the speedbar class.

Synopsis

speedbar_class = SPEEDBAR_GetClass();
D0

Class * SPEEDBAR_GetClass(VOID);

Function

    Obtains the pointer to the SpeedBar 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.)

    Note that this function does not create the class, that is done
    when the class library is opened.

Inputs

    Nothing.

RESULT
    speedbar_class - Pointer to the SpeedBar gadget class.