xref: /haiku/src/apps/processcontroller/IconMenuItem.h (revision cd552c7a15cc10c36dae8d7439ba1d6c0bb168c5)
1 /*
2 
3 	IconMenuItem.h
4 
5 	ProcessController
6 	(c) 2000, Georges-Edouard Berenger, All Rights Reserved.
7 	Copyright (C) 2004 beunited.org
8 
9 	This library is free software; you can redistribute it and/or
10 	modify it under the terms of the GNU Lesser General Public
11 	License as published by the Free Software Foundation; either
12 	version 2.1 of the License, or (at your option) any later version.
13 
14 	This library is distributed in the hope that it will be useful,
15 	but WITHOUT ANY WARRANTY; without even the implied warranty of
16 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 	Lesser General Public License for more details.
18 
19 	You should have received a copy of the GNU Lesser General Public
20 	License along with this library; if not, write to the Free Software
21 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 
23 */
24 
25 #ifndef _ICON_MENU_ITEM_H_
26 #define _ICON_MENU_ITEM_H_
27 
28 #include <MenuItem.h>
29 
30 class BBitmap;
31 
32 //---------------------------------------------------------------
33 
34 class IconMenuItem : public BMenuItem {
35 
36 public:
37 						IconMenuItem(BBitmap*, const char* title,
38 									  BMessage*, bool drawText = true, bool purge = false);
39 						IconMenuItem(BBitmap*, BMenu*,
40 									  bool drawText = true, bool purge = false);
41 						IconMenuItem(const char* mime, const char* title, BMessage*,
42 									  bool drawText = true);
43 virtual					~IconMenuItem();
44 virtual	void			DrawContent();
45 virtual	void			Highlight(bool isHighlighted);
46 virtual	void			GetContentSize(float* width, float* height);
47 static	int				MinHeight();
48 
49 private:
50 		void			DefaultIcon(const char* mime);
51 		void			DrawIcon();
52 
53 		BBitmap*		fIcon;
54 		bool			fDrawText;
55 		bool			fPurge;
56 };
57 
58 bool	before_dano();
59 
60 #endif // _ICON_MENU_ITEM_H_
61