integer.gadget Reference¶
Comprehensive function reference for integer.gadget, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/integer).
This page documents 2 functions of integer.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¶
integer.gadget()¶
**integer.gadget -- A numeric entry gadget with optional buttons.
SUPERCLASS
gadgetclass
REQUIRES
string.gadget, bevel.image
DESCRIPTION
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 HelpTest.
METHODS
OM_NEW -- Create the integer gadget. Passed to superclass.
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 -- Renders the gadget imagry. Overrides the superclass.
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.
ATTRIBUTES
GA_Disabled (BOOL)
Set to TRUE to disable gadget, FALSE otherwise
Defaults to FALSE.
Applicability is (OM_NEW, OM_SET, OM_GET)
GA_TextAttr (struct TextAttr *)
Font to use for the gadget text.
Defaults to the screen's font.
Applicability is (OM_NEW, OM_SET, OM_GET)
GA_BackFill (struct Hook *)
Backfill hook to be used when rendering the gadget.
Defaults to NULL.
Applicability is (OM_NEW, 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, 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().
Defaults to 0.
Applicability is (OM_NEW, OM_SET, OM_UPDATE, 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, 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, OM_GET, OM_NOTIFY)
INTEGER_Maximum (LONG)
Maximum value the number can have.
Applicability is (OM_NEW, OM_SET, 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, 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, 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, OM_SET
and OM_GET except for STRINGA_LongVal and STRINGA_MaxChars. Use
INTEGER_Number and INTEGER_MaxChars instead.**
INTEGER_GetClass()¶
INTEGER_GetClass -- Gets the pointer to the integer class.
Synopsis
integer_class = INTEGER_GetClass();
D0
Class * INTEGER_GetClass(VOID);
Function
Obtains the pointer to the Integer 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 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.
Inputs
Nothing.
RESULT
integer_class - Pointer to the Integer gadget class.