/**** * * Class BitmapPushButton is a subclass of PushButton that uses a stenciled * bitmap as its background rather than the standard ovaled text label. * */ #ifndef bitmappushbuttonIncluded #define bitmappushbuttonIncluded #include class BitmapPushButton : public PushButton { public: BitmapPushButton(Bitmap* bm, ButtonState* bs, int value); /* * Construct with the given bitmap as background. */ BitmapPushButton(const char* filename, ButtonState* bs, int value); /* * Construct with the given bitmap file as background. */ virtual void Refresh(); /* * Refresh this by stenciling the bitmap onto this->output. This is the * standard type of behavior for a specialization of Interactor::Refresh. * Cf. PushButton::Refresh. */ virtual void Redraw(Coord l, Coord b, Coord r, Coord t); /* * Redraw this by drawing a clear backbround onto this->output and the * refreshing This is the standard type of behavior for a specialization of * Interactor::Redraw. Cf. PushButton::Redraw. */ virtual void Reconfig(); /* * Reconfigure this, typically in response to a user size change, by * changing this' shape. refreshing This is the standard type of behavior * for a specialization of Interactor::Reconfig. Cf. PushButton::Reconfig. */ protected: void Init(); Bitmap* bm; /* X11 bitmap to be stenciled as background. */ Painter* normal; /* Painter for normal bitmap config. */ Painter* highlight; /* Painter for inversed bitmap config (when button is * pressed). */ }; #endif