2010-05-07 04:47:10 -05:00
|
|
|
/*
|
|
|
|
BitmapListItem.h: A BMenuItem with an optional picture
|
|
|
|
Written by DarkWyrm <darkwyrm@earthlink.net>, Copyright 2007
|
|
|
|
Released under the MIT license.
|
|
|
|
*/
|
|
|
|
#ifndef BITMAP_MENU_ITEM_H
|
|
|
|
#define BITMAP_MENU_ITEM_H
|
|
|
|
|
|
|
|
#include <MenuItem.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
BitmapMenuItems are simple little items, really. They provide the
|
|
|
|
ability to show a menu item with some text, a picture, or both. The item
|
|
|
|
takes ownership of the BBitmap given to it, so please do not delete it.
|
|
|
|
Note that it is still possible to see the checkmark on marked
|
|
|
|
BitmapMenuItems -- the bitmap does not obscure the checkmark.
|
|
|
|
*/
|
|
|
|
|
2013-01-04 07:52:14 -06:00
|
|
|
class BitmapMenuItem : public BMenuItem {
|
2010-05-07 04:47:10 -05:00
|
|
|
public:
|
2013-01-04 07:52:14 -06:00
|
|
|
BitmapMenuItem(const char *label, BMessage *msg,
|
|
|
|
BBitmap *bitmap, char shortcut = 0,
|
|
|
|
uint32 modifiers = 0);
|
|
|
|
BitmapMenuItem(BMessage *data);
|
|
|
|
virtual ~BitmapMenuItem(void);
|
2010-05-07 04:47:10 -05:00
|
|
|
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
|
|
|
|
|
|
|
virtual void GetContentSize(float *width, float *height);
|
|
|
|
virtual void DrawContent(void);
|
|
|
|
|
|
|
|
virtual void SetBitmap(BBitmap *bitmap);
|
2013-01-04 07:52:14 -06:00
|
|
|
BBitmap* Bitmap(void) const;
|
2010-05-07 04:47:10 -05:00
|
|
|
|
|
|
|
private:
|
2013-01-04 07:52:14 -06:00
|
|
|
BBitmap *fBitmap;
|
|
|
|
float fBaselineOffset;
|
2010-05-07 04:47:10 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|