fuelgauge.gadget Reference¶
Comprehensive function reference for fuelgauge.gadget, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/fuelgauge).
This page documents 2 functions of fuelgauge.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¶
fuelgauge_gc()¶
**fuelgauge_gc -- create fuelgauge BOOPSI objects
SUPERCLASS
gadgetclass
REQUIRES
bevel.image
DESCRIPTION
The fuelgauge gadget class is used to display stage of completion
of some operation, such as formating a floppy. Or, perhaps as
a means of indication, such as free drive space.
Advantages that this class provides:
> Supports window relativity.
> Optional tick marks, and short ticks.
> Ability to change background pen, text pen, and filltext pen.
> Supports OS 3.0 BOOPSI Gadget HelpTest.
METHODS
OM_NEW -- Passed to superclass to creates object instance
OM_SET -- Sets all possible settings, then passed to superclass
OM_GET -- Returns requested setting or passed to superclass
OM_DISPOSE -- Passed to superclass
GM_HITTEST -- Returns 0.
GM_RENDER -- Passed to superclass, then renders fuelgauge
GM_DOMAIN -- Returns GDOMAIN_MINIMUM, GDOMAIN_NOMINAL and
GDOMAIN_MAXIMUM dimensions.
GM_GOACTIVE -- NO OP
GM_HANDLEINPUT -- NO OP
GM_GOINACTIVE -- NO OP
ATTRIBUTES
GA_Text (STRPTR)
Used to specify the NULL terminated string to use
as the text for the gadget. The Text() function is used to draw
the text. NULL is valid input, and will enable the default
centered percentage rendering. Changing the label will invoke
GM_RENDER. Text string is clipped to fit inside the gauge via
the TextFit() function. The text string may contain varargs
format specifiers compatible to RawDoFmt() if the varargs data
is supplied via FUELGAUGE_VarArgs.
Do not forget to disable percentage display with the
FUELGAUGE_Percent tag or your text will not appear.
Applicability is (OM_NEW, OM_SET)
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 *)
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)
FUELGAUGE_Min (LONG)
Minimum value of the gauge.
Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
FUELGAUGE_Max (LONG)
Maximum value of the gauge.
Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
FUELGAUGE_Level (LONG)
Current gauge setting, usually something between Min and Max.
Based on Min, Max and Current a percentage can be calculated
and displayed by the gadget.
Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
FUELGAUGE_Orientation (WORD)
Sets the orientation of the fuel gauge to vertical or
horizontal.
Accepted values as defined in <gadgets/fuelgauge.h> are:
FGORIENT_HORIZ
FGORIENT_VERT
Defaults to FGORIENT_HORIZ
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_Percent (WORD)
Enable/Disable Percentage display.
Percentage is displayed in the center of the gauge using
the requested font, provided it fits within the gadget bounds.
Percentage overrides the GA_Text text display.
Defaults to TRUE.
Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
FUELGAUGE_Ticks (BOOL)
Sets the number of "tickmarks" rendered along the bottom
of the gadget. Take note, the tickmarks are rendered within
the gadgets size dimentions. Values greater than 0 enable
the tick mark(s).
Defaults to 4.
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_ShortTicks (BOOL)
Enables rendering of "short ticks", smaller size tickmarks
rendered in between the larger tick marks.
Defaults to FALSE.
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_TickSize (WORD)
Sets the size, in pixels, of the large tickmarks.
Shorttick size is TickHeight / 2. Note, if NOT setting
FUELGAUGE_Ticks non-zero, then you may need to 0 this as
well depending on the fuelgauge release version!
Defaults to 5 pixels
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_TickPen (WORD)
Pen number used to render the tickmarks.
Defaults to SHINEPEN.
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_PercentPen (WORD)
Pen number used to render the percentage text label.
Defaults to TEXTPEN.
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_EmptyPen (WORD)
Pen number used to render the empty section of the gauge.
Defaults to BACKGROUNDPEN.
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_FillPen (WORD)
Pen number used to render the filled section of the gauge.
Defaults to FILLPEN.
Applicability is (OM_NEW, OM_SET, OM_UPDATE)
FUELGAUGE_VarArgs (APTR)
Varargs data array to supply data for RawDoFmt() when
format specifiers are to be used in GA_Text text strings.
The VarArgs internal result buffer is 256 bytes in V47 and
later, but only 128 bytes in V45 and earlier; take care not
to exceed this buffer.
Defaults to NULL.
Applicability is (OM_NEW, OM_SET)
FUELGAUGE_Justification (WORD)
Justification mode of fuelgauge (GA_Text) text label.
Percentage rendering, when enabled, is always centered.
Supports:
FGJ_LEFT
FGJ_CENTER
Defaults to FGJ_LEFT.
Applicability is (OM_NEW, OM_SET)**
FUELGAUGE_GetClass()¶
FUELGAUGE_GetClass -- Gets the pointer to the fuelgauge class.
Synopsis
fuelgauge_class = FUELGAUGE_GetClass();
D0
Class * FUELGAUGE_GetClass(VOID);
Function
Obtains the pointer to the FuelGauge 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
fuelgauge_class - Pointer to the FuelGauge gadget class.