@database "integer_gc"
@master "AMIDEV:NDK/Autodocs/integer_gc.doc"

@Node Main "integer_gc.doc"
@toc "Autodocs/AG/INDEX/Main"
    @{" --datasheet--() " Link "--datasheet--()"}
    @{" INTEGER_GetClass() " Link "INTEGER_GetClass()"}
@EndNode

@Node "--datasheet--()" "integer_gc/--datasheet--"

@{b}    NAME@{ub}
        integer.gadget -- A numeric entry gadget with optional buttons.

@{b}    SUPERCLASS@{ub}
        gadgetclass

@{b}    REQUIRES@{ub}
        string.gadget, bevel.image

@{b}    DESCRIPTION@{ub}
        This gadget is a specialized form of a string.gadget for entering
        positive or negative long integers.  The user can type in the number
        or use the buttons to adjust the number up or down.

        Advantages that this class provides:

         > Supports window relativity.

         > Optionally creates buttons for adjusting the value.

         > Definable minimum and maximum values as well as maximum number
           of characters.

         > Supports OS 3.0 BOOPSI @{"Gadget" Link "INCLUDE:intuition/intuition.h/Main" 212} HelpTest.

@{b}    METHODS@{ub}
        @{"OM_NEW" Link "tabs_gc/OM_NEW"} -- Create the integer gadget.  Passed to superclass.

        @{"OM_SET" Link "tabs_gc/OM_SET"} -- Set object attributes.  Passed to superclass first.

        OM_DISPOSE -- Cancels the integer menu before being passed onto
            superclass.

        OM_UPDATE -- Set object notification attributes.  Passed to
            superclass first.

        @{"GM_RENDER" Link "tabs_gc/GM_RENDER"} -- Renders the gadget imagry.  Overrides the superclass.

        @{"GM_GOACTIVE" Link "tabs_gc/GM_GOACTIVE"} -- Handles activation, pops up the integer menu.
            Overrides the superclass.

        GM_HANDLEINPUT -- Handles input events once active.  Overrides the
            superclass.

        GM_GOINACTIVE -- Closes the integer menu.  Overrides the superclass.

        All other methods are passed to the superclass.

@{b}    ATTRIBUTES@{ub}
        GA_Disabled (BOOL)
            Set to TRUE to disable gadget, FALSE otherwise

            Defaults to FALSE.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, OM_GET)

        GA_TextAttr (struct @{"TextAttr" Link "INCLUDE:graphics/text.h/Main" 63} *)
            Font to use for the gadget text.

            Defaults to the screen's font.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, OM_GET)

        GA_BackFill (struct @{"Hook" Link "INCLUDE:utility/hooks.h/Main" 26} *)
            Backfill hook to be used when rendering the gadget.

            Defaults to @{"NULL" Link "rexxsupport/NULL"}.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, OM_UPDATE, OM_GET)

        INTEGER_Number (LONG)
            The value for the integer gadget.  The class will adjust this
            number to fit into the range you define.  The current value for
            INTEGER_Number will be returned in IntuiMessage.Code on
            IDCMP_GADGETUP as a WORD.  Note that since the gadget handles
            values of size @{"LONG" Link "INCLUDE:exec/types.h/Main" 112}, the value returned in IntuiMessage.Code
            will only be valid if the ranges you are allowing fit into a
            WORD value.  Otherwise you will have to use @{"GetAttr()" Link "intuition/GetAttr()"}.

            Defaults to 0.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, OM_UPDATE, @{"OM_GET" Link "tabs_gc/OM_GET"}, OM_NOTIFY)

        INTEGER_MaxChars (WORD)
            Maximum number of characters you are allowing the number to be.
            This is including an optional negative sign (-).

            Defaults to 10.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, @{"OM_GET" Link "tabs_gc/OM_GET"}, OM_NOTIFY)

        INTEGER_Minimum (LONG)
            Minimum value the number can have.
            Note that INTEGER_MaxChars must also be large enough.
            Eg. to allow numbers < -999999999, INTEGER_MaxChars
            must be increased to 11.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, @{"OM_GET" Link "tabs_gc/OM_GET"}, OM_NOTIFY)

        INTEGER_Maximum (LONG)
            Maximum value the number can have.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, @{"OM_GET" Link "tabs_gc/OM_GET"}, OM_NOTIFY)

        INTEGER_Arrows (BOOL)
            Should buttons be displayed for adjusting the number?  The class
            is smart enough to not render buttons if the gadget becomes too
            small.

            Defaults to TRUE.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, OM_GET)

        INTEGER_SkipVal (WORD)
            The value to increase or decrease the number by each time
            one of the buttons is pressed. (V45)

            Defaults to 1.

            Applicability is (OM_NEW, @{"OM_SET" Link "tabs_gc/OM_SET"}, OM_UPDATE, OM_GET)

        INTEGER_MinVisible (UWORD)
            If set, this tag specifies the minimum number of numeric
            characters which should be visible at the gadgets minimum
            domain size. This tag effects GM_DOMAIN's result to tweak
            the display in a pleasing way.

            This does not take the cursor into account, so if you
            want the entire number and also the cursor to be always
            visible without scrolling, you will need to make this
            larger by 1 than would otherwise be the case.

            Defaults to 0.

            Applicability is (OM_NEW, OM_SET)

        All strgclass and string.gadget tags can be used with @{"OM_NEW" Link "tabs_gc/OM_NEW"}, @{"OM_SET" Link "tabs_gc/OM_SET"}
        and @{"OM_GET" Link "tabs_gc/OM_GET"} except for STRINGA_LongVal and STRINGA_MaxChars.  Use
        INTEGER_Number and INTEGER_MaxChars instead.

@EndNode

@Node "INTEGER_GetClass()" "integer_gc/INTEGER_GetClass"

@{b}    NAME@{ub}
        INTEGER_GetClass -- Gets the pointer to the integer class.

@{b}    SYNOPSIS@{ub}
        integer_class = INTEGER_GetClass();
        D0

        Class * INTEGER_GetClass(VOID);

@{b}    FUNCTION@{ub}
        Obtains the pointer to the Integer gadget class for use with
        @{"NewObject()" Link "intuition/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 set up.  (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.

@{b}    INPUTS@{ub}
        Nothing.

@{b}    RESULT@{ub}
        integer_class - Pointer to the Integer gadget class.

@{b}    SEE ALSO@{ub}

@EndNode

