xref: /haiku/headers/private/shared/BitmapButton.h (revision 17889a8c70dbb3d59c1412f6431968753c767bab)
1 /*
2  * Copyright 2010 Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef BITMAP_BUTTON_H
6 #define BITMAP_BUTTON_H
7 
8 #include <Button.h>
9 #include <Size.h>
10 
11 
12 class BBitmap;
13 
14 
15 namespace BPrivate {
16 
17 class BBitmapButton : public BButton {
18 public:
19 	enum {
20 		BUTTON_BACKGROUND = 0,
21 		MENUBAR_BACKGROUND,
22 	};
23 
24 								BBitmapButton(const char* resourceName,
25 									BMessage* message);
26 
27 								BBitmapButton(const uint8* bits, uint32 width,
28 									uint32 height, color_space format,
29 									BMessage* message);
30 
31 	virtual						~BBitmapButton();
32 
33 	virtual	BSize				MinSize();
34 	virtual	BSize				MaxSize();
35 	virtual	BSize				PreferredSize();
36 
37 	virtual	void				Draw(BRect updateRect);
38 
39 			void				SetBackgroundMode(uint32 mode);
40 
41 private:
42 			BBitmap*			fBitmap;
43 			uint32				fBackgroundMode;
44 };
45 
46 };
47 
48 using BPrivate::BBitmapButton;
49 
50 
51 #endif // BITMAP_BUTTON_H
52