Be
Bar: Message wrapper class
DFGadget
Description
DFGadget is used to create gadgets on the BeBar. The messaging
between DFGadget and BeBar is
taken care of automatically. Example modules (Clock, Pulse)
using this class can be found in the "Modules sources" folder of the
BeBar distribution.
Constructor
DFGadget(float smallWidth, float largeWidth)
This creates a gadget on the BeBar with the given width (one is for
the small icons mode, the other for the large icon mode). Connection
with the BeBar is established when the Update() element function is
called.
Defining the gadget
SetBitmap(BBitmap *small, BBitmap *large = NULL)
This sets the bitmaps to be shown in the small and large icon modes,
respectively. If the large bitmap is omitted (large == NULL
),
the small bitmap is used in the large icon mode, too.
The bitmaps are not copied and can have BViews attached, for example,
to draw in the bitmaps. They are deleted in the DFGadget destructor or
when replaced by another call of this function.
SetOffset(BPoint small, BPoint large)
This sets the location where the bitmaps are drawn (in the local frame
of the gadget on the BeBar).
SetGadgetMenu(BPopUpMenu *menu)
This attaches a pop up menu to the gadget which is operated from
the BeBar just like the main menu for an application.
Updating
Update(bool invalidate = FALSE)
All changes to a gadget are updated on the BeBar when this function
is called. Setting invalidate = TRUE
redraws the whole area
of this gadget, otherwise only the bitmap is redrawn.
Copyright © 1996, 1997
Thorsten Seitz. All rights reserved.
WWW.
Your feedback is very much appreciated.