Home  /  Autodocs

fuelgauge.gadget

create fuelgauge BOOPSI objects

FUNCTIONS

FUELGAUGE_GetClass

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:

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)