xref: /haiku/headers/private/interface/BMCPrivate.h (revision 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb)
1 /*
2  * Copyright 2001-2006, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Marc Flerackers (mflerackers@androme.be)
7  *		Stephan Aßmus <superstippi@gmx.de>
8  */
9 
10 
11 #ifndef _BMC_PRIVATE_H
12 #define _BMC_PRIVATE_H
13 
14 #include <BeBuild.h>
15 #include <MenuBar.h>
16 #include <MenuItem.h>
17 #include <MessageFilter.h>
18 
19 class _BMCFilter_ : public BMessageFilter {
20 public:
21 	_BMCFilter_(BMenuField *menuField, uint32 what);
22 	~_BMCFilter_();
23 	filter_result Filter(BMessage *message, BHandler **handler);
24 
25 private:
26 	_BMCFilter_ &operator=(const _BMCFilter_ &);
27 	BMenuField *fMenuField;
28 };
29 
30 
31 //------------------------------------------------------------------------------
32 class _BMCMenuBar_ : public BMenuBar {
33 
34 public:
35 					_BMCMenuBar_(BRect frame, bool fixed_size,
36 						BMenuField *menuField);
37 					_BMCMenuBar_(BMessage *data);
38 virtual				~_BMCMenuBar_();
39 
40 static	BArchivable	*Instantiate(BMessage *data);
41 
42 virtual	void		AttachedToWindow();
43 virtual	void		Draw(BRect updateRect);
44 virtual	void		FrameResized(float width, float height);
45 virtual	void		MessageReceived(BMessage* msg);
46 virtual	void		MakeFocus(bool focused = true);
47 
48 	void		TogglePopUpMarker(bool show) { fShowPopUpMarker = show; }
49 	bool		IsPopUpMarkerShown() const { return fShowPopUpMarker; }
50 
51 private:
52 		_BMCMenuBar_&operator=(const _BMCMenuBar_ &);
53 
54 		BMenuField	*fMenuField;
55 		bool		fFixedSize;
56 		BMessageRunner	*fRunner;
57 		bool		fShowPopUpMarker;
58 };
59 //------------------------------------------------------------------------------
60 
61 #endif // _BMC_PRIVATE_H
62